408 lines
938 KiB
JavaScript
408 lines
938 KiB
JavaScript
var n2=Object.defineProperty;var i2=(e,t,n)=>t in e?n2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pi=(e,t,n)=>i2(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function W_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ph={exports:{}},gc={};/**
|
||
* @license React
|
||
* react-jsx-runtime.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var _x;function a2(){if(_x)return gc;_x=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,r,s){var u=null;if(s!==void 0&&(u=""+s),r.key!==void 0&&(u=""+r.key),"key"in r){s={};for(var f in r)f!=="key"&&(s[f]=r[f])}else s=r;return r=s.ref,{$$typeof:e,type:a,key:u,ref:r!==void 0?r:null,props:s}}return gc.Fragment=t,gc.jsx=n,gc.jsxs=n,gc}var gx;function l2(){return gx||(gx=1,ph.exports=a2()),ph.exports}var c=l2(),mh={exports:{}},Ve={};/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var yx;function r2(){if(yx)return Ve;yx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function k(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,A={};function x(M,J,$){this.props=M,this.context=J,this.refs=A,this.updater=$||C}x.prototype.isReactComponent={},x.prototype.setState=function(M,J){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,J,"setState")},x.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function T(){}T.prototype=x.prototype;function N(M,J,$){this.props=M,this.context=J,this.refs=A,this.updater=$||C}var F=N.prototype=new T;F.constructor=N,D(F,x.prototype),F.isPureReactComponent=!0;var L=Array.isArray;function B(){}var P={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function se(M,J,$){var _e=$.ref;return{$$typeof:e,type:M,key:J,ref:_e!==void 0?_e:null,props:$}}function I(M,J){return se(M.type,J,M.props)}function q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function Z(M){var J={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function($){return J[$]})}var Q=/\/+/g;function R(M,J){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):J.toString(36)}function U(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(B,B):(M.status="pending",M.then(function(J){M.status==="pending"&&(M.status="fulfilled",M.value=J)},function(J){M.status==="pending"&&(M.status="rejected",M.reason=J)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function O(M,J,$,_e,we){var be=typeof M;(be==="undefined"||be==="boolean")&&(M=null);var Ee=!1;if(M===null)Ee=!0;else switch(be){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(M.$$typeof){case e:case t:Ee=!0;break;case g:return Ee=M._init,O(Ee(M._payload),J,$,_e,we)}}if(Ee)return we=we(M),Ee=_e===""?"."+R(M,0):_e,L(we)?($="",Ee!=null&&($=Ee.replace(Q,"$&/")+"/"),O(we,J,$,"",function(me){return me})):we!=null&&(q(we)&&(we=I(we,$+(we.key==null||M&&M.key===we.key?"":(""+we.key).replace(Q,"$&/")+"/")+Ee)),J.push(we)),1;Ee=0;var Ie=_e===""?".":_e+":";if(L(M))for(var ue=0;ue<M.length;ue++)_e=M[ue],be=Ie+R(_e,ue),Ee+=O(_e,J,$,be,we);else if(ue=k(M),typeof ue=="function")for(M=ue.call(M),ue=0;!(_e=M.next()).done;)_e=_e.value,be=Ie+R(_e,ue++),Ee+=O(_e,J,$,be,we);else if(be==="object"){if(typeof M.then=="function")return O(U(M),J,$,_e,we);throw J=String(M),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function G(M,J,$){if(M==null)return M;var _e=[],we=0;return O(M,_e,"","",function(be){return J.call($,be,we++)}),_e}function ae(M){if(M._status===-1){var J=M._result;J=J(),J.then(function($){(M._status===0||M._status===-1)&&(M._status=1,M._result=$)},function($){(M._status===0||M._status===-1)&&(M._status=2,M._result=$)}),M._status===-1&&(M._status=0,M._result=J)}if(M._status===1)return M._result.default;throw M._result}var ie=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},z={map:G,forEach:function(M,J,$){G(M,function(){J.apply(this,arguments)},$)},count:function(M){var J=0;return G(M,function(){J++}),J},toArray:function(M){return G(M,function(J){return J})||[]},only:function(M){if(!q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Ve.Activity=b,Ve.Children=z,Ve.Component=x,Ve.Fragment=n,Ve.Profiler=r,Ve.PureComponent=N,Ve.StrictMode=a,Ve.Suspense=p,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(M){return P.H.useMemoCache(M)}},Ve.cache=function(M){return function(){return M.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(M,J,$){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var _e=D({},M.props),we=M.key;if(J!=null)for(be in J.key!==void 0&&(we=""+J.key),J)!K.call(J,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&J.ref===void 0||(_e[be]=J[be]);var be=arguments.length-2;if(be===1)_e.children=$;else if(1<be){for(var Ee=Array(be),Ie=0;Ie<be;Ie++)Ee[Ie]=arguments[Ie+2];_e.children=Ee}return se(M.type,we,_e)},Ve.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},Ve.createElement=function(M,J,$){var _e,we={},be=null;if(J!=null)for(_e in J.key!==void 0&&(be=""+J.key),J)K.call(J,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(we[_e]=J[_e]);var Ee=arguments.length-2;if(Ee===1)we.children=$;else if(1<Ee){for(var Ie=Array(Ee),ue=0;ue<Ee;ue++)Ie[ue]=arguments[ue+2];we.children=Ie}if(M&&M.defaultProps)for(_e in Ee=M.defaultProps,Ee)we[_e]===void 0&&(we[_e]=Ee[_e]);return se(M,be,we)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(M){return{$$typeof:f,render:M}},Ve.isValidElement=q,Ve.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:ae}},Ve.memo=function(M,J){return{$$typeof:m,type:M,compare:J===void 0?null:J}},Ve.startTransition=function(M){var J=P.T,$={};P.T=$;try{var _e=M(),we=P.S;we!==null&&we($,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(B,ie)}catch(be){ie(be)}finally{J!==null&&$.types!==null&&(J.types=$.types),P.T=J}},Ve.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ve.use=function(M){return P.H.use(M)},Ve.useActionState=function(M,J,$){return P.H.useActionState(M,J,$)},Ve.useCallback=function(M,J){return P.H.useCallback(M,J)},Ve.useContext=function(M){return P.H.useContext(M)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(M,J){return P.H.useDeferredValue(M,J)},Ve.useEffect=function(M,J){return P.H.useEffect(M,J)},Ve.useEffectEvent=function(M){return P.H.useEffectEvent(M)},Ve.useId=function(){return P.H.useId()},Ve.useImperativeHandle=function(M,J,$){return P.H.useImperativeHandle(M,J,$)},Ve.useInsertionEffect=function(M,J){return P.H.useInsertionEffect(M,J)},Ve.useLayoutEffect=function(M,J){return P.H.useLayoutEffect(M,J)},Ve.useMemo=function(M,J){return P.H.useMemo(M,J)},Ve.useOptimistic=function(M,J){return P.H.useOptimistic(M,J)},Ve.useReducer=function(M,J,$){return P.H.useReducer(M,J,$)},Ve.useRef=function(M){return P.H.useRef(M)},Ve.useState=function(M){return P.H.useState(M)},Ve.useSyncExternalStore=function(M,J,$){return P.H.useSyncExternalStore(M,J,$)},Ve.useTransition=function(){return P.H.useTransition()},Ve.version="19.2.7",Ve}var bx;function eg(){return bx||(bx=1,mh.exports=r2()),mh.exports}var w=eg();const s2=W_(w);var hh={exports:{}},yc={},_h={exports:{}},gh={};/**
|
||
* @license React
|
||
* scheduler.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var vx;function o2(){return vx||(vx=1,(function(e){function t(O,G){var ae=O.length;O.push(G);e:for(;0<ae;){var ie=ae-1>>>1,z=O[ie];if(0<r(z,G))O[ie]=G,O[ae]=z,ae=ie;else break e}}function n(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var G=O[0],ae=O.pop();if(ae!==G){O[0]=ae;e:for(var ie=0,z=O.length,M=z>>>1;ie<M;){var J=2*(ie+1)-1,$=O[J],_e=J+1,we=O[_e];if(0>r($,ae))_e<z&&0>r(we,$)?(O[ie]=we,O[_e]=ae,ie=_e):(O[ie]=$,O[J]=ae,ie=J);else if(_e<z&&0>r(we,ae))O[ie]=we,O[_e]=ae,ie=_e;else break e}}return G}function r(O,G){var ae=O.sortIndex-G.sortIndex;return ae!==0?ae:O.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],g=1,b=null,v=3,k=!1,C=!1,D=!1,A=!1,x=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function F(O){for(var G=n(m);G!==null;){if(G.callback===null)a(m);else if(G.startTime<=O)a(m),G.sortIndex=G.expirationTime,t(p,G);else break;G=n(m)}}function L(O){if(D=!1,F(O),!C)if(n(p)!==null)C=!0,B||(B=!0,Z());else{var G=n(m);G!==null&&U(L,G.startTime-O)}}var B=!1,P=-1,K=5,se=-1;function I(){return A?!0:!(e.unstable_now()-se<K)}function q(){if(A=!1,B){var O=e.unstable_now();se=O;var G=!0;try{e:{C=!1,D&&(D=!1,T(P),P=-1),k=!0;var ae=v;try{t:{for(F(O),b=n(p);b!==null&&!(b.expirationTime>O&&I());){var ie=b.callback;if(typeof ie=="function"){b.callback=null,v=b.priorityLevel;var z=ie(b.expirationTime<=O);if(O=e.unstable_now(),typeof z=="function"){b.callback=z,F(O),G=!0;break t}b===n(p)&&a(p),F(O)}else a(p);b=n(p)}if(b!==null)G=!0;else{var M=n(m);M!==null&&U(L,M.startTime-O),G=!1}}break e}finally{b=null,v=ae,k=!1}G=void 0}}finally{G?Z():B=!1}}}var Z;if(typeof N=="function")Z=function(){N(q)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,R=Q.port2;Q.port1.onmessage=q,Z=function(){R.postMessage(null)}}else Z=function(){x(q,0)};function U(O,G){P=x(function(){O(e.unstable_now())},G)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var ae=v;v=G;try{return O()}finally{v=ae}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(O,G){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var ae=v;v=O;try{return G()}finally{v=ae}},e.unstable_scheduleCallback=function(O,G,ae){var ie=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ie+ae:ie):ae=ie,O){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=ae+z,O={id:g++,callback:G,priorityLevel:O,startTime:ae,expirationTime:z,sortIndex:-1},ae>ie?(O.sortIndex=ae,t(m,O),n(p)===null&&O===n(m)&&(D?(T(P),P=-1):D=!0,U(L,ae-ie))):(O.sortIndex=z,t(p,O),C||k||(C=!0,B||(B=!0,Z()))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var G=v;return function(){var ae=v;v=G;try{return O.apply(this,arguments)}finally{v=ae}}}})(gh)),gh}var xx;function c2(){return xx||(xx=1,_h.exports=o2()),_h.exports}var yh={exports:{}},Vn={};/**
|
||
* @license React
|
||
* react-dom.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var kx;function u2(){if(kx)return Vn;kx=1;var e=eg();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(p,m,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:b==null?null:""+b,children:p,containerInfo:m,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Vn.createPortal=function(p,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return s(p,m,null,g)},Vn.flushSync=function(p){var m=u.T,g=a.p;try{if(u.T=null,a.p=2,p)return p()}finally{u.T=m,a.p=g,a.d.f()}},Vn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},Vn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},Vn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var g=m.as,b=f(g,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,k=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:k}):g==="script"&&a.d.X(p,{crossOrigin:b,integrity:v,fetchPriority:k,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Vn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},Vn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,b=f(g,m.crossOrigin);a.d.L(p,g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Vn.preloadModule=function(p,m){if(typeof p=="string")if(m){var g=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},Vn.requestFormReset=function(p){a.d.r(p)},Vn.unstable_batchedUpdates=function(p,m){return p(m)},Vn.useFormState=function(p,m,g){return u.H.useFormState(p,m,g)},Vn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Vn.version="19.2.7",Vn}var Sx;function d2(){if(Sx)return yh.exports;Sx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),yh.exports=u2(),yh.exports}/**
|
||
* @license React
|
||
* react-dom-client.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var wx;function f2(){if(wx)return yc;wx=1;var e=c2(),t=eg(),n=d2();function a(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)l+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,o=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(o=l.return),i=l.return;while(i)}return l.tag===3?o:null}function u(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function p(i){if(s(i)!==i)throw Error(a(188))}function m(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(a(188));return l!==i?null:i}for(var o=i,d=l;;){var _=o.return;if(_===null)break;var y=_.alternate;if(y===null){if(d=_.return,d!==null){o=d;continue}break}if(_.child===y.child){for(y=_.child;y;){if(y===o)return p(_),i;if(y===d)return p(_),l;y=y.sibling}throw Error(a(188))}if(o.return!==d.return)o=_,d=y;else{for(var S=!1,E=_.child;E;){if(E===o){S=!0,o=_,d=y;break}if(E===d){S=!0,d=_,o=y;break}E=E.sibling}if(!S){for(E=y.child;E;){if(E===o){S=!0,o=y,d=_;break}if(E===d){S=!0,d=y,o=_;break}E=E.sibling}if(!S)throw Error(a(189))}}if(o.alternate!==d)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?i:l}function g(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=g(i),l!==null)return l;i=i.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),N=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function Z(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var Q=Symbol.for("react.client.reference");function R(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case D:return"Fragment";case x:return"Profiler";case A:return"StrictMode";case L:return"Suspense";case B:return"SuspenseList";case se:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case C:return"Portal";case N:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case F:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case P:return l=i.displayName||null,l!==null?l:R(i.type)||"Memo";case K:l=i._payload,i=i._init;try{return R(i(l))}catch{}}return null}var U=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ie=[],z=-1;function M(i){return{current:i}}function J(i){0>z||(i.current=ie[z],ie[z]=null,z--)}function $(i,l){z++,ie[z]=i.current,i.current=l}var _e=M(null),we=M(null),be=M(null),Ee=M(null);function Ie(i,l){switch($(be,l),$(we,i),$(_e,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?Bv(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=Bv(l),i=qv(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}J(_e),$(_e,i)}function ue(){J(_e),J(we),J(be)}function me(i){i.memoizedState!==null&&$(Ee,i);var l=_e.current,o=qv(l,i.type);l!==o&&($(we,i),$(_e,o))}function Xe(i){we.current===i&&(J(_e),J(we)),Ee.current===i&&(J(Ee),pc._currentValue=ae)}var it,bt;function Lt(i){if(it===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);it=l&&l[1]||"",bt=-1<o.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+it+i+bt}var vt=!1;function Ue(i,l){if(!i||vt)return"";vt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ne){var te=ne}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(ne){te=ne}i.call(pe.prototype)}}else{try{throw Error()}catch(ne){te=ne}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),S=y[0],E=y[1];if(S&&E){var H=S.split(`
|
||
`),ee=E.split(`
|
||
`);for(_=d=0;d<H.length&&!H[d].includes("DetermineComponentFrameRoot");)d++;for(;_<ee.length&&!ee[_].includes("DetermineComponentFrameRoot");)_++;if(d===H.length||_===ee.length)for(d=H.length-1,_=ee.length-1;1<=d&&0<=_&&H[d]!==ee[_];)_--;for(;1<=d&&0<=_;d--,_--)if(H[d]!==ee[_]){if(d!==1||_!==1)do if(d--,_--,0>_||H[d]!==ee[_]){var re=`
|
||
`+H[d].replace(" at new "," at ");return i.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",i.displayName)),re}while(1<=d&&0<=_);break}}}finally{vt=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?Lt(o):""}function ft(i,l){switch(i.tag){case 26:case 27:case 5:return Lt(i.type);case 16:return Lt("Lazy");case 13:return i.child!==l&&l!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return Ue(i.type,!1);case 11:return Ue(i.type.render,!1);case 1:return Ue(i.type,!0);case 31:return Lt("Activity");default:return""}}function wt(i){try{var l="",o=null;do l+=ft(i,o),o=i,i=i.return;while(i);return l}catch(d){return`
|
||
Error generating stack: `+d.message+`
|
||
`+d.stack}}var at=Object.prototype.hasOwnProperty,qe=e.unstable_scheduleCallback,xt=e.unstable_cancelCallback,lt=e.unstable_shouldYield,ia=e.unstable_requestPaint,It=e.unstable_now,Oa=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,He=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,Gt=e.log,fn=e.unstable_setDisableYieldValue,rn=null,kt=null;function wn(i){if(typeof Gt=="function"&&fn(i),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(rn,i)}catch{}}var pt=Math.clz32?Math.clz32:yl,Zn=Math.log,Bt=Math.LN2;function yl(i){return i>>>=0,i===0?32:31-(Zn(i)/Bt|0)|0}var La=256,Vt=262144,ya=4194304;function Ze(i){var l=i&42;if(l!==0)return l;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function ve(i,l,o){var d=i.pendingLanes;if(d===0)return 0;var _=0,y=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var E=d&134217727;return E!==0?(d=E&~y,d!==0?_=Ze(d):(S&=E,S!==0?_=Ze(S):o||(o=E&~i,o!==0&&(_=Ze(o))))):(E=d&~y,E!==0?_=Ze(E):S!==0?_=Ze(S):o||(o=d&~i,o!==0&&(_=Ze(o)))),_===0?0:l!==0&&l!==_&&(l&y)===0&&(y=_&-_,o=l&-l,y>=o||y===32&&(o&4194048)!==0)?l:_}function li(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function mr(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bo(){var i=ya;return ya<<=1,(ya&62914560)===0&&(ya=4194304),i}function bl(i){for(var l=[],o=0;31>o;o++)l.push(i);return l}function ba(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function du(i,l,o,d,_,y){var S=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var E=i.entanglements,H=i.expirationTimes,ee=i.hiddenUpdates;for(o=S&~o;0<o;){var re=31-pt(o),pe=1<<re;E[re]=0,H[re]=-1;var te=ee[re];if(te!==null)for(ee[re]=null,re=0;re<te.length;re++){var ne=te[re];ne!==null&&(ne.lane&=-536870913)}o&=~pe}d!==0&&Qr(i,d,0),y!==0&&_===0&&i.tag!==0&&(i.suspendedLanes|=y&~(S&~l))}function Qr(i,l,o){i.pendingLanes|=l,i.suspendedLanes&=~l;var d=31-pt(l);i.entangledLanes|=l,i.entanglements[d]=i.entanglements[d]|1073741824|o&261930}function Xr(i,l){var o=i.entangledLanes|=l;for(i=i.entanglements;o;){var d=31-pt(o),_=1<<d;_&l|i[d]&l&&(i[d]|=l),o&=~_}}function fu(i,l){var o=l&-l;return o=(o&42)!==0?1:Et(o),(o&(i.suspendedLanes|l))!==0?0:o}function Et(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function En(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function hr(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:cx(i.type))}function vn(i,l){var o=G.p;try{return G.p=i,l()}finally{G.p=o}}var jt=Math.random().toString(36).slice(2),en="__reactFiber$"+jt,xn="__reactProps$"+jt,Ia="__reactContainer$"+jt,An="__reactEvents$"+jt,Nn="__reactListeners$"+jt,pu="__reactHandles$"+jt,va="__reactResources$"+jt,Ba="__reactMarker$"+jt;function vo(i){delete i[en],delete i[xn],delete i[An],delete i[Nn],delete i[pu]}function _r(i){var l=i[en];if(l)return l;for(var o=i.parentNode;o;){if(l=o[Ia]||o[en]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(i=Yv(i);i!==null;){if(o=i[en])return o;i=Yv(i)}return l}i=o,o=i.parentNode}return null}function xe(i){if(i=i[en]||i[Ia]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Pn(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(a(33))}function Ut(i){var l=i[va];return l||(l=i[va]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Me(i){i[Ba]=!0}var Jn=new Set,xo={};function xa(i,l){Fn(i,l),Fn(i+"Capture",l)}function Fn(i,l){for(xo[i]=l,i=0;i<l.length;i++)Jn.add(l[i])}var ri=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gr={},qa={};function ko(i){return at.call(qa,i)?!0:at.call(gr,i)?!1:ri.test(i)?qa[i]=!0:(gr[i]=!0,!1)}function Zr(i,l,o){if(ko(l))if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var d=l.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+o)}}function si(i,l,o){if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+o)}}function xi(i,l,o,d){if(d===null)i.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(l,o,""+d)}}function Wn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function So(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function St(i,l,o){var d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var _=d.get,y=d.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return _.call(this)},set:function(S){o=""+S,y.call(this,S)}}),Object.defineProperty(i,l,{enumerable:d.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ki(i){if(!i._valueTracker){var l=So(i)?"checked":"value";i._valueTracker=St(i,l,""+i[l])}}function aa(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var o=l.getValue(),d="";return i&&(d=So(i)?i.checked?"true":"false":i.value),i=d,i!==o?(l.setValue(i),!0):!1}function Ua(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var vl=/[\n"\\]/g;function Gn(i){return i.replace(vl,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function $i(i,l,o,d,_,y,S,E){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),l!=null?S==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Wn(l)):i.value!==""+Wn(l)&&(i.value=""+Wn(l)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),l!=null?wo(i,S,Wn(l)):o!=null?wo(i,S,Wn(o)):d!=null&&i.removeAttribute("value"),_==null&&y!=null&&(i.defaultChecked=!!y),_!=null&&(i.checked=_&&typeof _!="function"&&typeof _!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.name=""+Wn(E):i.removeAttribute("name")}function tn(i,l,o,d,_,y,S,E){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),l!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||l!=null)){ki(i);return}o=o!=null?""+Wn(o):"",l=l!=null?""+Wn(l):o,E||l===i.value||(i.value=l),i.defaultValue=l}d=d??_,d=typeof d!="function"&&typeof d!="symbol"&&!!d,i.checked=E?i.checked:!!d,i.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),ki(i)}function wo(i,l,o){l==="number"&&Ua(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function zi(i,l,o,d){if(i=i.options,l){l={};for(var _=0;_<o.length;_++)l["$"+o[_]]=!0;for(o=0;o<i.length;o++)_=l.hasOwnProperty("$"+i[o].value),i[o].selected!==_&&(i[o].selected=_),_&&d&&(i[o].defaultSelected=!0)}else{for(o=""+Wn(o),l=null,_=0;_<i.length;_++){if(i[_].value===o){i[_].selected=!0,d&&(i[_].defaultSelected=!0);return}l!==null||i[_].disabled||(l=i[_])}l!==null&&(l.selected=!0)}}function jo(i,l,o){if(l!=null&&(l=""+Wn(l),l!==i.value&&(i.value=l),o==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=o!=null?""+Wn(o):""}function Co(i,l,o,d){if(l==null){if(d!=null){if(o!=null)throw Error(a(92));if(U(d)){if(1<d.length)throw Error(a(93));d=d[0]}o=d}o==null&&(o=""),l=o}o=Wn(l),i.defaultValue=o,d=i.textContent,d===o&&d!==""&&d!==null&&(i.value=d),ki(i)}function xl(i,l){if(l){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=l;return}}i.textContent=l}var ip=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jr(i,l,o){var d=l.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":d?i.setProperty(l,o):typeof o!="number"||o===0||ip.has(l)?l==="float"?i.cssFloat=o:i[l]=(""+o).trim():i[l]=o+"px"}function Wr(i,l,o){if(l!=null&&typeof l!="object")throw Error(a(62));if(i=i.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||l!=null&&l.hasOwnProperty(d)||(d.indexOf("--")===0?i.setProperty(d,""):d==="float"?i.cssFloat="":i[d]="");for(var _ in l)d=l[_],l.hasOwnProperty(_)&&o[_]!==d&&Jr(i,_,d)}else for(var y in l)l.hasOwnProperty(y)&&Jr(i,y,l[y])}function Ge(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ap=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),lp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rn(i){return lp.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function la(){}var To=null;function Eo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var kl=null,ka=null;function mu(i){var l=xe(i);if(l&&(i=l.stateNode)){var o=i[xn]||null;e:switch(i=l.stateNode,l.type){case"input":if($i(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),l=o.name,o.type==="radio"&&l!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Gn(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var d=o[l];if(d!==i&&d.form===i.form){var _=d[xn]||null;if(!_)throw Error(a(90));$i(d,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(l=0;l<o.length;l++)d=o[l],d.form===i.form&&aa(d)}break e;case"textarea":jo(i,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&zi(i,!!o.multiple,l,!1)}}}var hu=!1;function es(i,l,o){if(hu)return i(l,o);hu=!0;try{var d=i(l);return d}finally{if(hu=!1,(kl!==null||ka!==null)&&(dd(),kl&&(l=kl,i=ka,ka=kl=null,mu(l),i)))for(l=0;l<i.length;l++)mu(i[l])}}function Sl(i,l){var o=i.stateNode;if(o===null)return null;var d=o[xn]||null;if(d===null)return null;o=d[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(a(231,l,typeof o));return o}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ao=!1;if(Oi)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{Ao=!1}var Li=null,Ha=null,Pa=null;function ts(){if(Pa)return Pa;var i,l=Ha,o=l.length,d,_="value"in Li?Li.value:Li.textContent,y=_.length;for(i=0;i<o&&l[i]===_[i];i++);var S=o-i;for(d=1;d<=S&&l[o-d]===_[y-d];d++);return Pa=_.slice(i,1<d?1-d:void 0)}function Fa(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function ns(){return!0}function _u(){return!1}function jn(i){function l(o,d,_,y,S){this._reactName=o,this._targetInst=_,this.type=d,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var E in i)i.hasOwnProperty(E)&&(o=i[E],this[E]=o?o(y):y[E]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?ns:_u,this.isPropagationStopped=_u,this}return b(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ns)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ns)},persist:function(){},isPersistent:ns}),l}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sa=jn(Ii),wl=b({},Ii,{view:0,detail:0}),gu=jn(wl),No,is,Ga,jl=b({},wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rs,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ga&&(Ga&&i.type==="mousemove"?(No=i.screenX-Ga.screenX,is=i.screenY-Ga.screenY):is=No=0,Ga=i),No)},movementY:function(i){return"movementY"in i?i.movementY:is}}),yu=jn(jl),rp=b({},jl,{dataTransfer:0}),Ro=jn(rp),sp=b({},wl,{relatedTarget:0}),Do=jn(sp),bu=b({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),vu=jn(bu),as=b({},Ii,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),op=jn(as),xu=b({},Ii,{data:0}),ls=jn(xu),ku={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cp={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"},up={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dp(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=up[i])?!!l[i]:!1}function rs(){return dp}var Su=b({},wl,{key:function(i){if(i.key){var l=ku[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Fa(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?cp[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rs,charCode:function(i){return i.type==="keypress"?Fa(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Fa(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),fp=jn(Su),pp=b({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wu=jn(pp),mp=b({},wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rs}),hp=jn(mp),_p=b({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mo=jn(_p),ju=b({},jl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Cu=jn(ju),gp=b({},Ii,{newState:0,oldState:0}),yp=jn(gp),Tu=[9,13,27,32],ss=Oi&&"CompositionEvent"in window,Cl=null;Oi&&"documentMode"in document&&(Cl=document.documentMode);var bp=Oi&&"TextEvent"in window&&!Cl,$o=Oi&&(!ss||Cl&&8<Cl&&11>=Cl),Eu=" ",zo=!1;function os(i,l){switch(i){case"keyup":return Tu.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oo(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Tl=!1;function vp(i,l){switch(i){case"compositionend":return Oo(l);case"keypress":return l.which!==32?null:(zo=!0,Eu);case"textInput":return i=l.data,i===Eu&&zo?null:i;default:return null}}function Au(i,l){if(Tl)return i==="compositionend"||!ss&&os(i,l)?(i=ts(),Pa=Ha=Li=null,Tl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return $o&&l.locale!=="ko"?null:l.data;default:return null}}var Nu={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 j(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Nu[i.type]:l==="textarea"}function Y(i,l,o,d){kl?ka?ka.push(d):ka=[d]:kl=d,l=yd(l,"onChange"),0<l.length&&(o=new Sa("onChange","change",null,o,d),i.push({event:o,listeners:l}))}var oe=null,fe=null;function de(i){Mv(i,0)}function je(i){var l=Pn(i);if(aa(l))return i}function Se(i,l){if(i==="change")return l}var Ae=!1;if(Oi){var pn;if(Oi){var Yt="oninput"in document;if(!Yt){var Bi=document.createElement("div");Bi.setAttribute("oninput","return;"),Yt=typeof Bi.oninput=="function"}pn=Yt}else pn=!1;Ae=pn&&(!document.documentMode||9<document.documentMode)}function Dn(){oe&&(oe.detachEvent("onpropertychange",ra),fe=oe=null)}function ra(i){if(i.propertyName==="value"&&je(fe)){var l=[];Y(l,fe,i,Eo(i)),es(de,l)}}function xp(i,l,o){i==="focusin"?(Dn(),oe=l,fe=o,oe.attachEvent("onpropertychange",ra)):i==="focusout"&&Dn()}function Rj(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return je(fe)}function Dj(i,l){if(i==="click")return je(l)}function Mj(i,l){if(i==="input"||i==="change")return je(l)}function $j(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Si=typeof Object.is=="function"?Object.is:$j;function Lo(i,l){if(Si(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var o=Object.keys(i),d=Object.keys(l);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var _=o[d];if(!at.call(l,_)||!Si(i[_],l[_]))return!1}return!0}function iy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ay(i,l){var o=iy(i);i=0;for(var d;o;){if(o.nodeType===3){if(d=i+o.textContent.length,i<=l&&d>=l)return{node:o,offset:l-i};i=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=iy(o)}}function ly(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?ly(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function ry(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Ua(i.document);l instanceof i.HTMLIFrameElement;){try{var o=typeof l.contentWindow.location.href=="string"}catch{o=!1}if(o)i=l.contentWindow;else break;l=Ua(i.document)}return l}function kp(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var zj=Oi&&"documentMode"in document&&11>=document.documentMode,cs=null,Sp=null,Io=null,wp=!1;function sy(i,l,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;wp||cs==null||cs!==Ua(d)||(d=cs,"selectionStart"in d&&kp(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Io&&Lo(Io,d)||(Io=d,d=yd(Sp,"onSelect"),0<d.length&&(l=new Sa("onSelect","select",null,l,o),i.push({event:l,listeners:d}),l.target=cs)))}function br(i,l){var o={};return o[i.toLowerCase()]=l.toLowerCase(),o["Webkit"+i]="webkit"+l,o["Moz"+i]="moz"+l,o}var us={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionrun:br("Transition","TransitionRun"),transitionstart:br("Transition","TransitionStart"),transitioncancel:br("Transition","TransitionCancel"),transitionend:br("Transition","TransitionEnd")},jp={},oy={};Oi&&(oy=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function vr(i){if(jp[i])return jp[i];if(!us[i])return i;var l=us[i],o;for(o in l)if(l.hasOwnProperty(o)&&o in oy)return jp[i]=l[o];return i}var cy=vr("animationend"),uy=vr("animationiteration"),dy=vr("animationstart"),Oj=vr("transitionrun"),Lj=vr("transitionstart"),Ij=vr("transitioncancel"),fy=vr("transitionend"),py=new Map,Cp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cp.push("scrollEnd");function sa(i,l){py.set(i,l),xa(l,[i])}var Ru=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},qi=[],ds=0,Tp=0;function Du(){for(var i=ds,l=Tp=ds=0;l<i;){var o=qi[l];qi[l++]=null;var d=qi[l];qi[l++]=null;var _=qi[l];qi[l++]=null;var y=qi[l];if(qi[l++]=null,d!==null&&_!==null){var S=d.pending;S===null?_.next=_:(_.next=S.next,S.next=_),d.pending=_}y!==0&&my(o,_,y)}}function Mu(i,l,o,d){qi[ds++]=i,qi[ds++]=l,qi[ds++]=o,qi[ds++]=d,Tp|=d,i.lanes|=d,i=i.alternate,i!==null&&(i.lanes|=d)}function Ep(i,l,o,d){return Mu(i,l,o,d),$u(i)}function xr(i,l){return Mu(i,null,null,l),$u(i)}function my(i,l,o){i.lanes|=o;var d=i.alternate;d!==null&&(d.lanes|=o);for(var _=!1,y=i.return;y!==null;)y.childLanes|=o,d=y.alternate,d!==null&&(d.childLanes|=o),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(_=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,_&&l!==null&&(_=31-pt(o),i=y.hiddenUpdates,d=i[_],d===null?i[_]=[l]:d.push(l),l.lane=o|536870912),y):null}function $u(i){if(50<rc)throw rc=0,Lm=null,Error(a(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var fs={};function Bj(i,l,o,d){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wi(i,l,o,d){return new Bj(i,l,o,d)}function Ap(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Va(i,l){var o=i.alternate;return o===null?(o=wi(i.tag,l,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=l,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,l=i.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function hy(i,l){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,l=o.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function zu(i,l,o,d,_,y){var S=0;if(d=i,typeof i=="function")Ap(i)&&(S=1);else if(typeof i=="string")S=FC(i,o,_e.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case se:return i=wi(31,o,l,_),i.elementType=se,i.lanes=y,i;case D:return kr(o.children,_,y,l);case A:S=8,_|=24;break;case x:return i=wi(12,o,l,_|2),i.elementType=x,i.lanes=y,i;case L:return i=wi(13,o,l,_),i.elementType=L,i.lanes=y,i;case B:return i=wi(19,o,l,_),i.elementType=B,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case N:S=10;break e;case T:S=9;break e;case F:S=11;break e;case P:S=14;break e;case K:S=16,d=null;break e}S=29,o=Error(a(130,i===null?"null":typeof i,"")),d=null}return l=wi(S,o,l,_),l.elementType=i,l.type=d,l.lanes=y,l}function kr(i,l,o,d){return i=wi(7,i,d,l),i.lanes=o,i}function Np(i,l,o){return i=wi(6,i,null,l),i.lanes=o,i}function _y(i){var l=wi(18,null,null,0);return l.stateNode=i,l}function Rp(i,l,o){return l=wi(4,i.children!==null?i.children:[],i.key,l),l.lanes=o,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var gy=new WeakMap;function Ui(i,l){if(typeof i=="object"&&i!==null){var o=gy.get(i);return o!==void 0?o:(l={value:i,source:l,stack:wt(l)},gy.set(i,l),l)}return{value:i,source:l,stack:wt(l)}}var ps=[],ms=0,Ou=null,Bo=0,Hi=[],Pi=0,El=null,wa=1,ja="";function Ya(i,l){ps[ms++]=Bo,ps[ms++]=Ou,Ou=i,Bo=l}function yy(i,l,o){Hi[Pi++]=wa,Hi[Pi++]=ja,Hi[Pi++]=El,El=i;var d=wa;i=ja;var _=32-pt(d)-1;d&=~(1<<_),o+=1;var y=32-pt(l)+_;if(30<y){var S=_-_%5;y=(d&(1<<S)-1).toString(32),d>>=S,_-=S,wa=1<<32-pt(l)+_|o<<_|d,ja=y+i}else wa=1<<y|o<<_|d,ja=i}function Dp(i){i.return!==null&&(Ya(i,1),yy(i,1,0))}function Mp(i){for(;i===Ou;)Ou=ps[--ms],ps[ms]=null,Bo=ps[--ms],ps[ms]=null;for(;i===El;)El=Hi[--Pi],Hi[Pi]=null,ja=Hi[--Pi],Hi[Pi]=null,wa=Hi[--Pi],Hi[Pi]=null}function by(i,l){Hi[Pi++]=wa,Hi[Pi++]=ja,Hi[Pi++]=El,wa=l.id,ja=l.overflow,El=i}var Mn=null,Ht=null,ct=!1,Al=null,Fi=!1,$p=Error(a(519));function Nl(i){var l=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(Ui(l,i)),$p}function vy(i){var l=i.stateNode,o=i.type,d=i.memoizedProps;switch(l[en]=i,l[xn]=d,o){case"dialog":We("cancel",l),We("close",l);break;case"iframe":case"object":case"embed":We("load",l);break;case"video":case"audio":for(o=0;o<oc.length;o++)We(oc[o],l);break;case"source":We("error",l);break;case"img":case"image":case"link":We("error",l),We("load",l);break;case"details":We("toggle",l);break;case"input":We("invalid",l),tn(l,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":We("invalid",l);break;case"textarea":We("invalid",l),Co(l,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||d.suppressHydrationWarning===!0||Lv(l.textContent,o)?(d.popover!=null&&(We("beforetoggle",l),We("toggle",l)),d.onScroll!=null&&We("scroll",l),d.onScrollEnd!=null&&We("scrollend",l),d.onClick!=null&&(l.onclick=la),l=!0):l=!1,l||Nl(i,!0)}function xy(i){for(Mn=i.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Fi=!1;return;case 27:case 3:Fi=!0;return;default:Mn=Mn.return}}function hs(i){if(i!==Mn)return!1;if(!ct)return xy(i),ct=!0,!1;var l=i.tag,o;if((o=l!==3&&l!==27)&&((o=l===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Jm(i.type,i.memoizedProps)),o=!o),o&&Ht&&Nl(i),xy(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Ht=Vv(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Ht=Vv(i)}else l===27?(l=Ht,Fl(i.type)?(i=ih,ih=null,Ht=i):Ht=l):Ht=Mn?Vi(i.stateNode.nextSibling):null;return!0}function Sr(){Ht=Mn=null,ct=!1}function zp(){var i=Al;return i!==null&&(di===null?di=i:di.push.apply(di,i),Al=null),i}function qo(i){Al===null?Al=[i]:Al.push(i)}var Op=M(null),wr=null,Ka=null;function Rl(i,l,o){$(Op,l._currentValue),l._currentValue=o}function Qa(i){i._currentValue=Op.current,J(Op)}function Lp(i,l,o){for(;i!==null;){var d=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,d!==null&&(d.childLanes|=l)):d!==null&&(d.childLanes&l)!==l&&(d.childLanes|=l),i===o)break;i=i.return}}function Ip(i,l,o,d){var _=i.child;for(_!==null&&(_.return=i);_!==null;){var y=_.dependencies;if(y!==null){var S=_.child;y=y.firstContext;e:for(;y!==null;){var E=y;y=_;for(var H=0;H<l.length;H++)if(E.context===l[H]){y.lanes|=o,E=y.alternate,E!==null&&(E.lanes|=o),Lp(y.return,o,i),d||(S=null);break e}y=E.next}}else if(_.tag===18){if(S=_.return,S===null)throw Error(a(341));S.lanes|=o,y=S.alternate,y!==null&&(y.lanes|=o),Lp(S,o,i),S=null}else S=_.child;if(S!==null)S.return=_;else for(S=_;S!==null;){if(S===i){S=null;break}if(_=S.sibling,_!==null){_.return=S.return,S=_;break}S=S.return}_=S}}function _s(i,l,o,d){i=null;for(var _=l,y=!1;_!==null;){if(!y){if((_.flags&524288)!==0)y=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var S=_.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var E=_.type;Si(_.pendingProps.value,S.value)||(i!==null?i.push(E):i=[E])}}else if(_===Ee.current){if(S=_.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(i!==null?i.push(pc):i=[pc])}_=_.return}i!==null&&Ip(l,i,o,d),l.flags|=262144}function Lu(i){for(i=i.firstContext;i!==null;){if(!Si(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function jr(i){wr=i,Ka=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function $n(i){return ky(wr,i)}function Iu(i,l){return wr===null&&jr(i),ky(i,l)}function ky(i,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},Ka===null){if(i===null)throw Error(a(308));Ka=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Ka=Ka.next=l;return o}var qj=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(o,d){i.push(d)}};this.abort=function(){l.aborted=!0,i.forEach(function(o){return o()})}},Uj=e.unstable_scheduleCallback,Hj=e.unstable_NormalPriority,mn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bp(){return{controller:new qj,data:new Map,refCount:0}}function Uo(i){i.refCount--,i.refCount===0&&Uj(Hj,function(){i.controller.abort()})}var Ho=null,qp=0,gs=0,ys=null;function Pj(i,l){if(Ho===null){var o=Ho=[];qp=0,gs=Pm(),ys={status:"pending",value:void 0,then:function(d){o.push(d)}}}return qp++,l.then(Sy,Sy),l}function Sy(){if(--qp===0&&Ho!==null){ys!==null&&(ys.status="fulfilled");var i=Ho;Ho=null,gs=0,ys=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function Fj(i,l){var o=[],d={status:"pending",value:null,reason:null,then:function(_){o.push(_)}};return i.then(function(){d.status="fulfilled",d.value=l;for(var _=0;_<o.length;_++)(0,o[_])(l)},function(_){for(d.status="rejected",d.reason=_,_=0;_<o.length;_++)(0,o[_])(void 0)}),d}var wy=O.S;O.S=function(i,l){sv=It(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&Pj(i,l),wy!==null&&wy(i,l)};var Cr=M(null);function Up(){var i=Cr.current;return i!==null?i:Mt.pooledCache}function Bu(i,l){l===null?$(Cr,Cr.current):$(Cr,l.pool)}function jy(){var i=Up();return i===null?null:{parent:mn._currentValue,pool:i}}var bs=Error(a(460)),Hp=Error(a(474)),qu=Error(a(542)),Uu={then:function(){}};function Cy(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ty(i,l,o){switch(o=i[o],o===void 0?i.push(l):o!==l&&(l.then(la,la),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,Ay(i),i;default:if(typeof l.status=="string")l.then(la,la);else{if(i=Mt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=l,i.status="pending",i.then(function(d){if(l.status==="pending"){var _=l;_.status="fulfilled",_.value=d}},function(d){if(l.status==="pending"){var _=l;_.status="rejected",_.reason=d}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,Ay(i),i}throw Er=l,bs}}function Tr(i){try{var l=i._init;return l(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Er=o,bs):o}}var Er=null;function Ey(){if(Er===null)throw Error(a(459));var i=Er;return Er=null,i}function Ay(i){if(i===bs||i===qu)throw Error(a(483))}var vs=null,Po=0;function Hu(i){var l=Po;return Po+=1,vs===null&&(vs=[]),Ty(vs,i,l)}function Fo(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function Pu(i,l){throw l.$$typeof===v?Error(a(525)):(i=Object.prototype.toString.call(l),Error(a(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function Ny(i){function l(X,V){if(i){var W=X.deletions;W===null?(X.deletions=[V],X.flags|=16):W.push(V)}}function o(X,V){if(!i)return null;for(;V!==null;)l(X,V),V=V.sibling;return null}function d(X){for(var V=new Map;X!==null;)X.key!==null?V.set(X.key,X):V.set(X.index,X),X=X.sibling;return V}function _(X,V){return X=Va(X,V),X.index=0,X.sibling=null,X}function y(X,V,W){return X.index=W,i?(W=X.alternate,W!==null?(W=W.index,W<V?(X.flags|=67108866,V):W):(X.flags|=67108866,V)):(X.flags|=1048576,V)}function S(X){return i&&X.alternate===null&&(X.flags|=67108866),X}function E(X,V,W,ce){return V===null||V.tag!==6?(V=Np(W,X.mode,ce),V.return=X,V):(V=_(V,W),V.return=X,V)}function H(X,V,W,ce){var Ne=W.type;return Ne===D?re(X,V,W.props.children,ce,W.key):V!==null&&(V.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===K&&Tr(Ne)===V.type)?(V=_(V,W.props),Fo(V,W),V.return=X,V):(V=zu(W.type,W.key,W.props,null,X.mode,ce),Fo(V,W),V.return=X,V)}function ee(X,V,W,ce){return V===null||V.tag!==4||V.stateNode.containerInfo!==W.containerInfo||V.stateNode.implementation!==W.implementation?(V=Rp(W,X.mode,ce),V.return=X,V):(V=_(V,W.children||[]),V.return=X,V)}function re(X,V,W,ce,Ne){return V===null||V.tag!==7?(V=kr(W,X.mode,ce,Ne),V.return=X,V):(V=_(V,W),V.return=X,V)}function pe(X,V,W){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=Np(""+V,X.mode,W),V.return=X,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case k:return W=zu(V.type,V.key,V.props,null,X.mode,W),Fo(W,V),W.return=X,W;case C:return V=Rp(V,X.mode,W),V.return=X,V;case K:return V=Tr(V),pe(X,V,W)}if(U(V)||Z(V))return V=kr(V,X.mode,W,null),V.return=X,V;if(typeof V.then=="function")return pe(X,Hu(V),W);if(V.$$typeof===N)return pe(X,Iu(X,V),W);Pu(X,V)}return null}function te(X,V,W,ce){var Ne=V!==null?V.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ne!==null?null:E(X,V,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case k:return W.key===Ne?H(X,V,W,ce):null;case C:return W.key===Ne?ee(X,V,W,ce):null;case K:return W=Tr(W),te(X,V,W,ce)}if(U(W)||Z(W))return Ne!==null?null:re(X,V,W,ce,null);if(typeof W.then=="function")return te(X,V,Hu(W),ce);if(W.$$typeof===N)return te(X,V,Iu(X,W),ce);Pu(X,W)}return null}function ne(X,V,W,ce,Ne){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return X=X.get(W)||null,E(V,X,""+ce,Ne);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case k:return X=X.get(ce.key===null?W:ce.key)||null,H(V,X,ce,Ne);case C:return X=X.get(ce.key===null?W:ce.key)||null,ee(V,X,ce,Ne);case K:return ce=Tr(ce),ne(X,V,W,ce,Ne)}if(U(ce)||Z(ce))return X=X.get(W)||null,re(V,X,ce,Ne,null);if(typeof ce.then=="function")return ne(X,V,W,Hu(ce),Ne);if(ce.$$typeof===N)return ne(X,V,W,Iu(V,ce),Ne);Pu(V,ce)}return null}function Ce(X,V,W,ce){for(var Ne=null,ht=null,Te=V,Ke=V=0,st=null;Te!==null&&Ke<W.length;Ke++){Te.index>Ke?(st=Te,Te=null):st=Te.sibling;var _t=te(X,Te,W[Ke],ce);if(_t===null){Te===null&&(Te=st);break}i&&Te&&_t.alternate===null&&l(X,Te),V=y(_t,V,Ke),ht===null?Ne=_t:ht.sibling=_t,ht=_t,Te=st}if(Ke===W.length)return o(X,Te),ct&&Ya(X,Ke),Ne;if(Te===null){for(;Ke<W.length;Ke++)Te=pe(X,W[Ke],ce),Te!==null&&(V=y(Te,V,Ke),ht===null?Ne=Te:ht.sibling=Te,ht=Te);return ct&&Ya(X,Ke),Ne}for(Te=d(Te);Ke<W.length;Ke++)st=ne(Te,X,Ke,W[Ke],ce),st!==null&&(i&&st.alternate!==null&&Te.delete(st.key===null?Ke:st.key),V=y(st,V,Ke),ht===null?Ne=st:ht.sibling=st,ht=st);return i&&Te.forEach(function(Ql){return l(X,Ql)}),ct&&Ya(X,Ke),Ne}function Le(X,V,W,ce){if(W==null)throw Error(a(151));for(var Ne=null,ht=null,Te=V,Ke=V=0,st=null,_t=W.next();Te!==null&&!_t.done;Ke++,_t=W.next()){Te.index>Ke?(st=Te,Te=null):st=Te.sibling;var Ql=te(X,Te,_t.value,ce);if(Ql===null){Te===null&&(Te=st);break}i&&Te&&Ql.alternate===null&&l(X,Te),V=y(Ql,V,Ke),ht===null?Ne=Ql:ht.sibling=Ql,ht=Ql,Te=st}if(_t.done)return o(X,Te),ct&&Ya(X,Ke),Ne;if(Te===null){for(;!_t.done;Ke++,_t=W.next())_t=pe(X,_t.value,ce),_t!==null&&(V=y(_t,V,Ke),ht===null?Ne=_t:ht.sibling=_t,ht=_t);return ct&&Ya(X,Ke),Ne}for(Te=d(Te);!_t.done;Ke++,_t=W.next())_t=ne(Te,X,Ke,_t.value,ce),_t!==null&&(i&&_t.alternate!==null&&Te.delete(_t.key===null?Ke:_t.key),V=y(_t,V,Ke),ht===null?Ne=_t:ht.sibling=_t,ht=_t);return i&&Te.forEach(function(t2){return l(X,t2)}),ct&&Ya(X,Ke),Ne}function Rt(X,V,W,ce){if(typeof W=="object"&&W!==null&&W.type===D&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case k:e:{for(var Ne=W.key;V!==null;){if(V.key===Ne){if(Ne=W.type,Ne===D){if(V.tag===7){o(X,V.sibling),ce=_(V,W.props.children),ce.return=X,X=ce;break e}}else if(V.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===K&&Tr(Ne)===V.type){o(X,V.sibling),ce=_(V,W.props),Fo(ce,W),ce.return=X,X=ce;break e}o(X,V);break}else l(X,V);V=V.sibling}W.type===D?(ce=kr(W.props.children,X.mode,ce,W.key),ce.return=X,X=ce):(ce=zu(W.type,W.key,W.props,null,X.mode,ce),Fo(ce,W),ce.return=X,X=ce)}return S(X);case C:e:{for(Ne=W.key;V!==null;){if(V.key===Ne)if(V.tag===4&&V.stateNode.containerInfo===W.containerInfo&&V.stateNode.implementation===W.implementation){o(X,V.sibling),ce=_(V,W.children||[]),ce.return=X,X=ce;break e}else{o(X,V);break}else l(X,V);V=V.sibling}ce=Rp(W,X.mode,ce),ce.return=X,X=ce}return S(X);case K:return W=Tr(W),Rt(X,V,W,ce)}if(U(W))return Ce(X,V,W,ce);if(Z(W)){if(Ne=Z(W),typeof Ne!="function")throw Error(a(150));return W=Ne.call(W),Le(X,V,W,ce)}if(typeof W.then=="function")return Rt(X,V,Hu(W),ce);if(W.$$typeof===N)return Rt(X,V,Iu(X,W),ce);Pu(X,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,V!==null&&V.tag===6?(o(X,V.sibling),ce=_(V,W),ce.return=X,X=ce):(o(X,V),ce=Np(W,X.mode,ce),ce.return=X,X=ce),S(X)):o(X,V)}return function(X,V,W,ce){try{Po=0;var Ne=Rt(X,V,W,ce);return vs=null,Ne}catch(Te){if(Te===bs||Te===qu)throw Te;var ht=wi(29,Te,null,X.mode);return ht.lanes=ce,ht.return=X,ht}finally{}}}var Ar=Ny(!0),Ry=Ny(!1),Dl=!1;function Pp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fp(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ml(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function $l(i,l,o){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(gt&2)!==0){var _=d.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),d.pending=l,l=$u(i),my(i,null,o),l}return Mu(i,d,l,o),$u(i)}function Go(i,l,o){if(l=l.updateQueue,l!==null&&(l=l.shared,(o&4194048)!==0)){var d=l.lanes;d&=i.pendingLanes,o|=d,l.lanes=o,Xr(i,o)}}function Gp(i,l){var o=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var _=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?_=y=S:y=y.next=S,o=o.next}while(o!==null);y===null?_=y=l:y=y.next=l}else _=y=l;o={baseState:d.baseState,firstBaseUpdate:_,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=l:i.next=l,o.lastBaseUpdate=l}var Vp=!1;function Vo(){if(Vp){var i=ys;if(i!==null)throw i}}function Yo(i,l,o,d){Vp=!1;var _=i.updateQueue;Dl=!1;var y=_.firstBaseUpdate,S=_.lastBaseUpdate,E=_.shared.pending;if(E!==null){_.shared.pending=null;var H=E,ee=H.next;H.next=null,S===null?y=ee:S.next=ee,S=H;var re=i.alternate;re!==null&&(re=re.updateQueue,E=re.lastBaseUpdate,E!==S&&(E===null?re.firstBaseUpdate=ee:E.next=ee,re.lastBaseUpdate=H))}if(y!==null){var pe=_.baseState;S=0,re=ee=H=null,E=y;do{var te=E.lane&-536870913,ne=te!==E.lane;if(ne?(rt&te)===te:(d&te)===te){te!==0&&te===gs&&(Vp=!0),re!==null&&(re=re.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ce=i,Le=E;te=l;var Rt=o;switch(Le.tag){case 1:if(Ce=Le.payload,typeof Ce=="function"){pe=Ce.call(Rt,pe,te);break e}pe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Le.payload,te=typeof Ce=="function"?Ce.call(Rt,pe,te):Ce,te==null)break e;pe=b({},pe,te);break e;case 2:Dl=!0}}te=E.callback,te!==null&&(i.flags|=64,ne&&(i.flags|=8192),ne=_.callbacks,ne===null?_.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:E.tag,payload:E.payload,callback:E.callback,next:null},re===null?(ee=re=ne,H=pe):re=re.next=ne,S|=te;if(E=E.next,E===null){if(E=_.shared.pending,E===null)break;ne=E,E=ne.next,ne.next=null,_.lastBaseUpdate=ne,_.shared.pending=null}}while(!0);re===null&&(H=pe),_.baseState=H,_.firstBaseUpdate=ee,_.lastBaseUpdate=re,y===null&&(_.shared.lanes=0),Bl|=S,i.lanes=S,i.memoizedState=pe}}function Dy(i,l){if(typeof i!="function")throw Error(a(191,i));i.call(l)}function My(i,l){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Dy(o[i],l)}var xs=M(null),Fu=M(0);function $y(i,l){i=al,$(Fu,i),$(xs,l),al=i|l.baseLanes}function Yp(){$(Fu,al),$(xs,xs.current)}function Kp(){al=Fu.current,J(xs),J(Fu)}var ji=M(null),Gi=null;function zl(i){var l=i.alternate;$(sn,sn.current&1),$(ji,i),Gi===null&&(l===null||xs.current!==null||l.memoizedState!==null)&&(Gi=i)}function Qp(i){$(sn,sn.current),$(ji,i),Gi===null&&(Gi=i)}function zy(i){i.tag===22?($(sn,sn.current),$(ji,i),Gi===null&&(Gi=i)):Ol()}function Ol(){$(sn,sn.current),$(ji,ji.current)}function Ci(i){J(ji),Gi===i&&(Gi=null),J(sn)}var sn=M(0);function Gu(i){for(var l=i;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||th(o)||nh(o)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Xa=0,Ye=null,At=null,hn=null,Vu=!1,ks=!1,Nr=!1,Yu=0,Ko=0,Ss=null,Gj=0;function nn(){throw Error(a(321))}function Xp(i,l){if(l===null)return!1;for(var o=0;o<l.length&&o<i.length;o++)if(!Si(i[o],l[o]))return!1;return!0}function Zp(i,l,o,d,_,y){return Xa=y,Ye=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,O.H=i===null||i.memoizedState===null?yb:fm,Nr=!1,y=o(d,_),Nr=!1,ks&&(y=Ly(l,o,d,_)),Oy(i),y}function Oy(i){O.H=Zo;var l=At!==null&&At.next!==null;if(Xa=0,hn=At=Ye=null,Vu=!1,Ko=0,Ss=null,l)throw Error(a(300));i===null||_n||(i=i.dependencies,i!==null&&Lu(i)&&(_n=!0))}function Ly(i,l,o,d){Ye=i;var _=0;do{if(ks&&(Ss=null),Ko=0,ks=!1,25<=_)throw Error(a(301));if(_+=1,hn=At=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}O.H=bb,y=l(o,d)}while(ks);return y}function Vj(){var i=O.H,l=i.useState()[0];return l=typeof l.then=="function"?Qo(l):l,i=i.useState()[0],(At!==null?At.memoizedState:null)!==i&&(Ye.flags|=1024),l}function Jp(){var i=Yu!==0;return Yu=0,i}function Wp(i,l,o){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~o}function em(i){if(Vu){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}Vu=!1}Xa=0,hn=At=Ye=null,ks=!1,Ko=Yu=0,Ss=null}function ei(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Ye.memoizedState=hn=i:hn=hn.next=i,hn}function on(){if(At===null){var i=Ye.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var l=hn===null?Ye.memoizedState:hn.next;if(l!==null)hn=l,At=i;else{if(i===null)throw Ye.alternate===null?Error(a(467)):Error(a(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},hn===null?Ye.memoizedState=hn=i:hn=hn.next=i}return hn}function Ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qo(i){var l=Ko;return Ko+=1,Ss===null&&(Ss=[]),i=Ty(Ss,i,l),l=Ye,(hn===null?l.memoizedState:hn.next)===null&&(l=l.alternate,O.H=l===null||l.memoizedState===null?yb:fm),i}function Qu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Qo(i);if(i.$$typeof===N)return $n(i)}throw Error(a(438,String(i)))}function tm(i){var l=null,o=Ye.updateQueue;if(o!==null&&(l=o.memoCache),l==null){var d=Ye.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(l={data:d.data.map(function(_){return _.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),o===null&&(o=Ku(),Ye.updateQueue=o),o.memoCache=l,o=l.data[l.index],o===void 0)for(o=l.data[l.index]=Array(i),d=0;d<i;d++)o[d]=I;return l.index++,o}function Za(i,l){return typeof l=="function"?l(i):l}function Xu(i){var l=on();return nm(l,At,i)}function nm(i,l,o){var d=i.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=o;var _=i.baseQueue,y=d.pending;if(y!==null){if(_!==null){var S=_.next;_.next=y.next,y.next=S}l.baseQueue=_=y,d.pending=null}if(y=i.baseState,_===null)i.memoizedState=y;else{l=_.next;var E=S=null,H=null,ee=l,re=!1;do{var pe=ee.lane&-536870913;if(pe!==ee.lane?(rt&pe)===pe:(Xa&pe)===pe){var te=ee.revertLane;if(te===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),pe===gs&&(re=!0);else if((Xa&te)===te){ee=ee.next,te===gs&&(re=!0);continue}else pe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(E=H=pe,S=y):H=H.next=pe,Ye.lanes|=te,Bl|=te;pe=ee.action,Nr&&o(y,pe),y=ee.hasEagerState?ee.eagerState:o(y,pe)}else te={lane:pe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(E=H=te,S=y):H=H.next=te,Ye.lanes|=pe,Bl|=pe;ee=ee.next}while(ee!==null&&ee!==l);if(H===null?S=y:H.next=E,!Si(y,i.memoizedState)&&(_n=!0,re&&(o=ys,o!==null)))throw o;i.memoizedState=y,i.baseState=S,i.baseQueue=H,d.lastRenderedState=y}return _===null&&(d.lanes=0),[i.memoizedState,d.dispatch]}function im(i){var l=on(),o=l.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=i;var d=o.dispatch,_=o.pending,y=l.memoizedState;if(_!==null){o.pending=null;var S=_=_.next;do y=i(y,S.action),S=S.next;while(S!==_);Si(y,l.memoizedState)||(_n=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),o.lastRenderedState=y}return[y,d]}function Iy(i,l,o){var d=Ye,_=on(),y=ct;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=l();var S=!Si((At||_).memoizedState,o);if(S&&(_.memoizedState=o,_n=!0),_=_.queue,rm(Uy.bind(null,d,_,i),[i]),_.getSnapshot!==l||S||hn!==null&&hn.memoizedState.tag&1){if(d.flags|=2048,ws(9,{destroy:void 0},qy.bind(null,d,_,o,l),null),Mt===null)throw Error(a(349));y||(Xa&127)!==0||By(d,l,o)}return o}function By(i,l,o){i.flags|=16384,i={getSnapshot:l,value:o},l=Ye.updateQueue,l===null?(l=Ku(),Ye.updateQueue=l,l.stores=[i]):(o=l.stores,o===null?l.stores=[i]:o.push(i))}function qy(i,l,o,d){l.value=o,l.getSnapshot=d,Hy(l)&&Py(i)}function Uy(i,l,o){return o(function(){Hy(l)&&Py(i)})}function Hy(i){var l=i.getSnapshot;i=i.value;try{var o=l();return!Si(i,o)}catch{return!0}}function Py(i){var l=xr(i,2);l!==null&&fi(l,i,2)}function am(i){var l=ei();if(typeof i=="function"){var o=i;if(i=o(),Nr){wn(!0);try{o()}finally{wn(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:i},l}function Fy(i,l,o,d){return i.baseState=o,nm(i,At,typeof d=="function"?d:Za)}function Yj(i,l,o,d,_){if(Wu(i))throw Error(a(485));if(i=l.action,i!==null){var y={payload:_,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};O.T!==null?o(!0):y.isTransition=!1,d(y),o=l.pending,o===null?(y.next=l.pending=y,Gy(l,y)):(y.next=o.next,l.pending=o.next=y)}}function Gy(i,l){var o=l.action,d=l.payload,_=i.state;if(l.isTransition){var y=O.T,S={};O.T=S;try{var E=o(_,d),H=O.S;H!==null&&H(S,E),Vy(i,l,E)}catch(ee){lm(i,l,ee)}finally{y!==null&&S.types!==null&&(y.types=S.types),O.T=y}}else try{y=o(_,d),Vy(i,l,y)}catch(ee){lm(i,l,ee)}}function Vy(i,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){Yy(i,l,d)},function(d){return lm(i,l,d)}):Yy(i,l,o)}function Yy(i,l,o){l.status="fulfilled",l.value=o,Ky(l),i.state=o,l=i.pending,l!==null&&(o=l.next,o===l?i.pending=null:(o=o.next,l.next=o,Gy(i,o)))}function lm(i,l,o){var d=i.pending;if(i.pending=null,d!==null){d=d.next;do l.status="rejected",l.reason=o,Ky(l),l=l.next;while(l!==d)}i.action=null}function Ky(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function Qy(i,l){return l}function Xy(i,l){if(ct){var o=Mt.formState;if(o!==null){e:{var d=Ye;if(ct){if(Ht){t:{for(var _=Ht,y=Fi;_.nodeType!==8;){if(!y){_=null;break t}if(_=Vi(_.nextSibling),_===null){_=null;break t}}y=_.data,_=y==="F!"||y==="F"?_:null}if(_){Ht=Vi(_.nextSibling),d=_.data==="F!";break e}}Nl(d)}d=!1}d&&(l=o[0])}}return o=ei(),o.memoizedState=o.baseState=l,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qy,lastRenderedState:l},o.queue=d,o=hb.bind(null,Ye,d),d.dispatch=o,d=am(!1),y=dm.bind(null,Ye,!1,d.queue),d=ei(),_={state:l,dispatch:null,action:i,pending:null},d.queue=_,o=Yj.bind(null,Ye,_,y,o),_.dispatch=o,d.memoizedState=i,[l,o,!1]}function Zy(i){var l=on();return Jy(l,At,i)}function Jy(i,l,o){if(l=nm(i,l,Qy)[0],i=Xu(Za)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var d=Qo(l)}catch(S){throw S===bs?qu:S}else d=l;l=on();var _=l.queue,y=_.dispatch;return o!==l.memoizedState&&(Ye.flags|=2048,ws(9,{destroy:void 0},Kj.bind(null,_,o),null)),[d,y,i]}function Kj(i,l){i.action=l}function Wy(i){var l=on(),o=At;if(o!==null)return Jy(l,o,i);on(),l=l.memoizedState,o=on();var d=o.queue.dispatch;return o.memoizedState=i,[l,d,!1]}function ws(i,l,o,d){return i={tag:i,create:o,deps:d,inst:l,next:null},l=Ye.updateQueue,l===null&&(l=Ku(),Ye.updateQueue=l),o=l.lastEffect,o===null?l.lastEffect=i.next=i:(d=o.next,o.next=i,i.next=d,l.lastEffect=i),i}function eb(){return on().memoizedState}function Zu(i,l,o,d){var _=ei();Ye.flags|=i,_.memoizedState=ws(1|l,{destroy:void 0},o,d===void 0?null:d)}function Ju(i,l,o,d){var _=on();d=d===void 0?null:d;var y=_.memoizedState.inst;At!==null&&d!==null&&Xp(d,At.memoizedState.deps)?_.memoizedState=ws(l,y,o,d):(Ye.flags|=i,_.memoizedState=ws(1|l,y,o,d))}function tb(i,l){Zu(8390656,8,i,l)}function rm(i,l){Ju(2048,8,i,l)}function Qj(i){Ye.flags|=4;var l=Ye.updateQueue;if(l===null)l=Ku(),Ye.updateQueue=l,l.events=[i];else{var o=l.events;o===null?l.events=[i]:o.push(i)}}function nb(i){var l=on().memoizedState;return Qj({ref:l,nextImpl:i}),function(){if((gt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}function ib(i,l){return Ju(4,2,i,l)}function ab(i,l){return Ju(4,4,i,l)}function lb(i,l){if(typeof l=="function"){i=i();var o=l(i);return function(){typeof o=="function"?o():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function rb(i,l,o){o=o!=null?o.concat([i]):null,Ju(4,4,lb.bind(null,l,i),o)}function sm(){}function sb(i,l){var o=on();l=l===void 0?null:l;var d=o.memoizedState;return l!==null&&Xp(l,d[1])?d[0]:(o.memoizedState=[i,l],i)}function ob(i,l){var o=on();l=l===void 0?null:l;var d=o.memoizedState;if(l!==null&&Xp(l,d[1]))return d[0];if(d=i(),Nr){wn(!0);try{i()}finally{wn(!1)}}return o.memoizedState=[d,l],d}function om(i,l,o){return o===void 0||(Xa&1073741824)!==0&&(rt&261930)===0?i.memoizedState=l:(i.memoizedState=o,i=cv(),Ye.lanes|=i,Bl|=i,o)}function cb(i,l,o,d){return Si(o,l)?o:xs.current!==null?(i=om(i,o,d),Si(i,l)||(_n=!0),i):(Xa&42)===0||(Xa&1073741824)!==0&&(rt&261930)===0?(_n=!0,i.memoizedState=o):(i=cv(),Ye.lanes|=i,Bl|=i,l)}function ub(i,l,o,d,_){var y=G.p;G.p=y!==0&&8>y?y:8;var S=O.T,E={};O.T=E,dm(i,!1,l,o);try{var H=_(),ee=O.S;if(ee!==null&&ee(E,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var re=Fj(H,d);Xo(i,l,re,Ai(i))}else Xo(i,l,d,Ai(i))}catch(pe){Xo(i,l,{then:function(){},status:"rejected",reason:pe},Ai())}finally{G.p=y,S!==null&&E.types!==null&&(S.types=E.types),O.T=S}}function Xj(){}function cm(i,l,o,d){if(i.tag!==5)throw Error(a(476));var _=db(i).queue;ub(i,_,l,ae,o===null?Xj:function(){return fb(i),o(d)})}function db(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:ae},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:o},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function fb(i){var l=db(i);l.next===null&&(l=i.alternate.memoizedState),Xo(i,l.next.queue,{},Ai())}function um(){return $n(pc)}function pb(){return on().memoizedState}function mb(){return on().memoizedState}function Zj(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var o=Ai();i=Ml(o);var d=$l(l,i,o);d!==null&&(fi(d,l,o),Go(d,l,o)),l={cache:Bp()},i.payload=l;return}l=l.return}}function Jj(i,l,o){var d=Ai();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Wu(i)?_b(l,o):(o=Ep(i,l,o,d),o!==null&&(fi(o,i,d),gb(o,l,d)))}function hb(i,l,o){var d=Ai();Xo(i,l,o,d)}function Xo(i,l,o,d){var _={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Wu(i))_b(l,_);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=l.lastRenderedReducer,y!==null))try{var S=l.lastRenderedState,E=y(S,o);if(_.hasEagerState=!0,_.eagerState=E,Si(E,S))return Mu(i,l,_,0),Mt===null&&Du(),!1}catch{}finally{}if(o=Ep(i,l,_,d),o!==null)return fi(o,i,d),gb(o,l,d),!0}return!1}function dm(i,l,o,d){if(d={lane:2,revertLane:Pm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Wu(i)){if(l)throw Error(a(479))}else l=Ep(i,o,d,2),l!==null&&fi(l,i,2)}function Wu(i){var l=i.alternate;return i===Ye||l!==null&&l===Ye}function _b(i,l){ks=Vu=!0;var o=i.pending;o===null?l.next=l:(l.next=o.next,o.next=l),i.pending=l}function gb(i,l,o){if((o&4194048)!==0){var d=l.lanes;d&=i.pendingLanes,o|=d,l.lanes=o,Xr(i,o)}}var Zo={readContext:$n,use:Qu,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};Zo.useEffectEvent=nn;var yb={readContext:$n,use:Qu,useCallback:function(i,l){return ei().memoizedState=[i,l===void 0?null:l],i},useContext:$n,useEffect:tb,useImperativeHandle:function(i,l,o){o=o!=null?o.concat([i]):null,Zu(4194308,4,lb.bind(null,l,i),o)},useLayoutEffect:function(i,l){return Zu(4194308,4,i,l)},useInsertionEffect:function(i,l){Zu(4,2,i,l)},useMemo:function(i,l){var o=ei();l=l===void 0?null:l;var d=i();if(Nr){wn(!0);try{i()}finally{wn(!1)}}return o.memoizedState=[d,l],d},useReducer:function(i,l,o){var d=ei();if(o!==void 0){var _=o(l);if(Nr){wn(!0);try{o(l)}finally{wn(!1)}}}else _=l;return d.memoizedState=d.baseState=_,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:_},d.queue=i,i=i.dispatch=Jj.bind(null,Ye,i),[d.memoizedState,i]},useRef:function(i){var l=ei();return i={current:i},l.memoizedState=i},useState:function(i){i=am(i);var l=i.queue,o=hb.bind(null,Ye,l);return l.dispatch=o,[i.memoizedState,o]},useDebugValue:sm,useDeferredValue:function(i,l){var o=ei();return om(o,i,l)},useTransition:function(){var i=am(!1);return i=ub.bind(null,Ye,i.queue,!0,!1),ei().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,o){var d=Ye,_=ei();if(ct){if(o===void 0)throw Error(a(407));o=o()}else{if(o=l(),Mt===null)throw Error(a(349));(rt&127)!==0||By(d,l,o)}_.memoizedState=o;var y={value:o,getSnapshot:l};return _.queue=y,tb(Uy.bind(null,d,y,i),[i]),d.flags|=2048,ws(9,{destroy:void 0},qy.bind(null,d,y,o,l),null),o},useId:function(){var i=ei(),l=Mt.identifierPrefix;if(ct){var o=ja,d=wa;o=(d&~(1<<32-pt(d)-1)).toString(32)+o,l="_"+l+"R_"+o,o=Yu++,0<o&&(l+="H"+o.toString(32)),l+="_"}else o=Gj++,l="_"+l+"r_"+o.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:um,useFormState:Xy,useActionState:Xy,useOptimistic:function(i){var l=ei();l.memoizedState=l.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=dm.bind(null,Ye,!0,o),o.dispatch=l,[i,l]},useMemoCache:tm,useCacheRefresh:function(){return ei().memoizedState=Zj.bind(null,Ye)},useEffectEvent:function(i){var l=ei(),o={impl:i};return l.memoizedState=o,function(){if((gt&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},fm={readContext:$n,use:Qu,useCallback:sb,useContext:$n,useEffect:rm,useImperativeHandle:rb,useInsertionEffect:ib,useLayoutEffect:ab,useMemo:ob,useReducer:Xu,useRef:eb,useState:function(){return Xu(Za)},useDebugValue:sm,useDeferredValue:function(i,l){var o=on();return cb(o,At.memoizedState,i,l)},useTransition:function(){var i=Xu(Za)[0],l=on().memoizedState;return[typeof i=="boolean"?i:Qo(i),l]},useSyncExternalStore:Iy,useId:pb,useHostTransitionStatus:um,useFormState:Zy,useActionState:Zy,useOptimistic:function(i,l){var o=on();return Fy(o,At,i,l)},useMemoCache:tm,useCacheRefresh:mb};fm.useEffectEvent=nb;var bb={readContext:$n,use:Qu,useCallback:sb,useContext:$n,useEffect:rm,useImperativeHandle:rb,useInsertionEffect:ib,useLayoutEffect:ab,useMemo:ob,useReducer:im,useRef:eb,useState:function(){return im(Za)},useDebugValue:sm,useDeferredValue:function(i,l){var o=on();return At===null?om(o,i,l):cb(o,At.memoizedState,i,l)},useTransition:function(){var i=im(Za)[0],l=on().memoizedState;return[typeof i=="boolean"?i:Qo(i),l]},useSyncExternalStore:Iy,useId:pb,useHostTransitionStatus:um,useFormState:Wy,useActionState:Wy,useOptimistic:function(i,l){var o=on();return At!==null?Fy(o,At,i,l):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:tm,useCacheRefresh:mb};bb.useEffectEvent=nb;function pm(i,l,o,d){l=i.memoizedState,o=o(d,l),o=o==null?l:b({},l,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var mm={enqueueSetState:function(i,l,o){i=i._reactInternals;var d=Ai(),_=Ml(d);_.payload=l,o!=null&&(_.callback=o),l=$l(i,_,d),l!==null&&(fi(l,i,d),Go(l,i,d))},enqueueReplaceState:function(i,l,o){i=i._reactInternals;var d=Ai(),_=Ml(d);_.tag=1,_.payload=l,o!=null&&(_.callback=o),l=$l(i,_,d),l!==null&&(fi(l,i,d),Go(l,i,d))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var o=Ai(),d=Ml(o);d.tag=2,l!=null&&(d.callback=l),l=$l(i,d,o),l!==null&&(fi(l,i,o),Go(l,i,o))}};function vb(i,l,o,d,_,y,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,y,S):l.prototype&&l.prototype.isPureReactComponent?!Lo(o,d)||!Lo(_,y):!0}function xb(i,l,o,d){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(o,d),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(o,d),l.state!==i&&mm.enqueueReplaceState(l,l.state,null)}function Rr(i,l){var o=l;if("ref"in l){o={};for(var d in l)d!=="ref"&&(o[d]=l[d])}if(i=i.defaultProps){o===l&&(o=b({},o));for(var _ in i)o[_]===void 0&&(o[_]=i[_])}return o}function kb(i){Ru(i)}function Sb(i){console.error(i)}function wb(i){Ru(i)}function ed(i,l){try{var o=i.onUncaughtError;o(l.value,{componentStack:l.stack})}catch(d){setTimeout(function(){throw d})}}function jb(i,l,o){try{var d=i.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function hm(i,l,o){return o=Ml(o),o.tag=3,o.payload={element:null},o.callback=function(){ed(i,l)},o}function Cb(i){return i=Ml(i),i.tag=3,i}function Tb(i,l,o,d){var _=o.type.getDerivedStateFromError;if(typeof _=="function"){var y=d.value;i.payload=function(){return _(y)},i.callback=function(){jb(l,o,d)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){jb(l,o,d),typeof _!="function"&&(ql===null?ql=new Set([this]):ql.add(this));var E=d.stack;this.componentDidCatch(d.value,{componentStack:E!==null?E:""})})}function Wj(i,l,o,d,_){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(l=o.alternate,l!==null&&_s(l,o,_,!0),o=ji.current,o!==null){switch(o.tag){case 31:case 13:return Gi===null?fd():o.alternate===null&&an===0&&(an=3),o.flags&=-257,o.flags|=65536,o.lanes=_,d===Uu?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([d]):l.add(d),qm(i,d,_)),!1;case 22:return o.flags|=65536,d===Uu?o.flags|=16384:(l=o.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=l):(o=l.retryQueue,o===null?l.retryQueue=new Set([d]):o.add(d)),qm(i,d,_)),!1}throw Error(a(435,o.tag))}return qm(i,d,_),fd(),!1}if(ct)return l=ji.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=_,d!==$p&&(i=Error(a(422),{cause:d}),qo(Ui(i,o)))):(d!==$p&&(l=Error(a(423),{cause:d}),qo(Ui(l,o))),i=i.current.alternate,i.flags|=65536,_&=-_,i.lanes|=_,d=Ui(d,o),_=hm(i.stateNode,d,_),Gp(i,_),an!==4&&(an=2)),!1;var y=Error(a(520),{cause:d});if(y=Ui(y,o),lc===null?lc=[y]:lc.push(y),an!==4&&(an=2),l===null)return!0;d=Ui(d,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,i=_&-_,o.lanes|=i,i=hm(o.stateNode,d,i),Gp(o,i),!1;case 1:if(l=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ql===null||!ql.has(y))))return o.flags|=65536,_&=-_,o.lanes|=_,_=Cb(_),Tb(_,i,o,d),Gp(o,_),!1}o=o.return}while(o!==null);return!1}var _m=Error(a(461)),_n=!1;function zn(i,l,o,d){l.child=i===null?Ry(l,null,o,d):Ar(l,i.child,o,d)}function Eb(i,l,o,d,_){o=o.render;var y=l.ref;if("ref"in d){var S={};for(var E in d)E!=="ref"&&(S[E]=d[E])}else S=d;return jr(l),d=Zp(i,l,o,S,y,_),E=Jp(),i!==null&&!_n?(Wp(i,l,_),Ja(i,l,_)):(ct&&E&&Dp(l),l.flags|=1,zn(i,l,d,_),l.child)}function Ab(i,l,o,d,_){if(i===null){var y=o.type;return typeof y=="function"&&!Ap(y)&&y.defaultProps===void 0&&o.compare===null?(l.tag=15,l.type=y,Nb(i,l,y,d,_)):(i=zu(o.type,null,d,l,l.mode,_),i.ref=l.ref,i.return=l,l.child=i)}if(y=i.child,!wm(i,_)){var S=y.memoizedProps;if(o=o.compare,o=o!==null?o:Lo,o(S,d)&&i.ref===l.ref)return Ja(i,l,_)}return l.flags|=1,i=Va(y,d),i.ref=l.ref,i.return=l,l.child=i}function Nb(i,l,o,d,_){if(i!==null){var y=i.memoizedProps;if(Lo(y,d)&&i.ref===l.ref)if(_n=!1,l.pendingProps=d=y,wm(i,_))(i.flags&131072)!==0&&(_n=!0);else return l.lanes=i.lanes,Ja(i,l,_)}return gm(i,l,o,d,_)}function Rb(i,l,o,d){var _=d.children,y=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(d=l.child=i.child,_=0;d!==null;)_=_|d.lanes|d.childLanes,d=d.sibling;d=_&~y}else d=0,l.child=null;return Db(i,l,y,o,d)}if((o&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&Bu(l,y!==null?y.cachePool:null),y!==null?$y(l,y):Yp(),zy(l);else return d=l.lanes=536870912,Db(i,l,y!==null?y.baseLanes|o:o,o,d)}else y!==null?(Bu(l,y.cachePool),$y(l,y),Ol(),l.memoizedState=null):(i!==null&&Bu(l,null),Yp(),Ol());return zn(i,l,_,o),l.child}function Jo(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Db(i,l,o,d,_){var y=Up();return y=y===null?null:{parent:mn._currentValue,pool:y},l.memoizedState={baseLanes:o,cachePool:y},i!==null&&Bu(l,null),Yp(),zy(l),i!==null&&_s(i,l,d,!0),l.childLanes=_,null}function td(i,l){return l=id({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function Mb(i,l,o){return Ar(l,i.child,null,o),i=td(l,l.pendingProps),i.flags|=2,Ci(l),l.memoizedState=null,i}function eC(i,l,o){var d=l.pendingProps,_=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(ct){if(d.mode==="hidden")return i=td(l,d),l.lanes=536870912,Jo(null,i);if(Qp(l),(i=Ht)?(i=Gv(i,Fi),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:El!==null?{id:wa,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},o=_y(i),o.return=l,l.child=o,Mn=l,Ht=null)):i=null,i===null)throw Nl(l);return l.lanes=536870912,null}return td(l,d)}var y=i.memoizedState;if(y!==null){var S=y.dehydrated;if(Qp(l),_)if(l.flags&256)l.flags&=-257,l=Mb(i,l,o);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(a(558));else if(_n||_s(i,l,o,!1),_=(o&i.childLanes)!==0,_n||_){if(d=Mt,d!==null&&(S=fu(d,o),S!==0&&S!==y.retryLane))throw y.retryLane=S,xr(i,S),fi(d,i,S),_m;fd(),l=Mb(i,l,o)}else i=y.treeContext,Ht=Vi(S.nextSibling),Mn=l,ct=!0,Al=null,Fi=!1,i!==null&&by(l,i),l=td(l,d),l.flags|=4096;return l}return i=Va(i.child,{mode:d.mode,children:d.children}),i.ref=l.ref,l.child=i,i.return=l,i}function nd(i,l){var o=l.ref;if(o===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(i===null||i.ref!==o)&&(l.flags|=4194816)}}function gm(i,l,o,d,_){return jr(l),o=Zp(i,l,o,d,void 0,_),d=Jp(),i!==null&&!_n?(Wp(i,l,_),Ja(i,l,_)):(ct&&d&&Dp(l),l.flags|=1,zn(i,l,o,_),l.child)}function $b(i,l,o,d,_,y){return jr(l),l.updateQueue=null,o=Ly(l,d,o,_),Oy(i),d=Jp(),i!==null&&!_n?(Wp(i,l,y),Ja(i,l,y)):(ct&&d&&Dp(l),l.flags|=1,zn(i,l,o,y),l.child)}function zb(i,l,o,d,_){if(jr(l),l.stateNode===null){var y=fs,S=o.contextType;typeof S=="object"&&S!==null&&(y=$n(S)),y=new o(d,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=mm,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=d,y.state=l.memoizedState,y.refs={},Pp(l),S=o.contextType,y.context=typeof S=="object"&&S!==null?$n(S):fs,y.state=l.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(pm(l,o,S,d),y.state=l.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&mm.enqueueReplaceState(y,y.state,null),Yo(l,d,y,_),Vo(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),d=!0}else if(i===null){y=l.stateNode;var E=l.memoizedProps,H=Rr(o,E);y.props=H;var ee=y.context,re=o.contextType;S=fs,typeof re=="object"&&re!==null&&(S=$n(re));var pe=o.getDerivedStateFromProps;re=typeof pe=="function"||typeof y.getSnapshotBeforeUpdate=="function",E=l.pendingProps!==E,re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E||ee!==S)&&xb(l,y,d,S),Dl=!1;var te=l.memoizedState;y.state=te,Yo(l,d,y,_),Vo(),ee=l.memoizedState,E||te!==ee||Dl?(typeof pe=="function"&&(pm(l,o,pe,d),ee=l.memoizedState),(H=Dl||vb(l,o,H,d,te,ee,S))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(l.flags|=4194308)):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=d,l.memoizedState=ee),y.props=d,y.state=ee,y.context=S,d=H):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),d=!1)}else{y=l.stateNode,Fp(i,l),S=l.memoizedProps,re=Rr(o,S),y.props=re,pe=l.pendingProps,te=y.context,ee=o.contextType,H=fs,typeof ee=="object"&&ee!==null&&(H=$n(ee)),E=o.getDerivedStateFromProps,(ee=typeof E=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==pe||te!==H)&&xb(l,y,d,H),Dl=!1,te=l.memoizedState,y.state=te,Yo(l,d,y,_),Vo();var ne=l.memoizedState;S!==pe||te!==ne||Dl||i!==null&&i.dependencies!==null&&Lu(i.dependencies)?(typeof E=="function"&&(pm(l,o,E,d),ne=l.memoizedState),(re=Dl||vb(l,o,re,d,te,ne,H)||i!==null&&i.dependencies!==null&&Lu(i.dependencies))?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,ne,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,ne,H)),typeof y.componentDidUpdate=="function"&&(l.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&te===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&te===i.memoizedState||(l.flags|=1024),l.memoizedProps=d,l.memoizedState=ne),y.props=d,y.state=ne,y.context=H,d=re):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&te===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&te===i.memoizedState||(l.flags|=1024),d=!1)}return y=d,nd(i,l),d=(l.flags&128)!==0,y||d?(y=l.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,i!==null&&d?(l.child=Ar(l,i.child,null,_),l.child=Ar(l,null,o,_)):zn(i,l,o,_),l.memoizedState=y.state,i=l.child):i=Ja(i,l,_),i}function Ob(i,l,o,d){return Sr(),l.flags|=256,zn(i,l,o,d),l.child}var ym={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bm(i){return{baseLanes:i,cachePool:jy()}}function vm(i,l,o){return i=i!==null?i.childLanes&~o:0,l&&(i|=Ei),i}function Lb(i,l,o){var d=l.pendingProps,_=!1,y=(l.flags&128)!==0,S;if((S=y)||(S=i!==null&&i.memoizedState===null?!1:(sn.current&2)!==0),S&&(_=!0,l.flags&=-129),S=(l.flags&32)!==0,l.flags&=-33,i===null){if(ct){if(_?zl(l):Ol(),(i=Ht)?(i=Gv(i,Fi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:El!==null?{id:wa,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},o=_y(i),o.return=l,l.child=o,Mn=l,Ht=null)):i=null,i===null)throw Nl(l);return nh(i)?l.lanes=32:l.lanes=536870912,null}var E=d.children;return d=d.fallback,_?(Ol(),_=l.mode,E=id({mode:"hidden",children:E},_),d=kr(d,_,o,null),E.return=l,d.return=l,E.sibling=d,l.child=E,d=l.child,d.memoizedState=bm(o),d.childLanes=vm(i,S,o),l.memoizedState=ym,Jo(null,d)):(zl(l),xm(l,E))}var H=i.memoizedState;if(H!==null&&(E=H.dehydrated,E!==null)){if(y)l.flags&256?(zl(l),l.flags&=-257,l=km(i,l,o)):l.memoizedState!==null?(Ol(),l.child=i.child,l.flags|=128,l=null):(Ol(),E=d.fallback,_=l.mode,d=id({mode:"visible",children:d.children},_),E=kr(E,_,o,null),E.flags|=2,d.return=l,E.return=l,d.sibling=E,l.child=d,Ar(l,i.child,null,o),d=l.child,d.memoizedState=bm(o),d.childLanes=vm(i,S,o),l.memoizedState=ym,l=Jo(null,d));else if(zl(l),nh(E)){if(S=E.nextSibling&&E.nextSibling.dataset,S)var ee=S.dgst;S=ee,d=Error(a(419)),d.stack="",d.digest=S,qo({value:d,source:null,stack:null}),l=km(i,l,o)}else if(_n||_s(i,l,o,!1),S=(o&i.childLanes)!==0,_n||S){if(S=Mt,S!==null&&(d=fu(S,o),d!==0&&d!==H.retryLane))throw H.retryLane=d,xr(i,d),fi(S,i,d),_m;th(E)||fd(),l=km(i,l,o)}else th(E)?(l.flags|=192,l.child=i.child,l=null):(i=H.treeContext,Ht=Vi(E.nextSibling),Mn=l,ct=!0,Al=null,Fi=!1,i!==null&&by(l,i),l=xm(l,d.children),l.flags|=4096);return l}return _?(Ol(),E=d.fallback,_=l.mode,H=i.child,ee=H.sibling,d=Va(H,{mode:"hidden",children:d.children}),d.subtreeFlags=H.subtreeFlags&65011712,ee!==null?E=Va(ee,E):(E=kr(E,_,o,null),E.flags|=2),E.return=l,d.return=l,d.sibling=E,l.child=d,Jo(null,d),d=l.child,E=i.child.memoizedState,E===null?E=bm(o):(_=E.cachePool,_!==null?(H=mn._currentValue,_=_.parent!==H?{parent:H,pool:H}:_):_=jy(),E={baseLanes:E.baseLanes|o,cachePool:_}),d.memoizedState=E,d.childLanes=vm(i,S,o),l.memoizedState=ym,Jo(i.child,d)):(zl(l),o=i.child,i=o.sibling,o=Va(o,{mode:"visible",children:d.children}),o.return=l,o.sibling=null,i!==null&&(S=l.deletions,S===null?(l.deletions=[i],l.flags|=16):S.push(i)),l.child=o,l.memoizedState=null,o)}function xm(i,l){return l=id({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function id(i,l){return i=wi(22,i,null,l),i.lanes=0,i}function km(i,l,o){return Ar(l,i.child,null,o),i=xm(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Ib(i,l,o){i.lanes|=l;var d=i.alternate;d!==null&&(d.lanes|=l),Lp(i.return,l,o)}function Sm(i,l,o,d,_,y){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:_,treeForkCount:y}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=o,S.tailMode=_,S.treeForkCount=y)}function Bb(i,l,o){var d=l.pendingProps,_=d.revealOrder,y=d.tail;d=d.children;var S=sn.current,E=(S&2)!==0;if(E?(S=S&1|2,l.flags|=128):S&=1,$(sn,S),zn(i,l,d,o),d=ct?Bo:0,!E&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ib(i,o,l);else if(i.tag===19)Ib(i,o,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(_){case"forwards":for(o=l.child,_=null;o!==null;)i=o.alternate,i!==null&&Gu(i)===null&&(_=o),o=o.sibling;o=_,o===null?(_=l.child,l.child=null):(_=o.sibling,o.sibling=null),Sm(l,!1,_,o,y,d);break;case"backwards":case"unstable_legacy-backwards":for(o=null,_=l.child,l.child=null;_!==null;){if(i=_.alternate,i!==null&&Gu(i)===null){l.child=_;break}i=_.sibling,_.sibling=o,o=_,_=i}Sm(l,!0,o,null,y,d);break;case"together":Sm(l,!1,null,null,void 0,d);break;default:l.memoizedState=null}return l.child}function Ja(i,l,o){if(i!==null&&(l.dependencies=i.dependencies),Bl|=l.lanes,(o&l.childLanes)===0)if(i!==null){if(_s(i,l,o,!1),(o&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(a(153));if(l.child!==null){for(i=l.child,o=Va(i,i.pendingProps),l.child=o,o.return=l;i.sibling!==null;)i=i.sibling,o=o.sibling=Va(i,i.pendingProps),o.return=l;o.sibling=null}return l.child}function wm(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Lu(i)))}function tC(i,l,o){switch(l.tag){case 3:Ie(l,l.stateNode.containerInfo),Rl(l,mn,i.memoizedState.cache),Sr();break;case 27:case 5:me(l);break;case 4:Ie(l,l.stateNode.containerInfo);break;case 10:Rl(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Qp(l),null;break;case 13:var d=l.memoizedState;if(d!==null)return d.dehydrated!==null?(zl(l),l.flags|=128,null):(o&l.child.childLanes)!==0?Lb(i,l,o):(zl(l),i=Ja(i,l,o),i!==null?i.sibling:null);zl(l);break;case 19:var _=(i.flags&128)!==0;if(d=(o&l.childLanes)!==0,d||(_s(i,l,o,!1),d=(o&l.childLanes)!==0),_){if(d)return Bb(i,l,o);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),$(sn,sn.current),d)break;return null;case 22:return l.lanes=0,Rb(i,l,o,l.pendingProps);case 24:Rl(l,mn,i.memoizedState.cache)}return Ja(i,l,o)}function qb(i,l,o){if(i!==null)if(i.memoizedProps!==l.pendingProps)_n=!0;else{if(!wm(i,o)&&(l.flags&128)===0)return _n=!1,tC(i,l,o);_n=(i.flags&131072)!==0}else _n=!1,ct&&(l.flags&1048576)!==0&&yy(l,Bo,l.index);switch(l.lanes=0,l.tag){case 16:e:{var d=l.pendingProps;if(i=Tr(l.elementType),l.type=i,typeof i=="function")Ap(i)?(d=Rr(i,d),l.tag=1,l=zb(null,l,i,d,o)):(l.tag=0,l=gm(null,l,i,d,o));else{if(i!=null){var _=i.$$typeof;if(_===F){l.tag=11,l=Eb(null,l,i,d,o);break e}else if(_===P){l.tag=14,l=Ab(null,l,i,d,o);break e}}throw l=R(i)||i,Error(a(306,l,""))}}return l;case 0:return gm(i,l,l.type,l.pendingProps,o);case 1:return d=l.type,_=Rr(d,l.pendingProps),zb(i,l,d,_,o);case 3:e:{if(Ie(l,l.stateNode.containerInfo),i===null)throw Error(a(387));d=l.pendingProps;var y=l.memoizedState;_=y.element,Fp(i,l),Yo(l,d,null,o);var S=l.memoizedState;if(d=S.cache,Rl(l,mn,d),d!==y.cache&&Ip(l,[mn],o,!0),Vo(),d=S.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:S.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=Ob(i,l,d,o);break e}else if(d!==_){_=Ui(Error(a(424)),l),qo(_),l=Ob(i,l,d,o);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Ht=Vi(i.firstChild),Mn=l,ct=!0,Al=null,Fi=!0,o=Ry(l,null,d,o),l.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Sr(),d===_){l=Ja(i,l,o);break e}zn(i,l,d,o)}l=l.child}return l;case 26:return nd(i,l),i===null?(o=Zv(l.type,null,l.pendingProps,null))?l.memoizedState=o:ct||(o=l.type,i=l.pendingProps,d=bd(be.current).createElement(o),d[en]=l,d[xn]=i,On(d,o,i),Me(d),l.stateNode=d):l.memoizedState=Zv(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return me(l),i===null&&ct&&(d=l.stateNode=Kv(l.type,l.pendingProps,be.current),Mn=l,Fi=!0,_=Ht,Fl(l.type)?(ih=_,Ht=Vi(d.firstChild)):Ht=_),zn(i,l,l.pendingProps.children,o),nd(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&ct&&((_=d=Ht)&&(d=RC(d,l.type,l.pendingProps,Fi),d!==null?(l.stateNode=d,Mn=l,Ht=Vi(d.firstChild),Fi=!1,_=!0):_=!1),_||Nl(l)),me(l),_=l.type,y=l.pendingProps,S=i!==null?i.memoizedProps:null,d=y.children,Jm(_,y)?d=null:S!==null&&Jm(_,S)&&(l.flags|=32),l.memoizedState!==null&&(_=Zp(i,l,Vj,null,null,o),pc._currentValue=_),nd(i,l),zn(i,l,d,o),l.child;case 6:return i===null&&ct&&((i=o=Ht)&&(o=DC(o,l.pendingProps,Fi),o!==null?(l.stateNode=o,Mn=l,Ht=null,i=!0):i=!1),i||Nl(l)),null;case 13:return Lb(i,l,o);case 4:return Ie(l,l.stateNode.containerInfo),d=l.pendingProps,i===null?l.child=Ar(l,null,d,o):zn(i,l,d,o),l.child;case 11:return Eb(i,l,l.type,l.pendingProps,o);case 7:return zn(i,l,l.pendingProps,o),l.child;case 8:return zn(i,l,l.pendingProps.children,o),l.child;case 12:return zn(i,l,l.pendingProps.children,o),l.child;case 10:return d=l.pendingProps,Rl(l,l.type,d.value),zn(i,l,d.children,o),l.child;case 9:return _=l.type._context,d=l.pendingProps.children,jr(l),_=$n(_),d=d(_),l.flags|=1,zn(i,l,d,o),l.child;case 14:return Ab(i,l,l.type,l.pendingProps,o);case 15:return Nb(i,l,l.type,l.pendingProps,o);case 19:return Bb(i,l,o);case 31:return eC(i,l,o);case 22:return Rb(i,l,o,l.pendingProps);case 24:return jr(l),d=$n(mn),i===null?(_=Up(),_===null&&(_=Mt,y=Bp(),_.pooledCache=y,y.refCount++,y!==null&&(_.pooledCacheLanes|=o),_=y),l.memoizedState={parent:d,cache:_},Pp(l),Rl(l,mn,_)):((i.lanes&o)!==0&&(Fp(i,l),Yo(l,null,null,o),Vo()),_=i.memoizedState,y=l.memoizedState,_.parent!==d?(_={parent:d,cache:d},l.memoizedState=_,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=_),Rl(l,mn,d)):(d=y.cache,Rl(l,mn,d),d!==_.cache&&Ip(l,[mn],o,!0))),zn(i,l,l.pendingProps.children,o),l.child;case 29:throw l.pendingProps}throw Error(a(156,l.tag))}function Wa(i){i.flags|=4}function jm(i,l,o,d,_){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(_&335544128)===_)if(i.stateNode.complete)i.flags|=8192;else if(pv())i.flags|=8192;else throw Er=Uu,Hp}else i.flags&=-16777217}function Ub(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!nx(l))if(pv())i.flags|=8192;else throw Er=Uu,Hp}function ad(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?bo():536870912,i.lanes|=l,Es|=l)}function Wo(i,l){if(!ct)switch(i.tailMode){case"hidden":l=i.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function Pt(i){var l=i.alternate!==null&&i.alternate.child===i.child,o=0,d=0;if(l)for(var _=i.child;_!==null;)o|=_.lanes|_.childLanes,d|=_.subtreeFlags&65011712,d|=_.flags&65011712,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)o|=_.lanes|_.childLanes,d|=_.subtreeFlags,d|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=d,i.childLanes=o,l}function nC(i,l,o){var d=l.pendingProps;switch(Mp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(l),null;case 1:return Pt(l),null;case 3:return o=l.stateNode,d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Qa(mn),ue(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(hs(l)?Wa(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,zp())),Pt(l),null;case 26:var _=l.type,y=l.memoizedState;return i===null?(Wa(l),y!==null?(Pt(l),Ub(l,y)):(Pt(l),jm(l,_,null,d,o))):y?y!==i.memoizedState?(Wa(l),Pt(l),Ub(l,y)):(Pt(l),l.flags&=-16777217):(i=i.memoizedProps,i!==d&&Wa(l),Pt(l),jm(l,_,i,d,o)),null;case 27:if(Xe(l),o=be.current,_=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==d&&Wa(l);else{if(!d){if(l.stateNode===null)throw Error(a(166));return Pt(l),null}i=_e.current,hs(l)?vy(l):(i=Kv(_,d,o),l.stateNode=i,Wa(l))}return Pt(l),null;case 5:if(Xe(l),_=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==d&&Wa(l);else{if(!d){if(l.stateNode===null)throw Error(a(166));return Pt(l),null}if(y=_e.current,hs(l))vy(l);else{var S=bd(be.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?S.createElement(_,{is:d.is}):S.createElement(_)}}y[en]=l,y[xn]=d;e:for(S=l.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===l)break e;for(;S.sibling===null;){if(S.return===null||S.return===l)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}l.stateNode=y;e:switch(On(y,_,d),_){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Wa(l)}}return Pt(l),jm(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,o),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==d&&Wa(l);else{if(typeof d!="string"&&l.stateNode===null)throw Error(a(166));if(i=be.current,hs(l)){if(i=l.stateNode,o=l.memoizedProps,d=null,_=Mn,_!==null)switch(_.tag){case 27:case 5:d=_.memoizedProps}i[en]=l,i=!!(i.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||Lv(i.nodeValue,o)),i||Nl(l,!0)}else i=bd(i).createTextNode(d),i[en]=l,l.stateNode=i}return Pt(l),null;case 31:if(o=l.memoizedState,i===null||i.memoizedState!==null){if(d=hs(l),o!==null){if(i===null){if(!d)throw Error(a(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[en]=l}else Sr(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),i=!1}else o=zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return l.flags&256?(Ci(l),l):(Ci(l),null);if((l.flags&128)!==0)throw Error(a(558))}return Pt(l),null;case 13:if(d=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(_=hs(l),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(a(318));if(_=l.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[en]=l}else Sr(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),_=!1}else _=zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=_),_=!0;if(!_)return l.flags&256?(Ci(l),l):(Ci(l),null)}return Ci(l),(l.flags&128)!==0?(l.lanes=o,l):(o=d!==null,i=i!==null&&i.memoizedState!==null,o&&(d=l.child,_=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(_=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==_&&(d.flags|=2048)),o!==i&&o&&(l.child.flags|=8192),ad(l,l.updateQueue),Pt(l),null);case 4:return ue(),i===null&&Ym(l.stateNode.containerInfo),Pt(l),null;case 10:return Qa(l.type),Pt(l),null;case 19:if(J(sn),d=l.memoizedState,d===null)return Pt(l),null;if(_=(l.flags&128)!==0,y=d.rendering,y===null)if(_)Wo(d,!1);else{if(an!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(y=Gu(i),y!==null){for(l.flags|=128,Wo(d,!1),i=y.updateQueue,l.updateQueue=i,ad(l,i),l.subtreeFlags=0,i=o,o=l.child;o!==null;)hy(o,i),o=o.sibling;return $(sn,sn.current&1|2),ct&&Ya(l,d.treeForkCount),l.child}i=i.sibling}d.tail!==null&&It()>cd&&(l.flags|=128,_=!0,Wo(d,!1),l.lanes=4194304)}else{if(!_)if(i=Gu(y),i!==null){if(l.flags|=128,_=!0,i=i.updateQueue,l.updateQueue=i,ad(l,i),Wo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!ct)return Pt(l),null}else 2*It()-d.renderingStartTime>cd&&o!==536870912&&(l.flags|=128,_=!0,Wo(d,!1),l.lanes=4194304);d.isBackwards?(y.sibling=l.child,l.child=y):(i=d.last,i!==null?i.sibling=y:l.child=y,d.last=y)}return d.tail!==null?(i=d.tail,d.rendering=i,d.tail=i.sibling,d.renderingStartTime=It(),i.sibling=null,o=sn.current,$(sn,_?o&1|2:o&1),ct&&Ya(l,d.treeForkCount),i):(Pt(l),null);case 22:case 23:return Ci(l),Kp(),d=l.memoizedState!==null,i!==null?i.memoizedState!==null!==d&&(l.flags|=8192):d&&(l.flags|=8192),d?(o&536870912)!==0&&(l.flags&128)===0&&(Pt(l),l.subtreeFlags&6&&(l.flags|=8192)):Pt(l),o=l.updateQueue,o!==null&&ad(l,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==o&&(l.flags|=2048),i!==null&&J(Cr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),Qa(mn),Pt(l),null;case 25:return null;case 30:return null}throw Error(a(156,l.tag))}function iC(i,l){switch(Mp(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Qa(mn),ue(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return Xe(l),null;case 31:if(l.memoizedState!==null){if(Ci(l),l.alternate===null)throw Error(a(340));Sr()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(Ci(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(a(340));Sr()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return J(sn),null;case 4:return ue(),null;case 10:return Qa(l.type),null;case 22:case 23:return Ci(l),Kp(),i!==null&&J(Cr),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return Qa(mn),null;case 25:return null;default:return null}}function Hb(i,l){switch(Mp(l),l.tag){case 3:Qa(mn),ue();break;case 26:case 27:case 5:Xe(l);break;case 4:ue();break;case 31:l.memoizedState!==null&&Ci(l);break;case 13:Ci(l);break;case 19:J(sn);break;case 10:Qa(l.type);break;case 22:case 23:Ci(l),Kp(),i!==null&&J(Cr);break;case 24:Qa(mn)}}function ec(i,l){try{var o=l.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var _=d.next;o=_;do{if((o.tag&i)===i){d=void 0;var y=o.create,S=o.inst;d=y(),S.destroy=d}o=o.next}while(o!==_)}}catch(E){Tt(l,l.return,E)}}function Ll(i,l,o){try{var d=l.updateQueue,_=d!==null?d.lastEffect:null;if(_!==null){var y=_.next;d=y;do{if((d.tag&i)===i){var S=d.inst,E=S.destroy;if(E!==void 0){S.destroy=void 0,_=l;var H=o,ee=E;try{ee()}catch(re){Tt(_,H,re)}}}d=d.next}while(d!==y)}}catch(re){Tt(l,l.return,re)}}function Pb(i){var l=i.updateQueue;if(l!==null){var o=i.stateNode;try{My(l,o)}catch(d){Tt(i,i.return,d)}}}function Fb(i,l,o){o.props=Rr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(d){Tt(i,l,d)}}function tc(i,l){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var d=i.stateNode;break;case 30:d=i.stateNode;break;default:d=i.stateNode}typeof o=="function"?i.refCleanup=o(d):o.current=d}}catch(_){Tt(i,l,_)}}function Ca(i,l){var o=i.ref,d=i.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(_){Tt(i,l,_)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(_){Tt(i,l,_)}else o.current=null}function Gb(i){var l=i.type,o=i.memoizedProps,d=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(_){Tt(i,i.return,_)}}function Cm(i,l,o){try{var d=i.stateNode;jC(d,i.type,o,l),d[xn]=l}catch(_){Tt(i,i.return,_)}}function Vb(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Fl(i.type)||i.tag===4}function Tm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Vb(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Fl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Em(i,l,o){var d=i.tag;if(d===5||d===6)i=i.stateNode,l?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,l):(l=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,l.appendChild(i),o=o._reactRootContainer,o!=null||l.onclick!==null||(l.onclick=la));else if(d!==4&&(d===27&&Fl(i.type)&&(o=i.stateNode,l=null),i=i.child,i!==null))for(Em(i,l,o),i=i.sibling;i!==null;)Em(i,l,o),i=i.sibling}function ld(i,l,o){var d=i.tag;if(d===5||d===6)i=i.stateNode,l?o.insertBefore(i,l):o.appendChild(i);else if(d!==4&&(d===27&&Fl(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(ld(i,l,o),i=i.sibling;i!==null;)ld(i,l,o),i=i.sibling}function Yb(i){var l=i.stateNode,o=i.memoizedProps;try{for(var d=i.type,_=l.attributes;_.length;)l.removeAttributeNode(_[0]);On(l,d,o),l[en]=i,l[xn]=o}catch(y){Tt(i,i.return,y)}}var el=!1,gn=!1,Am=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function aC(i,l){if(i=i.containerInfo,Xm=Cd,i=ry(i),kp(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var _=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var S=0,E=-1,H=-1,ee=0,re=0,pe=i,te=null;t:for(;;){for(var ne;pe!==o||_!==0&&pe.nodeType!==3||(E=S+_),pe!==y||d!==0&&pe.nodeType!==3||(H=S+d),pe.nodeType===3&&(S+=pe.nodeValue.length),(ne=pe.firstChild)!==null;)te=pe,pe=ne;for(;;){if(pe===i)break t;if(te===o&&++ee===_&&(E=S),te===y&&++re===d&&(H=S),(ne=pe.nextSibling)!==null)break;pe=te,te=pe.parentNode}pe=ne}o=E===-1||H===-1?null:{start:E,end:H}}else o=null}o=o||{start:0,end:0}}else o=null;for(Zm={focusedElem:i,selectionRange:o},Cd=!1,Cn=l;Cn!==null;)if(l=Cn,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,Cn=i;else for(;Cn!==null;){switch(l=Cn,y=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)_=i[o],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,o=l,_=y.memoizedProps,y=y.memoizedState,d=o.stateNode;try{var Ce=Rr(o.type,_);i=d.getSnapshotBeforeUpdate(Ce,y),d.__reactInternalSnapshotBeforeUpdate=i}catch(Le){Tt(o,o.return,Le)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,o=i.nodeType,o===9)eh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":eh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(a(163))}if(i=l.sibling,i!==null){i.return=l.return,Cn=i;break}Cn=l.return}}function Qb(i,l,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:nl(i,o),d&4&&ec(5,o);break;case 1:if(nl(i,o),d&4)if(i=o.stateNode,l===null)try{i.componentDidMount()}catch(S){Tt(o,o.return,S)}else{var _=Rr(o.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(_,l,i.__reactInternalSnapshotBeforeUpdate)}catch(S){Tt(o,o.return,S)}}d&64&&Pb(o),d&512&&tc(o,o.return);break;case 3:if(nl(i,o),d&64&&(i=o.updateQueue,i!==null)){if(l=null,o.child!==null)switch(o.child.tag){case 27:case 5:l=o.child.stateNode;break;case 1:l=o.child.stateNode}try{My(i,l)}catch(S){Tt(o,o.return,S)}}break;case 27:l===null&&d&4&&Yb(o);case 26:case 5:nl(i,o),l===null&&d&4&&Gb(o),d&512&&tc(o,o.return);break;case 12:nl(i,o);break;case 31:nl(i,o),d&4&&Jb(i,o);break;case 13:nl(i,o),d&4&&Wb(i,o),d&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=pC.bind(null,o),MC(i,o))));break;case 22:if(d=o.memoizedState!==null||el,!d){l=l!==null&&l.memoizedState!==null||gn,_=el;var y=gn;el=d,(gn=l)&&!y?il(i,o,(o.subtreeFlags&8772)!==0):nl(i,o),el=_,gn=y}break;case 30:break;default:nl(i,o)}}function Xb(i){var l=i.alternate;l!==null&&(i.alternate=null,Xb(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&vo(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Kt=null,oi=!1;function tl(i,l,o){for(o=o.child;o!==null;)Zb(i,l,o),o=o.sibling}function Zb(i,l,o){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(rn,o)}catch{}switch(o.tag){case 26:gn||Ca(o,l),tl(i,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:gn||Ca(o,l);var d=Kt,_=oi;Fl(o.type)&&(Kt=o.stateNode,oi=!1),tl(i,l,o),uc(o.stateNode),Kt=d,oi=_;break;case 5:gn||Ca(o,l);case 6:if(d=Kt,_=oi,Kt=null,tl(i,l,o),Kt=d,oi=_,Kt!==null)if(oi)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(o.stateNode)}catch(y){Tt(o,l,y)}else try{Kt.removeChild(o.stateNode)}catch(y){Tt(o,l,y)}break;case 18:Kt!==null&&(oi?(i=Kt,Pv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Os(i)):Pv(Kt,o.stateNode));break;case 4:d=Kt,_=oi,Kt=o.stateNode.containerInfo,oi=!0,tl(i,l,o),Kt=d,oi=_;break;case 0:case 11:case 14:case 15:Ll(2,o,l),gn||Ll(4,o,l),tl(i,l,o);break;case 1:gn||(Ca(o,l),d=o.stateNode,typeof d.componentWillUnmount=="function"&&Fb(o,l,d)),tl(i,l,o);break;case 21:tl(i,l,o);break;case 22:gn=(d=gn)||o.memoizedState!==null,tl(i,l,o),gn=d;break;default:tl(i,l,o)}}function Jb(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Os(i)}catch(o){Tt(l,l.return,o)}}}function Wb(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Os(i)}catch(o){Tt(l,l.return,o)}}function lC(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new Kb),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new Kb),l;default:throw Error(a(435,i.tag))}}function rd(i,l){var o=lC(i);l.forEach(function(d){if(!o.has(d)){o.add(d);var _=mC.bind(null,i,d);d.then(_,_)}})}function ci(i,l){var o=l.deletions;if(o!==null)for(var d=0;d<o.length;d++){var _=o[d],y=i,S=l,E=S;e:for(;E!==null;){switch(E.tag){case 27:if(Fl(E.type)){Kt=E.stateNode,oi=!1;break e}break;case 5:Kt=E.stateNode,oi=!1;break e;case 3:case 4:Kt=E.stateNode.containerInfo,oi=!0;break e}E=E.return}if(Kt===null)throw Error(a(160));Zb(y,S,_),Kt=null,oi=!1,y=_.alternate,y!==null&&(y.return=null),_.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)ev(l,i),l=l.sibling}var oa=null;function ev(i,l){var o=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ci(l,i),ui(i),d&4&&(Ll(3,i,i.return),ec(3,i),Ll(5,i,i.return));break;case 1:ci(l,i),ui(i),d&512&&(gn||o===null||Ca(o,o.return)),d&64&&el&&(i=i.updateQueue,i!==null&&(d=i.callbacks,d!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var _=oa;if(ci(l,i),ui(i),d&512&&(gn||o===null||Ca(o,o.return)),d&4){var y=o!==null?o.memoizedState:null;if(d=i.memoizedState,o===null)if(d===null)if(i.stateNode===null){e:{d=i.type,o=i.memoizedProps,_=_.ownerDocument||_;t:switch(d){case"title":y=_.getElementsByTagName("title")[0],(!y||y[Ba]||y[en]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=_.createElement(d),_.head.insertBefore(y,_.querySelector("head > title"))),On(y,d,o),y[en]=i,Me(y),d=y;break e;case"link":var S=ex("link","href",_).get(d+(o.href||""));if(S){for(var E=0;E<S.length;E++)if(y=S[E],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(E,1);break t}}y=_.createElement(d),On(y,d,o),_.head.appendChild(y);break;case"meta":if(S=ex("meta","content",_).get(d+(o.content||""))){for(E=0;E<S.length;E++)if(y=S[E],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(E,1);break t}}y=_.createElement(d),On(y,d,o),_.head.appendChild(y);break;default:throw Error(a(468,d))}y[en]=i,Me(y),d=y}i.stateNode=d}else tx(_,i.type,i.stateNode);else i.stateNode=Wv(_,d,i.memoizedProps);else y!==d?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,d===null?tx(_,i.type,i.stateNode):Wv(_,d,i.memoizedProps)):d===null&&i.stateNode!==null&&Cm(i,i.memoizedProps,o.memoizedProps)}break;case 27:ci(l,i),ui(i),d&512&&(gn||o===null||Ca(o,o.return)),o!==null&&d&4&&Cm(i,i.memoizedProps,o.memoizedProps);break;case 5:if(ci(l,i),ui(i),d&512&&(gn||o===null||Ca(o,o.return)),i.flags&32){_=i.stateNode;try{xl(_,"")}catch(Ce){Tt(i,i.return,Ce)}}d&4&&i.stateNode!=null&&(_=i.memoizedProps,Cm(i,_,o!==null?o.memoizedProps:_)),d&1024&&(Am=!0);break;case 6:if(ci(l,i),ui(i),d&4){if(i.stateNode===null)throw Error(a(162));d=i.memoizedProps,o=i.stateNode;try{o.nodeValue=d}catch(Ce){Tt(i,i.return,Ce)}}break;case 3:if(kd=null,_=oa,oa=vd(l.containerInfo),ci(l,i),oa=_,ui(i),d&4&&o!==null&&o.memoizedState.isDehydrated)try{Os(l.containerInfo)}catch(Ce){Tt(i,i.return,Ce)}Am&&(Am=!1,tv(i));break;case 4:d=oa,oa=vd(i.stateNode.containerInfo),ci(l,i),ui(i),oa=d;break;case 12:ci(l,i),ui(i);break;case 31:ci(l,i),ui(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,rd(i,d)));break;case 13:ci(l,i),ui(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(od=It()),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,rd(i,d)));break;case 22:_=i.memoizedState!==null;var H=o!==null&&o.memoizedState!==null,ee=el,re=gn;if(el=ee||_,gn=re||H,ci(l,i),gn=re,el=ee,ui(i),d&8192)e:for(l=i.stateNode,l._visibility=_?l._visibility&-2:l._visibility|1,_&&(o===null||H||el||gn||Dr(i)),o=null,l=i;;){if(l.tag===5||l.tag===26){if(o===null){H=o=l;try{if(y=H.stateNode,_)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{E=H.stateNode;var pe=H.memoizedProps.style,te=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;E.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ce){Tt(H,H.return,Ce)}}}else if(l.tag===6){if(o===null){H=l;try{H.stateNode.nodeValue=_?"":H.memoizedProps}catch(Ce){Tt(H,H.return,Ce)}}}else if(l.tag===18){if(o===null){H=l;try{var ne=H.stateNode;_?Fv(ne,!0):Fv(H.stateNode,!1)}catch(Ce){Tt(H,H.return,Ce)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;o===l&&(o=null),l=l.return}o===l&&(o=null),l.sibling.return=l.return,l=l.sibling}d&4&&(d=i.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,rd(i,o))));break;case 19:ci(l,i),ui(i),d&4&&(d=i.updateQueue,d!==null&&(i.updateQueue=null,rd(i,d)));break;case 30:break;case 21:break;default:ci(l,i),ui(i)}}function ui(i){var l=i.flags;if(l&2){try{for(var o,d=i.return;d!==null;){if(Vb(d)){o=d;break}d=d.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var _=o.stateNode,y=Tm(i);ld(i,y,_);break;case 5:var S=o.stateNode;o.flags&32&&(xl(S,""),o.flags&=-33);var E=Tm(i);ld(i,E,S);break;case 3:case 4:var H=o.stateNode.containerInfo,ee=Tm(i);Em(i,ee,H);break;default:throw Error(a(161))}}catch(re){Tt(i,i.return,re)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function tv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;tv(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function nl(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Qb(i,l.alternate,l),l=l.sibling}function Dr(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:Ll(4,l,l.return),Dr(l);break;case 1:Ca(l,l.return);var o=l.stateNode;typeof o.componentWillUnmount=="function"&&Fb(l,l.return,o),Dr(l);break;case 27:uc(l.stateNode);case 26:case 5:Ca(l,l.return),Dr(l);break;case 22:l.memoizedState===null&&Dr(l);break;case 30:Dr(l);break;default:Dr(l)}i=i.sibling}}function il(i,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var d=l.alternate,_=i,y=l,S=y.flags;switch(y.tag){case 0:case 11:case 15:il(_,y,o),ec(4,y);break;case 1:if(il(_,y,o),d=y,_=d.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ee){Tt(d,d.return,ee)}if(d=y,_=d.updateQueue,_!==null){var E=d.stateNode;try{var H=_.shared.hiddenCallbacks;if(H!==null)for(_.shared.hiddenCallbacks=null,_=0;_<H.length;_++)Dy(H[_],E)}catch(ee){Tt(d,d.return,ee)}}o&&S&64&&Pb(y),tc(y,y.return);break;case 27:Yb(y);case 26:case 5:il(_,y,o),o&&d===null&&S&4&&Gb(y),tc(y,y.return);break;case 12:il(_,y,o);break;case 31:il(_,y,o),o&&S&4&&Jb(_,y);break;case 13:il(_,y,o),o&&S&4&&Wb(_,y);break;case 22:y.memoizedState===null&&il(_,y,o),tc(y,y.return);break;case 30:break;default:il(_,y,o)}l=l.sibling}}function Nm(i,l){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Uo(o))}function Rm(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Uo(i))}function ca(i,l,o,d){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)nv(i,l,o,d),l=l.sibling}function nv(i,l,o,d){var _=l.flags;switch(l.tag){case 0:case 11:case 15:ca(i,l,o,d),_&2048&&ec(9,l);break;case 1:ca(i,l,o,d);break;case 3:ca(i,l,o,d),_&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Uo(i)));break;case 12:if(_&2048){ca(i,l,o,d),i=l.stateNode;try{var y=l.memoizedProps,S=y.id,E=y.onPostCommit;typeof E=="function"&&E(S,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(H){Tt(l,l.return,H)}}else ca(i,l,o,d);break;case 31:ca(i,l,o,d);break;case 13:ca(i,l,o,d);break;case 23:break;case 22:y=l.stateNode,S=l.alternate,l.memoizedState!==null?y._visibility&2?ca(i,l,o,d):nc(i,l):y._visibility&2?ca(i,l,o,d):(y._visibility|=2,js(i,l,o,d,(l.subtreeFlags&10256)!==0||!1)),_&2048&&Nm(S,l);break;case 24:ca(i,l,o,d),_&2048&&Rm(l.alternate,l);break;default:ca(i,l,o,d)}}function js(i,l,o,d,_){for(_=_&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=i,S=l,E=o,H=d,ee=S.flags;switch(S.tag){case 0:case 11:case 15:js(y,S,E,H,_),ec(8,S);break;case 23:break;case 22:var re=S.stateNode;S.memoizedState!==null?re._visibility&2?js(y,S,E,H,_):nc(y,S):(re._visibility|=2,js(y,S,E,H,_)),_&&ee&2048&&Nm(S.alternate,S);break;case 24:js(y,S,E,H,_),_&&ee&2048&&Rm(S.alternate,S);break;default:js(y,S,E,H,_)}l=l.sibling}}function nc(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var o=i,d=l,_=d.flags;switch(d.tag){case 22:nc(o,d),_&2048&&Nm(d.alternate,d);break;case 24:nc(o,d),_&2048&&Rm(d.alternate,d);break;default:nc(o,d)}l=l.sibling}}var ic=8192;function Cs(i,l,o){if(i.subtreeFlags&ic)for(i=i.child;i!==null;)iv(i,l,o),i=i.sibling}function iv(i,l,o){switch(i.tag){case 26:Cs(i,l,o),i.flags&ic&&i.memoizedState!==null&&GC(o,oa,i.memoizedState,i.memoizedProps);break;case 5:Cs(i,l,o);break;case 3:case 4:var d=oa;oa=vd(i.stateNode.containerInfo),Cs(i,l,o),oa=d;break;case 22:i.memoizedState===null&&(d=i.alternate,d!==null&&d.memoizedState!==null?(d=ic,ic=16777216,Cs(i,l,o),ic=d):Cs(i,l,o));break;default:Cs(i,l,o)}}function av(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function ac(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var d=l[o];Cn=d,rv(d,i)}av(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)lv(i),i=i.sibling}function lv(i){switch(i.tag){case 0:case 11:case 15:ac(i),i.flags&2048&&Ll(9,i,i.return);break;case 3:ac(i);break;case 12:ac(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,sd(i)):ac(i);break;default:ac(i)}}function sd(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var d=l[o];Cn=d,rv(d,i)}av(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:Ll(8,l,l.return),sd(l);break;case 22:o=l.stateNode,o._visibility&2&&(o._visibility&=-3,sd(l));break;default:sd(l)}i=i.sibling}}function rv(i,l){for(;Cn!==null;){var o=Cn;switch(o.tag){case 0:case 11:case 15:Ll(8,o,l);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Uo(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,Cn=d;else e:for(o=i;Cn!==null;){d=Cn;var _=d.sibling,y=d.return;if(Xb(d),d===o){Cn=null;break e}if(_!==null){_.return=y,Cn=_;break e}Cn=y}}}var rC={getCacheForType:function(i){var l=$n(mn),o=l.data.get(i);return o===void 0&&(o=i(),l.data.set(i,o)),o},cacheSignal:function(){return $n(mn).controller.signal}},sC=typeof WeakMap=="function"?WeakMap:Map,gt=0,Mt=null,Je=null,rt=0,Ct=0,Ti=null,Il=!1,Ts=!1,Dm=!1,al=0,an=0,Bl=0,Mr=0,Mm=0,Ei=0,Es=0,lc=null,di=null,$m=!1,od=0,sv=0,cd=1/0,ud=null,ql=null,kn=0,Ul=null,As=null,ll=0,zm=0,Om=null,ov=null,rc=0,Lm=null;function Ai(){return(gt&2)!==0&&rt!==0?rt&-rt:O.T!==null?Pm():hr()}function cv(){if(Ei===0)if((rt&536870912)===0||ct){var i=Vt;Vt<<=1,(Vt&3932160)===0&&(Vt=262144),Ei=i}else Ei=536870912;return i=ji.current,i!==null&&(i.flags|=32),Ei}function fi(i,l,o){(i===Mt&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)&&(Ns(i,0),Hl(i,rt,Ei,!1)),ba(i,o),((gt&2)===0||i!==Mt)&&(i===Mt&&((gt&2)===0&&(Mr|=o),an===4&&Hl(i,rt,Ei,!1)),Ta(i))}function uv(i,l,o){if((gt&6)!==0)throw Error(a(327));var d=!o&&(l&127)===0&&(l&i.expiredLanes)===0||li(i,l),_=d?uC(i,l):Bm(i,l,!0),y=d;do{if(_===0){Ts&&!d&&Hl(i,l,0,!1);break}else{if(o=i.current.alternate,y&&!oC(o)){_=Bm(i,l,!1),y=!1;continue}if(_===2){if(y=l,i.errorRecoveryDisabledLanes&y)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){l=S;e:{var E=i;_=lc;var H=E.current.memoizedState.isDehydrated;if(H&&(Ns(E,S).flags|=256),S=Bm(E,S,!1),S!==2){if(Dm&&!H){E.errorRecoveryDisabledLanes|=y,Mr|=y,_=4;break e}y=di,di=_,y!==null&&(di===null?di=y:di.push.apply(di,y))}_=S}if(y=!1,_!==2)continue}}if(_===1){Ns(i,0),Hl(i,l,0,!0);break}e:{switch(d=i,y=_,y){case 0:case 1:throw Error(a(345));case 4:if((l&4194048)!==l)break;case 6:Hl(d,l,Ei,!Il);break e;case 2:di=null;break;case 3:case 5:break;default:throw Error(a(329))}if((l&62914560)===l&&(_=od+300-It(),10<_)){if(Hl(d,l,Ei,!Il),ve(d,0,!0)!==0)break e;ll=l,d.timeoutHandle=Uv(dv.bind(null,d,o,di,ud,$m,l,Ei,Mr,Es,Il,y,"Throttled",-0,0),_);break e}dv(d,o,di,ud,$m,l,Ei,Mr,Es,Il,y,null,-0,0)}}break}while(!0);Ta(i)}function dv(i,l,o,d,_,y,S,E,H,ee,re,pe,te,ne){if(i.timeoutHandle=-1,pe=l.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},iv(l,y,pe);var Ce=(y&62914560)===y?od-It():(y&4194048)===y?sv-It():0;if(Ce=VC(pe,Ce),Ce!==null){ll=y,i.cancelPendingCommit=Ce(bv.bind(null,i,l,y,o,d,_,S,E,H,re,pe,null,te,ne)),Hl(i,y,S,!ee);return}}bv(i,l,y,o,d,_,S,E,H)}function oC(i){for(var l=i;;){var o=l.tag;if((o===0||o===11||o===15)&&l.flags&16384&&(o=l.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var _=o[d],y=_.getSnapshot;_=_.value;try{if(!Si(y(),_))return!1}catch{return!1}}if(o=l.child,l.subtreeFlags&16384&&o!==null)o.return=l,l=o;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Hl(i,l,o,d){l&=~Mm,l&=~Mr,i.suspendedLanes|=l,i.pingedLanes&=~l,d&&(i.warmLanes|=l),d=i.expirationTimes;for(var _=l;0<_;){var y=31-pt(_),S=1<<y;d[y]=-1,_&=~S}o!==0&&Qr(i,o,l)}function dd(){return(gt&6)===0?(sc(0),!1):!0}function Im(){if(Je!==null){if(Ct===0)var i=Je.return;else i=Je,Ka=wr=null,em(i),vs=null,Po=0,i=Je;for(;i!==null;)Hb(i.alternate,i),i=i.return;Je=null}}function Ns(i,l){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,EC(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),ll=0,Im(),Mt=i,Je=o=Va(i.current,null),rt=l,Ct=0,Ti=null,Il=!1,Ts=li(i,l),Dm=!1,Es=Ei=Mm=Mr=Bl=an=0,di=lc=null,$m=!1,(l&8)!==0&&(l|=l&32);var d=i.entangledLanes;if(d!==0)for(i=i.entanglements,d&=l;0<d;){var _=31-pt(d),y=1<<_;l|=i[_],d&=~y}return al=l,Du(),o}function fv(i,l){Ye=null,O.H=Zo,l===bs||l===qu?(l=Ey(),Ct=3):l===Hp?(l=Ey(),Ct=4):Ct=l===_m?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ti=l,Je===null&&(an=1,ed(i,Ui(l,i.current)))}function pv(){var i=ji.current;return i===null?!0:(rt&4194048)===rt?Gi===null:(rt&62914560)===rt||(rt&536870912)!==0?i===Gi:!1}function mv(){var i=O.H;return O.H=Zo,i===null?Zo:i}function hv(){var i=O.A;return O.A=rC,i}function fd(){an=4,Il||(rt&4194048)!==rt&&ji.current!==null||(Ts=!0),(Bl&134217727)===0&&(Mr&134217727)===0||Mt===null||Hl(Mt,rt,Ei,!1)}function Bm(i,l,o){var d=gt;gt|=2;var _=mv(),y=hv();(Mt!==i||rt!==l)&&(ud=null,Ns(i,l)),l=!1;var S=an;e:do try{if(Ct!==0&&Je!==null){var E=Je,H=Ti;switch(Ct){case 8:Im(),S=6;break e;case 3:case 2:case 9:case 6:ji.current===null&&(l=!0);var ee=Ct;if(Ct=0,Ti=null,Rs(i,E,H,ee),o&&Ts){S=0;break e}break;default:ee=Ct,Ct=0,Ti=null,Rs(i,E,H,ee)}}cC(),S=an;break}catch(re){fv(i,re)}while(!0);return l&&i.shellSuspendCounter++,Ka=wr=null,gt=d,O.H=_,O.A=y,Je===null&&(Mt=null,rt=0,Du()),S}function cC(){for(;Je!==null;)_v(Je)}function uC(i,l){var o=gt;gt|=2;var d=mv(),_=hv();Mt!==i||rt!==l?(ud=null,cd=It()+500,Ns(i,l)):Ts=li(i,l);e:do try{if(Ct!==0&&Je!==null){l=Je;var y=Ti;t:switch(Ct){case 1:Ct=0,Ti=null,Rs(i,l,y,1);break;case 2:case 9:if(Cy(y)){Ct=0,Ti=null,gv(l);break}l=function(){Ct!==2&&Ct!==9||Mt!==i||(Ct=7),Ta(i)},y.then(l,l);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:Cy(y)?(Ct=0,Ti=null,gv(l)):(Ct=0,Ti=null,Rs(i,l,y,7));break;case 5:var S=null;switch(Je.tag){case 26:S=Je.memoizedState;case 5:case 27:var E=Je;if(S?nx(S):E.stateNode.complete){Ct=0,Ti=null;var H=E.sibling;if(H!==null)Je=H;else{var ee=E.return;ee!==null?(Je=ee,pd(ee)):Je=null}break t}}Ct=0,Ti=null,Rs(i,l,y,5);break;case 6:Ct=0,Ti=null,Rs(i,l,y,6);break;case 8:Im(),an=6;break e;default:throw Error(a(462))}}dC();break}catch(re){fv(i,re)}while(!0);return Ka=wr=null,O.H=d,O.A=_,gt=o,Je!==null?0:(Mt=null,rt=0,Du(),an)}function dC(){for(;Je!==null&&!lt();)_v(Je)}function _v(i){var l=qb(i.alternate,i,al);i.memoizedProps=i.pendingProps,l===null?pd(i):Je=l}function gv(i){var l=i,o=l.alternate;switch(l.tag){case 15:case 0:l=$b(o,l,l.pendingProps,l.type,void 0,rt);break;case 11:l=$b(o,l,l.pendingProps,l.type.render,l.ref,rt);break;case 5:em(l);default:Hb(o,l),l=Je=hy(l,al),l=qb(o,l,al)}i.memoizedProps=i.pendingProps,l===null?pd(i):Je=l}function Rs(i,l,o,d){Ka=wr=null,em(l),vs=null,Po=0;var _=l.return;try{if(Wj(i,_,l,o,rt)){an=1,ed(i,Ui(o,i.current)),Je=null;return}}catch(y){if(_!==null)throw Je=_,y;an=1,ed(i,Ui(o,i.current)),Je=null;return}l.flags&32768?(ct||d===1?i=!0:Ts||(rt&536870912)!==0?i=!1:(Il=i=!0,(d===2||d===9||d===3||d===6)&&(d=ji.current,d!==null&&d.tag===13&&(d.flags|=16384))),yv(l,i)):pd(l)}function pd(i){var l=i;do{if((l.flags&32768)!==0){yv(l,Il);return}i=l.return;var o=nC(l.alternate,l,al);if(o!==null){Je=o;return}if(l=l.sibling,l!==null){Je=l;return}Je=l=i}while(l!==null);an===0&&(an=5)}function yv(i,l){do{var o=iC(i.alternate,i);if(o!==null){o.flags&=32767,Je=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!l&&(i=i.sibling,i!==null)){Je=i;return}Je=i=o}while(i!==null);an=6,Je=null}function bv(i,l,o,d,_,y,S,E,H){i.cancelPendingCommit=null;do md();while(kn!==0);if((gt&6)!==0)throw Error(a(327));if(l!==null){if(l===i.current)throw Error(a(177));if(y=l.lanes|l.childLanes,y|=Tp,du(i,o,y,S,E,H),i===Mt&&(Je=Mt=null,rt=0),As=l,Ul=i,ll=o,zm=y,Om=_,ov=d,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,hC(ze,function(){return wv(),null})):(i.callbackNode=null,i.callbackPriority=0),d=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||d){d=O.T,O.T=null,_=G.p,G.p=2,S=gt,gt|=4;try{aC(i,l,o)}finally{gt=S,G.p=_,O.T=d}}kn=1,vv(),xv(),kv()}}function vv(){if(kn===1){kn=0;var i=Ul,l=As,o=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||o){o=O.T,O.T=null;var d=G.p;G.p=2;var _=gt;gt|=4;try{ev(l,i);var y=Zm,S=ry(i.containerInfo),E=y.focusedElem,H=y.selectionRange;if(S!==E&&E&&E.ownerDocument&&ly(E.ownerDocument.documentElement,E)){if(H!==null&&kp(E)){var ee=H.start,re=H.end;if(re===void 0&&(re=ee),"selectionStart"in E)E.selectionStart=ee,E.selectionEnd=Math.min(re,E.value.length);else{var pe=E.ownerDocument||document,te=pe&&pe.defaultView||window;if(te.getSelection){var ne=te.getSelection(),Ce=E.textContent.length,Le=Math.min(H.start,Ce),Rt=H.end===void 0?Le:Math.min(H.end,Ce);!ne.extend&&Le>Rt&&(S=Rt,Rt=Le,Le=S);var X=ay(E,Le),V=ay(E,Rt);if(X&&V&&(ne.rangeCount!==1||ne.anchorNode!==X.node||ne.anchorOffset!==X.offset||ne.focusNode!==V.node||ne.focusOffset!==V.offset)){var W=pe.createRange();W.setStart(X.node,X.offset),ne.removeAllRanges(),Le>Rt?(ne.addRange(W),ne.extend(V.node,V.offset)):(W.setEnd(V.node,V.offset),ne.addRange(W))}}}}for(pe=[],ne=E;ne=ne.parentNode;)ne.nodeType===1&&pe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<pe.length;E++){var ce=pe[E];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Cd=!!Xm,Zm=Xm=null}finally{gt=_,G.p=d,O.T=o}}i.current=l,kn=2}}function xv(){if(kn===2){kn=0;var i=Ul,l=As,o=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||o){o=O.T,O.T=null;var d=G.p;G.p=2;var _=gt;gt|=4;try{Qb(i,l.alternate,l)}finally{gt=_,G.p=d,O.T=o}}kn=3}}function kv(){if(kn===4||kn===3){kn=0,ia();var i=Ul,l=As,o=ll,d=ov;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?kn=5:(kn=0,As=Ul=null,Sv(i,i.pendingLanes));var _=i.pendingLanes;if(_===0&&(ql=null),En(o),l=l.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(rn,l,void 0,(l.current.flags&128)===128)}catch{}if(d!==null){l=O.T,_=G.p,G.p=2,O.T=null;try{for(var y=i.onRecoverableError,S=0;S<d.length;S++){var E=d[S];y(E.value,{componentStack:E.stack})}}finally{O.T=l,G.p=_}}(ll&3)!==0&&md(),Ta(i),_=i.pendingLanes,(o&261930)!==0&&(_&42)!==0?i===Lm?rc++:(rc=0,Lm=i):rc=0,sc(0)}}function Sv(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Uo(l)))}function md(){return vv(),xv(),kv(),wv()}function wv(){if(kn!==5)return!1;var i=Ul,l=zm;zm=0;var o=En(ll),d=O.T,_=G.p;try{G.p=32>o?32:o,O.T=null,o=Om,Om=null;var y=Ul,S=ll;if(kn=0,As=Ul=null,ll=0,(gt&6)!==0)throw Error(a(331));var E=gt;if(gt|=4,lv(y.current),nv(y,y.current,S,o),gt=E,sc(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(rn,y)}catch{}return!0}finally{G.p=_,O.T=d,Sv(i,l)}}function jv(i,l,o){l=Ui(o,l),l=hm(i.stateNode,l,2),i=$l(i,l,2),i!==null&&(ba(i,2),Ta(i))}function Tt(i,l,o){if(i.tag===3)jv(i,i,o);else for(;l!==null;){if(l.tag===3){jv(l,i,o);break}else if(l.tag===1){var d=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ql===null||!ql.has(d))){i=Ui(o,i),o=Cb(2),d=$l(l,o,2),d!==null&&(Tb(o,d,l,i),ba(d,2),Ta(d));break}}l=l.return}}function qm(i,l,o){var d=i.pingCache;if(d===null){d=i.pingCache=new sC;var _=new Set;d.set(l,_)}else _=d.get(l),_===void 0&&(_=new Set,d.set(l,_));_.has(o)||(Dm=!0,_.add(o),i=fC.bind(null,i,l,o),l.then(i,i))}function fC(i,l,o){var d=i.pingCache;d!==null&&d.delete(l),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Mt===i&&(rt&o)===o&&(an===4||an===3&&(rt&62914560)===rt&&300>It()-od?(gt&2)===0&&Ns(i,0):Mm|=o,Es===rt&&(Es=0)),Ta(i)}function Cv(i,l){l===0&&(l=bo()),i=xr(i,l),i!==null&&(ba(i,l),Ta(i))}function pC(i){var l=i.memoizedState,o=0;l!==null&&(o=l.retryLane),Cv(i,o)}function mC(i,l){var o=0;switch(i.tag){case 31:case 13:var d=i.stateNode,_=i.memoizedState;_!==null&&(o=_.retryLane);break;case 19:d=i.stateNode;break;case 22:d=i.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(l),Cv(i,o)}function hC(i,l){return qe(i,l)}var hd=null,Ds=null,Um=!1,_d=!1,Hm=!1,Pl=0;function Ta(i){i!==Ds&&i.next===null&&(Ds===null?hd=Ds=i:Ds=Ds.next=i),_d=!0,Um||(Um=!0,gC())}function sc(i,l){if(!Hm&&_d){Hm=!0;do for(var o=!1,d=hd;d!==null;){if(i!==0){var _=d.pendingLanes;if(_===0)var y=0;else{var S=d.suspendedLanes,E=d.pingedLanes;y=(1<<31-pt(42|i)+1)-1,y&=_&~(S&~E),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,Nv(d,y))}else y=rt,y=ve(d,d===Mt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||li(d,y)||(o=!0,Nv(d,y));d=d.next}while(o);Hm=!1}}function _C(){Tv()}function Tv(){_d=Um=!1;var i=0;Pl!==0&&TC()&&(i=Pl);for(var l=It(),o=null,d=hd;d!==null;){var _=d.next,y=Ev(d,l);y===0?(d.next=null,o===null?hd=_:o.next=_,_===null&&(Ds=o)):(o=d,(i!==0||(y&3)!==0)&&(_d=!0)),d=_}kn!==0&&kn!==5||sc(i),Pl!==0&&(Pl=0)}function Ev(i,l){for(var o=i.suspendedLanes,d=i.pingedLanes,_=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var S=31-pt(y),E=1<<S,H=_[S];H===-1?((E&o)===0||(E&d)!==0)&&(_[S]=mr(E,l)):H<=l&&(i.expiredLanes|=E),y&=~E}if(l=Mt,o=rt,o=ve(i,i===l?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d=i.callbackNode,o===0||i===l&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)return d!==null&&d!==null&&xt(d),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||li(i,o)){if(l=o&-o,l===i.callbackPriority)return l;switch(d!==null&&xt(d),En(o)){case 2:case 8:o=ge;break;case 32:o=ze;break;case 268435456:o=Pe;break;default:o=ze}return d=Av.bind(null,i),o=qe(o,d),i.callbackPriority=l,i.callbackNode=o,l}return d!==null&&d!==null&&xt(d),i.callbackPriority=2,i.callbackNode=null,2}function Av(i,l){if(kn!==0&&kn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(md()&&i.callbackNode!==o)return null;var d=rt;return d=ve(i,i===Mt?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),d===0?null:(uv(i,d,l),Ev(i,It()),i.callbackNode!=null&&i.callbackNode===o?Av.bind(null,i):null)}function Nv(i,l){if(md())return null;uv(i,l,!0)}function gC(){AC(function(){(gt&6)!==0?qe(le,_C):Tv()})}function Pm(){if(Pl===0){var i=gs;i===0&&(i=La,La<<=1,(La&261888)===0&&(La=256)),Pl=i}return Pl}function Rv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Rn(""+i)}function Dv(i,l){var o=l.ownerDocument.createElement("input");return o.name=l.name,o.value=l.value,i.id&&o.setAttribute("form",i.id),l.parentNode.insertBefore(o,l),i=new FormData(i),o.parentNode.removeChild(o),i}function yC(i,l,o,d,_){if(l==="submit"&&o&&o.stateNode===_){var y=Rv((_[xn]||null).action),S=d.submitter;S&&(l=(l=S[xn]||null)?Rv(l.formAction):S.getAttribute("formAction"),l!==null&&(y=l,S=null));var E=new Sa("action","action",null,d,_);i.push({event:E,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Pl!==0){var H=S?Dv(_,S):new FormData(_);cm(o,{pending:!0,data:H,method:_.method,action:y},null,H)}}else typeof y=="function"&&(E.preventDefault(),H=S?Dv(_,S):new FormData(_),cm(o,{pending:!0,data:H,method:_.method,action:y},y,H))},currentTarget:_}]})}}for(var Fm=0;Fm<Cp.length;Fm++){var Gm=Cp[Fm],bC=Gm.toLowerCase(),vC=Gm[0].toUpperCase()+Gm.slice(1);sa(bC,"on"+vC)}sa(cy,"onAnimationEnd"),sa(uy,"onAnimationIteration"),sa(dy,"onAnimationStart"),sa("dblclick","onDoubleClick"),sa("focusin","onFocus"),sa("focusout","onBlur"),sa(Oj,"onTransitionRun"),sa(Lj,"onTransitionStart"),sa(Ij,"onTransitionCancel"),sa(fy,"onTransitionEnd"),Fn("onMouseEnter",["mouseout","mouseover"]),Fn("onMouseLeave",["mouseout","mouseover"]),Fn("onPointerEnter",["pointerout","pointerover"]),Fn("onPointerLeave",["pointerout","pointerover"]),xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),xC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oc));function Mv(i,l){l=(l&4)!==0;for(var o=0;o<i.length;o++){var d=i[o],_=d.event;d=d.listeners;e:{var y=void 0;if(l)for(var S=d.length-1;0<=S;S--){var E=d[S],H=E.instance,ee=E.currentTarget;if(E=E.listener,H!==y&&_.isPropagationStopped())break e;y=E,_.currentTarget=ee;try{y(_)}catch(re){Ru(re)}_.currentTarget=null,y=H}else for(S=0;S<d.length;S++){if(E=d[S],H=E.instance,ee=E.currentTarget,E=E.listener,H!==y&&_.isPropagationStopped())break e;y=E,_.currentTarget=ee;try{y(_)}catch(re){Ru(re)}_.currentTarget=null,y=H}}}}function We(i,l){var o=l[An];o===void 0&&(o=l[An]=new Set);var d=i+"__bubble";o.has(d)||($v(l,i,2,!1),o.add(d))}function Vm(i,l,o){var d=0;l&&(d|=4),$v(o,i,d,l)}var gd="_reactListening"+Math.random().toString(36).slice(2);function Ym(i){if(!i[gd]){i[gd]=!0,Jn.forEach(function(o){o!=="selectionchange"&&(xC.has(o)||Vm(o,!1,i),Vm(o,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[gd]||(l[gd]=!0,Vm("selectionchange",!1,l))}}function $v(i,l,o,d){switch(cx(l)){case 2:var _=QC;break;case 8:_=XC;break;default:_=oh}o=_.bind(null,l,o,i),_=void 0,!Ao||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),d?_!==void 0?i.addEventListener(l,o,{capture:!0,passive:_}):i.addEventListener(l,o,!0):_!==void 0?i.addEventListener(l,o,{passive:_}):i.addEventListener(l,o,!1)}function Km(i,l,o,d,_){var y=d;if((l&1)===0&&(l&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var E=d.stateNode.containerInfo;if(E===_)break;if(S===4)for(S=d.return;S!==null;){var H=S.tag;if((H===3||H===4)&&S.stateNode.containerInfo===_)return;S=S.return}for(;E!==null;){if(S=_r(E),S===null)return;if(H=S.tag,H===5||H===6||H===26||H===27){d=y=S;continue e}E=E.parentNode}}d=d.return}es(function(){var ee=y,re=Eo(o),pe=[];e:{var te=py.get(i);if(te!==void 0){var ne=Sa,Ce=i;switch(i){case"keypress":if(Fa(o)===0)break e;case"keydown":case"keyup":ne=fp;break;case"focusin":Ce="focus",ne=Do;break;case"focusout":Ce="blur",ne=Do;break;case"beforeblur":case"afterblur":ne=Do;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=yu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Ro;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=hp;break;case cy:case uy:case dy:ne=vu;break;case fy:ne=Mo;break;case"scroll":case"scrollend":ne=gu;break;case"wheel":ne=Cu;break;case"copy":case"cut":case"paste":ne=op;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=wu;break;case"toggle":case"beforetoggle":ne=yp}var Le=(l&4)!==0,Rt=!Le&&(i==="scroll"||i==="scrollend"),X=Le?te!==null?te+"Capture":null:te;Le=[];for(var V=ee,W;V!==null;){var ce=V;if(W=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||W===null||X===null||(ce=Sl(V,X),ce!=null&&Le.push(cc(V,ce,W))),Rt)break;V=V.return}0<Le.length&&(te=new ne(te,Ce,null,o,re),pe.push({event:te,listeners:Le}))}}if((l&7)===0){e:{if(te=i==="mouseover"||i==="pointerover",ne=i==="mouseout"||i==="pointerout",te&&o!==To&&(Ce=o.relatedTarget||o.fromElement)&&(_r(Ce)||Ce[Ia]))break e;if((ne||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(Ce=o.relatedTarget||o.toElement,ne=ee,Ce=Ce?_r(Ce):null,Ce!==null&&(Rt=s(Ce),Le=Ce.tag,Ce!==Rt||Le!==5&&Le!==27&&Le!==6)&&(Ce=null)):(ne=null,Ce=ee),ne!==Ce)){if(Le=yu,ce="onMouseLeave",X="onMouseEnter",V="mouse",(i==="pointerout"||i==="pointerover")&&(Le=wu,ce="onPointerLeave",X="onPointerEnter",V="pointer"),Rt=ne==null?te:Pn(ne),W=Ce==null?te:Pn(Ce),te=new Le(ce,V+"leave",ne,o,re),te.target=Rt,te.relatedTarget=W,ce=null,_r(re)===ee&&(Le=new Le(X,V+"enter",Ce,o,re),Le.target=W,Le.relatedTarget=Rt,ce=Le),Rt=ce,ne&&Ce)t:{for(Le=kC,X=ne,V=Ce,W=0,ce=X;ce;ce=Le(ce))W++;ce=0;for(var Ne=V;Ne;Ne=Le(Ne))ce++;for(;0<W-ce;)X=Le(X),W--;for(;0<ce-W;)V=Le(V),ce--;for(;W--;){if(X===V||V!==null&&X===V.alternate){Le=X;break t}X=Le(X),V=Le(V)}Le=null}else Le=null;ne!==null&&zv(pe,te,ne,Le,!1),Ce!==null&&Rt!==null&&zv(pe,Rt,Ce,Le,!0)}}e:{if(te=ee?Pn(ee):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var ht=Se;else if(j(te))if(Ae)ht=Mj;else{ht=Rj;var Te=xp}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&Ge(ee.elementType)&&(ht=Se):ht=Dj;if(ht&&(ht=ht(i,ee))){Y(pe,ht,o,re);break e}Te&&Te(i,te,ee),i==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&wo(te,"number",te.value)}switch(Te=ee?Pn(ee):window,i){case"focusin":(j(Te)||Te.contentEditable==="true")&&(cs=Te,Sp=ee,Io=null);break;case"focusout":Io=Sp=cs=null;break;case"mousedown":wp=!0;break;case"contextmenu":case"mouseup":case"dragend":wp=!1,sy(pe,o,re);break;case"selectionchange":if(zj)break;case"keydown":case"keyup":sy(pe,o,re)}var Ke;if(ss)e:{switch(i){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Tl?os(i,o)&&(st="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(st="onCompositionStart");st&&($o&&o.locale!=="ko"&&(Tl||st!=="onCompositionStart"?st==="onCompositionEnd"&&Tl&&(Ke=ts()):(Li=re,Ha="value"in Li?Li.value:Li.textContent,Tl=!0)),Te=yd(ee,st),0<Te.length&&(st=new ls(st,i,null,o,re),pe.push({event:st,listeners:Te}),Ke?st.data=Ke:(Ke=Oo(o),Ke!==null&&(st.data=Ke)))),(Ke=bp?vp(i,o):Au(i,o))&&(st=yd(ee,"onBeforeInput"),0<st.length&&(Te=new ls("onBeforeInput","beforeinput",null,o,re),pe.push({event:Te,listeners:st}),Te.data=Ke)),yC(pe,i,ee,o,re)}Mv(pe,l)})}function cc(i,l,o){return{instance:i,listener:l,currentTarget:o}}function yd(i,l){for(var o=l+"Capture",d=[];i!==null;){var _=i,y=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||y===null||(_=Sl(i,o),_!=null&&d.unshift(cc(i,_,y)),_=Sl(i,l),_!=null&&d.push(cc(i,_,y))),i.tag===3)return d;i=i.return}return[]}function kC(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function zv(i,l,o,d,_){for(var y=l._reactName,S=[];o!==null&&o!==d;){var E=o,H=E.alternate,ee=E.stateNode;if(E=E.tag,H!==null&&H===d)break;E!==5&&E!==26&&E!==27||ee===null||(H=ee,_?(ee=Sl(o,y),ee!=null&&S.unshift(cc(o,ee,H))):_||(ee=Sl(o,y),ee!=null&&S.push(cc(o,ee,H)))),o=o.return}S.length!==0&&i.push({event:l,listeners:S})}var SC=/\r\n?/g,wC=/\u0000|\uFFFD/g;function Ov(i){return(typeof i=="string"?i:""+i).replace(SC,`
|
||
`).replace(wC,"")}function Lv(i,l){return l=Ov(l),Ov(i)===l}function Nt(i,l,o,d,_,y){switch(o){case"children":typeof d=="string"?l==="body"||l==="textarea"&&d===""||xl(i,d):(typeof d=="number"||typeof d=="bigint")&&l!=="body"&&xl(i,""+d);break;case"className":si(i,"class",d);break;case"tabIndex":si(i,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":si(i,o,d);break;case"style":Wr(i,d,y);break;case"data":if(l!=="object"){si(i,"data",d);break}case"src":case"href":if(d===""&&(l!=="a"||o!=="href")){i.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(o);break}d=Rn(""+d),i.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(o==="formAction"?(l!=="input"&&Nt(i,l,"name",_.name,_,null),Nt(i,l,"formEncType",_.formEncType,_,null),Nt(i,l,"formMethod",_.formMethod,_,null),Nt(i,l,"formTarget",_.formTarget,_,null)):(Nt(i,l,"encType",_.encType,_,null),Nt(i,l,"method",_.method,_,null),Nt(i,l,"target",_.target,_,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){i.removeAttribute(o);break}d=Rn(""+d),i.setAttribute(o,d);break;case"onClick":d!=null&&(i.onclick=la);break;case"onScroll":d!=null&&We("scroll",i);break;case"onScrollEnd":d!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(_.children!=null)throw Error(a(60));i.innerHTML=o}}break;case"multiple":i.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":i.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){i.removeAttribute("xlink:href");break}o=Rn(""+d),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,""+d):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":d===!0?i.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?i.setAttribute(o,d):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?i.setAttribute(o,d):i.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?i.removeAttribute(o):i.setAttribute(o,d);break;case"popover":We("beforetoggle",i),We("toggle",i),Zr(i,"popover",d);break;case"xlinkActuate":xi(i,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":xi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":xi(i,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":xi(i,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":xi(i,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":xi(i,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":xi(i,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":xi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":xi(i,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Zr(i,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=ap.get(o)||o,Zr(i,o,d))}}function Qm(i,l,o,d,_,y){switch(o){case"style":Wr(i,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(_.children!=null)throw Error(a(60));i.innerHTML=o}}break;case"children":typeof d=="string"?xl(i,d):(typeof d=="number"||typeof d=="bigint")&&xl(i,""+d);break;case"onScroll":d!=null&&We("scroll",i);break;case"onScrollEnd":d!=null&&We("scrollend",i);break;case"onClick":d!=null&&(i.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xo.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(_=o.endsWith("Capture"),l=o.slice(2,_?o.length-7:void 0),y=i[xn]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(l,y,_),typeof d=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(l,d,_);break e}o in i?i[o]=d:d===!0?i.setAttribute(o,""):Zr(i,o,d)}}}function On(i,l,o){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var d=!1,_=!1,y;for(y in o)if(o.hasOwnProperty(y)){var S=o[y];if(S!=null)switch(y){case"src":d=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,l));default:Nt(i,l,y,S,o,null)}}_&&Nt(i,l,"srcSet",o.srcSet,o,null),d&&Nt(i,l,"src",o.src,o,null);return;case"input":We("invalid",i);var E=y=S=_=null,H=null,ee=null;for(d in o)if(o.hasOwnProperty(d)){var re=o[d];if(re!=null)switch(d){case"name":_=re;break;case"type":S=re;break;case"checked":H=re;break;case"defaultChecked":ee=re;break;case"value":y=re;break;case"defaultValue":E=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,l));break;default:Nt(i,l,d,re,o,null)}}tn(i,y,E,H,ee,S,_,!1);return;case"select":We("invalid",i),d=S=y=null;for(_ in o)if(o.hasOwnProperty(_)&&(E=o[_],E!=null))switch(_){case"value":y=E;break;case"defaultValue":S=E;break;case"multiple":d=E;default:Nt(i,l,_,E,o,null)}l=y,o=S,i.multiple=!!d,l!=null?zi(i,!!d,l,!1):o!=null&&zi(i,!!d,o,!0);return;case"textarea":We("invalid",i),y=_=d=null;for(S in o)if(o.hasOwnProperty(S)&&(E=o[S],E!=null))switch(S){case"value":d=E;break;case"defaultValue":_=E;break;case"children":y=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(a(91));break;default:Nt(i,l,S,E,o,null)}Co(i,d,_,y);return;case"option":for(H in o)if(o.hasOwnProperty(H)&&(d=o[H],d!=null))switch(H){case"selected":i.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Nt(i,l,H,d,o,null)}return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(d=0;d<oc.length;d++)We(oc[d],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in o)if(o.hasOwnProperty(ee)&&(d=o[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,l));default:Nt(i,l,ee,d,o,null)}return;default:if(Ge(l)){for(re in o)o.hasOwnProperty(re)&&(d=o[re],d!==void 0&&Qm(i,l,re,d,o,void 0));return}}for(E in o)o.hasOwnProperty(E)&&(d=o[E],d!=null&&Nt(i,l,E,d,o,null))}function jC(i,l,o,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,y=null,S=null,E=null,H=null,ee=null,re=null;for(ne in o){var pe=o[ne];if(o.hasOwnProperty(ne)&&pe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":H=pe;default:d.hasOwnProperty(ne)||Nt(i,l,ne,null,d,pe)}}for(var te in d){var ne=d[te];if(pe=o[te],d.hasOwnProperty(te)&&(ne!=null||pe!=null))switch(te){case"type":y=ne;break;case"name":_=ne;break;case"checked":ee=ne;break;case"defaultChecked":re=ne;break;case"value":S=ne;break;case"defaultValue":E=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,l));break;default:ne!==pe&&Nt(i,l,te,ne,d,pe)}}$i(i,S,E,H,ee,re,y,_);return;case"select":ne=S=E=te=null;for(y in o)if(H=o[y],o.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":ne=H;default:d.hasOwnProperty(y)||Nt(i,l,y,null,d,H)}for(_ in d)if(y=d[_],H=o[_],d.hasOwnProperty(_)&&(y!=null||H!=null))switch(_){case"value":te=y;break;case"defaultValue":E=y;break;case"multiple":S=y;default:y!==H&&Nt(i,l,_,y,d,H)}l=E,o=S,d=ne,te!=null?zi(i,!!o,te,!1):!!d!=!!o&&(l!=null?zi(i,!!o,l,!0):zi(i,!!o,o?[]:"",!1));return;case"textarea":ne=te=null;for(E in o)if(_=o[E],o.hasOwnProperty(E)&&_!=null&&!d.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Nt(i,l,E,null,d,_)}for(S in d)if(_=d[S],y=o[S],d.hasOwnProperty(S)&&(_!=null||y!=null))switch(S){case"value":te=_;break;case"defaultValue":ne=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==y&&Nt(i,l,S,_,d,y)}jo(i,te,ne);return;case"option":for(var Ce in o)if(te=o[Ce],o.hasOwnProperty(Ce)&&te!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":i.selected=!1;break;default:Nt(i,l,Ce,null,d,te)}for(H in d)if(te=d[H],ne=o[H],d.hasOwnProperty(H)&&te!==ne&&(te!=null||ne!=null))switch(H){case"selected":i.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Nt(i,l,H,te,d,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Le in o)te=o[Le],o.hasOwnProperty(Le)&&te!=null&&!d.hasOwnProperty(Le)&&Nt(i,l,Le,null,d,te);for(ee in d)if(te=d[ee],ne=o[ee],d.hasOwnProperty(ee)&&te!==ne&&(te!=null||ne!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,l));break;default:Nt(i,l,ee,te,d,ne)}return;default:if(Ge(l)){for(var Rt in o)te=o[Rt],o.hasOwnProperty(Rt)&&te!==void 0&&!d.hasOwnProperty(Rt)&&Qm(i,l,Rt,void 0,d,te);for(re in d)te=d[re],ne=o[re],!d.hasOwnProperty(re)||te===ne||te===void 0&&ne===void 0||Qm(i,l,re,te,d,ne);return}}for(var X in o)te=o[X],o.hasOwnProperty(X)&&te!=null&&!d.hasOwnProperty(X)&&Nt(i,l,X,null,d,te);for(pe in d)te=d[pe],ne=o[pe],!d.hasOwnProperty(pe)||te===ne||te==null&&ne==null||Nt(i,l,pe,te,d,ne)}function Iv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function CC(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var _=o[d],y=_.transferSize,S=_.initiatorType,E=_.duration;if(y&&E&&Iv(S)){for(S=0,E=_.responseEnd,d+=1;d<o.length;d++){var H=o[d],ee=H.startTime;if(ee>E)break;var re=H.transferSize,pe=H.initiatorType;re&&Iv(pe)&&(H=H.responseEnd,S+=re*(H<E?1:(E-ee)/(H-ee)))}if(--d,l+=8*(y+S)/(_.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Xm=null,Zm=null;function bd(i){return i.nodeType===9?i:i.ownerDocument}function Bv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qv(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function Jm(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Wm=null;function TC(){var i=window.event;return i&&i.type==="popstate"?i===Wm?!1:(Wm=i,!0):(Wm=null,!1)}var Uv=typeof setTimeout=="function"?setTimeout:void 0,EC=typeof clearTimeout=="function"?clearTimeout:void 0,Hv=typeof Promise=="function"?Promise:void 0,AC=typeof queueMicrotask=="function"?queueMicrotask:typeof Hv<"u"?function(i){return Hv.resolve(null).then(i).catch(NC)}:Uv;function NC(i){setTimeout(function(){throw i})}function Fl(i){return i==="head"}function Pv(i,l){var o=l,d=0;do{var _=o.nextSibling;if(i.removeChild(o),_&&_.nodeType===8)if(o=_.data,o==="/$"||o==="/&"){if(d===0){i.removeChild(_),Os(l);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")uc(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,uc(o);for(var y=o.firstChild;y;){var S=y.nextSibling,E=y.nodeName;y[Ba]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=S}}else o==="body"&&uc(i.ownerDocument.body);o=_}while(o);Os(l)}function Fv(i,l){var o=i;i=0;do{var d=o.nextSibling;if(o.nodeType===1?l?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(l?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=d}while(o)}function eh(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var o=l;switch(l=l.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":eh(o),vo(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function RC(i,l,o,d){for(;i.nodeType===1;){var _=o;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!d&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(d){if(!i[Ba])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==_.rel||i.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||i.getAttribute("title")!==(_.title==null?null:_.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(_.src==null?null:_.src)||i.getAttribute("type")!==(_.type==null?null:_.type)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var y=_.name==null?null:""+_.name;if(_.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Vi(i.nextSibling),i===null)break}return null}function DC(i,l,o){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Vi(i.nextSibling),i===null))return null;return i}function Gv(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Vi(i.nextSibling),i===null))return null;return i}function th(i){return i.data==="$?"||i.data==="$~"}function nh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function MC(i,l){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||o.readyState!=="loading")l();else{var d=function(){l(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),i._reactRetry=d}}function Vi(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var ih=null;function Vv(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(l===0)return Vi(i.nextSibling);l--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||l++}i=i.nextSibling}return null}function Yv(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(l===0)return i;l--}else o!=="/$"&&o!=="/&"||l++}i=i.previousSibling}return null}function Kv(i,l,o){switch(l=bd(o),i){case"html":if(i=l.documentElement,!i)throw Error(a(452));return i;case"head":if(i=l.head,!i)throw Error(a(453));return i;case"body":if(i=l.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function uc(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);vo(i)}var Yi=new Map,Qv=new Set;function vd(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var rl=G.d;G.d={f:$C,r:zC,D:OC,C:LC,L:IC,m:BC,X:UC,S:qC,M:HC};function $C(){var i=rl.f(),l=dd();return i||l}function zC(i){var l=xe(i);l!==null&&l.tag===5&&l.type==="form"?fb(l):rl.r(i)}var Ms=typeof document>"u"?null:document;function Xv(i,l,o){var d=Ms;if(d&&typeof l=="string"&&l){var _=Gn(l);_='link[rel="'+i+'"][href="'+_+'"]',typeof o=="string"&&(_+='[crossorigin="'+o+'"]'),Qv.has(_)||(Qv.add(_),i={rel:i,crossOrigin:o,href:l},d.querySelector(_)===null&&(l=d.createElement("link"),On(l,"link",i),Me(l),d.head.appendChild(l)))}}function OC(i){rl.D(i),Xv("dns-prefetch",i,null)}function LC(i,l){rl.C(i,l),Xv("preconnect",i,l)}function IC(i,l,o){rl.L(i,l,o);var d=Ms;if(d&&i&&l){var _='link[rel="preload"][as="'+Gn(l)+'"]';l==="image"&&o&&o.imageSrcSet?(_+='[imagesrcset="'+Gn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(_+='[imagesizes="'+Gn(o.imageSizes)+'"]')):_+='[href="'+Gn(i)+'"]';var y=_;switch(l){case"style":y=$s(i);break;case"script":y=zs(i)}Yi.has(y)||(i=b({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:i,as:l},o),Yi.set(y,i),d.querySelector(_)!==null||l==="style"&&d.querySelector(dc(y))||l==="script"&&d.querySelector(fc(y))||(l=d.createElement("link"),On(l,"link",i),Me(l),d.head.appendChild(l)))}}function BC(i,l){rl.m(i,l);var o=Ms;if(o&&i){var d=l&&typeof l.as=="string"?l.as:"script",_='link[rel="modulepreload"][as="'+Gn(d)+'"][href="'+Gn(i)+'"]',y=_;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=zs(i)}if(!Yi.has(y)&&(i=b({rel:"modulepreload",href:i},l),Yi.set(y,i),o.querySelector(_)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(fc(y)))return}d=o.createElement("link"),On(d,"link",i),Me(d),o.head.appendChild(d)}}}function qC(i,l,o){rl.S(i,l,o);var d=Ms;if(d&&i){var _=Ut(d).hoistableStyles,y=$s(i);l=l||"default";var S=_.get(y);if(!S){var E={loading:0,preload:null};if(S=d.querySelector(dc(y)))E.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":l},o),(o=Yi.get(y))&&ah(i,o);var H=S=d.createElement("link");Me(H),On(H,"link",i),H._p=new Promise(function(ee,re){H.onload=ee,H.onerror=re}),H.addEventListener("load",function(){E.loading|=1}),H.addEventListener("error",function(){E.loading|=2}),E.loading|=4,xd(S,l,d)}S={type:"stylesheet",instance:S,count:1,state:E},_.set(y,S)}}}function UC(i,l){rl.X(i,l);var o=Ms;if(o&&i){var d=Ut(o).hoistableScripts,_=zs(i),y=d.get(_);y||(y=o.querySelector(fc(_)),y||(i=b({src:i,async:!0},l),(l=Yi.get(_))&&lh(i,l),y=o.createElement("script"),Me(y),On(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(_,y))}}function HC(i,l){rl.M(i,l);var o=Ms;if(o&&i){var d=Ut(o).hoistableScripts,_=zs(i),y=d.get(_);y||(y=o.querySelector(fc(_)),y||(i=b({src:i,async:!0,type:"module"},l),(l=Yi.get(_))&&lh(i,l),y=o.createElement("script"),Me(y),On(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(_,y))}}function Zv(i,l,o,d){var _=(_=be.current)?vd(_):null;if(!_)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(l=$s(o.href),o=Ut(_).hoistableStyles,d=o.get(l),d||(d={type:"style",instance:null,count:0,state:null},o.set(l,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=$s(o.href);var y=Ut(_).hoistableStyles,S=y.get(i);if(S||(_=_.ownerDocument||_,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,S),(y=_.querySelector(dc(i)))&&!y._p&&(S.instance=y,S.state.loading=5),Yi.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Yi.set(i,o),y||PC(_,i,o,S.state))),l&&d===null)throw Error(a(528,""));return S}if(l&&d!==null)throw Error(a(529,""));return null;case"script":return l=o.async,o=o.src,typeof o=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=zs(o),o=Ut(_).hoistableScripts,d=o.get(l),d||(d={type:"script",instance:null,count:0,state:null},o.set(l,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function $s(i){return'href="'+Gn(i)+'"'}function dc(i){return'link[rel="stylesheet"]['+i+"]"}function Jv(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function PC(i,l,o,d){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?d.loading=1:(l=i.createElement("link"),d.preload=l,l.addEventListener("load",function(){return d.loading|=1}),l.addEventListener("error",function(){return d.loading|=2}),On(l,"link",o),Me(l),i.head.appendChild(l))}function zs(i){return'[src="'+Gn(i)+'"]'}function fc(i){return"script[async]"+i}function Wv(i,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var d=i.querySelector('style[data-href~="'+Gn(o.href)+'"]');if(d)return l.instance=d,Me(d),d;var _=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(i.ownerDocument||i).createElement("style"),Me(d),On(d,"style",_),xd(d,o.precedence,i),l.instance=d;case"stylesheet":_=$s(o.href);var y=i.querySelector(dc(_));if(y)return l.state.loading|=4,l.instance=y,Me(y),y;d=Jv(o),(_=Yi.get(_))&&ah(d,_),y=(i.ownerDocument||i).createElement("link"),Me(y);var S=y;return S._p=new Promise(function(E,H){S.onload=E,S.onerror=H}),On(y,"link",d),l.state.loading|=4,xd(y,o.precedence,i),l.instance=y;case"script":return y=zs(o.src),(_=i.querySelector(fc(y)))?(l.instance=_,Me(_),_):(d=o,(_=Yi.get(y))&&(d=b({},o),lh(d,_)),i=i.ownerDocument||i,_=i.createElement("script"),Me(_),On(_,"link",d),i.head.appendChild(_),l.instance=_);case"void":return null;default:throw Error(a(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(d=l.instance,l.state.loading|=4,xd(d,o.precedence,i));return l.instance}function xd(i,l,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=d.length?d[d.length-1]:null,y=_,S=0;S<d.length;S++){var E=d[S];if(E.dataset.precedence===l)y=E;else if(y!==_)break}y?y.parentNode.insertBefore(i,y.nextSibling):(l=o.nodeType===9?o.head:o,l.insertBefore(i,l.firstChild))}function ah(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function lh(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var kd=null;function ex(i,l,o){if(kd===null){var d=new Map,_=kd=new Map;_.set(o,d)}else _=kd,d=_.get(o),d||(d=new Map,_.set(o,d));if(d.has(i))return d;for(d.set(i,null),o=o.getElementsByTagName(i),_=0;_<o.length;_++){var y=o[_];if(!(y[Ba]||y[en]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(l)||"";S=i+S;var E=d.get(S);E?E.push(y):d.set(S,[y])}}return d}function tx(i,l,o){i=i.ownerDocument||i,i.head.insertBefore(o,l==="title"?i.querySelector("head > title"):null)}function FC(i,l,o){if(o===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function nx(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function GC(i,l,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var _=$s(d.href),y=l.querySelector(dc(_));if(y){l=y._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=Sd.bind(i),l.then(i,i)),o.state.loading|=4,o.instance=y,Me(y);return}y=l.ownerDocument||l,d=Jv(d),(_=Yi.get(_))&&ah(d,_),y=y.createElement("link"),Me(y);var S=y;S._p=new Promise(function(E,H){S.onload=E,S.onerror=H}),On(y,"link",d),o.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,l),(l=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Sd.bind(i),l.addEventListener("load",o),l.addEventListener("error",o))}}var rh=0;function VC(i,l){return i.stylesheets&&i.count===0&&jd(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var d=setTimeout(function(){if(i.stylesheets&&jd(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+l);0<i.imgBytes&&rh===0&&(rh=62500*CC());var _=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&jd(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>rh?50:800)+l);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(d),clearTimeout(_)}}:null}function Sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jd(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var wd=null;function jd(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,wd=new Map,l.forEach(YC,i),wd=null,Sd.call(i))}function YC(i,l){if(!(l.state.loading&4)){var o=wd.get(i);if(o)var d=o.get(null);else{o=new Map,wd.set(i,o);for(var _=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<_.length;y++){var S=_[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),d=S)}d&&o.set(null,d)}_=l.instance,S=_.getAttribute("data-precedence"),y=o.get(S)||d,y===d&&o.set(null,_),o.set(S,_),this.count++,d=Sd.bind(this),_.addEventListener("load",d),_.addEventListener("error",d),y?y.parentNode.insertBefore(_,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(_,i.firstChild)),l.state.loading|=4}}var pc={$$typeof:N,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function KC(i,l,o,d,_,y,S,E,H){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bl(0),this.hiddenUpdates=bl(null),this.identifierPrefix=d,this.onUncaughtError=_,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function ix(i,l,o,d,_,y,S,E,H,ee,re,pe){return i=new KC(i,l,o,S,H,ee,re,pe,E),l=1,y===!0&&(l|=24),y=wi(3,null,null,l),i.current=y,y.stateNode=i,l=Bp(),l.refCount++,i.pooledCache=l,l.refCount++,y.memoizedState={element:d,isDehydrated:o,cache:l},Pp(y),i}function ax(i){return i?(i=fs,i):fs}function lx(i,l,o,d,_,y){_=ax(_),d.context===null?d.context=_:d.pendingContext=_,d=Ml(l),d.payload={element:o},y=y===void 0?null:y,y!==null&&(d.callback=y),o=$l(i,d,l),o!==null&&(fi(o,i,l),Go(o,i,l))}function rx(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<l?o:l}}function sh(i,l){rx(i,l),(i=i.alternate)&&rx(i,l)}function sx(i){if(i.tag===13||i.tag===31){var l=xr(i,67108864);l!==null&&fi(l,i,67108864),sh(i,67108864)}}function ox(i){if(i.tag===13||i.tag===31){var l=Ai();l=Et(l);var o=xr(i,l);o!==null&&fi(o,i,l),sh(i,l)}}var Cd=!0;function QC(i,l,o,d){var _=O.T;O.T=null;var y=G.p;try{G.p=2,oh(i,l,o,d)}finally{G.p=y,O.T=_}}function XC(i,l,o,d){var _=O.T;O.T=null;var y=G.p;try{G.p=8,oh(i,l,o,d)}finally{G.p=y,O.T=_}}function oh(i,l,o,d){if(Cd){var _=ch(d);if(_===null)Km(i,l,d,Td,o),ux(i,d);else if(JC(_,i,l,o,d))d.stopPropagation();else if(ux(i,d),l&4&&-1<ZC.indexOf(i)){for(;_!==null;){var y=xe(_);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=Ze(y.pendingLanes);if(S!==0){var E=y;for(E.pendingLanes|=2,E.entangledLanes|=2;S;){var H=1<<31-pt(S);E.entanglements[1]|=H,S&=~H}Ta(y),(gt&6)===0&&(cd=It()+500,sc(0))}}break;case 31:case 13:E=xr(y,2),E!==null&&fi(E,y,2),dd(),sh(y,2)}if(y=ch(d),y===null&&Km(i,l,d,Td,o),y===_)break;_=y}_!==null&&d.stopPropagation()}else Km(i,l,d,null,o)}}function ch(i){return i=Eo(i),uh(i)}var Td=null;function uh(i){if(Td=null,i=_r(i),i!==null){var l=s(i);if(l===null)i=null;else{var o=l.tag;if(o===13){if(i=u(l),i!==null)return i;i=null}else if(o===31){if(i=f(l),i!==null)return i;i=null}else if(o===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Td=i,null}function cx(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Oa()){case le:return 2;case ge:return 8;case ze:case He:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var dh=!1,Gl=null,Vl=null,Yl=null,mc=new Map,hc=new Map,Kl=[],ZC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ux(i,l){switch(i){case"focusin":case"focusout":Gl=null;break;case"dragenter":case"dragleave":Vl=null;break;case"mouseover":case"mouseout":Yl=null;break;case"pointerover":case"pointerout":mc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":hc.delete(l.pointerId)}}function _c(i,l,o,d,_,y){return i===null||i.nativeEvent!==y?(i={blockedOn:l,domEventName:o,eventSystemFlags:d,nativeEvent:y,targetContainers:[_]},l!==null&&(l=xe(l),l!==null&&sx(l)),i):(i.eventSystemFlags|=d,l=i.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),i)}function JC(i,l,o,d,_){switch(l){case"focusin":return Gl=_c(Gl,i,l,o,d,_),!0;case"dragenter":return Vl=_c(Vl,i,l,o,d,_),!0;case"mouseover":return Yl=_c(Yl,i,l,o,d,_),!0;case"pointerover":var y=_.pointerId;return mc.set(y,_c(mc.get(y)||null,i,l,o,d,_)),!0;case"gotpointercapture":return y=_.pointerId,hc.set(y,_c(hc.get(y)||null,i,l,o,d,_)),!0}return!1}function dx(i){var l=_r(i.target);if(l!==null){var o=s(l);if(o!==null){if(l=o.tag,l===13){if(l=u(o),l!==null){i.blockedOn=l,vn(i.priority,function(){ox(o)});return}}else if(l===31){if(l=f(o),l!==null){i.blockedOn=l,vn(i.priority,function(){ox(o)});return}}else if(l===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ed(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var o=ch(i.nativeEvent);if(o===null){o=i.nativeEvent;var d=new o.constructor(o.type,o);To=d,o.target.dispatchEvent(d),To=null}else return l=xe(o),l!==null&&sx(l),i.blockedOn=o,!1;l.shift()}return!0}function fx(i,l,o){Ed(i)&&o.delete(l)}function WC(){dh=!1,Gl!==null&&Ed(Gl)&&(Gl=null),Vl!==null&&Ed(Vl)&&(Vl=null),Yl!==null&&Ed(Yl)&&(Yl=null),mc.forEach(fx),hc.forEach(fx)}function Ad(i,l){i.blockedOn===l&&(i.blockedOn=null,dh||(dh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WC)))}var Nd=null;function px(i){Nd!==i&&(Nd=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Nd===i&&(Nd=null);for(var l=0;l<i.length;l+=3){var o=i[l],d=i[l+1],_=i[l+2];if(typeof d!="function"){if(uh(d||o)===null)continue;break}var y=xe(o);y!==null&&(i.splice(l,3),l-=3,cm(y,{pending:!0,data:_,method:o.method,action:d},d,_))}}))}function Os(i){function l(H){return Ad(H,i)}Gl!==null&&Ad(Gl,i),Vl!==null&&Ad(Vl,i),Yl!==null&&Ad(Yl,i),mc.forEach(l),hc.forEach(l);for(var o=0;o<Kl.length;o++){var d=Kl[o];d.blockedOn===i&&(d.blockedOn=null)}for(;0<Kl.length&&(o=Kl[0],o.blockedOn===null);)dx(o),o.blockedOn===null&&Kl.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var _=o[d],y=o[d+1],S=_[xn]||null;if(typeof y=="function")S||px(o);else if(S){var E=null;if(y&&y.hasAttribute("formAction")){if(_=y,S=y[xn]||null)E=S.formAction;else if(uh(_)!==null)continue}else E=S.action;typeof E=="function"?o[d+1]=E:(o.splice(d,3),d-=3),px(o)}}}function mx(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return _=S})},focusReset:"manual",scroll:"manual"})}function l(){_!==null&&(_(),_=null),d||setTimeout(o,20)}function o(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,_=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),_!==null&&(_(),_=null)}}}function fh(i){this._internalRoot=i}Rd.prototype.render=fh.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(a(409));var o=l.current,d=Ai();lx(o,d,i,l,null,null)},Rd.prototype.unmount=fh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;lx(i.current,2,null,i,null,null),dd(),l[Ia]=null}};function Rd(i){this._internalRoot=i}Rd.prototype.unstable_scheduleHydration=function(i){if(i){var l=hr();i={blockedOn:null,target:i,priority:l};for(var o=0;o<Kl.length&&l!==0&&l<Kl[o].priority;o++);Kl.splice(o,0,i),o===0&&dx(i)}};var hx=t.version;if(hx!=="19.2.7")throw Error(a(527,hx,"19.2.7"));G.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=m(l),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var e2={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dd.isDisabled&&Dd.supportsFiber)try{rn=Dd.inject(e2),kt=Dd}catch{}}return yc.createRoot=function(i,l){if(!r(i))throw Error(a(299));var o=!1,d="",_=kb,y=Sb,S=wb;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),l=ix(i,1,!1,null,null,o,d,null,_,y,S,mx),i[Ia]=l.current,Ym(i),new fh(l)},yc.hydrateRoot=function(i,l,o){if(!r(i))throw Error(a(299));var d=!1,_="",y=kb,S=Sb,E=wb,H=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(_=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError),o.formState!==void 0&&(H=o.formState)),l=ix(i,1,!0,l,o??null,d,_,H,y,S,E,mx),l.context=ax(null),o=l.current,d=Ai(),d=Et(d),_=Ml(d),_.callback=null,$l(o,_,d),o=d,l.current.lanes=o,ba(l,o),Ta(l),i[Ia]=l.current,Ym(i),new Rd(l)},yc.version="19.2.7",yc}var jx;function p2(){if(jx)return hh.exports;jx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hh.exports=f2(),hh.exports}var m2=p2();/**
|
||
* react-router v7.17.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/var Cx="popstate";function Tx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function h2(e={}){function t(r,s){let{pathname:u="/",search:f="",hash:p=""}=Fr(r.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),u_("",{pathname:u,search:f,hash:p},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){let u=r.document.querySelector("base"),f="";if(u&&u.getAttribute("href")){let p=r.location.href,m=p.indexOf("#");f=m===-1?p:p.slice(0,m)}return f+"#"+(typeof s=="string"?s:Fc(s))}function a(r,s){Wi(r.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(s)})`)}return g2(t,n,a,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Wi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _2(){return Math.random().toString(36).substring(2,10)}function Ex(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function u_(e,t,n=null,a,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Fr(t):t,state:n,key:t&&t.key||a||_2(),mask:r}}function Fc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Fr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function g2(e,t,n,a={}){let{window:r=document.defaultView,v5Compat:s=!1}=a,u=r.history,f="POP",p=null,m=g();m==null&&(m=0,u.replaceState({...u.state,idx:m},""));function g(){return(u.state||{idx:null}).idx}function b(){f="POP";let A=g(),x=A==null?null:A-m;m=A,p&&p({action:f,location:D.location,delta:x})}function v(A,x){f="PUSH";let T=Tx(A)?A:u_(D.location,A,x);n&&n(T,A),m=g()+1;let N=Ex(T,m),F=D.createHref(T.mask||T);try{u.pushState(N,"",F)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;r.location.assign(F)}s&&p&&p({action:f,location:D.location,delta:1})}function k(A,x){f="REPLACE";let T=Tx(A)?A:u_(D.location,A,x);n&&n(T,A),m=g();let N=Ex(T,m),F=D.createHref(T.mask||T);u.replaceState(N,"",F),s&&p&&p({action:f,location:D.location,delta:0})}function C(A){return y2(r,A)}let D={get action(){return f},get location(){return e(r,u)},listen(A){if(p)throw new Error("A history only accepts one active listener");return r.addEventListener(Cx,b),p=A,()=>{r.removeEventListener(Cx,b),p=null}},createHref(A){return t(r,A)},createURL:C,encodeLocation(A){let x=C(A);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:v,replace:k,go(A){return u.go(A)}};return D}function y2(e,t,n=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Qt(a,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Fc(t);return r=r.replace(/ $/,"%20"),!n&&r.startsWith("//")&&(r=a+r),new URL(r,a)}function Z0(e,t,n="/"){return b2(e,t,n,!1)}function b2(e,t,n,a,r){let s=typeof t=="string"?Fr(t):t,u=dl(s.pathname||"/",n);if(u==null)return null;let f=v2(e),p=null,m=D2(u);for(let g=0;p==null&&g<f.length;++g)p=N2(f[g],m,a);return p}function v2(e){let t=J0(e);return x2(t),t}function J0(e,t=[],n=[],a="",r=!1){let s=(u,f,p=r,m)=>{let g={relativePath:m===void 0?u.path||"":m,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&p)return;Qt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let b=pa([a,g.relativePath]),v=n.concat(g);u.children&&u.children.length>0&&(Qt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),J0(u.children,t,v,b,p)),!(u.path==null&&!u.index)&&t.push({path:b,score:E2(b,u.index),routesMeta:v})};return e.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,f);else for(let m of W0(u.path))s(u,f,!0,m)}),t}function W0(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return r?[s,""]:[s];let u=W0(a.join("/")),f=[];return f.push(...u.map(p=>p===""?s:[s,p].join("/"))),r&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function x2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:A2(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var k2=/^:[\w-]+$/,S2=3,w2=2,j2=1,C2=10,T2=-2,Ax=e=>e==="*";function E2(e,t){let n=e.split("/"),a=n.length;return n.some(Ax)&&(a+=T2),t&&(a+=w2),n.filter(r=>!Ax(r)).reduce((r,s)=>r+(k2.test(s)?S2:s===""?j2:C2),a)}function A2(e,t){return e.length===t.length&&e.slice(0,-1).every((a,r)=>a===t[r])?e[e.length-1]-t[t.length-1]:0}function N2(e,t,n=!1){let{routesMeta:a}=e,r={},s="/",u=[];for(let f=0;f<a.length;++f){let p=a[f],m=f===a.length-1,g=s==="/"?t:t.slice(s.length)||"/",b=uf({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},g),v=p.route;if(!b&&m&&n&&!a[a.length-1].route.index&&(b=uf({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(r,b.params),u.push({params:r,pathname:pa([s,b.pathname]),pathnameBase:O2(pa([s,b.pathnameBase])),route:v}),b.pathnameBase!=="/"&&(s=pa([s,b.pathnameBase]))}return u}function uf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=R2(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let s=r[0],u=s.replace(/(.)\/+$/,"$1"),f=r.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:b},v)=>{if(g==="*"){let C=f[v]||"";u=s.slice(0,s.length-C.length).replace(/(.)\/+$/,"$1")}const k=f[v];return b&&!k?m[g]=void 0:m[g]=(k||"").replace(/%2F/g,"/"),m},{}),pathname:s,pathnameBase:u,pattern:e}}function R2(e,t=!1,n=!0){Wi(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 a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,p,m,g)=>{if(a.push({paramName:f,isOptional:p!=null}),p){let b=g.charAt(m+u.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),a]}function D2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Wi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function dl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var M2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $2(e,t="/"){let{pathname:n,search:a="",hash:r=""}=typeof e=="string"?Fr(e):e,s;return n?(n=e1(n),n.startsWith("/")?s=Nx(n.substring(1),"/"):s=Nx(n,t)):s=t,{pathname:s,search:L2(a),hash:I2(r)}}function Nx(e,t){let n=df(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function bh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 z2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tg(e){let t=z2(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function zf(e,t,n,a=!1){let r;typeof e=="string"?r=Fr(e):(r={...e},Qt(!r.pathname||!r.pathname.includes("?"),bh("?","pathname","search",r)),Qt(!r.pathname||!r.pathname.includes("#"),bh("#","pathname","hash",r)),Qt(!r.search||!r.search.includes("#"),bh("#","search","hash",r)));let s=e===""||r.pathname==="",u=s?"/":r.pathname,f;if(u==null)f=n;else{let b=t.length-1;if(!a&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),b-=1;r.pathname=v.join("/")}f=b>=0?t[b]:"/"}let p=$2(r,f),m=u&&u!=="/"&&u.endsWith("/"),g=(s||u===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var e1=e=>e.replace(/\/\/+/g,"/"),pa=e=>e1(e.join("/")),df=e=>e.replace(/\/+$/,""),O2=e=>df(e).replace(/^\/*/,"/"),L2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,I2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,B2=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function q2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function U2(e){let t=e.map(n=>n.route.path).filter(Boolean);return pa(t)||"/"}var t1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function n1(e,t){let n=e;if(typeof n!="string"||!M2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,r=!1;if(t1)try{let s=new URL(window.location.href),u=n.startsWith("//")?new URL(s.protocol+n):new URL(n),f=dl(u.pathname,t);u.origin===s.origin&&f!=null?n=f+u.search+u.hash:r=!0}catch{Wi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var i1=["POST","PUT","PATCH","DELETE"];new Set(i1);var H2=["GET",...i1];new Set(H2);var uo=w.createContext(null);uo.displayName="DataRouter";var Of=w.createContext(null);Of.displayName="DataRouterState";var a1=w.createContext(!1);function P2(){return w.useContext(a1)}var l1=w.createContext({isTransitioning:!1});l1.displayName="ViewTransition";var F2=w.createContext(new Map);F2.displayName="Fetchers";var G2=w.createContext(null);G2.displayName="Await";var Di=w.createContext(null);Di.displayName="Navigation";var eu=w.createContext(null);eu.displayName="Location";var $a=w.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var ng=w.createContext(null);ng.displayName="RouteError";var r1="REACT_ROUTER_ERROR",V2="REDIRECT",Y2="ROUTE_ERROR_RESPONSE";function K2(e){if(e.startsWith(`${r1}:${V2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Q2(e){if(e.startsWith(`${r1}:${Y2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new B2(t.status,t.statusText,t.data)}catch{}}function X2(e,{relative:t}={}){Qt(fo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=w.useContext(Di),{hash:r,pathname:s,search:u}=tu(e,{relative:t}),f=s;return n!=="/"&&(f=s==="/"?n:pa([n,s])),a.createHref({pathname:f,search:u,hash:r})}function fo(){return w.useContext(eu)!=null}function _a(){return Qt(fo(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(eu).location}var s1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function o1(e){w.useContext(Di).static||w.useLayoutEffect(e)}function ig(){let{isDataRoute:e}=w.useContext($a);return e?cT():Z2()}function Z2(){Qt(fo(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(uo),{basename:t,navigator:n}=w.useContext(Di),{matches:a}=w.useContext($a),{pathname:r}=_a(),s=JSON.stringify(tg(a)),u=w.useRef(!1);return o1(()=>{u.current=!0}),w.useCallback((p,m={})=>{if(Wi(u.current,s1),!u.current)return;if(typeof p=="number"){n.go(p);return}let g=zf(p,JSON.parse(s),r,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:pa([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,s,r,e])}w.createContext(null);function tu(e,{relative:t}={}){let{matches:n}=w.useContext($a),{pathname:a}=_a(),r=JSON.stringify(tg(n));return w.useMemo(()=>zf(e,JSON.parse(r),a,t==="path"),[e,r,a,t])}function J2(e,t){return c1(e,t)}function c1(e,t,n){var A;Qt(fo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=w.useContext(Di),{matches:r}=w.useContext($a),s=r[r.length-1],u=s?s.params:{},f=s?s.pathname:"/",p=s?s.pathnameBase:"/",m=s&&s.route;{let x=m&&m.path||"";d1(f,!m||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${x}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let g=_a(),b;if(t){let x=typeof t=="string"?Fr(t):t;Qt(p==="/"||((A=x.pathname)==null?void 0:A.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${x.pathname}" was given in the \`location\` prop.`),b=x}else b=g;let v=b.pathname||"/",k=v;if(p!=="/"){let x=p.replace(/^\//,"").split("/");k="/"+v.replace(/^\//,"").split("/").slice(x.length).join("/")}let C=n&&n.state.matches.length?n.state.matches.map(x=>Object.assign(x,{route:n.manifest[x.route.id]||x.route})):Z0(e,{pathname:k});Wi(m||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Wi(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let D=iT(C&&C.map(x=>Object.assign({},x,{params:Object.assign({},u,x.params),pathname:pa([p,a.encodeLocation?a.encodeLocation(x.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?p:pa([p,a.encodeLocation?a.encodeLocation(x.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),r,n);return t&&D?w.createElement(eu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},D):D}function W2(){let e=oT(),t=q2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:s},"ErrorBoundary")," or"," ",w.createElement("code",{style:s},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:r},n):null,u)}var eT=w.createElement(W2,null),u1=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Q2(e.digest);n&&(e=n)}let t=e!==void 0?w.createElement($a.Provider,{value:this.props.routeContext},w.createElement(ng.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(tT,{error:e},t):t}};u1.contextType=a1;var vh=new WeakMap;function tT({children:e,error:t}){let{basename:n}=w.useContext(Di);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=K2(t.digest);if(a){let r=vh.get(t);if(r)throw r;let s=n1(a.location,n);if(t1&&!vh.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw vh.set(t,u),u}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function nT({routeContext:e,match:t,children:n}){let a=w.useContext(uo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement($a.Provider,{value:e},n)}function iT(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let r=e,s=a==null?void 0:a.errors;if(s!=null){let g=r.findIndex(b=>b.route.id&&(s==null?void 0:s[b.route.id])!==void 0);Qt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,g+1))}let u=!1,f=-1;if(n&&a){u=a.renderFallback;for(let g=0;g<r.length;g++){let b=r[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=g),b.route.id){let{loaderData:v,errors:k}=a,C=b.route.loader&&!v.hasOwnProperty(b.route.id)&&(!k||k[b.route.id]===void 0);if(b.route.lazy||C){n.isStatic&&(u=!0),f>=0?r=r.slice(0,f+1):r=[r[0]];break}}}}let p=n==null?void 0:n.onError,m=a&&p?(g,b)=>{var v,k;p(g,{location:a.location,params:((k=(v=a.matches)==null?void 0:v[0])==null?void 0:k.params)??{},pattern:U2(a.matches),errorInfo:b})}:void 0;return r.reduceRight((g,b,v)=>{let k,C=!1,D=null,A=null;a&&(k=s&&b.route.id?s[b.route.id]:void 0,D=b.route.errorElement||eT,u&&(f<0&&v===0?(d1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,A=null):f===v&&(C=!0,A=b.route.hydrateFallbackElement||null)));let x=t.concat(r.slice(0,v+1)),T=()=>{let N;return k?N=D:C?N=A:b.route.Component?N=w.createElement(b.route.Component,null):b.route.element?N=b.route.element:N=g,w.createElement(nT,{match:b,routeContext:{outlet:g,matches:x,isDataRoute:a!=null},children:N})};return a&&(b.route.ErrorBoundary||b.route.errorElement||v===0)?w.createElement(u1,{location:a.location,revalidation:a.revalidation,component:D,error:k,children:T(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:m}):T()},null)}function ag(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function aT(e){let t=w.useContext(uo);return Qt(t,ag(e)),t}function lT(e){let t=w.useContext(Of);return Qt(t,ag(e)),t}function rT(e){let t=w.useContext($a);return Qt(t,ag(e)),t}function lg(e){let t=rT(e),n=t.matches[t.matches.length-1];return Qt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sT(){return lg("useRouteId")}function oT(){var a;let e=w.useContext(ng),t=lT("useRouteError"),n=lg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function cT(){let{router:e}=aT("useNavigate"),t=lg("useNavigate"),n=w.useRef(!1);return o1(()=>{n.current=!0}),w.useCallback(async(r,s={})=>{Wi(n.current,s1),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))},[e,t])}var Rx={};function d1(e,t,n){!t&&!Rx[e]&&(Rx[e]=!0,Wi(!1,n))}w.memo(uT);function uT({routes:e,manifest:t,future:n,state:a,isStatic:r,onError:s}){return c1(e,void 0,{manifest:t,state:a,isStatic:r,onError:s})}function dT({to:e,replace:t,state:n,relative:a}){Qt(fo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=w.useContext(Di);Wi(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=w.useContext($a),{pathname:u}=_a(),f=ig(),p=zf(e,tg(s),u,a==="path"),m=JSON.stringify(p);return w.useEffect(()=>{f(JSON.parse(m),{replace:t,state:n,relative:a})},[f,m,a,t,n]),null}function d_(e){Qt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function fT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:r,static:s=!1,useTransitions:u}){Qt(!fo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:f,navigator:r,static:s,useTransitions:u,future:{}}),[f,r,s,u]);typeof n=="string"&&(n=Fr(n));let{pathname:m="/",search:g="",hash:b="",state:v=null,key:k="default",mask:C}=n,D=w.useMemo(()=>{let A=dl(m,f);return A==null?null:{location:{pathname:A,search:g,hash:b,state:v,key:k,mask:C},navigationType:a}},[f,m,g,b,v,k,a,C]);return Wi(D!=null,`<Router basename="${f}"> is not able to match the URL "${m}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),D==null?null:w.createElement(Di.Provider,{value:p},w.createElement(eu.Provider,{children:t,value:D}))}function pT({children:e,location:t}){return J2(f_(e),t)}function f_(e,t=[]){let n=[];return w.Children.forEach(e,(a,r)=>{if(!w.isValidElement(a))return;let s=[...t,r];if(a.type===w.Fragment){n.push.apply(n,f_(a.props.children,s));return}Qt(a.type===d_,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={id:a.props.id||s.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(u.children=f_(a.props.children,s)),n.push(u)}),n}var Wd="get",ef="application/x-www-form-urlencoded";function Lf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function mT(e){return Lf(e)&&e.tagName.toLowerCase()==="button"}function hT(e){return Lf(e)&&e.tagName.toLowerCase()==="form"}function _T(e){return Lf(e)&&e.tagName.toLowerCase()==="input"}function gT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yT(e,t){return e.button===0&&(!t||t==="_self")&&!gT(e)}var Md=null;function bT(){if(Md===null)try{new FormData(document.createElement("form"),0),Md=!1}catch{Md=!0}return Md}var vT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xh(e){return e!=null&&!vT.has(e)?(Wi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ef}"`),null):e}function xT(e,t){let n,a,r,s,u;if(hT(e)){let f=e.getAttribute("action");a=f?dl(f,t):null,n=e.getAttribute("method")||Wd,r=xh(e.getAttribute("enctype"))||ef,s=new FormData(e)}else if(mT(e)||_T(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||f.getAttribute("action");if(a=p?dl(p,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Wd,r=xh(e.getAttribute("formenctype"))||xh(f.getAttribute("enctype"))||ef,s=new FormData(f,e),!bT()){let{name:m,type:g,value:b}=e;if(g==="image"){let v=m?`${m}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else m&&s.append(m,b)}}else{if(Lf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wd,a=null,r=ef,u=e}return s&&r==="text/plain"&&(u=s,s=void 0),{action:a,method:n.toLowerCase(),encType:r,formData:s,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function f1(e,t,n,a){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${a}`:r.pathname=`${r.pathname}.${a}`:r.pathname==="/"?r.pathname=`_root.${a}`:t&&dl(r.pathname,t)==="/"?r.pathname=`${df(t)}/_root.${a}`:r.pathname=`${df(r.pathname)}.${a}`,r}async function kT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ST(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function wT(e,t,n){let a=await Promise.all(e.map(async r=>{let s=t.routes[r.route.id];if(s){let u=await kT(s,n);return u.links?u.links():[]}return[]}));return ET(a.flat(1).filter(ST).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Dx(e,t,n,a,r,s){let u=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,f=(p,m)=>{var g;return n[m].pathname!==p.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==p.params["*"]};return s==="assets"?t.filter((p,m)=>u(p,m)||f(p,m)):s==="data"?t.filter((p,m)=>{var b;let g=a.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(u(p,m)||f(p,m))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function jT(e,t,{includeHydrateFallback:n}={}){return CT(e.map(a=>{let r=t.routes[a.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function CT(e){return[...new Set(e)]}function TT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function ET(e,t){let n=new Set;return new Set(t),e.reduce((a,r)=>{let s=JSON.stringify(TT(r));return n.has(s)||(n.add(s),a.push({key:s,link:r})),a},[])}function sg(){let e=w.useContext(uo);return rg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function AT(){let e=w.useContext(Of);return rg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var og=w.createContext(void 0);og.displayName="FrameworkContext";function cg(){let e=w.useContext(og);return rg(e,"You must render this element inside a <HydratedRouter> element"),e}function NT(e,t){let n=w.useContext(og),[a,r]=w.useState(!1),[s,u]=w.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:g,onTouchStart:b}=t,v=w.useRef(null);w.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let D=x=>{x.forEach(T=>{u(T.isIntersecting)})},A=new IntersectionObserver(D,{threshold:.5});return v.current&&A.observe(v.current),()=>{A.disconnect()}}},[e]),w.useEffect(()=>{if(a){let D=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(D)}}},[a]);let k=()=>{r(!0)},C=()=>{r(!1),u(!1)};return n?e!=="intent"?[s,v,{}]:[s,v,{onFocus:bc(f,k),onBlur:bc(p,C),onMouseEnter:bc(m,k),onMouseLeave:bc(g,C),onTouchStart:bc(b,k)}]:[!1,v,{}]}function bc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function RT({page:e,...t}){let n=P2(),{router:a}=sg(),r=w.useMemo(()=>Z0(a.routes,e,a.basename),[a.routes,e,a.basename]);return r?n?w.createElement(MT,{page:e,matches:r,...t}):w.createElement($T,{page:e,matches:r,...t}):null}function DT(e){let{manifest:t,routeModules:n}=cg(),[a,r]=w.useState([]);return w.useEffect(()=>{let s=!1;return wT(e,t,n).then(u=>{s||r(u)}),()=>{s=!0}},[e,t,n]),a}function MT({page:e,matches:t,...n}){let a=_a(),{future:r}=cg(),{basename:s}=sg(),u=w.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let f=f1(e,s,r.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?p=!0:m.push(g.route.id);return p&&m.length>0&&f.searchParams.set("_routes",m.join(",")),[f.pathname+f.search]},[s,r.v8_trailingSlashAwareDataRequests,e,a,t]);return w.createElement(w.Fragment,null,u.map(f=>w.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...n})))}function $T({page:e,matches:t,...n}){let a=_a(),{future:r,manifest:s,routeModules:u}=cg(),{basename:f}=sg(),{loaderData:p,matches:m}=AT(),g=w.useMemo(()=>Dx(e,t,m,s,a,"data"),[e,t,m,s,a]),b=w.useMemo(()=>Dx(e,t,m,s,a,"assets"),[e,t,m,s,a]),v=w.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let D=new Set,A=!1;if(t.forEach(T=>{var F;let N=s.routes[T.route.id];!N||!N.hasLoader||(!g.some(L=>L.route.id===T.route.id)&&T.route.id in p&&((F=u[T.route.id])!=null&&F.shouldRevalidate)||N.hasClientLoader?A=!0:D.add(T.route.id))}),D.size===0)return[];let x=f1(e,f,r.v8_trailingSlashAwareDataRequests,"data");return A&&D.size>0&&x.searchParams.set("_routes",t.filter(T=>D.has(T.route.id)).map(T=>T.route.id).join(",")),[x.pathname+x.search]},[f,r.v8_trailingSlashAwareDataRequests,p,a,s,g,t,e,u]),k=w.useMemo(()=>jT(b,s),[b,s]),C=DT(b);return w.createElement(w.Fragment,null,v.map(D=>w.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...n})),k.map(D=>w.createElement("link",{key:D,rel:"modulepreload",href:D,...n})),C.map(({key:D,link:A})=>w.createElement("link",{key:D,nonce:n.nonce,...A,crossOrigin:A.crossOrigin??n.crossOrigin})))}function zT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var OT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{OT&&(window.__reactRouterVersion="7.17.0")}catch{}function LT({basename:e,children:t,useTransitions:n,window:a}){let r=w.useRef();r.current==null&&(r.current=h2({window:a,v5Compat:!0}));let s=r.current,[u,f]=w.useState({action:s.action,location:s.location}),p=w.useCallback(m=>{n===!1?f(m):w.startTransition(()=>f(m))},[n]);return w.useLayoutEffect(()=>s.listen(p),[s,p]),w.createElement(fT,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:s,useTransitions:n})}var p1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,m1=w.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:r,reloadDocument:s,replace:u,mask:f,state:p,target:m,to:g,preventScrollReset:b,viewTransition:v,defaultShouldRevalidate:k,...C},D){let{basename:A,navigator:x,useTransitions:T}=w.useContext(Di),N=typeof g=="string"&&p1.test(g),F=n1(g,A);g=F.to;let L=X2(g,{relative:r}),B=_a(),P=null;if(f){let U=zf(f,[],B.mask?B.mask.pathname:"/",!0);A!=="/"&&(U.pathname=U.pathname==="/"?A:pa([A,U.pathname])),P=x.createHref(U)}let[K,se,I]=NT(a,C),q=UT(g,{replace:u,mask:f,state:p,target:m,preventScrollReset:b,relative:r,viewTransition:v,defaultShouldRevalidate:k,useTransitions:T});function Z(U){t&&t(U),U.defaultPrevented||q(U)}let Q=!(F.isExternal||s),R=w.createElement("a",{...C,...I,href:(Q?P:void 0)||F.absoluteURL||L,onClick:Q?Z:t,ref:zT(D,se),target:m,"data-discover":!N&&n==="render"?"true":void 0});return K&&!N?w.createElement(w.Fragment,null,R,w.createElement(RT,{page:L})):R});m1.displayName="Link";var IT=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:r=!1,style:s,to:u,viewTransition:f,children:p,...m},g){let b=tu(u,{relative:m.relative}),v=_a(),k=w.useContext(Of),{navigator:C,basename:D}=w.useContext(Di),A=k!=null&&VT(b)&&f===!0,x=C.encodeLocation?C.encodeLocation(b).pathname:b.pathname,T=v.pathname,N=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,x=x.toLowerCase()),N&&D&&(N=dl(N,D)||N);const F=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let L=T===x||!r&&T.startsWith(x)&&T.charAt(F)==="/",B=N!=null&&(N===x||!r&&N.startsWith(x)&&N.charAt(x.length)==="/"),P={isActive:L,isPending:B,isTransitioning:A},K=L?t:void 0,se;typeof a=="function"?se=a(P):se=[a,L?"active":null,B?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(P):s;return w.createElement(m1,{...m,"aria-current":K,className:se,ref:g,style:I,to:u,viewTransition:f},typeof p=="function"?p(P):p)});IT.displayName="NavLink";var BT=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:r,state:s,method:u=Wd,action:f,onSubmit:p,relative:m,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:v,...k},C)=>{let{useTransitions:D}=w.useContext(Di),A=FT(),x=GT(f,{relative:m}),T=u.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&p1.test(f),F=L=>{if(p&&p(L),L.defaultPrevented)return;L.preventDefault();let B=L.nativeEvent.submitter,P=(B==null?void 0:B.getAttribute("formmethod"))||u,K=()=>A(B||L.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:r,state:s,relative:m,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:v});D&&n!==!1?w.startTransition(()=>K()):K()};return w.createElement("form",{ref:C,method:T,action:x,onSubmit:a?p:F,...k,"data-discover":!N&&e==="render"?"true":void 0})});BT.displayName="Form";function qT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function h1(e){let t=w.useContext(uo);return Qt(t,qT(e)),t}function UT(e,{target:t,replace:n,mask:a,state:r,preventScrollReset:s,relative:u,viewTransition:f,defaultShouldRevalidate:p,useTransitions:m}={}){let g=ig(),b=_a(),v=tu(e,{relative:u});return w.useCallback(k=>{if(yT(k,t)){k.preventDefault();let C=n!==void 0?n:Fc(b)===Fc(v),D=()=>g(e,{replace:C,mask:a,state:r,preventScrollReset:s,relative:u,viewTransition:f,defaultShouldRevalidate:p});m?w.startTransition(()=>D()):D()}},[b,g,v,n,a,r,t,e,s,u,f,p,m])}var HT=0,PT=()=>`__${String(++HT)}__`;function FT(){let{router:e}=h1("useSubmit"),{basename:t}=w.useContext(Di),n=sT(),a=e.fetch,r=e.navigate;return w.useCallback(async(s,u={})=>{let{action:f,method:p,encType:m,formData:g,body:b}=xT(s,t);if(u.navigate===!1){let v=u.fetcherKey||PT();await a(v,n,u.action||f,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:b,formMethod:u.method||p,formEncType:u.encType||m,flushSync:u.flushSync})}else await r(u.action||f,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:b,formMethod:u.method||p,formEncType:u.encType||m,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,r,t,n])}function GT(e,{relative:t}={}){let{basename:n}=w.useContext(Di),a=w.useContext($a);Qt(a,"useFormAction must be used inside a RouteContext");let[r]=a.matches.slice(-1),s={...tu(e||".",{relative:t})},u=_a();if(e==null){s.search=u.search;let f=new URLSearchParams(s.search),p=f.getAll("index");if(p.some(g=>g==="")){f.delete("index"),p.filter(b=>b).forEach(b=>f.append("index",b));let g=f.toString();s.search=g?`?${g}`:""}}return(!e||e===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:pa([n,s.pathname])),Fc(s)}function VT(e,{relative:t}={}){let n=w.useContext(l1);Qt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=h1("useViewTransitionState"),r=tu(e,{relative:t});if(!n.isTransitioning)return!1;let s=dl(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=dl(n.nextLocation.pathname,a)||n.nextLocation.pathname;return uf(r.pathname,u)!=null||uf(r.pathname,s)!=null}const ff={finance:{id:"finance",labelKey:"console.role.finance",density:"compact",tone:"strict",contentPriority:["audit","sources","exactNumbers"],motion:{defaultLevel:"none",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:3e4,cssVars:{"--role-accent":"#2563eb","--role-accent-soft":"rgba(37,99,235,0.12)","--role-surface-tint":"rgba(248,250,252,0.78)","--role-border":"rgba(37,99,235,0.22)","--role-focus-ring":"#1d4ed8"}},engineering:{id:"engineering",labelKey:"console.role.engineering",density:"compact",tone:"technical",contentPriority:["alarms","timestamps","reliability"],motion:{defaultLevel:"none",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:15e3,cssVars:{"--role-accent":"#0f766e","--role-accent-soft":"rgba(15,118,110,0.12)","--role-surface-tint":"rgba(240,253,250,0.72)","--role-border":"rgba(15,118,110,0.24)","--role-focus-ring":"#0f766e"}},executive:{id:"executive",labelKey:"console.role.executive",density:"presentation",tone:"executive",contentPriority:["kpi","approvals","exactNumbers"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!0},staleDataThresholdMs:6e4,cssVars:{"--role-accent":"#334155","--role-accent-soft":"rgba(51,65,85,0.10)","--role-surface-tint":"rgba(248,250,252,0.82)","--role-border":"rgba(51,65,85,0.20)","--role-focus-ring":"#475569"}},hr:{id:"hr",labelKey:"console.role.hr",density:"balanced",tone:"warm-professional",contentPriority:["queues","timestamps","approvals"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:45e3,cssVars:{"--role-accent":"#7c3aed","--role-accent-soft":"rgba(124,58,237,0.10)","--role-surface-tint":"rgba(250,245,255,0.72)","--role-border":"rgba(124,58,237,0.20)","--role-focus-ring":"#6d28d9"}},sales:{id:"sales",labelKey:"console.role.sales",density:"balanced",tone:"warm-professional",contentPriority:["pipeline","sources","exactNumbers"],motion:{defaultLevel:"minimal",allowParticles:!1,allowCelebrations:!1,allowDecorativeBadges:!1},actionPolicy:{requireConfirmationForDestructive:!0,showReversalHint:!0,preferOneClickApproval:!1},staleDataThresholdMs:45e3,cssVars:{"--role-accent":"#b45309","--role-accent-soft":"rgba(180,83,9,0.10)","--role-surface-tint":"rgba(255,251,235,0.70)","--role-border":"rgba(180,83,9,0.20)","--role-focus-ring":"#92400e"}}},_1=w.createContext(null),g1="sgrobot-console-role";function YT(){try{const e=localStorage.getItem(g1);if(e&&e in ff)return e}catch{}return"sales"}function KT({children:e}){const[t,n]=w.useState(YT),a=w.useCallback(s=>{n(s);try{localStorage.setItem(g1,s)}catch{}},[]),r=ff[t];return c.jsx(_1.Provider,{value:{role:t,profile:r,setRole:a},children:c.jsx("div",{style:r.cssVars,"data-role":t,children:e})})}function QT(){const e=w.useContext(_1);if(!e)throw new Error("useRole must be used within RoleProvider");return e}/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const rr=typeof window<"u",kh=rr?window:null,Gc=rr?document:null,Jt={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ot={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},Ji={NONE:0,AUTO:1,FORCE:2},Hn={replace:0,none:1,blend:2},Mx=Symbol(),Vc=Symbol(),y1=Symbol(),If=Symbol(),XT=Symbol(),zt=1e-11,p_=1e12,to=1e3,m_=240,no="",ZT="var(",b1=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),pf=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],JT=pf.reduce((e,t)=>({...e,[t]:t+"("}),{}),Xi=()=>{},WT=/\)\s*[-.\d]/,eE=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,tE=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,nE=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,iE=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,aE=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,$x=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,lE=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,rE=/([a-z])([A-Z])/g,sE=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const mf={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:m_,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:to,delay:0,loopDelay:0,ease:"out(2)",composition:Hn.replace,modifier:e=>e,onBegin:Xi,onBeforeUpdate:Xi,onUpdate:Xi,onLoop:Xi,onPause:Xi,onComplete:Xi,onRender:Xi},oE={root:Gc},qn={defaults:mf,precision:4,timeScale:1,tickThreshold:200},v1={version:"4.4.1",engine:null};rr&&(kh.AnimeJS||(kh.AnimeJS=[]),kh.AnimeJS.push(v1));/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const x1=e=>e.replace(rE,"$1-$2").toLowerCase(),nr=(e,t)=>e.indexOf(t)===0,io=Date.now,ao=Array.isArray,Sh=e=>e&&e.constructor===Object,cE=e=>typeof e=="number"&&!isNaN(e),Yc=e=>typeof e=="string",Kc=e=>typeof e=="function",ln=e=>typeof e>"u",zc=e=>ln(e)||e===null,k1=e=>rr&&e instanceof SVGElement,S1=e=>eE.test(e),w1=e=>nr(e,"rgb"),j1=e=>nr(e,"hsl"),uE=e=>S1(e)||(w1(e)||j1(e))&&(e[e.length-1]===")"||!WT.test(e)),tf=e=>!qn.defaults.hasOwnProperty(e),dE=["opacity","rotate","overflow","color"],fE=(e,t)=>{if(dE.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const n=e.parentNode;return n&&n.tagName==="filter"}return!0}},Vs=Math.pow,pE=Math.sqrt,mE=Math.sin,hE=Math.cos,_E=Math.floor,gE=Math.asin,ug=Math.PI,zx=Math.round,ii=(e,t,n)=>e<t?t:e>n?n:e,bn=(e,t)=>{if(t<0)return e;if(!t)return zx(e);const n=10**t;return zx(e*n)/n},qr=(e,t,n)=>e+(t-e)*n,dg=e=>e===1/0?p_:e===-1/0?-p_:e,Oc=e=>e<=zt?zt:dg(bn(e,11)),Yn=e=>ao(e)?[...e]:e,yE=(e,t)=>{const n={...e};for(let a in t){const r=e[a];n[a]=ln(r)?t[a]:r}return n},Sn=(e,t,n,a="_prev",r="_next")=>{let s=e._head,u=r;for(n&&(s=e._tail,u=a);s;){const f=s[u];t(s),s=f}},Dc=(e,t,n="_prev",a="_next")=>{const r=t[n],s=t[a];r?r[a]=s:e._head=s,s?s[n]=r:e._tail=r,t[n]=null,t[a]=null},Xs=(e,t,n,a="_prev",r="_next")=>{let s=e._tail;for(;s&&n&&n(s,t);)s=s[a];const u=s?s[r]:e._head;s?s[r]=t:e._head=t,u?u[a]=t:e._tail=t,t[a]=s,t[r]=u};/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const bE=(e,t,n)=>{const a=e.style.transform;if(a){const r=e[If];let s=0;const u=a.length;let f;for(;s<u;){for(;s<u&&a.charCodeAt(s)===32;)s++;if(s>=u)break;const m=s;for(;s<u&&a.charCodeAt(s)!==40;)s++;if(s>=u)break;const g=a.substring(m,s);let b=1;const v=s+1;let k=-1,C=-1;for(s++;s<u&&b>0;){const A=a.charCodeAt(s);A===40?b++:A===41?b--:A===44&&b===1&&(k===-1?k=s:C===-1&&(C=s)),s++}const D=s-1;g==="translate"||g==="translate3d"?(k===-1?r.translateX=a.substring(v,D).trim():(r.translateX=a.substring(v,k).trim(),C===-1?r.translateY=a.substring(k+1,D).trim():(r.translateY=a.substring(k+1,C).trim(),r.translateZ=a.substring(C+1,D).trim())),f=a.substring(v,D)):g==="scale"||g==="scale3d"?k===-1?r.scale=a.substring(v,D).trim():(r.scaleX=a.substring(v,k).trim(),C===-1?r.scaleY=a.substring(k+1,D).trim():(r.scaleY=a.substring(k+1,C).trim(),r.scaleZ=a.substring(C+1,D).trim())):r[g]=a.substring(v,D)}if(t==="translate3d"&&f)return n&&(n[t]=f),f;const p=r[t];if(!ln(p))return n&&(n[t]=p),p}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":nr(t,"scale")?"1":nr(t,"rotate")||nr(t,"skew")?"0deg":"0px"},C1=e=>{let t=no;for(let n=0,a=pf.length;n<a;n++){const r=pf[n],s=e[r];if(s!==void 0){if(r==="translateX"){const u=e.translateY;if(u!==void 0){const f=e.translateZ;f!==void 0?(t+=`translate3d(${s},${u},${f}) `,n+=2):(t+=`translate(${s},${u}) `,n+=1);continue}}if(r==="scaleX"&&e.scale===void 0){const u=e.scaleY;if(u!==void 0){const f=e.scaleZ;f!==void 0?(t+=`scale3d(${s},${u},${f}) `,n+=2):(t+=`scale(${s},${u}) `,n+=1);continue}}t+=`${JT[r]}${s}) `}r==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t};/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const vE=e=>{const t=tE.exec(e)||nE.exec(e),n=ln(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},xE=e=>{const t=e.length,n=t===4||t===5;return[+("0x"+e[1]+e[n?1:2]),+("0x"+e[n?2:3]+e[n?2:4]),+("0x"+e[n?3:5]+e[n?3:6]),t===5||t===9?+(+("0x"+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},wh=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),kE=e=>{const t=iE.exec(e)||aE.exec(e),n=+t[1]/360,a=+t[2]/100,r=+t[3]/100,s=ln(t[4])?1:+t[4];let u,f,p;if(a===0)u=f=p=r;else{const m=r<.5?r*(1+a):r+a-r*a,g=2*r-m;u=bn(wh(g,m,n+1/3)*255,0),f=bn(wh(g,m,n)*255,0),p=bn(wh(g,m,n-1/3)*255,0)}return[u,f,p,s]},SE=e=>w1(e)?vE(e):S1(e)?xE(e):j1(e)?kE(e):[0,0,0,1];/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Un=(e,t)=>ln(e)?t:e,sl=(e,t,n,a,r,s)=>{let u;if(Kc(e))u=()=>{const f=e(t,n,a,s);return isNaN(+f)?f||0:+f};else if(Yc(e)&&nr(e,ZT))u=()=>{var b;const f=e.match(sE),p=f[1],m=f[2];let g=(b=getComputedStyle(t))==null?void 0:b.getPropertyValue(p);return(!g||g.trim()===no)&&m&&(g=m.trim()),g||0};else return e;return r&&(r.func=u),u()},T1=(e,t)=>e[Vc]?e[y1]&&fE(e,t)?Jt.ATTRIBUTE:pf.includes(t)||b1.get(t)?Jt.TRANSFORM:nr(t,"--")?Jt.CSS_VAR:t in e.style?Jt.CSS:t in e?Jt.OBJECT:Jt.ATTRIBUTE:Jt.OBJECT,Ox=(e,t,n)=>{const a=e.style[t];a&&n&&(n[t]=a);const r=a||getComputedStyle(e[XT]||e).getPropertyValue(t);return r==="auto"?"0":r},vc=(e,t,n,a)=>{const r=ln(n)?T1(e,t):n;if(r===Jt.OBJECT){const s=e[t];return s&&a&&(a[t]=s),s||0}if(r===Jt.ATTRIBUTE){const s=e.getAttribute(t);return s&&a&&(a[t]=s),s}return r===Jt.TRANSFORM?bE(e,t,a):r===Jt.CSS_VAR?Ox(e,t,a).trimStart():Ox(e,t,a)},jh=(e,t,n)=>n==="-"?e-t:n==="+"?e+t:e*t,fg=()=>({t:ot.NUMBER,n:0,u:null,o:null,d:null,s:null}),ua=(e,t)=>{if(t.t=ot.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const n=+e;if(isNaN(n)){let a=e;a[1]==="="&&(t.o=a[0],a=a.slice(2));const r=a.includes(" ")?!1:lE.exec(a);if(r)return t.t=ot.UNIT,t.n=+r[1],t.u=r[2],t;if(t.o)return t.n=+a,t;if(uE(a))return t.t=ot.COLOR,t.d=SE(a),t;{const s=a.match($x);return t.t=ot.COMPLEX,t.d=s?s.map(Number):[],t.s=a.split($x)||[],t}}else return t.n=n,t},Lx=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=Yn(e._toNumbers),t.s=Yn(e._strings),t),$r=fg(),E1=(e,t,n)=>{const a=e._modifier,r=e._fromNumbers,s=e._toNumbers,u=bn(ii(a(qr(r[0],s[0],t)),0,255),0),f=bn(ii(a(qr(r[1],s[1],t)),0,255),0),p=bn(ii(a(qr(r[2],s[2],t)),0,255),0),m=ii(a(bn(qr(r[3],s[3],t),n)),0,1);if(e._composition!==Hn.none){const g=e._numbers;g[0]=u,g[1]=f,g[2]=p,g[3]=m}return`rgba(${u},${f},${p},${m})`},A1=(e,t,n)=>{const a=e._modifier,r=e._fromNumbers,s=e._toNumbers,u=e._strings,f=e._composition!==Hn.none;let p=u[0];for(let m=0,g=s.length;m<g;m++){const b=a(bn(qr(r[m],s[m],t),n)),v=u[m+1];p+=`${v?b+v:b}`,f&&(e._numbers[m]=b)}return p};/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const nf=(e,t,n,a,r)=>{const s=e.parent,u=e.duration,f=e.completed,p=e.iterationDuration,m=e.iterationCount,g=e._currentIteration,b=e._loopDelay,v=e._reversed,k=e._alternate,C=e._hasChildren,D=e._delay,A=e._currentTime,x=D+p,T=t-D,N=ii(A,-D,u),F=ii(T,-D,u),L=T-A,B=F>0,P=F>=u,K=u<=zt,se=r===Ji.FORCE;let I=0,q=T,Z=0;if(m>1){const G=~~(F/(p+(P?0:b)));e._currentIteration=ii(G,0,m),P&&e._currentIteration--,I=e._currentIteration%2,q=F%(p+b)||0}const Q=v^(k&&I),R=e._ease;let U=P?Q?0:u:Q?p-q:q;R&&(U=p*R(U/p)||0);const O=(s?s.backwards:T<A)?!Q:!!Q;if(e._currentTime=T,e._iterationTime=U,e.backwards=O,B&&!e.began?(e.began=!0,!n&&!(s&&(O||!s.began))&&e.onBegin(e)):T<=0&&(e.began=!1),!n&&!C&&B&&e._currentIteration!==g&&e.onLoop(e),se||r===Ji.AUTO&&(t>=D&&t<=x||t<=D&&N>D||t>=x&&N!==u)||U>=x&&N!==u||U<=D&&N>0||t<=N&&N===u&&f||P&&!f&&K){if(B&&(e.computeDeltaTime(N),n||e.onBeforeUpdate(e)),!C){const G=se||(O?L*-1:L)>=qn.tickThreshold,ae=e._offset+(s?s._offset:0)+D+U;let ie=e._head,z,M,J,$,_e=0;for(;ie;){const we=ie._composition,be=ie._currentTime,Ee=ie._changeDuration,Ie=ie._absoluteStartTime+ie._changeDuration,ue=ie._nextRep,me=ie._prevRep,Xe=we!==Hn.none;if((G||(be!==Ee||ae<=Ie+(ue?ue._delay:0))&&(be!==0||ae>=ie._absoluteStartTime))&&(!Xe||!ie._isOverridden&&(!ie._isOverlapped||ae<=Ie)&&(!ue||ue._isOverridden||ae<=ue._absoluteStartTime)&&(!me||me._isOverridden||ae>=me._absoluteStartTime+me._changeDuration+ie._delay))){const it=ie._currentTime=ii(U-ie._startTime,0,Ee),bt=ie._ease(it/ie._updateDuration),Lt=ie._modifier,vt=ie._valueType,Ue=ie._tweenType,ft=Ue===Jt.OBJECT,wt=vt===ot.NUMBER,at=wt&&ft||bt===0||bt===1?-1:qn.precision;let qe,xt;if(wt?qe=xt=Lt(bn(qr(ie._fromNumber,ie._toNumber,bt),at)):vt===ot.UNIT?(xt=Lt(bn(qr(ie._fromNumber,ie._toNumber,bt),at)),qe=`${xt}${ie._unit}`):vt===ot.COLOR?qe=E1(ie,bt,at):vt===ot.COMPLEX&&(qe=A1(ie,bt,at)),Xe&&(ie._number=xt),!a&&we!==Hn.blend){const lt=ie.property;z=ie.target,ft?z[lt]=qe:Ue===Jt.ATTRIBUTE?z.setAttribute(lt,qe):(M=z.style,Ue===Jt.TRANSFORM?(z!==J&&(J=z,$=z[If]),$[lt]=qe,_e=1):Ue===Jt.CSS?M[lt]=qe:Ue===Jt.CSS_VAR&&M.setProperty(lt,qe)),B&&(Z=1)}else ie._value=qe}_e&&ie._renderTransforms&&(M.transform=C1($),_e=0),ie=ie._next}!n&&Z&&e.onRender(e)}!n&&B&&e.onUpdate(e)}return s&&K?!n&&(s.began&&!O&&T>0&&!f||O&&T<=zt&&f)&&(e.onComplete(e),e.completed=!O):B&&P?m===1/0?e._startTime+=e.duration:e._currentIteration>=m-1&&(e.paused=!0,!f&&!C&&(e.completed=!0,!n&&!(s&&(O||!s.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,Z},Ys=(e,t,n,a,r)=>{const s=e._currentIteration;if(nf(e,t,n,a,r),e._hasChildren){const u=e,f=u.backwards,p=a?t:u._iterationTime,m=io();let g=0,b=!0;if(!a&&u._currentIteration!==s){const v=u.iterationDuration;Sn(u,k=>{if(!f)!k.completed&&!k.backwards&&k._currentTime<k.iterationDuration&&nf(k,v,n,1,Ji.FORCE),k.began=!1,k.completed=!1;else{const C=k.duration,D=k._offset+k._delay,A=D+C;!n&&C<=zt&&(!D||A===v)&&k.onComplete(k)}}),n||u.onLoop(u)}Sn(u,v=>{const k=bn((p-v._offset)*v._speed,12),C=v._fps<u._fps?v.requestTick(m):r;g+=nf(v,k,n,a,C),!v.completed&&b&&(b=!1)},f),!n&&g&&u.onRender(u),(b||f)&&u._currentTime>=u.duration&&(u.paused=!0,u.completed||(u.completed=!0,n||(u.onComplete(u),u._resolve(u))))}};/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Ix={},wE=(e,t,n)=>{if(n===Jt.TRANSFORM){const a=b1.get(e);return a||e}else if(n===Jt.CSS||n===Jt.ATTRIBUTE&&k1(t)&&e in t.style){const a=Ix[e];if(a)return a;{const r=e&&x1(e);return Ix[e]=r,r}}else return e},N1=(e,t=!1)=>{if(e._hasChildren)Sn(e,n=>N1(n,t),!0);else{const n=e;n.pause(),Sn(n,a=>{const r=a.property,s=a.target,u=a._tweenType,f=a._inlineValue,p=zc(f)||f===no;if(u===Jt.OBJECT)!t&&!p&&(s[r]=f);else if(s[Vc])if(u===Jt.ATTRIBUTE)t||(p?s.removeAttribute(r):s.setAttribute(r,f));else{const m=s.style;if(u===Jt.TRANSFORM){const g=s[If];p?delete g[r]:g[r]=f,a._renderTransforms&&(Object.keys(g).length?m.transform=C1(g):m.removeProperty("transform"))}else p?m.removeProperty(x1(r)):m[r]=f}s[Vc]&&n._tail===a&&n.targets.forEach(m=>{m.getAttribute&&m.getAttribute("style")===no&&m.removeAttribute("style")})})}return e};/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/class R1{constructor(t=0){this.deltaTime=0,this._currentTime=t,this._lastTickTime=t,this._startTime=t,this._lastTime=t,this._scheduledTime=0,this._frameDuration=to/m_,this._fps=m_,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(t){const n=this._frameDuration,a=+t,r=a<zt?zt:a,s=to/r;r>mf.frameRate&&(mf.frameRate=r),this._fps=r,this._frameDuration=s,this._scheduledTime+=s-n}get speed(){return this._speed}set speed(t){const n=+t;this._speed=n<zt?zt:n}requestTick(t){const n=this._scheduledTime;if(this._lastTickTime=t,t<n)return Ji.NONE;const a=this._frameDuration,r=t-n;return this._scheduledTime+=r<a?a:r,Ji.AUTO}computeDeltaTime(t){const n=t-this._lastTime;return this.deltaTime=n,this._lastTime=t,n}}/**
|
||
* Anime.js - animation - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Js={animation:null,update:Xi},jE=e=>{let t=Js.animation;return t||(t={duration:zt,computeDeltaTime:Xi,_offset:0,_delay:0,_head:null,_tail:null},Js.animation=t,Js.update=()=>{e.forEach(n=>{for(let a in n){const r=n[a],s=r._head;if(s){const u=s._valueType,f=u===ot.COMPLEX||u===ot.COLOR?Yn(s._fromNumbers):null;let p=s._fromNumber,m=r._tail;for(;m&&m!==s;){if(f)for(let g=0,b=m._numbers.length;g<b;g++)f[g]+=m._numbers[g];else p+=m._number;m=m._prevAdd}s._toNumber=p,s._toNumbers=f}}}),nf(t,1,1,0,Ji.FORCE)}),t};/**
|
||
* Anime.js - engine - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const D1=rr?requestAnimationFrame:setImmediate,CE=rr?cancelAnimationFrame:clearImmediate;class TE extends R1{constructor(t){super(t),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=mf,this.paused=!0,this.reqId=0}update(){const t=this._currentTime=io();if(this.requestTick(t)){this.computeDeltaTime(t);const n=this._speed,a=this._fps;let r=this._head;for(;r;){const s=r._next;r.paused?(Dc(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Ys(r,(t-r._startTime)*r._speed*n,0,0,r._fps<a?r.requestTick(t):Ji.AUTO),r=s}Js.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(io()),this.reqId=D1(M1)),this}pause(){if(this.reqId)return this.paused=!0,EE()}resume(){if(this.paused)return this.paused=!1,Sn(this,t=>t.resetTime()),this.wake()}get speed(){return this._speed*(qn.timeScale===1?1:to)}set speed(t){this._speed=t*qn.timeScale,Sn(this,n=>n.speed=n._speed)}get timeUnit(){return qn.timeScale===1?"ms":"s"}set timeUnit(t){const a=t==="s",r=a?.001:1;if(qn.timeScale!==r){qn.timeScale=r,qn.tickThreshold=200*r;const s=a?.001:to;this.defaults.duration*=s,this._speed*=s}}get precision(){return qn.precision}set precision(t){qn.precision=t}}const Kn=(()=>{const e=new TE(io());return rr&&(v1.engine=e,Gc.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(Gc.hidden?e.pause():e.resume())})),e})(),M1=()=>{Kn._head?(Kn.reqId=D1(M1),Kn.update()):Kn.reqId=0},EE=()=>(CE(Kn.reqId),Kn.reqId=0,Kn);/**
|
||
* Anime.js - animation - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const hf={_rep:new WeakMap,_add:new Map},pg=(e,t,n="_rep")=>{const a=hf[n];let r=a.get(e);return r||(r={},a.set(e,r)),r[t]?r[t]:r[t]={_head:null,_tail:null}},AE=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,af=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=zt,e._currentTime=zt},$1=(e,t)=>{const n=e._composition;if(n===Hn.replace){const a=e._absoluteStartTime;Xs(t,e,AE,"_prevRep","_nextRep");const r=e._prevRep;if(r){const s=r.parent,u=r._absoluteStartTime+r._changeDuration;if(e.parent.id!==s.id&&s.iterationCount>1&&u+(s.duration-s.iterationDuration)>a){af(r);let m=r._prevRep;for(;m&&m.parent.id===s.id;)af(m),m=m._prevRep}const f=a-e._delay;if(u>f){const m=r._startTime,g=u-(m+r._updateDuration),b=bn(f-g-m,12);r._changeDuration=b,r._currentTime=b,r._isOverlapped=1,b<zt&&af(r)}let p=!0;if(Sn(s,m=>{m._isOverlapped||(p=!1)}),p){const m=s.parent;if(m){let g=!0;Sn(m,b=>{b!==s&&Sn(b,v=>{v._isOverlapped||(g=!1)})}),g&&m.cancel()}else s.cancel()}}}else if(n===Hn.blend){const a=pg(e.target,e.property,"_add"),r=jE(hf._add);let s=a._head;s||(s={...e},s._composition=Hn.replace,s._updateDuration=zt,s._startTime=0,s._numbers=Yn(e._fromNumbers),s._number=0,s._next=null,s._prev=null,Xs(a,s),Xs(r,s));const u=e._toNumber;if(e._fromNumber=s._fromNumber-u,e._toNumber=0,e._numbers=Yn(e._fromNumbers),e._number=0,s._fromNumber=u,e._toNumbers){const f=Yn(e._toNumbers);f&&f.forEach((p,m)=>{e._fromNumbers[m]=s._fromNumbers[m]-p,e._toNumbers[m]=0}),s._fromNumbers=f}Xs(a,e,null,"_prevAdd","_nextAdd")}return e},NE=e=>{const t=e._composition;if(t!==Hn.none){const n=e.target,a=e.property,u=hf._rep.get(n)[a];if(Dc(u,e,"_prevRep","_nextRep"),t===Hn.blend){const f=hf._add,p=f.get(n);if(!p)return;const m=p[a],g=Js.animation;Dc(m,e,"_prevAdd","_nextAdd");const b=m._head;if(b&&b===m._tail){Dc(m,b,"_prevAdd","_nextAdd"),Dc(g,b);let v=!0;for(let k in p)if(p[k]._head){v=!1;break}v&&f.delete(n)}}}return e};/**
|
||
* Anime.js - timer - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Bx=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),h_=e=>(e._cancelled&&(e._hasChildren?Sn(e,h_):Sn(e,t=>{t._composition!==Hn.none&&$1(t,pg(t.target,t.property))}),e._cancelled=0),e);let qx=0;const RE=(e,t)=>e._priority>t._priority;class DE extends R1{constructor(t={},n=null,a=0){super(0),++qx;const{id:r,delay:s,duration:u,reversed:f,alternate:p,loop:m,loopDelay:g,autoplay:b,frameRate:v,playbackRate:k,priority:C,onComplete:D,onLoop:A,onPause:x,onBegin:T,onBeforeUpdate:N,onUpdate:F}=t,L=n?0:Kn._lastTickTime,B=n?n.defaults:qn.defaults,P=Kc(s)||ln(s)?B.delay:+s,K=Kc(u)||ln(u)?1/0:+u,se=Un(m,B.loop),I=Un(g,B.loopDelay);let q=se===!0||se===1/0||se<0?1/0:se+1,Z=0;n?Z=a:(Kn.reqId||Kn.requestTick(io()),Z=(Kn._lastTickTime-Kn._startTime)*qn.timeScale),this.id=ln(r)?qx:r,this.parent=n,this.duration=dg((K+I)*q-I)||zt,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=T||B.onBegin,this.onBeforeUpdate=N||B.onBeforeUpdate,this.onUpdate=F||B.onUpdate,this.onLoop=A||B.onLoop,this.onPause=x||B.onPause,this.onComplete=D||B.onComplete,this.iterationDuration=K,this.iterationCount=q,this._autoplay=n?!1:Un(b,B.autoplay),this._offset=Z,this._delay=P,this._loopDelay=I,this._iterationTime=0,this._currentIteration=0,this._resolve=Xi,this._running=!1,this._reversed=+Un(f,B.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Un(p,B.alternate),this._prev=null,this._next=null,this._lastTickTime=L,this._startTime=L,this._lastTime=L,this._fps=Un(v,B.frameRate),this._speed=Un(k,B.playbackRate),this._priority=+Un(C,1)}get cancelled(){return!!this._cancelled}set cancelled(t){t?this.cancel():this.reset(!0).play()}get currentTime(){return ii(bn(this._currentTime,qn.precision),-this._delay,this.duration)}set currentTime(t){const n=this.paused;this.pause().seek(+t),n||this.resume()}get iterationCurrentTime(){return ii(bn(this._iterationTime,qn.precision),0,this.iterationDuration)}set iterationCurrentTime(t){this.currentTime=this.iterationDuration*this._currentIteration+t}get progress(){return ii(bn(this._currentTime/this.duration,10),0,1)}set progress(t){this.currentTime=this.duration*t}get iterationProgress(){return ii(bn(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(t){const n=this.iterationDuration;this.currentTime=n*this._currentIteration+n*t}get currentIteration(){return this._currentIteration}set currentIteration(t){this.currentTime=this.iterationDuration*ii(+t,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(t){t?this.reverse():this.play()}get speed(){return super.speed}set speed(t){super.speed=t,this.resetTime()}reset(t=!1){return h_(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Ys(this,0,1,~~t,Ji.FORCE),Bx(this),this._hasChildren&&Sn(this,Bx),this}init(t=!1){this.fps=this._fps,this.speed=this._speed,!t&&this._hasChildren&&Ys(this,this.duration,1,~~t,Ji.FORCE),this.reset(t);const n=this._autoplay;return n===!0?this.resume():n&&!ln(n.linked)&&n.link(this),this}resetTime(){const t=1/(this._speed*Kn._speed);return this._startTime=io()-(this._currentTime+this._delay)*t,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=zt&&!this._hasChildren?Ys(this,zt,0,0,Ji.FORCE):(this._running||(Xs(Kn,this,RE),Kn._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Kn.wake()),this):this}restart(){return this.reset().resume()}seek(t,n=0,a=0){h_(this),this.completed=!1;const r=this.paused;return this.paused=!0,Ys(this,t+this._delay,~~n,~~a,Ji.AUTO),r?this:this.resume()}alternate(){const t=this._reversed,n=this.iterationCount,a=this.iterationDuration,r=n===1/0?_E(p_/a):n;return this._reversed=+(this._alternate&&!(r%2)?t:!t),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(a*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Sn(this,t=>t.cancel(),!0):Sn(this,NE),this._cancelled=1,this.pause()}stretch(t){const n=this.duration,a=Oc(t);if(n===a)return this;const r=t/n,s=t<=zt;return this.duration=s?zt:a,this.iterationDuration=s?zt:Oc(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Ys(this,0,1,0,Ji.AUTO);const t=this._autoplay;return t&&t.linked&&t.linked===this&&t.revert(),this.cancel()}complete(t=0){return this.seek(this.duration,t).cancel()}then(t=Xi){const n=this.then,a=()=>{this.then=null,t(this),this.then=n,this._resolve=Xi};return new Promise(r=>(this._resolve=()=>r(a()),this.completed&&this._resolve(),this))}}/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/function Ux(e){const t=Yc(e)?oE.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function ME(e){if(zc(e))return[];if(!rr)return ao(e)&&e.flat(1/0)||[e];if(ao(e)){const n=e.flat(1/0),a=[];for(let r=0,s=n.length;r<s;r++){const u=n[r];if(!zc(u)){const f=Ux(u);if(f)for(let p=0,m=f.length;p<m;p++){const g=f[p];if(!zc(g)){let b=!1;for(let v=0,k=a.length;v<k;v++)if(a[v]===g){b=!0;break}b||a.push(g)}}else{let p=!1;for(let m=0,g=a.length;m<g;m++)if(a[m]===u){p=!0;break}p||a.push(u)}}}return a}const t=Ux(e);return t?Array.from(t):[e]}function $E(e){const t=ME(e),n=t.length;if(n)for(let a=0;a<n;a++){const r=t[a];if(!r[Mx]){r[Mx]=!0;const s=k1(r);(r.nodeType||s)&&(r[Vc]=!0,r[y1]=s,r[If]={})}}return t}/**
|
||
* Anime.js - core - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Ch={deg:1,rad:180/ug,turn:360},Hx={},Px=(e,t,n,a=!1)=>{const r=t.u,s=t.n;if(t.t===ot.UNIT&&r===n)return t;const u=s+r+n,f=Hx[u];if(!ln(f)&&!a)t.n=f;else{let p;if(r in Ch)p=s*Ch[r]/Ch[n];else{const g=e.cloneNode(),b=e.parentNode,v=b&&b!==Gc?b:Gc.body;v.appendChild(g);const k=g.style;k.width=100+r;const C=g.offsetWidth||100;k.width=100+n;const D=g.offsetWidth||100,A=C/D;v.removeChild(g),p=A*s}t.n=p,Hx[u]=p}return t.t,ot.UNIT,t.u=n,t};/**
|
||
* Anime.js - easings - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const ir=e=>e;/**
|
||
* Anime.js - easings - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const xc=(e=1.68)=>t=>Vs(t,+e),__={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},zE=ug/2,Fx=ug*2,Gx={[no]:xc,Quad:xc(2),Cubic:xc(3),Quart:xc(4),Quint:xc(5),Sine:e=>1-hE(e*zE),Circ:e=>1-pE(1-e*e),Expo:e=>e?Vs(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=Vs(2,--n))-1)/11;);return 1/Vs(4,3-n)-7.5625*Vs((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const n=ii(+e,1,10),a=ii(+t,zt,2),r=a/Fx*gE(1/n),s=Fx/a;return u=>u===0||u===1?u:-n*Vs(2,-10*(1-u))*mE((1-u-r)*s)}},Th=(()=>{const e={linear:ir,none:ir};for(let t in __)for(let n in Gx){const a=Gx[n],r=__[t];e[t+n]=n===no||n==="Back"||n==="Elastic"?(s,u)=>r(a(s,u)):r(a)}return e})(),$d={linear:ir,none:ir},OE=e=>{if($d[e])return $d[e];if(e.indexOf("(")<=-1){const n=__[e]||e.includes("Back")||e.includes("Elastic")?Th[e]():Th[e];return n?$d[e]=n:ir}else{const t=e.slice(0,-1).split("("),n=Th[t[0]];return n?$d[e]=n(...t[1].split(",")):ir}},Vx=["steps(","irregular(","linear(","cubicBezier("],Yx=e=>{if(Yc(e)){for(let n=0,a=Vx.length;n<a;n++)if(nr(e,Vx[n]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),ir}return Kc(e)?e:Yc(e)?OE(e):ir};/**
|
||
* Anime.js - animation - ESM
|
||
* @version v4.4.1
|
||
* @license MIT
|
||
* @copyright 2026 - Julian Garnier
|
||
*/const Be=fg(),Qe=fg(),Ls={},zd={func:null},Eh={func:null},Od=[null],Is=[null,null],Ld={to:null};let LE=0,Kx=0,Xl,Ea;const IE=(e,t)=>{const n={};if(ao(e)){const a=[].concat(...e.map(r=>Object.keys(r))).filter(tf);for(let r=0,s=a.length;r<s;r++){const u=a[r],f=e.map(p=>{const m={};for(let g in p){const b=p[g];tf(g)?g===u&&(m.to=b):m[g]=b}return m});n[u]=f}}else{const a=Un(t.duration,qn.defaults.duration);Object.keys(e).map(s=>({o:parseFloat(s)/100,p:e[s]})).sort((s,u)=>s.o-u.o).forEach(s=>{const u=s.o,f=s.p;for(let p in f)if(tf(p)){let m=n[p];m||(m=n[p]=[]);const g=u*a;let b=m.length,v=m[b-1];const k={to:f[p]};let C=0;for(let D=0;D<b;D++)C+=m[D].duration;b===1&&(k.from=v.to),f.ease&&(k.ease=f.ease),k.duration=g-(b?C:0),m.push(k)}return s});for(let s in n){const u=n[s];let f;for(let p=0,m=u.length;p<m;p++){const g=u[p],b=g.ease;g.ease=f||void 0,f=b}u[0].duration||u.shift()}}return n};class BE extends DE{constructor(t,n,a,r,s=!1,u=0,f){super(n,a,r),++Kx;const p=$E(t),m=p.length,g=n.keyframes,b=g?yE(IE(g,n),n):n,{id:v,delay:k,duration:C,ease:D,playbackEase:A,modifier:x,composition:T,onRender:N}=b,F=a?a.defaults:qn.defaults,L=Un(D,F.ease),B=Un(A,F.playbackEase),P=B?Yx(B):null,K=!ln(L.ease),se=K?L.ease:Un(D,P?"linear":F.ease),I=K?L.settlingDuration:Un(C,F.duration),q=Un(k,F.delay),Z=x||F.modifier,Q=ln(T)&&m>=to?Hn.none:ln(T)?F.composition:T,R=this._offset+(a?a._offset:0);K&&(L.parent=this);let U=NaN,O=NaN,G=0,ae=0;for(let ie=0;ie<m;ie++){const z=p[ie],M=u||ie,J=f||p;let $=NaN,_e=NaN;for(let we in b)if(tf(we)){const be=T1(z,we),Ee=wE(we,z,be);let Ie=b[we];const ue=ao(Ie);if(s&&!ue&&(Is[0]=Ie,Is[1]=Ie,Ie=Is),ue){const vt=Ie.length,Ue=!Sh(Ie[0]);vt===2&&Ue?(Ld.to=Ie,Od[0]=Ld,Xl=Od):vt>2&&Ue?(Xl=[],Ie.forEach((ft,wt)=>{wt?wt===1?(Is[1]=ft,Xl.push(Is)):Xl.push(ft):Is[0]=ft})):Xl=Ie}else Od[0]=Ie,Xl=Od;let me=null,Xe=null,it=NaN,bt=0,Lt=0;for(let vt=Xl.length;Lt<vt;Lt++){const Ue=Xl[Lt];Sh(Ue)?Ea=Ue:(Ld.to=Ue,Ea=Ld),zd.func=null,Eh.func=null;const ft=sl(Un(Ea.composition,Q),z,M,J,null,null),wt=cE(ft)?ft:Hn[ft];!me&&wt!==Hn.none&&(me=pg(z,Ee));const at=me?me._tail:null,qe=a&&at&&at.parent.parent===a?at:Xe,xt=sl(Ea.to,z,M,J,zd,qe);let lt;Sh(xt)&&!ln(xt.to)?(Ea=xt,lt=xt.to):lt=xt;const ia=sl(Ea.from,z,M,J,null,qe),It=Ea.ease||se,Oa=sl(It,z,M,J,null,qe),le=Kc(Oa)||Yc(Oa)?Oa:It,ge=!ln(le)&&!ln(le.ease),ze=ge?le.ease:le,He=ge?le.settlingDuration:sl(Un(Ea.duration,vt>1?sl(I,z,M,J,null,qe)/vt:I),z,M,J,null,qe),Pe=sl(Un(Ea.delay,Lt?0:q),z,M,J,null,qe),Gt=Ea.modifier||Z,fn=!ln(ia),rn=!ln(lt),kt=ao(lt),wn=kt||fn&&rn,pt=Xe?bt+Pe:Pe,Zn=bn(R+pt,12);!ae&&(fn||kt)&&(ae=1);let Bt=Xe;if(wt!==Hn.none){let Ze=me._head;for(;Ze&&!Ze._isOverridden&&Ze._absoluteStartTime<=Zn;)if(Bt=Ze,Ze=Ze._nextRep,Ze&&Ze._absoluteStartTime>=Zn)for(;Ze;)af(Ze),Ze=Ze._nextRep}if(wn){ua(kt?sl(lt[0],z,M,J,Eh,qe):ia,Be),ua(kt?sl(lt[1],z,M,J,zd,qe):lt,Qe);const Ze=vc(z,Ee,be,Ls);Be.t===ot.NUMBER&&(Bt?Bt._valueType===ot.UNIT&&(Be.t=ot.UNIT,Be.u=Bt._unit):(ua(Ze,$r),$r.t===ot.UNIT&&(Be.t=ot.UNIT,Be.u=$r.u)))}else rn?ua(lt,Qe):Xe?Lx(Xe,Qe):ua(a&&Bt&&Bt.parent.parent===a?Bt._value:vc(z,Ee,be,Ls),Qe),fn?ua(ia,Be):Xe?Lx(Xe,Be):ua(a&&Bt&&Bt.parent.parent===a?Bt._value:vc(z,Ee,be,Ls),Be);if(Be.o&&(Be.n=jh(Bt?Bt._toNumber:ua(vc(z,Ee,be,Ls),$r).n,Be.n,Be.o)),Qe.o&&(Qe.n=jh(Be.n,Qe.n,Qe.o)),Be.t!==Qe.t){if(Be.t===ot.COMPLEX||Qe.t===ot.COMPLEX){const Ze=Be.t===ot.COMPLEX?Be:Qe,ve=Be.t===ot.COMPLEX?Qe:Be;ve.t=ot.COMPLEX,ve.s=Yn(Ze.s),ve.d=Ze.d.map(()=>ve.n)}else if(Be.t===ot.UNIT||Qe.t===ot.UNIT){const Ze=Be.t===ot.UNIT?Be:Qe,ve=Be.t===ot.UNIT?Qe:Be;ve.t=ot.UNIT,ve.u=Ze.u}else if(Be.t===ot.COLOR||Qe.t===ot.COLOR){const Ze=Be.t===ot.COLOR?Be:Qe,ve=Be.t===ot.COLOR?Qe:Be;ve.t=ot.COLOR,ve.s=Ze.s,ve.d=[0,0,0,1]}}if(Be.u!==Qe.u){let Ze=Qe.u?Be:Qe;Ze=Px(z,Ze,Qe.u?Qe.u:Be.u,!1)}if(Qe.d&&Be.d&&Qe.d.length!==Be.d.length){const Ze=Be.d.length>Qe.d.length?Be:Qe,ve=Ze===Be?Qe:Be;ve.d=Ze.d.map((li,mr)=>ln(ve.d[mr])?0:ve.d[mr]),ve.s=Yn(Ze.s)}const yl=bn(+He||zt,12);let La=Ls[Ee];zc(La)||(Ls[Ee]=null);const Vt={parent:this,id:LE++,property:Ee,target:z,_value:null,_toFunc:zd.func,_fromFunc:Eh.func,_ease:Yx(ze),_fromNumbers:Yn(Be.d),_toNumbers:Yn(Qe.d),_strings:Yn(Qe.s),_fromNumber:Be.n,_toNumber:Qe.n,_numbers:Yn(Be.d),_number:Be.n,_unit:Qe.u,_modifier:Gt,_currentTime:0,_startTime:pt,_delay:+Pe,_updateDuration:yl,_changeDuration:yl,_absoluteStartTime:Zn,_tweenType:be,_valueType:Qe.t,_composition:wt,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:La,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};wt!==Hn.none&&$1(Vt,me);const ya=Vt._valueType;ya===ot.COMPLEX?Vt._value=A1(Vt,1,-1):ya===ot.COLOR?Vt._value=E1(Vt,1,-1):ya===ot.UNIT?Vt._value=`${Gt(Vt._toNumber)}${Vt._unit}`:Vt._value=Gt(Vt._toNumber),isNaN(it)&&(it=Vt._startTime),bt=bn(pt+yl,12),Xe=Vt,G++,Xs(this,Vt)}(isNaN(O)||it<O)&&(O=it),(isNaN(U)||bt>U)&&(U=bt),be===Jt.TRANSFORM&&($=G-Lt,_e=G)}if(!isNaN($)){let we=0;Sn(this,be=>{we>=$&&we<_e&&(be._renderTransforms=1,be._composition===Hn.blend&&Sn(Js.animation,Ee=>{Ee.id===be.id&&(Ee._renderTransforms=1)})),we++})}}m||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),O?(Sn(this,ie=>{ie._startTime-ie._delay||(ie._delay-=O),ie._startTime-=O}),U-=O):O=0,U||(U=zt,this.iterationCount=0),this.targets=p,this.id=ln(v)?Kx:v,this.duration=U===zt?zt:dg((U+this._loopDelay)*this.iterationCount-this._loopDelay)||zt,this.onRender=N||F.onRender,this._ease=P,this._delay=O,this.iterationDuration=U,!this._autoplay&&ae&&this.onRender(this)}stretch(t){const n=this.duration;if(n===Oc(t))return this;const a=t/n;return Sn(this,r=>{r._updateDuration=Oc(r._updateDuration*a),r._changeDuration=Oc(r._changeDuration*a),r._currentTime*=a,r._startTime*=a,r._absoluteStartTime*=a}),super.stretch(t)}refresh(){return Sn(this,t=>{const n=t._toFunc,a=t._fromFunc;(n||a)&&(a?(ua(a(),Be),Be.u!==t._unit&&t.target[Vc]&&Px(t.target,Be,t._unit,!0),t._fromNumbers=Yn(Be.d),t._fromNumber=Be.n):n&&(ua(vc(t.target,t.property,t._tweenType),$r),t._fromNumbers=Yn($r.d),t._fromNumber=$r.n),n&&(ua(n(),Qe),t._toNumbers=Yn(Qe.d),t._strings=Yn(Qe.s),t._toNumber=Qe.o?jh(t._fromNumber,Qe.n,Qe.o):Qe.n))}),this.duration===zt&&this.restart(),this}revert(){return super.revert(),N1(this)}then(t){return super.then(t)}}const g_=(e,t)=>new BE(e,t,null,0,!1).init();/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),z1=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var UE={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"};/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const HE=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:s,iconNode:u,...f},p)=>w.createElement("svg",{ref:p,...UE,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:z1("lucide",r),...f},[...u.map(([m,g])=>w.createElement(m,g)),...Array.isArray(s)?s:[s]]));/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nt=(e,t)=>{const n=w.forwardRef(({className:a,...r},s)=>w.createElement(HE,{ref:s,iconNode:t,className:z1(`lucide-${qE(e)}`,a),...r}));return n.displayName=`${e}`,n};/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const PE=nt("Archive",[["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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FE=nt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qx=nt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GE=nt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xx=nt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zx=nt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mg=nt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const VE=nt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Jx=nt("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YE=nt("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const KE=nt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lo=nt("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wx=nt("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const QE=nt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const y_=nt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const b_=nt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const O1=nt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const L1=nt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const XE=nt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const I1=nt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const B1=nt("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ZE=nt("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const v_=nt("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const x_=nt("MonitorCheck",[["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const k_=nt("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JE=nt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ml=nt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const WE=nt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fl=nt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hg=nt("Send",[["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"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const eA=nt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tA=nt("ShieldAlert",[["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:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _g=nt("ShieldCheck",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const q1=nt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const U1=nt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nA=nt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
||
* @license lucide-react v0.468.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gr=nt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),iA=".",gg=(()=>{var t;return((t=window.__QIMINGCLAW_DIGITAL_API_BASE__)==null?void 0:t.replace(/\/+$/,""))??""})(),H1=()=>"",P1="zeroclaw_token";function yg(){try{return localStorage.getItem(P1)}catch{return null}}function aA(){try{localStorage.removeItem(P1)}catch{}}const F1="qimingclaw:digital-employee-adapter-state",lA="18:00",rA=["info","warn","error","action"],sA=["user_message","need_input","need_approval","task_progress","task_failed","task_finished","confirmation_pending","confirmation_resolved"],G1=["comment","delegate","mark_timeout","mark_risk","clear_risk","decision"],oA=["normal","medium","high","critical"],cA=[{skill_id:"qimingclaw-acp-session",name:"ACP 会话执行",version:"1.0.0",enabled:!0,description:"通过 qimingclaw 的 ACP 引擎创建会话、执行任务并跟踪结果。",category:"执行",capability_level:"core"},{skill_id:"qimingclaw-mcp-tools",name:"MCP 工具编排",version:"1.0.0",enabled:!0,description:"读取已配置 MCP 服务与工具,作为数字员工的工具能力池。",category:"工具",capability_level:"core"},{skill_id:"qimingclaw-computer-control",name:"客户端电脑控制",version:"1.0.0",enabled:!0,description:"承接 /computer/chat 执行入口,面向远程任务和本地自动化操作。",category:"桌面",capability_level:"specialized"},{skill_id:"qimingclaw-artifact-report",name:"产物与日报整理",version:"1.0.0",enabled:!0,description:"把执行记录、关键产物和异常汇总成数字员工日报。",category:"汇报",capability_level:"standard"}],uA=[{plan_id:"qimingclaw-client-readiness",title:"客户端运行状态巡检",objective:"确认 qimingclaw 客户端、Agent、MCP 和远程接入能力是否处于可执行状态。",status:"running",created_at:ul(9,0),steps:[{step_id:"agent-status",title:"检查 Agent 引擎状态",depends_on:[],preferred_skills:["qimingclaw-acp-session"],tasks:[{task_id:"task-agent-status",title:"读取 Agent 服务状态",status:"running"}]},{step_id:"mcp-status",title:"检查 MCP 工具能力",depends_on:["agent-status"],preferred_skills:["qimingclaw-mcp-tools"],tasks:[{task_id:"task-mcp-status",title:"同步 MCP 工具列表",status:"pending"}]}]},{plan_id:"qimingclaw-remote-task-ingress",title:"远程任务接入准备",objective:"检查 lanproxy、computer server 和文件服务,为后端下发数字员工任务做准备。",status:"pending",created_at:ul(9,30),steps:[{step_id:"computer-server",title:"确认 /computer/chat 执行入口",depends_on:[],preferred_skills:["qimingclaw-computer-control"],tasks:[{task_id:"task-computer-server",title:"检查电脑控制服务",status:"pending"}]},{step_id:"file-artifact",title:"准备产物回传目录",depends_on:["computer-server"],preferred_skills:["qimingclaw-artifact-report"],tasks:[{task_id:"task-file-artifact",title:"整理执行产物通道",status:"pending"}]}]},{plan_id:"qimingclaw-daily-report",title:"数字员工日报生成",objective:"汇总今日执行记录、服务状态和待介入事项,生成面向业务的日报。",status:"pending",created_at:ul(17,30),steps:[{step_id:"collect-events",title:"汇总运行事件",depends_on:[],preferred_skills:["qimingclaw-artifact-report"],tasks:[{task_id:"task-collect-events",title:"整理今日运行明细",status:"pending"}]},{step_id:"write-report",title:"生成日报摘要",depends_on:["collect-events"],preferred_skills:["qimingclaw-artifact-report"],tasks:[{task_id:"task-write-report",title:"生成数字员工日报",status:"pending"}]}]}],_f={"qimingclaw-client-readiness":{expression:"0 9 * * *",nextRun:ul(9,0),scheduleText:"已定时 09:00 执行"},"qimingclaw-remote-task-ingress":{expression:"30 9 * * *",nextRun:ul(9,30),scheduleText:"已定时 09:30 执行"},"qimingclaw-daily-report":{expression:"0 18 * * *",nextRun:ul(18,0),scheduleText:"已定时 18:00 执行"}},yt="qimingclaw-runtime-projection";function dA(){return window.__QIMINGCLAW_EMBEDDED_DIGITAL__===!0}async function fA(e,t={}){var I,q,Z;if(!dA())return;const n=new URL(e,window.location.origin),a=(t.method||"GET").toUpperCase(),r=n.pathname;if(a==="GET"&&r==="/api/digital-employee/workday")return FS(n.searchParams.get("date")||nu(),await ke());if(a==="POST"&&r==="/api/digital-employee/workday/actions")return await HR(ti(t.body),await ke());const s=r.match(/^\/api\/(?:digital-employee\/)?managed-services\/([^/]+)\/restart$/);if(a==="POST"&&s)return await iS(decodeURIComponent(s[1]||""),Ln(t.body));const u=r.match(/^\/api\/digital-employee\/daily-reports\/([^/]+)$/);if(a==="GET"&&u){const Q=decodeURIComponent(u[1]||"");return{item:C_(await ke()).find(U=>h(U.report_id)===Q||h(U.artifact_id)===Q)??null,source:yt}}if(a==="GET"&&r==="/api/digital-employee/daily-reports"){const Q=KN(C_(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="POST"&&r==="/api/digital-employee/daily-reports/delivery")return await FR(ti(t.body));if(a==="GET"&&r==="/api/digital-employee/skill-call-audits"){const Q=UN(kS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/memory-governance"){const Q=RA(NA(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="POST"&&r==="/api/digital-employee/memory-governance/status/batch")return await DA(Ln(t.body),await ke());if(a==="GET"&&r==="/api/digital-employee/skill-audit-workbench"){const Q=NN(AN(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/ops-workbench"){const Q=$N(SS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="POST"&&r==="/api/digital-employee/ops-workbench/actions/batch")return await LN(Ln(t.body),await ke());if(a==="GET"&&r==="/api/digital-employee/notifications/workbench"){const Q=zN(DN(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="POST"&&r==="/api/digital-employee/notifications/actions/batch")return await IN(Ln(t.body),await ke());if(a==="GET"&&r==="/api/digital-employee/daily-reports/workbench"){const Q=ON(MN(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/artifact-access-events"){const Q=HN(jS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}const f=r.match(/^\/api\/(?:digital-employee\/artifacts|artifact)\/([^/]+)\/access$/);if(a==="POST"&&f){const Q=decodeURIComponent(f[1]||"");return await BA(Q,Ln(t.body))}if(a==="POST"&&r==="/api/digital-employee/artifacts/retention/batch")return await UA(Ln(t.body),await ke());const p=r.match(/^\/api\/digital-employee\/artifacts\/([^/]+)\/retention$/);if(a==="POST"&&p){const Q=decodeURIComponent(p[1]||"");return await aS(Q,Ln(t.body),await ke())}const m=r.match(/^\/api\/digital-employee\/artifacts\/([^/]+)\/cleanup$/);if(a==="POST"&&m){const Q=decodeURIComponent(m[1]||"");return await HA(Q,Ln(t.body),await ke())}const g=r.match(/^\/api\/digital-employee\/artifacts\/([^/]+)\/versions$/);if(a==="GET"&&g){const Q=decodeURIComponent(g[1]||""),R=await ke();return{items:yS(R,Q),source:yt}}const b=r.match(/^\/api\/digital-employee\/artifacts\/([^/]+)$/);if(a==="GET"&&b){const Q=decodeURIComponent(b[1]||""),R=await ke();return{item:jg(R,Q),source:yt}}const v=r.match(/^\/api\/digital-employee\/plans\/([^/]+)$/);if(a==="GET"&&v){const Q=decodeURIComponent(v[1]||"");return{item:_S(await ke()).find(U=>h(U.plan_id)===Q||h(U.remote_id)===Q)??null,source:yt}}const k=r.match(/^\/api\/digital-employee\/approvals\/([^/]+)\/actions$/);if(a==="POST"&&k){const Q=decodeURIComponent(k[1]||"");return await PA(Q,Ln(t.body),await ke())}const C=r.match(/^\/api\/approval\/([^/]+)\/conflict\/resolve$/);if(a==="POST"&&C){const Q=decodeURIComponent(C[1]||"");return await lS(Q,Ln(t.body),await ke())}if(a==="POST"&&r==="/api/approval/conflicts/resolve/batch")return await FA(Ln(t.body),await ke());if(a==="GET"&&r==="/api/approval/subscriptions")return Sf(Ma(await ke()));if(a==="PATCH"&&r==="/api/approval/subscriptions")return await rR(ti(t.body),await ke());if(a==="GET"&&r==="/api/plan-step/dispatch-policy")return ar(Ma(await ke()));if(a==="GET"&&r==="/api/risk-approval/policy")return ro(Ma(await ke()));if(a==="PATCH"&&r==="/api/risk-approval/policy")return await oR(ti(t.body),await ke());if(a==="POST"&&r==="/api/plan-step/dispatch-policy/pull")return await IS(await ke());if(a==="PATCH"&&r==="/api/plan-step/dispatch-policy")return await sR(ti(t.body),await ke());if(a==="GET"&&r==="/api/digital-employee/plan-steps"){const Q=w_(Gf(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/plan-step-graph"){const Q=w_(dS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/approval-history"){const Q=xS(vS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}if(a==="GET"&&r==="/api/digital-employee/artifact-groups"){const Q=ga(gS(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}const D=r.match(/^\/api\/digital-employee\/(plans|plan-steps|plan-step-graph|tasks|runs|events|artifacts|artifact-groups|approvals|approval-history|route-decisions|notifications|audits)$/);if(a==="GET"&&D)return uN(D[1],await ke(),n.searchParams);if(a==="GET"&&r==="/api/route-decisions")return await WR(Number(n.searchParams.get("limit"))||80);if(a==="GET"&&r==="/api/route-decisions/interventions")return await Kf(Number(n.searchParams.get("limit"))||80);if(a==="POST"&&r==="/api/route-decisions/interventions/batch")return await eD(Ln(t.body),await ke());if(a==="GET"&&r==="/api/digital-employee/interventions/workbench"){const Q=gN(_N(await ke()),n.searchParams);return{...mi(Q,n.searchParams),source:yt}}const A=r.match(/^\/api\/route-decisions\/([^/]+)\/intervention$/);if(a==="POST"&&A)return await VS(decodeURIComponent(A[1]||""),ti(t.body),await ke());if(a==="POST"&&r==="/api/ingress/route")return await aD(ti(t.body),await ke());if(a==="POST"&&r==="/api/governance/command")return await fr(ti(t.body),await ke());if(a==="GET"&&r==="/api/scheduler/jobs")return{jobs:bf(await ke())};if(a==="GET"&&r==="/api/cron")return{jobs:bf(await ke())};if(a==="POST"&&r==="/api/cron")return await $A(ti(t.body),await ke());if(a==="GET"&&r==="/api/cron/settings")return await jA();if(a==="PATCH"&&r==="/api/cron/settings"){const Q=ti(t.body);return await CA(Q)}if(a==="POST"&&r==="/api/cron/check"){const Q=await((Z=(q=(I=window.QimingClawBridge)==null?void 0:I.digital)==null?void 0:q.runSchedulerCheck)==null?void 0:Z.call(q));return{ok:!0,activated:(Q==null?void 0:Q.activated)??0,...Q}}const x=r.match(/^\/api\/cron\/([^/]+)\/runs$/);if(a==="GET"&&x)return{runs:await OA(decodeURIComponent(x[1]||""),Number(n.searchParams.get("limit"))||20)};const T=r.match(/^\/api\/cron\/([^/]+)$/);if((a==="PATCH"||a==="DELETE")&&T){const Q=decodeURIComponent(T[1]||"");if(a==="DELETE"){await W1("delete_schedule",Q,{},await ke());return}return await zA(Q,ti(t.body),await ke())}if(a==="GET"&&r==="/api/debug/plans")return{plans:Rg(n.searchParams.get("q"),await ke())};if(a==="GET"&&r==="/api/debug/tasks"){const Q=n.searchParams.get("plan_id");return po(Q,await ke())}if(a==="GET"&&r==="/api/debug/store")return iN(await ke());if(a==="GET"&&r==="/api/dashboard")return aN(await ke());if((a==="GET"||a==="POST")&&r==="/api/doctor")return Pf(await ke());if(a==="GET"&&r==="/api/cost")return{cost:uS(await ke())};if(a==="GET"&&r==="/api/audit")return{events:kg(await ke(),n.searchParams)};if(a==="GET"&&r==="/api/artifact")return{artifacts:Yr(await ke())};const N=r.match(/^\/api\/approval\/([^/]+)\/timeline$/);if(a==="GET"&&N)return NS(decodeURIComponent(N[1]||""),await ke());if(a==="GET"&&r==="/api/notifications")return aR(n.searchParams.get("status"),await ke());if(a==="GET"&&r==="/api/notifications/preferences")return oo(Ma(await ke()));if(a==="PATCH"&&r==="/api/notifications/preferences")return await lR(ti(t.body),await ke());if(a==="POST"&&r==="/api/notifications/updates/pull")return await Q1();if(a==="POST"&&r==="/api/digital-employee/admin/actions/pull")return await bA();if(a==="POST"&&r==="/api/notifications/desktop")return await vA(Ln(t.body));if(a==="GET"&&r==="/api/notifications/desktop/status")return await xA();if(a==="POST"&&r==="/api/notifications/desktop/settings/open")return await X1();if(a==="GET"&&r==="/api/notifications/unread-count"){const Q=await ke();return{count:Yf(Q,Ma(Q)).filter(R=>R.status==="unread").length}}const F=r.match(/^\/api\/notifications\/([^/]+)\/(read|dismiss|reply)$/);if(a==="POST"&&F)return await BS(decodeURIComponent(F[1]||""),F[2],Ln(t.body),await ke());if(a==="GET"&&r==="/api/memory")return{entries:await TA(n.searchParams.get("query"),n.searchParams.get("category"))};if(a==="POST"&&r==="/api/memory")return await EA(ti(t.body));const L=r.match(/^\/api\/memory\/([^/]+)$/);if(a==="DELETE"&&L){await AA(decodeURIComponent(L[1]||""));return}if(a==="GET"&&r.startsWith("/api/debug/plan/")&&r.endsWith("/flow"))return QS(decodeURIComponent(r.split("/")[4]||""),await ke());if(a==="GET"&&r.startsWith("/api/debug/task/")&&r.endsWith("/flow"))return yD(decodeURIComponent(r.split("/")[4]||""),await ke());const B=r.match(/^\/api\/digital-employee\/plans\/([^/]+)\/dispatch-ready-steps$/);if(a==="POST"&&B)return await bD(decodeURIComponent(B[1]||""),await ke());if(a==="POST"&&r.startsWith("/api/debug/plan/")&&r.endsWith("/dispatch"))return await XS(decodeURIComponent(r.split("/")[4]||""),await ke());const P=r.match(/^\/api\/debug\/plan\/([^/]+)\/([^/]+)$/);if(a==="POST"&&P)return await ok(decodeURIComponent(P[1]||""),decodeURIComponent(P[2]||""),await ke(),Ln(t.body));const K=r.match(/^\/api\/plan\/([^/]+)\/submit$/);if(a==="POST"&&K)return await ok(decodeURIComponent(K[1]||""),"submit",await ke(),Ln(t.body));if(a==="GET"&&r.startsWith("/api/plan/")&&r.endsWith("/revisions"))return JR(decodeURIComponent(r.split("/")[3]||""),await ke());const se=r.match(/^\/api\/task\/([^/]+)\/([^/]+)$/);if(a==="POST"&&se)return await QR(decodeURIComponent(se[1]||""),decodeURIComponent(se[2]||""),await ke(),Ln(t.body));if(a==="GET"&&r.startsWith("/api/plan/")&&r.endsWith("/messages"))return{messages:vD(decodeURIComponent(r.split("/")[3]||""),await ke())};if(a==="GET"&&r==="/api/skill")return{skills:await hA()};if(a==="POST"&&r==="/api/skill/policies/pull")return await gA();if(a==="POST"&&r==="/api/risk-approval/policy/pull")return await Y1();if(a==="POST"&&r==="/api/route-decision/policy/pull")return await K1();if(a==="POST"&&r==="/api/approval/updates/pull")return await yA();if(a==="POST"&&r.startsWith("/api/skill/")&&r.endsWith("/enabled")){const Q=decodeURIComponent(r.split("/")[3]||""),R=ti(t.body);return await _A(Q,R.enabled??!0)}}function V1(){return{selectedDutyIdsByDate:{},confirmedDates:{},reportScheduleTime:lA,reportGeneratedAtByDate:{},decisionResultsByDate:{},notificationStateById:{},notificationPreferences:MS(),approvalSubscriptionPreferences:$S(),planStepDispatchPolicy:zS(),riskApprovalPolicy:OS(),routeDecisionPolicy:kf(),opsWorkbenchStateById:{},dailyReportWorkbenchStateById:{},consoleRole:"sales",rolePreferences:{},profile:{name:"飞天数字员工",company:"qimingclaw 客户端",position:"客户端任务执行员",currentStatus:"working"}}}function dn(){try{const e=window.localStorage.getItem(F1);return sr(e?JSON.parse(e):{})}catch{return V1()}}function sr(e){return{...V1(),...e,notificationPreferences:oo(e),approvalSubscriptionPreferences:Sf(e),planStepDispatchPolicy:ar(e),riskApprovalPolicy:ro(e),routeDecisionPolicy:so(e),memoryGovernanceById:e.memoryGovernanceById??{},opsWorkbenchStateById:e.opsWorkbenchStateById??{},dailyReportWorkbenchStateById:e.dailyReportWorkbenchStateById??{}}}function pA(e){window.localStorage.setItem(F1,JSON.stringify(e))}async function ke(){var e,t,n,a,r,s,u,f,p,m,g,b;try{const v=await((n=(t=(e=window.QimingClawBridge)==null?void 0:e.digital)==null?void 0:t.getSnapshot)==null?void 0:n.call(t))??null;if(!v)return null;const[k,C,D,A]=await Promise.all([((s=(r=(a=window.QimingClawBridge)==null?void 0:a.digital)==null?void 0:r.getSyncStatus)==null?void 0:s.call(r).catch(()=>null))??null,((p=(f=(u=window.QimingClawBridge)==null?void 0:u.digital)==null?void 0:f.getRuntimeRecords)==null?void 0:p.call(f).catch(()=>null))??null,bi(),((b=(g=(m=window.QimingClawBridge)==null?void 0:m.digital)==null?void 0:g.getPlanTemplates)==null?void 0:b.call(g).catch(()=>null))??null]);return{...v,sync:k,runtime:C,uiState:D,planTemplates:(A==null?void 0:A.templates)??[]}}catch{return null}}async function bi(){var e,t,n;try{return await((n=(t=(e=window.QimingClawBridge)==null?void 0:e.digital)==null?void 0:t.getUiState)==null?void 0:n.call(t))??null}catch{return null}}async function mA(){var e,t,n;try{const a=await((n=(t=(e=window.QimingClawBridge)==null?void 0:e.digital)==null?void 0:t.getSkillCapabilities)==null?void 0:n.call(t))??null;return Array.isArray(a==null?void 0:a.skills)?a.skills:[]}catch{return[]}}async function hA(){const e=await mA();return wA([...e,...cA])}async function _A(e,t){var a;const n=(a=window.QimingClawBridge)==null?void 0:a.digital;if(!(n!=null&&n.setSkillEnabled))return{ok:!1,skill_id:e,enabled:t,error:"qimingclaw_bridge_unavailable"};try{const r=await n.setSkillEnabled(e,t);return{ok:(r==null?void 0:r.ok)!==!1,skill_id:(r==null?void 0:r.skill_id)??e,enabled:(r==null?void 0:r.enabled)??t,...r!=null&&r.error?{error:r.error}:{}}}catch(r){return{ok:!1,skill_id:e,enabled:t,error:r instanceof Error?r.message:String(r)}}}async function gA(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.pullSkillPolicies))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const n=await e.pullSkillPolicies();return{ok:(n==null?void 0:n.ok)!==!1,...n!=null&&n.skipped?{skipped:!0}:{},...n!=null&&n.error?{error:n.error}:{}}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function Y1(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.pullRiskApprovalPolicy))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const n=await e.pullRiskApprovalPolicy();return{ok:(n==null?void 0:n.ok)!==!1,...n!=null&&n.skipped?{skipped:!0}:{},...n!=null&&n.error?{error:n.error}:{}}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function K1(){var n;const e=so(await bi()??dn()),t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.pullRouteDecisionPolicy))return{ok:!1,policy:e,error:"qimingclaw_bridge_unavailable"};try{const a=await t.pullRouteDecisionPolicy();return{ok:(a==null?void 0:a.ok)!==!1,skipped:a==null?void 0:a.skipped,endpoint:(a==null?void 0:a.endpoint)??null,pulled_at:(a==null?void 0:a.pulled_at)??null,policy:so({routeDecisionPolicy:(a==null?void 0:a.policy)??e}),error:(a==null?void 0:a.error)??null}}catch(a){return{ok:!1,policy:e,error:a instanceof Error?a.message:String(a)}}}async function yA(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.pullApprovalUpdates))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const n=await e.pullApprovalUpdates();return(n==null?void 0:n.ok)!==!1&&await kA(await ke()),{ok:(n==null?void 0:n.ok)!==!1,applied:Number((n==null?void 0:n.applied)??0),ignored:Number((n==null?void 0:n.ignored)??0),conflicted:Number((n==null?void 0:n.conflicted)??0),...n!=null&&n.skipped?{skipped:!0}:{},...n!=null&&n.error?{error:n.error}:{}}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function Q1(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.pullNotificationUpdates))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const n=await e.pullNotificationUpdates();return{ok:(n==null?void 0:n.ok)!==!1,applied:Number((n==null?void 0:n.applied)??0),ignored:Number((n==null?void 0:n.ignored)??0),...n!=null&&n.skipped?{skipped:!0}:{},...n!=null&&n.error?{error:n.error}:{}}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function bA(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.pullAdminActions))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const n=await e.pullAdminActions();return{ok:(n==null?void 0:n.ok)!==!1,applied:Number((n==null?void 0:n.applied)??0),rejected:Number((n==null?void 0:n.rejected)??0),failed:Number((n==null?void 0:n.failed)??0),ignored:Number((n==null?void 0:n.ignored)??0),...n!=null&&n.skipped?{skipped:!0}:{},...n!=null&&n.error?{error:n.error}:{}}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async function vA(e){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.showDesktopNotification))return{ok:!1,shown:!1,reason:"qimingclaw_bridge_unavailable"};try{const a=await t.showDesktopNotification(e);return{ok:(a==null?void 0:a.ok)!==!1,shown:(a==null?void 0:a.shown)===!0,...a!=null&&a.reason?{reason:a.reason}:{},...a!=null&&a.error?{error:a.error}:{}}}catch(a){return{ok:!1,shown:!1,error:a instanceof Error?a.message:String(a)}}}async function xA(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.getDesktopNotificationStatus))return{supported:!1,platform:"unknown",can_open_settings:!1,reason:"qimingclaw_bridge_unavailable"};try{const n=await e.getDesktopNotificationStatus();return{supported:(n==null?void 0:n.supported)===!0,platform:h(n==null?void 0:n.platform)||"unknown",can_open_settings:(n==null?void 0:n.can_open_settings)===!0,reason:h(n==null?void 0:n.reason)||null}}catch(n){return{supported:!1,platform:"unknown",can_open_settings:!1,reason:n instanceof Error?n.message:String(n)}}}async function X1(){var t;const e=(t=window.QimingClawBridge)==null?void 0:t.digital;if(!(e!=null&&e.openDesktopNotificationSettings))return{success:!1,reason:"qimingclaw_bridge_unavailable"};try{const n=await e.openDesktopNotificationSettings();return{success:(n==null?void 0:n.success)===!0,platform:h(n==null?void 0:n.platform)||null,reason:h(n==null?void 0:n.reason)||null,error:h(n==null?void 0:n.error)||null}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async function kA(e){const n=(await Kf(120)).interventions.filter(a=>a.intervention_status==="approved"&&a.approval_id&&!a.resolved_at).slice(0,5);for(const a of n)await VS(a.route_decision_id,{approval_id:a.approval_id,decision:"approved",actor:"management-api"},e).catch(r=>{console.warn("[qimingclawAdapter] auto route intervention resolution failed:",r)})}async function or(e){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.evaluateRiskPolicy))return{ok:!0,decision:"allowed",action_kind:e.actionKind||"unknown_action",risk_level:e.riskLevel||"normal",reason_codes:["qimingclaw_bridge_unavailable"],status:"allowed"};try{return await t.evaluateRiskPolicy(e)}catch(a){return{ok:!0,decision:"allowed",action_kind:e.actionKind||"unknown_action",risk_level:e.riskLevel||"normal",reason_codes:["risk_policy_evaluation_failed"],status:"allowed",error:a instanceof Error?a.message:String(a)}}}async function SA(e){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.evaluateRouteDecisionPolicy))return{ok:!0,decision:"allowed",status:"allowed",policy_result:"accepted",route_kind:e.routeKind||"ChatOnly",intent_kind:wf(e.intentKind),reason_codes:["qimingclaw_bridge_unavailable"],policy_source:"local",policy:kf()};try{return await t.evaluateRouteDecisionPolicy(e)}catch(a){return{ok:!0,decision:"allowed",status:"allowed",policy_result:"accepted",route_kind:e.routeKind||"ChatOnly",intent_kind:wf(e.intentKind),reason_codes:["route_policy_evaluation_failed"],policy_source:"local",policy:kf(),error:a instanceof Error?a.message:String(a)}}}function cr(e){return e.decision==="allowed"?null:{ok:!1,status:e.decision,decision:e.decision,action_kind:e.action_kind,risk_level:e.risk_level,reason_codes:e.reason_codes??[],approval_id:e.approval_id??null,event_id:e.event_id??null,error:e.decision==="approval_required"?"risk_approval_required":"risk_policy_rejected"}}function wA(e){const t=new Set,n=[];for(const a of e){const r=typeof a.skill_id=="string"?a.skill_id.trim():"";!r||t.has(r)||(t.add(r),n.push({...a,skill_id:r}))}return n}async function na(e,t,n,a){var r,s,u;pA(e);try{return await((u=(s=(r=window.QimingClawBridge)==null?void 0:r.digital)==null?void 0:s.saveUiState)==null?void 0:u.call(s,{state:e,action:t,date:n,metadata:a}))??e}catch{return e}}async function Ra(e,t){var n,a,r,s,u,f,p,m,g,b,v,k,C,D,A,x,T,N,F,L;try{await((L=(a=(n=window.QimingClawBridge)==null?void 0:n.digital)==null?void 0:a.recordGovernanceCommand)==null?void 0:L.call(a,{commandKind:e.command_kind,commandId:t.command_id,correlationId:t.correlation_id,planId:Re((r=t.result)==null?void 0:r.plan_id)||Re((s=e.context_refs)==null?void 0:s.plan_id)||Re((u=e.payload)==null?void 0:u.plan_id)||null,taskId:Re((f=t.result)==null?void 0:f.task_id)||Re((p=e.context_refs)==null?void 0:p.task_id)||Re((m=e.payload)==null?void 0:m.task_id)||null,runId:Re((g=t.result)==null?void 0:g.run_id)||Re((b=e.context_refs)==null?void 0:b.run_id)||Re((v=e.payload)==null?void 0:v.run_id)||Re((k=e.payload)==null?void 0:k.latest_run_id)||null,stepId:Re((C=t.result)==null?void 0:C.step_id)||Re((D=e.context_refs)==null?void 0:D.step_id)||Re((A=e.payload)==null?void 0:A.step_id)||Re((x=e.payload)==null?void 0:x.stepId)||null,scheduleId:Re((T=t.result)==null?void 0:T.schedule_id)||Re((N=e.context_refs)==null?void 0:N.schedule_id)||Re((F=e.payload)==null?void 0:F.schedule_id)||null,accepted:t.accepted,message:t.message,error:t.error??null,payload:e.payload??null,result:t.result??null}))}catch{}}async function jA(){var e,t,n;try{return await((n=(t=(e=window.QimingClawBridge)==null?void 0:e.digital)==null?void 0:t.getCronSettings)==null?void 0:n.call(t))??gf()}catch{return gf()}}async function CA(e){var t,n,a;try{return await((a=(n=(t=window.QimingClawBridge)==null?void 0:t.digital)==null?void 0:n.saveCronSettings)==null?void 0:a.call(n,e))??{...gf(),...e}}catch{return{...gf(),...e}}}async function TA(e,t){var n,a,r;try{return(await((r=(a=(n=window.QimingClawBridge)==null?void 0:n.digital)==null?void 0:a.listMemories)==null?void 0:r.call(a,{query:e||void 0,category:t||void 0,limit:300}))??[]).map(Z1)}catch{return[]}}async function EA(e){var s,u,f;const t=Re(e.key),n=Re(e.content??e.text),a=Re(e.category)||"fact";if(!n)return{ok:!0,entry:null};const r=await((f=(u=(s=window.QimingClawBridge)==null?void 0:s.digital)==null?void 0:u.addMemory)==null?void 0:f.call(u,{key:t||void 0,content:n,category:a,source:"qimingclaw-digital-page",payload:{source:"embedded-memory-api",key:t||null}}))??null;return{ok:!0,entry:r?Z1(r):null}}async function AA(e){var t,n,a;try{await((a=(n=(t=window.QimingClawBridge)==null?void 0:t.digital)==null?void 0:n.deleteMemory)==null?void 0:a.call(n,e))}catch{}}function Z1(e){return{id:e.id,key:e.key||e.id,content:e.content,category:e.category||"fact",timestamp:e.updatedAt||e.createdAt||new Date().toISOString(),session_id:e.sessionId??null,score:typeof e.score=="number"?e.score:null}}function NA(e){var s;const n=((e==null?void 0:e.uiState)??dn()).memoryGovernanceById??{},a=((s=e==null?void 0:e.runtime)==null?void 0:s.memories)??[],r=new Map;return a.forEach(u=>{const f=Ah(u);r.set(f,[...r.get(f)??[],u])}),a.map(u=>{const f=n[u.id]??{},p=(r.get(Ah(u))??[]).map(g=>g.id).filter(g=>g!==u.id),m=h(f.governance_status)||(u.deletedAt?"archived":u.status||"active");return{memory_id:u.id,remote_id:u.remoteId??null,key:u.key||u.id,category:u.category||"fact",source:u.source||null,source_path:u.sourcePath??null,status:m,governance_status:m,last_governance_action:h(f.last_governance_action)||null,last_reviewed_at:h(f.last_reviewed_at)||null,actor:h(f.actor)||null,reason:h(f.reason)||null,content_preview:J1(u.content),score:typeof u.score=="number"?u.score:null,session_id:u.sessionId??null,sync_status:u.syncStatus??null,sync_error:u.syncError??null,merge_candidate_count:p.length,duplicate_memory_ids:p,latest_memory_id:MA(r.get(Ah(u))??[]),entity_type:"memory",entity_id:u.id,created_at:u.createdAt,updated_at:h(f.updated_at)||u.updatedAt||u.createdAt,payload:xf("memory_governance",ye(u.payload)??{content_length:u.content.length}),source_label:"qimingclaw-memory"}}).sort((u,f)=>Tn(f).localeCompare(Tn(u))||h(u.memory_id).localeCompare(h(f.memory_id)))}function RA(e,t){const n=h(t.get("q")??t.get("query")),a=h(t.get("category")),r=h(t.get("status")),s=h(t.get("entity_id"));return e.filter(u=>!n||[u.key,u.content_preview,u.source].some(f=>h(f).toLowerCase().includes(n.toLowerCase()))).filter(u=>!a||h(u.category)===a).filter(u=>!r||h(u.governance_status)===r||h(u.status)===r).filter(u=>!s||Ag(u).includes(s)||h(u.memory_id)===s)}async function DA(e,t){var m;const n=h(e.action)||"mark_reviewed";if(!["archive","restore","mark_reviewed"].includes(n))return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_memory_governance_action"]};const a=tt([...De(e.memory_ids),...De(e.memoryIds)]).slice(0,100);if(a.length===0)return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["memory_ids_required"]};const r=new Set((((m=t==null?void 0:t.runtime)==null?void 0:m.memories)??[]).map(g=>g.id)),s=(t==null?void 0:t.uiState)??await bi()??dn();s.memoryGovernanceById=s.memoryGovernanceById??{};const u=new Date().toISOString(),f=a.map(g=>{var b,v,k,C;return r.has(g)?(s.memoryGovernanceById[g]={governance_status:n==="archive"?"archived":n==="restore"?"active":((v=(b=s.memoryGovernanceById)==null?void 0:b[g])==null?void 0:v.governance_status)??"reviewed",last_governance_action:n,last_reviewed_at:n==="mark_reviewed"?u:((C=(k=s.memoryGovernanceById)==null?void 0:k[g])==null?void 0:C.last_reviewed_at)??null,actor:h(e.actor)||"digital_employee_operator",reason:h(e.reason)||null,updated_at:u},{memory_id:g,ok:!0,status:"recorded",action:n}):{memory_id:g,ok:!1,status:"rejected",reason_codes:["memory_not_found"]}});await na(s,"memory_governance_status_batch",nu(),{action:n,memory_ids:a,reason:h(e.reason)||null});const p=f.filter(g=>g.ok===!0).length;return{ok:p>0,action:n,total:a.length,recorded:p,rejected:a.length-p,items:f,reason_codes:tt(f.flatMap(g=>De(g.reason_codes)))}}function Ah(e){return`${e.category||"fact"}:${e.key||"memory"}:${J1(e.content).toLowerCase()}`}function J1(e){return String(e||"").replace(/\s+/g," ").trim().slice(0,120)}function MA(e){var t;return((t=e.slice().sort((n,a)=>h(a.updatedAt).localeCompare(h(n.updatedAt)))[0])==null?void 0:t.id)??null}function gf(){return{enabled:!0,catch_up_on_startup:!0,max_run_history:100,max_catch_up_runs:5,max_concurrent_schedule_runs:1}}async function $A(e,t){const n=Date.now(),a=Re(e.id)||Re(e.schedule_id)||`cron-${Ft(Re(e.name)||"job")}-${n}`;await fr({command_kind:"create_schedule",context_refs:{schedule_id:a,plan_id:Re(e.plan_id)||Re(e.template_id)||void 0},payload:{...e,schedule_id:a,cron_expr:Re(e.schedule)||Re(e.cron_expr)},correlation_id:`qimingclaw-cron-create-${n}`,idempotency_key:`qimingclaw-cron-create-${a}-${n}`},t);const r=await ke();return{status:"created",job:bf(r).find(s=>s.id===a)??eS(a,e)}}async function zA(e,t,n){await W1("update_schedule",e,t,n);const a=await ke();return{status:"updated",job:bf(a).find(r=>r.id===e)??eS(e,t)}}async function W1(e,t,n,a){const r=Date.now();return fr({command_kind:e,context_refs:{schedule_id:t,plan_id:Re(n.plan_id)||Re(n.template_id)||void 0},payload:{...n,schedule_id:t,cron_expr:Re(n.schedule)||Re(n.cron_expr)},correlation_id:`qimingclaw-cron-${e}-${r}`,idempotency_key:`qimingclaw-cron-${e}-${t}-${r}`},a)}function eS(e,t){const n=new Date().toISOString(),a=Re(t.schedule)||Re(t.cron_expr)||"0 9 * * *";return{id:e,name:Re(t.name)||e,expression:a,command:Re(t.command)||`digital-employee:${e}`,prompt:Re(t.prompt)||null,job_type:Re(t.job_type)||"qimingclaw_schedule",schedule:{expression:a,schedule_id:e},enabled:t.enabled!==!1,delivery:{mode:"qimingclaw_schedule",schedule_id:e},template_id:Re(t.template_id)||Re(t.plan_id)||e,trigger_kind:"scheduled",delete_after_run:t.delete_after_run===!0,created_at:n,next_run:n,last_run:null,last_status:null,last_output:null}}async function OA(e,t){var a,r,s;return(await((s=(r=(a=window.QimingClawBridge)==null?void 0:a.digital)==null?void 0:r.getScheduleRuns)==null?void 0:s.call(r,e,t).catch(()=>[]))??[]).map((u,f)=>({id:Number.isFinite(Date.parse(u.createdAt))?Date.parse(u.createdAt)+f:f+1,job_id:u.scheduleId,started_at:u.startedAt||u.createdAt,finished_at:u.finishedAt||"",status:u.status,output:u.error||null,duration_ms:u.startedAt&&u.finishedAt?Math.max(0,Date.parse(u.finishedAt)-Date.parse(u.startedAt)):null}))}function ti(e){return typeof e!="string"||!e.trim()?{}:JSON.parse(e)}function Ln(e){return ti(e)}function nu(){const e=new Date;return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")}function ul(e,t){const n=new Date;return n.setHours(e,t,0,0),n.toISOString()}function lf(e){return e.split("-").join("/")}function yf(e){if(!e)return"未知";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit"}).format(t)}function tS(e,t){return new Set(e.selectedDutyIdsByDate[t]??[])}function nS(e){return["completed","succeeded","success"].includes(e)?"success":["running","active"].includes(e)?"running":["failed","error"].includes(e)?"danger":"waiting"}function kc(e,t){var n;return((n=e==null?void 0:e.services[t])==null?void 0:n.running)===!0}function Sc(e,t){var n;return(n=e==null?void 0:e.services[t])==null?void 0:n.error}function LA(e,t){return t?e.plan_id==="qimingclaw-client-readiness"?kc(t,"agent")&&kc(t,"mcp")?"running":Sc(t,"agent")||Sc(t,"mcp")?"failed":"pending":e.plan_id==="qimingclaw-remote-task-ingress"?kc(t,"computerServer")||kc(t,"lanproxy")||kc(t,"fileServer")?"running":Sc(t,"computerServer")||Sc(t,"lanproxy")||Sc(t,"fileServer")?"failed":"pending":e.status:e.status}function er(e,t,n){const a=e==null?void 0:e.services[t];if(!a)return`${n}:未连接`;if(a.running){const r=a.port?`(端口 ${a.port})`:"";return`${n}:运行中${r}`}return`${n}:未运行${a.error?`,${a.error}`:""}`}function tr(e){const t=(e==null?void 0:e.managedServices)??[];return t.length>0?t.map(n=>({service_id:n.serviceId,name:n.name,kind:n.kind,status:n.status,status_label:n.statusLabel,running:n.running,error:n.error??null,requires_human_action:n.requiresHumanAction,dependent_tasks:n.dependentTasks??[],restart_count:n.restartCount??0,last_seen_at:n.lastSeenAt,instance:n.instance,lease:n.lease})):[Bs(e,"agent","Agent","agent",["ACP 会话执行","Plan Agent"]),Bs(e,"mcp","MCP Proxy","mcp",["Skill Catalog","MCP 工具调用"]),Bs(e,"computerServer","Computer Server","desktop",["/computer/chat","远程任务接入"]),Bs(e,"fileServer","File Server","file",["Artifact 上传","文件交付"]),Bs(e,"lanproxy","Lanproxy","network",["远程访问","管理端回连"]),Bs(e,"guiServer","GUI Agent Server","gui",["GUI 自动化"])]}function Bs(e,t,n,a,r){const s=e==null?void 0:e.services[t],u=(s==null?void 0:s.running)===!0,f=s!=null&&s.error?"degraded":u?"running":"stopped";return{service_id:t,name:n,kind:a,status:f,status_label:f==="running"?"运行中":f==="degraded"?"异常":"未运行",running:u,error:(s==null?void 0:s.error)??null,requires_human_action:!!(s!=null&&s.error),dependent_tasks:r,restart_count:0,last_seen_at:(e==null?void 0:e.generatedAt)??new Date().toISOString(),instance:s?{port:s.port,engineType:s.engineType,serverCount:s.serverCount,serverNames:s.serverNames}:void 0,lease:{state:f==="running"?"active":f,updatedAt:(e==null?void 0:e.generatedAt)??new Date().toISOString()}}}function IA(e){const t=e.dependent_tasks.length>0?`;依赖任务:${e.dependent_tasks.slice(0,2).join("、")}`:"";return`${e.name}:${e.status_label}${e.error?`,${e.error}`:""}${t}`}function ek(e){const t=e.filter(a=>a.running).length,n=e.filter(a=>a.requires_human_action||a.status==="degraded").length;return`ManagedService:${t}/${e.length} 运行,${n} 项需处理`}async function iS(e,t){var s;const n=await or({actionKind:`managed_service.restart.${e}`,actionLabel:`重启服务:${e}`,riskLevel:"high",reasonCodes:["managed_service_restart"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",correlationId:`managed-service:${e}:restart`,payload:{service_id:e,reason:h(t.reason)||null}}),a=cr(n);if(a){const u=await ke();return{ok:!1,service_id:e,action:"restart",status:a.status==="approval_required"?"rejected":"failed",error:String(a.error||a.status||"risk_policy_blocked"),managed_service:tr(u).find(f=>f.service_id===e)??null,event_id:h(a.event_id)||null}}const r=(s=window.QimingClawBridge)==null?void 0:s.digital;if(!(r!=null&&r.restartManagedService)){const u=await ke();return{ok:!1,service_id:e,action:"restart",status:"failed",error:"bridge_unavailable",managed_service:tr(u).find(f=>f.service_id===e)??null}}try{const u=await r.restartManagedService(e,{reason:h(t.reason)||"digital_employee_managed_service_restart",actor:h(t.actor)||"digital_employee_ui"}),f=await ke();return{...u,managed_service:u.managed_service??tr(f).find(p=>p.service_id===e)??null}}catch(u){const f=await ke();return{ok:!1,service_id:e,action:"restart",status:"failed",error:u instanceof Error?u.message:String(u),managed_service:tr(f).find(p=>p.service_id===e)??null}}}async function BA(e,t){var u;const n=(u=window.QimingClawBridge)==null?void 0:u.digital,a=qA(h(t.action)),r=await or({actionKind:`artifact.access.${a}`,actionLabel:`访问产物:${a}`,riskLevel:a==="download"||a==="open_location"?"high":"medium",reasonCodes:["artifact_access"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",correlationId:`artifact:${e}:${a}`,payload:{artifact_id:e,action:a}}),s=cr(r);if(s)return{ok:!1,artifact_id:e,action:a,status:"rejected",error:String(s.error||s.status||"risk_policy_blocked"),reason_codes:Array.isArray(s.reason_codes)?s.reason_codes.map(String):["risk_policy_blocked"],event_id:h(s.event_id)||null};if(!(n!=null&&n.accessArtifact))return{ok:!1,artifact_id:e,action:a,status:"rejected",error:"bridge_unavailable",reason_codes:["bridge_unavailable"]};try{return await n.accessArtifact(e,a,{actor:h(t.actor)||"digital_employee_ui",source:h(t.source)||"sgrobot-digital-adapter"})}catch(f){return{ok:!1,artifact_id:e,action:a,status:"rejected",error:f instanceof Error?f.message:String(f),reason_codes:["artifact_access_failed"]}}}function qA(e){return e==="download"||e==="open_location"?e:"preview"}async function aS(e,t,n){var m;const a=(m=window.QimingClawBridge)==null?void 0:m.digital,r=h(t.action)||"mark_review",s=jg(n,e),u=await or({actionKind:`artifact.retention.${r}`,actionLabel:`调整产物保留策略:${r}`,riskLevel:r==="mark_expire"||r==="clear_retention"?"high":"medium",reasonCodes:["artifact_retention"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",planId:s&&h(s.plan_id)||null,taskId:s&&h(s.task_id)||null,runId:s&&h(s.run_id)||null,correlationId:`artifact:${e}:retention:${r}`,payload:{artifact_id:e,action:r}}),f=cr(u);if(f)return{...f,artifact_id:e,action:r,item:s};if(!(a!=null&&a.recordArtifactLifecycle))return{ok:!1,artifact_id:e,action:r,status:"rejected",error:"bridge_unavailable"};const p=await a.recordArtifactLifecycle({artifactId:e,action:r,reason:h(t.reason)||null,retentionUntil:h(t.retention_until??t.retentionUntil)||null,versionSummary:s?GN(s):null,retentionSummary:s?PN(s,r,t):null,deliverySummary:s?Vf(s):null,actor:h(t.actor)||"digital_employee_ui",source:h(t.source)||"sgrobot-digital-adapter",planId:s&&h(s.plan_id)||null,taskId:s&&h(s.task_id)||null,runId:s&&h(s.run_id)||null});return{ok:!!(p&&p.kind!=="artifact_retention_rejected"),artifact_id:e,action:r,status:(p==null?void 0:p.kind)==="artifact_retention_rejected"?"rejected":"recorded",event_id:(p==null?void 0:p.eventId)??null,item:s}}async function UA(e,t){const n=h(e.action)||"mark_review";if(!["mark_keep","mark_expire","mark_review","clear_retention"].includes(n))return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_retention_action"]};const a=tt([...De(e.artifact_ids),...De(e.artifactIds)]).slice(0,50);if(a.length===0)return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["artifact_ids_required"]};const r={action:n,reason:h(e.reason)||"digital_employee_artifact_batch_governance",retention_until:h(e.retention_until??e.retentionUntil)||null,actor:h(e.actor)||"digital_employee_ui",source:h(e.source)||"sgrobot-digital-adapter"},s=[];for(const p of a){const m=await aS(p,r,t);s.push({artifact_id:p,ok:m.ok===!0,status:h(m.status)||(m.ok===!0?"recorded":"rejected"),event_id:h(m.event_id)||null,error:h(m.error)||null,reason_codes:De(m.reason_codes).map(h).filter(Boolean)})}const u=s.filter(p=>p.ok===!0).length,f=tt(s.flatMap(p=>De(p.reason_codes)));return{ok:u>0,action:n,total:a.length,recorded:u,rejected:a.length-u,items:s,reason_codes:f}}async function HA(e,t,n){var f;const a=(f=window.QimingClawBridge)==null?void 0:f.digital,r=jg(n,e),s=await or({actionKind:"artifact.cleanup.delete_local_file",actionLabel:"清理产物本地文件",riskLevel:"high",reasonCodes:["artifact_cleanup"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",planId:r&&h(r.plan_id)||null,taskId:r&&h(r.task_id)||null,runId:r&&h(r.run_id)||null,correlationId:`artifact:${e}:cleanup`,payload:{artifact_id:e,retention_status:h(r==null?void 0:r.retention_status)||null}}),u=cr(s);if(u)return{...u,artifact_id:e,status:"rejected",item:r};if(!(a!=null&&a.cleanupArtifact))return{ok:!1,artifact_id:e,status:"rejected",error:"bridge_unavailable",reason_codes:["bridge_unavailable"],item:r};try{return{...await a.cleanupArtifact(e,{actor:h(t.actor)||"digital_employee_ui",source:h(t.source)||"sgrobot-digital-adapter",reason:h(t.reason)||"digital_employee_artifact_cleanup",retentionStatus:h(t.retention_status??t.retentionStatus)||h(r==null?void 0:r.retention_status)||null,lastRetentionAction:h(t.last_retention_action??t.lastRetentionAction)||h(r==null?void 0:r.last_retention_action)||null}),item:r}}catch(p){return{ok:!1,artifact_id:e,status:"failed",error:p instanceof Error?p.message:String(p),reason_codes:["artifact_cleanup_failed"],item:r}}}async function PA(e,t,n){var m;const a=(m=window.QimingClawBridge)==null?void 0:m.digital,r=h(t.action)||"comment",s=bS(n,e),u=await or({actionKind:`approval.action.${r}`,actionLabel:`审批治理动作:${r}`,riskLevel:r==="mark_risk"||r==="delegate"||r==="mark_timeout"?"medium":"normal",reasonCodes:["approval_action"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",planId:s&&h(s.plan_id)||null,taskId:s&&h(s.task_id)||null,runId:s&&h(s.run_id)||null,correlationId:`approval:${e}:action:${r}`,payload:{approval_id:e,action:r}}),f=cr(u);if(f)return{...f,approval_id:e,action:r,item:s};if(!(a!=null&&a.recordApprovalAction))return{ok:!1,approval_id:e,action:r,status:"rejected",error:"bridge_unavailable"};const p=await a.recordApprovalAction({approvalId:e,action:r,comment:h(t.comment)||null,delegateTo:h(t.delegate_to??t.delegateTo)||null,delegateLabel:h(t.delegate_label??t.delegateLabel)||null,dueAt:h(t.due_at??t.dueAt)||null,riskLevel:h(t.risk_level??t.riskLevel)||null,reason:h(t.reason)||null,actor:h(t.actor)||"digital_employee_ui",source:h(t.source)||"sgrobot-digital-adapter",planId:s&&h(s.plan_id)||null,taskId:s&&h(s.task_id)||null,runId:s&&h(s.run_id)||null});return{ok:!!(p&&p.kind!=="approval_action_rejected"),approval_id:e,action:r,status:(p==null?void 0:p.kind)==="approval_action_rejected"?"rejected":"recorded",event_id:(p==null?void 0:p.eventId)??null,item:s}}async function lS(e,t,n){var m;const a=(m=window.QimingClawBridge)==null?void 0:m.digital,r=h(t.resolution)||"mark_reviewed",s=bS(n,e),u=await or({actionKind:`approval.conflict.resolve.${r}`,actionLabel:`审批冲突裁决:${r}`,riskLevel:r==="accept_remote"?"medium":"normal",reasonCodes:["approval_conflict_resolution"],actor:h(t.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",planId:s&&h(s.plan_id)||null,taskId:s&&h(s.task_id)||null,runId:s&&h(s.run_id)||null,correlationId:`approval:${e}:conflict:${r}`,payload:{approval_id:e,resolution:r}}),f=cr(u);if(f)return{...f,approval_id:e,resolution:r,item:s};if(!(a!=null&&a.resolveApprovalConflict))return{ok:!1,approval_id:e,resolution:r,status:"rejected",error:"bridge_unavailable",reason_codes:["bridge_unavailable"],item:s};const p=await a.resolveApprovalConflict({approvalId:e,resolution:r,actor:h(t.actor)||"digital_employee_ui",comment:h(t.comment)||null});return{...p,ok:(p==null?void 0:p.ok)===!0,approval_id:(p==null?void 0:p.approval_id)||e,resolution:(p==null?void 0:p.resolution)??r,item:s}}async function FA(e,t){const n=h(e.resolution)||"mark_reviewed";if(n==="accept_remote")return{ok:!1,resolution:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["batch_accept_remote_disabled"]};if(!["keep_local","mark_reviewed"].includes(n))return{ok:!1,resolution:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_resolution"]};const a=tt([...De(e.approval_ids),...De(e.approvalIds)]).slice(0,50);if(a.length===0)return{ok:!1,resolution:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["approval_ids_required"]};const r=[];for(const u of a){const f=await lS(u,{resolution:n,actor:h(e.actor)||"digital_employee_operator",comment:h(e.comment)||null},t);r.push({approval_id:u,ok:f.ok===!0,status:h(f.status)||(f.ok===!0?"recorded":"rejected"),event_id:h(f.event_id)||null,error:h(f.error)||null,reason_codes:De(f.reason_codes).map(h).filter(Boolean)})}const s=r.filter(u=>u.ok===!0).length;return{ok:s>0,resolution:n,total:a.length,recorded:s,rejected:a.length-s,items:r,reason_codes:tt(r.flatMap(u=>De(u.reason_codes)))}}function Bf(e){const t=e==null?void 0:e.sync;return t?t.enabled?t.endpoint?t.syncing?`管理端同步:同步中,待同步 ${t.pending} 条`:t.failed>0?`管理端同步:${t.failed} 条失败,待同步 ${t.pending} 条`:t.pending>0?`管理端同步:待同步 ${t.pending} 条`:t.lastSyncAt?`管理端同步:已同步,最近 ${t.lastSyncAt}`:"管理端同步:等待本地数据":"管理端同步:未配置地址":"管理端同步:已停用":"管理端同步:未连接"}function GA(e){return String(e||"").replace(/\s+/g," ").trim()}function ea(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.plans)??[]}function Vr(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.planSteps)??[]}function un(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.tasks)??[]}function ta(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.runs)??[]}function Dt(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.events)??[]}function qf(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.artifacts)??[]}function iu(e){var t;return((t=e==null?void 0:e.runtime)==null?void 0:t.approvals)??[]}function ur(e){return ea(e).length>0||Vr(e).length>0||un(e).length>0||qf(e).length>0||iu(e).length>0}function bg(e,t){const n=[e.updatedAt,...t.map(a=>a.updatedAt)].filter(Boolean).sort();return n[n.length-1]??e.updatedAt??e.createdAt}function qt(e){const t=e.toLowerCase();return["completed","succeeded","success","done"].includes(t)?"success":["failed","error","rejected","cancelled"].includes(t)?"danger":["running","active","leased","syncing"].includes(t)?"running":"waiting"}function ma(e){const t=e.toLowerCase();if(t==="ready")return"待启动";if(t==="blocked")return"依赖阻塞";if(t==="skipped")return"已跳过";if(t==="cancelled")return"已取消";if(t==="paused")return"已暂停";const n=qt(e);return n==="success"?"已完成":n==="danger"?"异常":n==="running"?"执行中":"待执行"}function au(e,t){return un(e).filter(n=>n.planId===t)}function rS(e,t){return Vr(e).filter(n=>n.planId===t).sort((n,a)=>n.seq-a.seq||n.createdAt.localeCompare(a.createdAt))}function hl(e){const t=ye(e.payload);return h((t==null?void 0:t.stepId)??(t==null?void 0:t.step_id))||(e.planId?`${e.planId}:runtime`:"qimingclaw-runtime")}function Uf(e,t){return t.some(n=>qt(n.status)==="danger")?"failed":t.some(n=>qt(n.status)==="running")?"running":t.length>0&&t.every(n=>qt(n.status)==="success")?"completed":e.status||"pending"}function VA(e){return ea(e).map(t=>{const n=au(e,t.id),a=Uf(t,n),r=nS(a),s=n.filter(f=>qt(f.status)==="danger").length,u=n.filter(f=>qt(f.status)==="running").length;return{agent_id:`plan-agent-${Ft(t.id)}`,plan_id:t.id,title:t.title,lifecycle:a,status_label:oS(a),status_tone:r,managed_task_count:n.length,running_task_count:u,failed_task_count:s,next_action:s>0?"review_failures":u>0?"monitor_runs":r==="success"?"archive_results":"activate_plan",can_replan:s>0,can_pause:u>0,can_resume:a==="paused",updated_at:bg(t,n)}})}function YA(e){const t=ta(e);return un(e).map(n=>{const a=Hf(t,n.id),r=qt(n.status),s=n.status.toLowerCase(),u=hl(n);return{agent_id:`task-agent-${Ft(n.id)}`,task_id:n.id,plan_id:n.planId??null,step_id:u,title:n.title,execution_state:n.status,status_label:ma(n.status),status_tone:r,assigned_skill_id:n.assignedSkillId??null,latest_run_id:(a==null?void 0:a.id)??null,can_retry:["failed","cancelled","skipped"].includes(s),can_skip:["pending","running"].includes(s),can_cancel:["pending","running","paused"].includes(s),next_action:KA(s,r),updated_at:(a==null?void 0:a.updatedAt)??n.updatedAt}})}function KA(e,t){return["failed","cancelled","skipped"].includes(e)?"retry_or_review":e==="paused"?"resume_or_cancel":t==="running"?"watch_progress":t==="success"?"collect_artifacts":"start_run"}function Hf(e,t){return e.filter(a=>a.taskId===t).sort((a,r)=>(r.updatedAt||r.createdAt).localeCompare(a.updatedAt||a.createdAt))[0]??null}function QA(e,t){const n=au(t,e.id),a=rS(t,e.id),r=Uf(e,n),s=new Set(a.map(p=>p.id)),u=n.filter(p=>!s.has(hl(p))),f=a.length>0?[...a.map(p=>sS(p,n)),...u.length>0?[tk(e.id,u)]:[]]:[tk(e.id,n)];return{plan_id:e.id,title:e.title,objective:e.objective??void 0,status:r,created_at:e.createdAt,updated_at:bg(e,n),source:e.source,sync_status:e.syncStatus,steps:f}}function sS(e,t){return{step_id:e.id,title:e.title,depends_on:e.dependsOn,preferred_skills:e.preferredSkillIds,tasks:t.filter(n=>hl(n)===e.id).map(n=>({task_id:n.id,title:n.title,status:n.status}))}}function tk(e,t){return{step_id:`${e}:runtime`,title:"qimingclaw 执行记录",depends_on:[],preferred_skills:[...new Set(t.map(n=>n.assignedSkillId).filter(n=>!!n))],tasks:t.map(n=>({task_id:n.id,title:n.title,status:n.status}))}}function XA(e){return{task_id:e.id,title:e.title,status:e.status,plan_id:e.planId??null,step_id:hl(e),assigned_skill_id:e.assignedSkillId??"",description:e.syncError??"",created_at:e.createdAt,updated_at:e.updatedAt,started_at:e.createdAt,finished_at:qt(e.status)==="success"||qt(e.status)==="danger"?e.updatedAt:null,error_message:e.syncError??null,sync_status:e.syncStatus}}function ZA(e,t){return{run_id:e.id,task_id:e.taskId??"",plan_id:e.planId??null,skill_id:void 0,attempt_no:1,lifecycle:qt(e.status)==="success"?"Succeeded":qt(e.status)==="danger"?"Failed":qt(e.status)==="running"?"Running":e.status,created_at:e.startedAt??e.createdAt,completed_at:e.finishedAt??null,events:t.filter(n=>n.runId===e.id).map(n=>({event_id:n.id,kind:n.kind,occurred_at:n.occurredAt,message:n.message})),artifacts:US(e,t),sync_status:e.syncStatus}}function lu(e){const t=GA(e.error),n=t.length>120?`${t.slice(0,120)}...`:t,a=e.dueForRetry?"等待补偿":e.nextRetryAt?`下次重试 ${e.nextRetryAt}`:"等待重试";return`${e.entityType}/${e.operation} ${e.id} 重试 ${e.attempts} 次,${a}${n?`,${n}`:""}`}function ru(e,t){return{...e,status:LA(e,t)}}function oS(e){return e==="running"?"执行中":e==="completed"||e==="succeeded"?"已完成":e==="failed"?"异常":"待执行"}function vg(e){const t=ea(e);if(t.length>0)return t.map(a=>QA(a,e));const n=un(e);return n.length===0?[]:n.map(a=>({plan_id:a.id,title:a.title,objective:"未绑定 Plan 的 qimingclaw 本地任务记录。",status:a.status,created_at:a.createdAt,updated_at:a.updatedAt,source:"qimingclaw",sync_status:a.syncStatus,steps:[{step_id:`${a.id}:runtime`,title:"qimingclaw 执行记录",depends_on:[],preferred_skills:a.assignedSkillId?[a.assignedSkillId]:[],tasks:[{task_id:a.id,title:a.title,status:a.status}]}]}))}function pl(e){const t=(e==null?void 0:e.planTemplates)??[],n=new Map;for(const a of[...t,...uA])n.has(a.plan_id)||n.set(a.plan_id,a);return Array.from(n.values())}function xg(e){const t=new Map;for(const n of[...vg(e),...pl(e).map(a=>ru(a,e))])t.has(n.plan_id)||t.set(n.plan_id,n);return Array.from(t.values())}function JA(e,t){var r;const n=ru(e,t),a=_f[e.plan_id]??_f["qimingclaw-client-readiness"];return{id:`schedule-${e.plan_id}`,name:e.title,expression:a.expression,command:`digital-employee:${e.plan_id}`,prompt:e.objective??null,job_type:"plan_template",schedule:{expression:a.expression,template_id:e.plan_id},enabled:!0,delivery:{mode:"plan_template",template_id:e.plan_id},template_id:e.plan_id,trigger_kind:"scheduled",step_count:((r=e.steps)==null?void 0:r.length)??0,skill_ids:[...new Set((e.steps??[]).flatMap(s=>s.preferred_skills??[]))],delete_after_run:!1,created_at:e.created_at,next_run:a.nextRun,last_run:n.status==="running"?ul(9,5):null,last_status:n.status==="running"?"running":null,last_output:null}}function WA(e,t){var s,u;const n=e.planId?xg(t).find(f=>f.plan_id===e.planId):null,r=(((s=t==null?void 0:t.runtime)==null?void 0:s.scheduleRuns)??[]).find(f=>f.scheduleId===e.id);return{id:e.id,name:e.name,expression:e.cronExpr,command:e.command||`digital-employee:${e.planId||e.id}`,prompt:e.prompt??e.description??null,job_type:"qimingclaw_schedule",schedule:{mode:"qimingclaw_schedule",schedule_id:e.id,plan_id:e.planId,expression:e.cronExpr,timezone:e.timezone,status:e.status,failure_count:e.failureCount,last_error:e.lastError},enabled:e.enabled&&e.status==="enabled"&&!e.deletedAt,delivery:{mode:"qimingclaw_schedule",schedule_id:e.id,plan_id:e.planId},template_id:e.planId??e.id,trigger_kind:"scheduled",step_count:((u=n==null?void 0:n.steps)==null?void 0:u.length)??0,skill_ids:[...new Set(((n==null?void 0:n.steps)??[]).flatMap(f=>f.preferred_skills??[]))],delete_after_run:!1,created_at:e.createdAt,next_run:e.nextRunAt||e.updatedAt,last_run:e.lastRunAt??(r==null?void 0:r.finishedAt)??(r==null?void 0:r.startedAt)??null,last_status:(r==null?void 0:r.status)??(e.lastError?"failed":null),last_output:(r==null?void 0:r.error)??e.lastError??null}}function bf(e=null){var a;const t=(((a=e==null?void 0:e.runtime)==null?void 0:a.schedules)??[]).filter(r=>r.status!=="deleted").map(r=>WA(r,e)),n=pl(e).map(r=>JA(r,e));if(t.length>0){const r=new Set(t.map(s=>s.template_id));return[...t,...n.filter(s=>!r.has(s.template_id))]}if(ur(e)){const r=vg(e).map(u=>{var f;return{id:`runtime-${u.plan_id}`,name:u.title,expression:"",command:`qimingclaw-runtime:${u.plan_id}`,prompt:u.objective??null,job_type:"qimingclaw_runtime",schedule:{mode:"runtime_record",plan_id:u.plan_id},enabled:!0,delivery:{mode:"qimingclaw_runtime",plan_id:u.plan_id},template_id:u.plan_id,trigger_kind:"runtime_record",step_count:((f=u.steps)==null?void 0:f.length)??0,skill_ids:[...new Set((u.steps??[]).flatMap(p=>p.preferred_skills??[]))],delete_after_run:!1,created_at:u.created_at,next_run:u.updated_at??u.created_at,last_run:u.updated_at??u.created_at,last_status:u.status,last_output:null}}),s=new Set(r.map(u=>u.template_id));return[...r,...n.filter(u=>!s.has(u.template_id))]}return n}function eN(e,t,n){const a=tS(e,t);if(ur(n)){const r=ea(n),s=un(n).filter(m=>!m.planId),u=r.map((m,g)=>{const b=au(n,m.id),v=Uf(m,b),k=b.filter(A=>qt(A.status)==="success").length,C=b.filter(A=>qt(A.status)==="danger").length,D=a.size===0?g<3:a.has(m.id);return{id:m.id,title:m.title,summary:m.objective||"qimingclaw 本地执行记录已同步到数字员工。",implemented:!0,selectable:!0,selected:D,status:v,status_label:ma(v),status_tone:qt(v),schedule_text:b.length>0?`最近更新 ${yf(bg(m,b))}`:"等待任务记录",result_text:b.length>0?`${b.length} 项任务,${k} 项完成,${C} 项异常`:`同步状态:${m.syncStatus}`,conversation_id:m.id}}),f=s.map((m,g)=>({id:m.id,title:m.title,summary:"未绑定 Plan 的 qimingclaw 本地任务记录。",implemented:!0,selectable:!0,selected:a.size===0?u.length+g<3:a.has(m.id),status:m.status,status_label:ma(m.status),status_tone:qt(m.status),schedule_text:`最近更新 ${yf(m.updatedAt)}`,result_text:m.syncError||`同步状态:${m.syncStatus}`,conversation_id:m.id})),p=new Set([...u,...f].map(m=>m.id));return[...u,...f,...nk(e,t,n).filter(m=>!p.has(m.id))]}return nk(e,t,n)}function nk(e,t,n){const a=tS(e,t);return pl(n).map(r=>{const s=ru(r,n),u=_f[s.plan_id]??_f["qimingclaw-client-readiness"];return{id:s.plan_id,title:s.title,summary:s.objective??"等待 qimingclaw 执行链路补充任务说明。",implemented:!0,selectable:!0,selected:a.has(s.plan_id),status:s.status,status_label:oS(s.status),status_tone:nS(s.status),schedule_text:u.scheduleText,result_text:cS(s,n),conversation_id:s.plan_id}})}function cS(e,t){return e.plan_id==="qimingclaw-client-readiness"?[er(t,"agent","Agent"),er(t,"mcp","MCP"),`活跃会话:${(t==null?void 0:t.sessions.active)??0}`].join(";"):e.plan_id==="qimingclaw-remote-task-ingress"?[er(t,"computerServer","Computer Server"),er(t,"lanproxy","Lanproxy"),er(t,"fileServer","File Server")].join(";"):e.status==="running"?"正在同步客户端运行状态":"等待任务执行"}function _l(e,t=null){const n=pl(t).filter(a=>!e||a.plan_id===e).map(a=>ru(a,t)).flatMap(tN);if(ur(t)){const a=un(t).filter(s=>!e||s.planId===e||s.id===e).map(XA),r=new Set(a.map(s=>s.task_id));return[...a,...n.filter(s=>!r.has(s.task_id))]}return n}function tN(e){return(e.steps??[]).flatMap(t=>(t.tasks??[]).map(n=>{var a;return{task_id:n.task_id,title:n.title,status:e.status==="running"&&n.status==="pending"?"running":n.status,plan_id:e.plan_id,step_id:t.step_id,assigned_skill_id:((a=t.preferred_skills)==null?void 0:a[0])??"",description:`${e.title} · ${t.title}`,created_at:e.created_at,updated_at:e.status==="running"?new Date().toISOString():e.created_at,started_at:n.status==="running"?ul(9,5):null,finished_at:n.status==="completed"?ul(9,10):null}}))}function nN(e){return e.filter(t=>t.status==="running"||t.status==="completed").map((t,n)=>({run_id:`qimingclaw-run-${n+1}`,task_id:t.task_id,plan_id:t.plan_id,skill_id:t.assigned_skill_id,attempt_no:1,lifecycle:t.status==="running"?"Running":"Succeeded",created_at:t.started_at??t.created_at,completed_at:t.finished_at,events:[{event_id:`${t.task_id}-event-start`,kind:"RunStarted",occurred_at:t.started_at??t.created_at,message:`${t.title} 已进入 qimingclaw 执行链路`}]}))}function po(e,t=null){const n=_l(e,t);if(ur(t)){const a=new Set(n.map(s=>s.task_id)),r=ta(t).filter(s=>!s.taskId||a.has(s.taskId)).map(s=>ZA(s,Dt(t)));return{tasks:n,runs:r,total:n.length,truncated:!1}}return{tasks:n,runs:nN(n),total:n.length,truncated:!1}}function iN(e){const t=Rg(null,e),n=_l(null,e),a=po(null,e).runs,r=Vr(e);return{tables:{canonical_events:Ng(e,n,a),tasks:n,runs:a,plans:t,plan_steps:r.length>0?r.map(s=>sS(s,un(e))):t.flatMap(s=>s.steps??[]),approvals:dr(e),artifacts:Yr(e)}}}function aN(e){const t=_l(null,e),n=t.filter(f=>qt(f.status)==="waiting").length,a=t.filter(f=>qt(f.status)==="running").length,r=t.filter(f=>qt(f.status)==="success").length,s=t.filter(f=>qt(f.status)==="danger").length,u=dr(e);return{runtime:{active_tasks:a,failed_tasks:s,pending_confirmations:u.filter(f=>f.status==="pending").length},tasks:{total:t.length,queued:n,running:a,succeeded:r,failed:s},approvals:{total:u.length,pending:u.filter(f=>f.status==="pending").length}}}function Pf(e){var m;const t=new Date().toISOString(),n=tr(e),a=_l(null,e),r=dr(e),s=Dt(e).filter(g=>/fail|error|reject|cancel/i.test(`${g.kind} ${g.message}`)),u=n.map(g=>({id:`service:${g.service_id}`,severity:g.requires_human_action||g.status==="stopped"?"error":g.status==="degraded"?"warn":"ok",category:"service",message:`${g.name}:${g.status_label||g.status}`,details:gi({error:g.error,kind:g.kind,running:g.running,dependent_tasks:g.dependent_tasks}),source:"qimingclaw-managed-service",created_at:g.last_seen_at||t})),f=e==null?void 0:e.sync;u.push({id:"sync:management",severity:lN(f??null),category:"sync",message:Bf(e),details:f?gi({pending:f.pending,failed:f.failed,endpoint:f.endpoint,missing_credentials:f.missingCredentials,last_error:f.lastSyncError}):null,source:"qimingclaw-sync-status",created_at:(f==null?void 0:f.lastSyncAt)??t});for(const g of(f==null?void 0:f.recentFailures)??[])u.push({id:`sync_failure:${g.id}`,severity:g.dueForRetry===!1?"error":"warn",category:"sync",message:lu(g),details:gi({entity_type:g.entityType,entity_id:g.entityId,operation:g.operation,attempts:g.attempts,next_retry_at:g.nextRetryAt}),source:"qimingclaw-sync-failure",created_at:g.lastAttemptAt??g.updatedAt??g.createdAt});const p=a.filter(g=>qt(g.status)==="danger");return u.push({id:"runtime:tasks",severity:p.length>0?"error":a.length===0?"warn":"ok",category:"runtime",message:a.length===0?"尚未读取到 qimingclaw runtime task。":`任务 ${a.length} 个,异常 ${p.length} 个。`,details:gi({task_count:a.length,failed_task_count:p.length}),source:"qimingclaw-runtime-records",created_at:t}),u.push({id:"runtime:approvals",severity:r.some(g=>g.status==="pending")?"warn":"ok",category:"approval",message:`审批 ${r.length} 个,待处理 ${r.filter(g=>g.status==="pending").length} 个。`,details:gi({approval_count:r.length,pending_count:r.filter(g=>g.status==="pending").length}),source:"qimingclaw-approval-records",created_at:t}),s.length>0&&u.push({id:"runtime:events:error",severity:"error",category:"runtime",message:`最近运行事件中发现 ${s.length} 条异常事实。`,details:{event_ids:s.slice(0,8).map(g=>g.id)},source:"qimingclaw-runtime-events",created_at:((m=s[0])==null?void 0:m.occurredAt)??t}),ur(e)||u.push({id:"runtime:data:empty",severity:"warn",category:"data",message:"本地数字员工 runtime 记录为空,页面将只显示兼容投影。",source:"qimingclaw-runtime-records",created_at:t}),{results:u,summary:{ok:u.filter(g=>g.severity==="ok").length,warn:u.filter(g=>g.severity==="warn").length,error:u.filter(g=>g.severity==="error").length,generated_at:t,source:"qimingclaw-runtime-projection"}}}function lN(e){var t;return e?e.failed>0||e.lastSyncError||(((t=e.missingCredentials)==null?void 0:t.length)??0)>0?"error":!e.enabled||!e.endpoint||e.pending>0?"warn":"ok":"warn"}function uS(e){const t=[...Dt(e).map(a=>S_(ye(a.payload),a.occurredAt)),...ta(e).map(a=>S_(ye(a.payload),a.finishedAt??a.updatedAt??a.createdAt))].filter(a=>!!a),n=t.length||Dt(e).length+ta(e).length+un(e).length;if(t.length>0){const a={};let r=0,s=0,u=!1,f=(e==null?void 0:e.generatedAt)??new Date().toISOString();for(const p of t){const m=p.model||"unknown",g=a[m]??{model:m,cost_usd:0,total_tokens:0,request_count:0};g.cost_usd+=p.estimated_cost_usd??0,g.total_tokens+=p.total_tokens??0,g.request_count+=1,a[m]=g,r+=p.total_tokens??0,s+=p.estimated_cost_usd??0,u=u||p.estimated,p.updated_at&&p.updated_at>f&&(f=p.updated_at)}return{session_cost_usd:s,daily_cost_usd:s,monthly_cost_usd:s,total_tokens:r,request_count:t.length,by_model:a,estimated:u,source:"qimingclaw-runtime-projection",updated_at:f}}return{session_cost_usd:0,daily_cost_usd:0,monthly_cost_usd:0,total_tokens:0,request_count:n,by_model:{"qimingclaw-local":{model:"qimingclaw-local",cost_usd:0,total_tokens:0,request_count:n}},estimated:!0,source:"qimingclaw-runtime-projection",updated_at:(e==null?void 0:e.generatedAt)??new Date().toISOString()}}function S_(e,t){if(!e)return null;const n=ye(e.usage)??ye(e.token_usage)??ye(e.tokenUsage)??e,a=ye(e.cost)??e,r=Wt(n.input_tokens??n.inputTokens??n.prompt_tokens??n.promptTokens),s=Wt(n.output_tokens??n.outputTokens??n.completion_tokens??n.completionTokens),u=Wt(n.total_tokens??n.totalTokens)??((r??0)+(s??0)||null),f=Wt(a.estimated_cost_usd??a.estimatedCostUsd??a.cost_usd??a.costUsd??a.usd),p=h(e.model??e.model_name??e.modelName??n.model)||"unknown";return r===null&&s===null&&u===null&&f===null?null:{model:p,input_tokens:r,output_tokens:s,total_tokens:u,estimated_cost_usd:f,estimated:typeof e.estimated=="boolean"?e.estimated:f===null,updated_at:h(e.updated_at??e.updatedAt)||t||null}}function kg(e,t){var f;const n=Math.max(1,Math.min(Math.floor(Wt(t.get("limit"))??100),300)),a=h(t.get("category"))||h(t.get("kind")),r=h(t.get("level")),s=h(t.get("id"));return[...Dt(e).map(XN),...(((f=e==null?void 0:e.sync)==null?void 0:f.recentFailures)??[]).map(p=>({audit_id:`sync_failure:${p.id}`,category:"sync",action:"sync_failed",level:p.dueForRetry===!1?"error":"warn",message:lu(p),actor:"qimingclaw-sync",entity_type:p.entityType,entity_id:p.entityId,occurred_at:p.lastAttemptAt??p.updatedAt??p.createdAt,payload:p})),...Yr(e).flatMap(p=>WN(p))].filter(p=>!a||h(p.category)===a||h(p.entity_type)===a).filter(p=>!r||h(p.level)===r).filter(p=>!s||h(p.entity_id)===s||h(p.audit_id).includes(s)).sort((p,m)=>h(m.occurred_at).localeCompare(h(p.occurred_at))).slice(0,n)}function rN(e){const t=Pf(e).results,n=kg(e,new URLSearchParams({limit:"300"})),a=uS(e),r=sN(t,n);return{doctor:{ok:t.filter(s=>s.severity==="ok").length,warn:t.filter(s=>s.severity==="warn").length,error:t.filter(s=>s.severity==="error").length},audit:{info:n.filter(s=>h(s.level)==="info").length,warn:n.filter(s=>h(s.level)==="warn").length,error:n.filter(s=>h(s.level)==="error").length},cost:{request_count:a.request_count,total_tokens:a.total_tokens,estimated_cost_usd:a.session_cost_usd,by_model_count:Object.keys(a.by_model??{}).length,estimated:!!a.estimated,updated_at:a.updated_at??null},latest_issue:r}}function sN(e,t){const n=ik(e,"error");if(n)return n;const a=ak(t,"error");if(a)return a;const r=ik(e,"warn");return r||ak(t,"warn")}function ik(e,t){const n=e.filter(a=>a.severity===t).sort((a,r)=>h(r.created_at).localeCompare(h(a.created_at)))[0];return n?{id:h(n.id)||`${n.category}:${t}`,source:"doctor",level:t,category:h(n.category)||"diagnostic",message:n.message,occurred_at:n.created_at??null}:null}function ak(e,t){const n=e.find(a=>h(a.level)===t);return n?{id:h(n.audit_id)||`${h(n.category)||"audit"}:${t}`,source:"audit",level:t,category:h(n.category)||h(n.entity_type)||"audit",message:h(n.message)||h(n.action)||"审计事件需要关注",occurred_at:h(n.occurred_at)||null}:null}function Ff(e){return kg(e,new URLSearchParams({limit:"300"})).map(t=>({...t,audit_id:h(t.audit_id),status:h(t.level)||"info",status_label:cN(h(t.level)),entity_id:h(t.entity_id)||h(t.audit_id),updated_at:h(t.occurred_at),source:yt}))}function oN(e,t){const n=h(t.get("category"))||h(t.get("kind")),a=h(t.get("level")),r=h(t.get("id"));return ga(e,t).filter(s=>!n||h(s.category)===n||h(s.entity_type)===n).filter(s=>!a||h(s.level)===a).filter(s=>!r||h(s.entity_id)===r||h(s.audit_id).includes(r))}function cN(e){return e==="error"?"异常":e==="warn"?"警告":"信息"}function uN(e,t,n){const a={plans:_S(t),"plan-steps":Gf(t),"plan-step-graph":dS(t),tasks:vN(t),runs:xN(t),events:kN(t),artifacts:wg(t),"artifact-groups":gS(t),approvals:mo(t),"approval-history":vS(t),"route-decisions":su(t),notifications:pS(t,Ma(t)),audits:Ff(t)},r=e==="route-decisions"?hN(a[e],n):e==="plan-steps"||e==="plan-step-graph"?w_(a[e],n):e==="approval-history"?xS(a[e],n):e==="notifications"?yN(a[e],n):e==="audits"?oN(a[e],n):ga(a[e],n);return{...mi(r,n),source:yt}}function Gf(e){return Vr(e).map(t=>{const n=ye(t.payload)??{},a=ye(n.dependencyGraph??n.dependency_graph)??{},r=ye(n.lastDispatch??n.last_dispatch)??{},s=Sg(n),u=fS(t,e,n),f=tt(De(a.blockedDependencies??a.blocked_dependencies)),p=tt(De(a.waitingDependencies??a.waiting_dependencies)),m=tt(De(a.satisfiedDependencies??a.satisfied_dependencies));return{step_id:t.id,node_id:t.id,remote_id:t.remoteId??null,plan_id:t.planId,title:t.title,status:t.status,seq:t.seq,depends_on:t.dependsOn,dependency_count:t.dependsOn.length,dependency_status:h(a.status)||dN(t,f,p),blocked_dependencies:f,blocked_dependency_count:f.length,blocked_dependency_details:fN(f,e),waiting_dependencies:p,waiting_dependency_count:p.length,satisfied_dependencies:m,preferred_skill_ids:t.preferredSkillIds,task_id:u.taskId,latest_run_id:u.latestRunId,dispatchable:u.dispatchable,skip_reason:u.skipReason,last_dispatch_status:h(r.status)||null,last_dispatch_at:h(r.occurredAt??r.occurred_at)||null,lease:s,lease_id:h((s==null?void 0:s.lease_id)??(s==null?void 0:s.leaseId))||null,lease_state:h(s==null?void 0:s.state)||null,lease_owner_device_id:h((s==null?void 0:s.owner_device_id)??(s==null?void 0:s.ownerDeviceId))||null,lease_acquired_at:h((s==null?void 0:s.acquired_at)??(s==null?void 0:s.acquiredAt))||null,lease_expires_at:h((s==null?void 0:s.expires_at)??(s==null?void 0:s.expiresAt))||null,lease_released_at:h((s==null?void 0:s.released_at)??(s==null?void 0:s.releasedAt))||null,lease_release_reason:h((s==null?void 0:s.release_reason)??(s==null?void 0:s.releaseReason))||null,lease_source:h(s==null?void 0:s.source)||null,remote_lease_id:h((s==null?void 0:s.remote_lease_id)??(s==null?void 0:s.remoteLeaseId))||null,remote_lease_error:h((s==null?void 0:s.remote_error)??(s==null?void 0:s.remoteError))||null,remote_release_error:h((s==null?void 0:s.remote_release_error)??(s==null?void 0:s.remoteReleaseError))||null,remote_lease_rejected:h((s==null?void 0:s.release_reason)??(s==null?void 0:s.releaseReason))==="remote_lease_rejected",lease_active:!!s,sync_status:t.syncStatus,last_synced_at:t.lastSyncedAt??null,sync_error:t.syncError??null,created_at:t.createdAt,updated_at:t.updatedAt,entity_type:"plan_step",entity_id:t.id,source:yt}}).sort((t,n)=>h(t.plan_id).localeCompare(h(n.plan_id))||Number(t.seq??0)-Number(n.seq??0)||h(t.step_id).localeCompare(h(n.step_id)))}function dS(e){return Gf(e).map(t=>({node_id:h(t.node_id)||h(t.step_id),step_id:h(t.step_id),plan_id:h(t.plan_id)||null,title:h(t.title),status:h(t.status),seq:t.seq,depends_on:De(t.depends_on),dependency_status:h(t.dependency_status)||null,blocked_dependencies:De(t.blocked_dependencies),blocked_dependency_details:De(t.blocked_dependency_details),waiting_dependencies:De(t.waiting_dependencies),satisfied_dependencies:De(t.satisfied_dependencies),task_id:h(t.task_id)||null,latest_run_id:h(t.latest_run_id)||null,dispatchable:t.dispatchable===!0,skip_reason:h(t.skip_reason)||null,lease:ye(t.lease)??null,lease_id:h(t.lease_id)||null,lease_state:h(t.lease_state)||null,lease_owner_device_id:h(t.lease_owner_device_id)||null,lease_acquired_at:h(t.lease_acquired_at)||null,lease_expires_at:h(t.lease_expires_at)||null,lease_released_at:h(t.lease_released_at)||null,lease_release_reason:h(t.lease_release_reason)||null,lease_source:h(t.lease_source)||null,remote_lease_id:h(t.remote_lease_id)||null,remote_lease_error:h(t.remote_lease_error)||null,remote_release_error:h(t.remote_release_error)||null,remote_lease_rejected:t.remote_lease_rejected===!0,lease_active:t.lease_active===!0,sync_status:h(t.sync_status)||null,updated_at:h(t.updated_at)||null,entity_type:"plan_step_graph_node",entity_id:h(t.step_id),source:yt}))}function w_(e,t){const n=h(t.get("plan_id")),a=h(t.get("step_id"))||h(t.get("id")),r=h(t.get("status")),s=h(t.get("sync_status"));return ga(e,t).filter(u=>!n||h(u.plan_id)===n).filter(u=>!a||h(u.step_id)===a||h(u.node_id)===a||h(u.entity_id)===a).filter(u=>!r||h(u.status)===r).filter(u=>!s||h(u.sync_status)===s)}function dN(e,t,n){return t.length>0?"blocked":n.length>0?"waiting":e.dependsOn.length>0?"ready":"independent"}function fS(e,t,n){var m;const a=au(t,e.planId),r=a.find(g=>hl(g)===e.id)??a.find(g=>!lk(g.status))??null,s=(r==null?void 0:r.id)??null,u=r?((m=Hf(ta(t),r.id))==null?void 0:m.id)??null:null,f=Sg(n);let p=null;return f?p="lease_active":e.status.toLowerCase()!=="ready"?p="not_ready":r?lk(r.status)?p="task_terminal":ta(t).some(g=>g.taskId===r.id&&pN(g.status))?p="task_already_running":iu(t).some(g=>{var b,v;return mN(g.status)&&(g.planId===e.planId||g.taskId===r.id||h(((b=ye(g.payload))==null?void 0:b.stepId)??((v=ye(g.payload))==null?void 0:v.step_id))===e.id)})?p="approval_pending":(n.auto_dispatch===!1||n.autoDispatch===!1)&&(p="auto_dispatch_disabled"):p="missing_task",{taskId:s,latestRunId:u,dispatchable:!p,skipReason:p}}function fN(e,t){const n=new Map(Vr(t).map(a=>[a.id,a]));return e.map(a=>{const r=n.get(a);if(!r)return{step_id:a,task_id:null,latest_run_id:null,title:a,status:"missing",dependency_status:"missing",dispatchable:!1,skip_reason:"missing_step"};const s=ye(r.payload)??{},u=ye(s.dependencyGraph??s.dependency_graph)??{},f=Sg(s),p=fS(r,t,s);return{step_id:r.id,task_id:p.taskId,latest_run_id:p.latestRunId,title:r.title,status:r.status,dependency_status:h(u.status)||r.status,dispatchable:p.dispatchable,skip_reason:p.skipReason,lease_state:h(f==null?void 0:f.state)||null,lease_active:!!f}})}function Sg(e){const t=ye(e.dispatchLease??e.dispatch_lease);if(!t)return null;const n=h(t.state)||"active",a=h(t.expires_at??t.expiresAt),r=h(t.lease_id??t.leaseId),s=h(t.owner_device_id??t.ownerDeviceId);return n!=="active"||!a||a<=new Date().toISOString()||!r||!s?null:t}function lk(e){return["completed","succeeded","success","done","skipped","cancelled","canceled"].includes(e.toLowerCase())}function pN(e){return["running","pending","queued","started"].includes(e.toLowerCase())}function mN(e){return["pending","reviewing","open","waiting"].includes(e.toLowerCase()||"pending")}function su(e){return Dt(e).filter(t=>t.kind==="route_decision").map(t=>{const n=ye(t.payload)??{},a=j_(n,t),r=mS(a);return{...a,route_decision_id:a.id,event_id:t.id,status:a.policy_result||"accepted",status_label:hS(a),attention_level:r,entity_type:"route_decision",entity_id:a.id,occurred_at:t.occurredAt,created_at:t.createdAt,updated_at:a.recorded_at||t.occurredAt,payload:n}}).sort((t,n)=>h(n.recorded_at).localeCompare(h(t.recorded_at))||h(n.event_id).localeCompare(h(t.event_id)))}function hN(e,t){const n=h(t.get("route_kind")),a=h(t.get("intent_kind")),r=h(t.get("policy_result"));return ga(e,t).filter(s=>!n||h(s.route_kind)===n).filter(s=>!a||h(s.intent_kind)===a).filter(s=>!r||h(s.policy_result)===r)}function pS(e,t){const n=oo(t);return DS(e,t).map(a=>({notification_id:a.notification_id,kind:a.kind,level:a.level,status:a.status,title:a.title,body:a.body,plan_id:a.plan_id,task_id:a.task_id,correlation_id:a.correlation_id,created_at:a.created_at,updated_at:a.replied_at||a.dismissed_at||a.read_at||a.created_at,read_at:a.read_at??null,dismissed_at:a.dismissed_at??null,replied_at:a.replied_at??null,muted_by_preferences:!LS(a,n),entity_type:"notification",entity_id:a.notification_id,source:yt})).sort((a,r)=>h(r.created_at).localeCompare(h(a.created_at))||h(r.notification_id).localeCompare(h(a.notification_id)))}function _N(e){const t=mo(e).filter(s=>s.approval_conflict_active===!0).map(s=>({intervention_id:`approval-conflict:${h(s.approval_id)}`,kind:"approval_conflict",title:h(s.title)||h(s.summary)||"审批跨端冲突",status:"open",priority:"high",entity_type:"approval",entity_id:h(s.approval_id),approval_id:h(s.approval_id),plan_id:h(s.plan_id)||null,task_id:h(s.task_id)||null,run_id:h(s.run_id)||null,reason:h(s.approval_conflict_reason)||"approval_conflict",summary:`本地 ${h(s.approval_conflict_local_status)||h(s.status)} / 管理端 ${h(s.approval_conflict_remote_status)||"unknown"}`,occurred_at:h(s.approval_conflict_detected_at)||h(s.updated_at)||h(s.created_at),updated_at:h(s.approval_conflict_detected_at)||h(s.updated_at)||h(s.created_at),source:yt,payload:s})),n=su(e).filter(s=>["warn","error","action"].includes(h(s.attention_level))).map(s=>{var u,f,p;return{intervention_id:`route-intervention:${h(s.route_decision_id)}`,kind:"route_intervention",title:hS(s),status:h(s.policy_result)||h(s.status)||"attention",priority:h(s.attention_level)==="error"?"high":h(s.attention_level)==="warn"?"medium":"normal",entity_type:"route_decision",entity_id:h(s.route_decision_id),route_decision_id:h(s.route_decision_id),plan_id:h((u=ye(s.context_refs))==null?void 0:u.plan_id)||null,task_id:h((f=ye(s.context_refs))==null?void 0:f.task_id)||null,run_id:h((p=ye(s.context_refs))==null?void 0:p.run_id)||null,reason:tt(De(s.reason_codes)).join(" / ")||h(s.blocked_reason)||h(s.policy_result),summary:`${h(s.route_kind)} / ${h(s.intent_kind)}`,occurred_at:h(s.recorded_at)||h(s.created_at),updated_at:h(s.recorded_at)||h(s.created_at),source:yt,payload:s}}),a=Dt(e).filter(s=>["risk_approval_required","risk_policy_rejected"].includes(s.kind)).map(s=>{const u=ye(s.payload)??{};return{intervention_id:`risk-approval:${s.id}`,kind:"risk_approval",title:s.kind==="risk_policy_rejected"?"风险策略已拒绝":"风险审批待处理",status:h(u.status)||s.kind,priority:["high","critical"].includes(h(u.risk_level??u.riskLevel))?"high":"medium",entity_type:"risk_approval",entity_id:s.id,event_id:s.id,approval_id:h(u.approval_id??u.approvalId)||null,plan_id:(s.planId??h(u.plan_id))||null,task_id:(s.taskId??h(u.task_id))||null,run_id:(s.runId??h(u.run_id))||null,reason:h(u.action_kind??u.actionKind??u.reason)||s.kind,summary:s.message,occurred_at:s.occurredAt,updated_at:s.occurredAt,source:yt,payload:u}}),r=pS(e,Ma(e)).filter(s=>h(s.level)==="action"&&!["resolved","dismissed"].includes(h(s.status))).map(s=>({intervention_id:`notification:${h(s.notification_id)}`,kind:"action_notification",title:h(s.title)||"待处理通知",status:h(s.status)||"unread",priority:"normal",entity_type:"notification",entity_id:h(s.notification_id),notification_id:h(s.notification_id),plan_id:h(s.plan_id)||null,task_id:h(s.task_id)||null,run_id:null,reason:h(s.kind),summary:h(s.body),occurred_at:h(s.created_at),updated_at:h(s.updated_at)||h(s.created_at),source:yt,payload:s}));return[...t,...n,...a,...r].sort((s,u)=>Tn(u).localeCompare(Tn(s))||h(s.intervention_id).localeCompare(h(u.intervention_id)))}function gN(e,t){const n=h(t.get("kind")),a=h(t.get("status")),r=h(t.get("priority")),s=h(t.get("entity_id"));return e.filter(u=>!n||n==="all"||h(u.kind)===n).filter(u=>!a||h(u.status)===a).filter(u=>!r||h(u.priority)===r).filter(u=>!s||Ag(u).includes(s)||h(u.intervention_id)===s||h(u.route_decision_id)===s)}function yN(e,t){const n=h(t.get("id")),a=h(t.get("kind")),r=h(t.get("level")),s=h(t.get("muted")).toLowerCase();return ga(e,t).filter(u=>!n||h(u.notification_id)===n||h(u.correlation_id)===n||h(u.entity_id)===n).filter(u=>!a||h(u.kind)===a).filter(u=>!r||h(u.level)===r).filter(u=>{if(!s)return!0;const f=u.muted_by_preferences===!0;return["1","true","yes"].includes(s)?f:["0","false","no"].includes(s)?!f:!0})}function j_(e,t){const n=ye(e.routeDecision??e.route_decision??e)??{};return{id:h(n.id)||t.id,route_kind:h(n.route_kind??n.routeKind)||"ChatOnly",intent_kind:h(n.intent_kind??n.intentKind)||"chat",reason_codes:tt(De(n.reason_codes??n.reasonCodes)),candidate_skills:tt(De(n.candidate_skills??n.candidateSkills)),context_refs:ye(n.context_refs??n.contextRefs)??{},created_command_id:h(n.created_command_id??n.createdCommandId)||null,correlation_id:h(n.correlation_id??n.correlationId)||t.id,creates_plan:!!(n.creates_plan??n.createsPlan),creates_task_run:!!(n.creates_task_run??n.createsTaskRun),approval_mode:h(n.approval_mode??n.approvalMode)||null,policy_result:h(n.policy_result??n.policyResult)||"accepted",policy_source:h(n.policy_source??n.policySource)||null,blocked_reason:h(n.blocked_reason??n.blockedReason)||null,approval_id:h(n.approval_id??n.approvalId)||null,matched_intent:h(n.matched_intent??n.matchedIntent)||null,recorded_at:h(n.recorded_at??n.recordedAt)||t.occurredAt,entrypoint:h(n.entrypoint)||null,actor:h(n.actor)||null}}function mS(e){return e.policy_result==="approval_required"?"action":e.policy_result&&e.policy_result!=="accepted"?"error":e.reason_codes.includes("candidate_skills_disabled")||e.reason_codes.includes("route_action_missing_context")||e.reason_codes.includes("route_action_policy_blocked")||e.reason_codes.includes("route_action_not_mapped")?"warn":e.created_command_id?"action":"info"}function hS(e){const t=mS(e);return t==="error"?"策略拒绝":e.policy_result==="approval_required"?"待审批":t==="warn"?"需要关注":e.created_command_id?"已映射命令":"已记录"}function bN(e){const t=su(e),n=t[0]??null,a=so((e==null?void 0:e.uiState)??dn()),r=Dt(e).filter(p=>p.kind==="route_decision_intervention_resolved"),s=new Set(r.map(p=>{var m;return h((m=ye(p.payload))==null?void 0:m.route_decision_id)}).filter(Boolean)),u=r.sort((p,m)=>m.occurredAt.localeCompare(p.occurredAt))[0]??null,f=ye(u==null?void 0:u.payload)??null;return{total:t.length,mapped_count:t.filter(p=>h(p.created_command_id)).length,governance_mapped_count:t.filter(p=>h(p.created_command_id)).length,governance_blocked_count:t.filter(p=>{const m=De(p.reason_codes).map(h);return m.includes("route_action_policy_blocked")||m.includes("route_action_missing_context")||m.includes("route_action_not_mapped")}).length,attention_count:t.filter(p=>["warn","error"].includes(h(p.attention_level))).length,blocked_count:t.filter(p=>h(p.policy_result)==="blocked").length,approval_required_count:t.filter(p=>h(p.policy_result)==="approval_required").length,pending_intervention_count:t.filter(p=>h(p.policy_result)!=="accepted"&&!s.has(h(p.route_decision_id))).length,restored_count:r.filter(p=>{var m;return((m=ye(p.payload))==null?void 0:m.command_accepted)===!0}).length,latest_intervention_status:h((f==null?void 0:f.status)??(f==null?void 0:f.decision))||null,policy_source:a.source??null,policy_last_pulled_at:a.last_pulled_at??null,policy_last_pull_error:a.last_pull_error??null,latest:n?{id:h(n.route_decision_id),route_kind:h(n.route_kind),intent_kind:h(n.intent_kind),status_label:h(n.status_label),attention_level:h(n.attention_level),created_command_id:h(n.created_command_id)||null,policy_source:h(n.policy_source)||null,blocked_reason:h(n.blocked_reason)||null,approval_id:h(n.approval_id)||null,recorded_at:h(n.recorded_at)}:null}}function _S(e){const t=new Map(ea(e).map(s=>[s.id,s])),n=_l(null,e),a=po(null,e).runs,r=Ng(e,n,a);return Rg(null,e).map(s=>{const u=t.get(s.plan_id),f=n.filter(g=>g.plan_id===s.plan_id),p=a.filter(g=>g.plan_id===s.plan_id),m=r.filter(g=>g.plan_id===s.plan_id).map(g=>h(g.occurred_at??g.timestamp)).filter(Boolean).sort().pop()||null;return{plan_id:s.plan_id,remote_id:(u==null?void 0:u.remoteId)??null,title:s.title,objective:s.objective??null,status:s.status,task_count:f.length,run_count:p.length,latest_event_at:m,sync_status:((u==null?void 0:u.syncStatus)??h(s.sync_status))||null,created_at:s.created_at,updated_at:h(s.updated_at)||(u==null?void 0:u.updatedAt)||s.created_at,payload:(u==null?void 0:u.payload)??gi({source:s.source,steps:s.steps})}})}function vN(e){const t=new Map(un(e).map(n=>[n.id,n]));return _l(null,e).map(n=>{const a=t.get(n.task_id);return{task_id:n.task_id,remote_id:(a==null?void 0:a.remoteId)??null,plan_id:n.plan_id??null,title:n.title,status:n.status,assigned_skill_id:n.assigned_skill_id||(a==null?void 0:a.assignedSkillId)||null,sync_status:((a==null?void 0:a.syncStatus)??h(n.sync_status))||null,created_at:n.created_at,updated_at:n.updated_at,payload:(a==null?void 0:a.payload)??gi({step_id:n.step_id,description:n.description})}})}function xN(e){const t=new Map(ta(e).map(n=>[n.id,n]));return po(null,e).runs.map(n=>{const a=t.get(n.run_id),r=(a==null?void 0:a.startedAt)??n.created_at,s=(a==null?void 0:a.finishedAt)??n.completed_at??null,u=(n.events??[]).slice().sort((f,p)=>h(p.occurred_at).localeCompare(h(f.occurred_at)))[0];return{run_id:n.run_id,remote_id:(a==null?void 0:a.remoteId)??null,plan_id:n.plan_id??null,task_id:n.task_id||null,status:(a==null?void 0:a.status)??n.lifecycle,started_at:r??null,finished_at:s,duration_ms:QN(r,s),last_event_message:(u==null?void 0:u.message)??null,sync_status:((a==null?void 0:a.syncStatus)??h(n.sync_status))||null,created_at:(a==null?void 0:a.createdAt)??n.created_at,payload:(a==null?void 0:a.payload)??gi({lifecycle:n.lifecycle,attempt_no:n.attempt_no})}})}function kN(e){const t=_l(null,e),n=po(null,e).runs,a=new Map(Dt(e).map(r=>[r.id,r]));return Ng(e,t,n).map(r=>{const s=a.get(r.event_id),u=h(r.plan_id)||(s==null?void 0:s.planId)||null,f=h(r.task_id)||(s==null?void 0:s.taskId)||null;return{event_id:r.event_id,remote_id:(s==null?void 0:s.remoteId)??null,plan_id:u,task_id:f,run_id:(s==null?void 0:s.runId)??null,kind:r.kind??r.event_type??(s==null?void 0:s.kind)??null,message:r.message??(s==null?void 0:s.message)??null,occurred_at:h(r.occurred_at??r.timestamp)||(s==null?void 0:s.occurredAt),sync_status:(s==null?void 0:s.syncStatus)??null,payload:(s==null?void 0:s.payload)??gi({aggregate_type:r.aggregate_type,aggregate_id:r.aggregate_id})}})}function wg(e){const t=new Map(qf(e).map(a=>[a.id,a])),n=Yr(e);return n.map(a=>{var b;const r=h(a.artifact_id)||h(a.subject_id),s=t.get(r),u=AS({plan_id:a.plan_id,task_id:a.task_id,run_id:a.run_id,fallback_type:"artifact",fallback_id:a.subject_id??r}),f=Tg(e,r),p=ES(e,r,a),m=Eg(n,a),g=Vf(a);return{...a,artifact_id:r,remote_id:((s==null?void 0:s.remoteId)??h(a.remote_id))||null,entity_type:u.entity_type,entity_id:u.entity_id,sync_status:((s==null?void 0:s.syncStatus)??h(a.sync_status))||null,version:m.version,version_key:m.version_key,version_rank:m.version_rank,retention_status:f.retention_status,retention_until:f.retention_until,last_retention_action:f.last_retention_action,cleanup_status:p.cleanup_status,deleted_at:p.deleted_at,cleanup_reason:p.cleanup_reason,cleanup_event_id:p.cleanup_event_id,last_access_status:h((b=ye(a.access))==null?void 0:b.last_access_status)||null,delivery_summary:g}})}function gS(e){const t=new Map;return wg(e).forEach(n=>{const a=SN(n);t.set(a,[...t.get(a)??[],n])}),[...t.entries()].map(([n,a])=>{const r=a.slice().sort((m,g)=>Tn(g).localeCompare(Tn(m))),s=r[0]??{},u=tt(a.map(m=>m.artifact_id)),f=tt(a.map(m=>wN(m))),p=tt(a.map(m=>m.version_key||m.version||m.artifact_id));return{entity_type:"artifact_group",entity_id:n,group_key:n,version_key:h(s.version_key)||n,title:h(s.name)||h(s.title)||n,summary:`产物 ${u.length} / 设备 ${f.length} / 版本 ${p.length}`,status:rk(Id(a,"retention_status"))||"unmanaged",sync_status:rk(Id(a,"sync_status"))||null,plan_id:h(s.plan_id)||null,task_id:h(s.task_id)||null,run_id:h(s.run_id)||null,artifact_ids:u,artifact_count:u.length,device_count:f.length,version_count:p.length,latest_artifact_id:h(s.artifact_id)||null,retention_status_counts:Id(a,"retention_status"),cleanup_status_counts:Id(a,"cleanup_status"),updated_at:Tn(s),created_at:h(s.created_at)||null,business_view:gi({artifact_ids:u,device_ids:f,version_keys:p}),payload:{artifacts:r},source:yt}}).sort((n,a)=>Tn(a).localeCompare(Tn(n))||h(n.entity_id).localeCompare(h(a.entity_id)))}function SN(e){const t=h(e.version_key).replace(/:v[^:]+$/,"");if(t)return t;const n=h(e.name)||h(e.title);return`artifact-group:${h(e.kind)||"artifact"}:${h(e.source_label)||h(e.source_type)}:${n||h(e.uri)||h(e.artifact_id)}`}function wN(e){const t=ye(e.payload)??{};return h(e.device_id)||h(e.source_device_id)||h(e.remote_device_id)||h(t.device_id??t.deviceId)||h(t.source_device_id??t.sourceDeviceId)||"local"}function Id(e,t){return e.reduce((n,a)=>{const r=h(a[t])||"none";return n[r]=(n[r]??0)+1,n},{})}function rk(e){var t;return((t=Object.entries(e).sort((n,a)=>a[1]-n[1]||n[0].localeCompare(a[0]))[0])==null?void 0:t[0])??null}function jg(e,t){const n=wg(e).find(a=>h(a.artifact_id)===t||h(a.remote_id)===t)??null;return n?{...n,versions:yS(e,h(n.artifact_id)),lifecycle_events:CS(e).filter(a=>h(a.artifact_id)===h(n.artifact_id)).slice(0,20),cleanup_events:TS(e).filter(a=>h(a.artifact_id)===h(n.artifact_id)).slice(0,20)}:null}function yS(e,t){const n=Yr(e),a=n.find(s=>h(s.artifact_id)===t||h(s.subject_id)===t);if(!a)return[];const r=vf(a);return n.filter(s=>vf(s)===r).sort((s,u)=>h(s.created_at).localeCompare(h(u.created_at))).map((s,u)=>{const f=Eg(n,s);return{artifact_id:h(s.artifact_id)||h(s.subject_id),name:h(s.name)||null,version:f.version||`local-v${u+1}`,version_key:f.version_key,version_rank:u+1,delivery_summary:Vf(s),retention_status:Tg(e,h(s.artifact_id)).retention_status,created_at:h(s.created_at)||null,source_label:h(s.source_label)||null}})}function mo(e){const t=new Map(iu(e).map(n=>[n.id,n]));return dr(e).map(n=>{const a=h(n.approval_id),r=t.get(a),s=TN(e,a,n),u=jN(n),f=CN(n),p=AS({plan_id:n.plan_id,task_id:n.task_id,run_id:n.run_id,fallback_type:h(n.source)==="qimingclaw-sync"?"sync_outbox":"approval",fallback_id:n.task_id||a});return{...n,approval_id:a,remote_id:((r==null?void 0:r.remoteId)??h(n.remote_id))||null,entity_type:p.entity_type,entity_id:p.entity_id,sync_status:((r==null?void 0:r.syncStatus)??h(n.sync_status))||null,risk_level:s.risk_level,sla_status:s.sla_status,due_at:s.due_at,last_action:s.last_action,last_actor:s.last_actor,comment_count:s.comment_count,delegate_to:s.delegate_to,workflow_id:u.workflow_id,current_step_id:u.current_step_id,current_step_label:u.current_step_label,current_participant:u.current_participant,approval_step_index:u.step_index,approval_step_count:u.step_count,next_step_label:u.next_step_label,approval_conflict_active:f.active,approval_conflict_reason:f.reason,approval_conflict_remote_status:f.remote_status,approval_conflict_detected_at:f.detected_at,approval_conflict_local_status:f.local_status,approval_conflict_remote_current_step_id:f.remote_current_step_id,approval_conflict_resolved_at:f.resolved_at,approval_conflict_resolution:f.resolution,approval_conflict_resolution_actor:f.resolution_actor,approval_conflict_resolution_event_id:f.resolution_event_id}})}function bS(e,t){const n=mo(e).find(a=>h(a.approval_id)===t||h(a.remote_id)===t)??null;return n?{...n,timeline:NS(h(n.approval_id),e).events}:null}function Cg(e){return Dt(e).filter(t=>["approval_action_recorded","approval_action_rejected"].includes(t.kind)).map(t=>{const n=ye(t.payload)??{},a=ye(n.delegate_summary),r=ye(n.comment_summary),s=ye(n.sla_summary),u=ye(n.risk_summary);return{action_id:t.id,event_id:t.id,kind:t.kind,approval_id:h(n.approval_id)||null,action:h(n.action)||null,status:h(n.status)||null,comment_preview:h(r==null?void 0:r.preview)||null,comment_length:Wt(r==null?void 0:r.length),delegate_to:h((a==null?void 0:a.label)??(a==null?void 0:a.target))||null,sla_status:h(s==null?void 0:s.sla_status)||null,due_at:h(s==null?void 0:s.due_at)||null,risk_level:h(u==null?void 0:u.risk_level)||null,actor:h(n.actor)||null,source:h(n.source)||null,plan_id:(t.planId??h(n.plan_id))||null,task_id:(t.taskId??h(n.task_id))||null,run_id:(t.runId??h(n.run_id))||null,message:t.message,occurred_at:t.occurredAt,sync_status:t.syncStatus??null,payload:n}}).sort((t,n)=>h(n.occurred_at).localeCompare(h(t.occurred_at)))}function vS(e){const t=new Map(mo(e).map(r=>[h(r.approval_id),r])),n=Cg(e).map(r=>{const s=h(r.approval_id),u=t.get(s);return{history_id:h(r.action_id),event_id:h(r.event_id),approval_id:s||null,action:h(r.action)||null,status:h(r.status)||null,actor:h(r.actor)||null,risk_level:h(r.risk_level)||null,due_at:h(r.due_at)||null,delegate_to:h(r.delegate_to)||null,comment_length:Wt(r.comment_length),message:h(r.message)||null,plan_id:h(r.plan_id)||h(u==null?void 0:u.plan_id)||null,task_id:h(r.task_id)||h(u==null?void 0:u.task_id)||null,run_id:h(r.run_id)||h(u==null?void 0:u.run_id)||null,occurred_at:h(r.occurred_at)||null,updated_at:h(r.occurred_at)||null,sync_status:h(r.sync_status)||null,entity_type:"approval_history",entity_id:h(r.action_id),source:yt}}),a=Dt(e).filter(r=>r.kind==="approval_decision").map(r=>{const s=ye(r.payload)??{},u=h(s.approvalId??s.approval_id)||r.id.split(":decision:")[0]||"",f=t.get(u);return{history_id:r.id,event_id:r.id,approval_id:u||null,action:"decision",status:h(s.nextStatus??s.next_status??s.decision)||null,actor:h(s.actor)||h(s.source)||"qimingclaw-approval-decision",risk_level:h(f==null?void 0:f.risk_level)||null,due_at:h(f==null?void 0:f.due_at)||null,delegate_to:h(f==null?void 0:f.delegate_to)||null,comment_length:null,message:r.message||null,plan_id:r.planId||h(s.planId??s.plan_id)||h(f==null?void 0:f.plan_id)||null,task_id:r.taskId||h(s.taskId??s.task_id)||h(f==null?void 0:f.task_id)||null,run_id:r.runId||h(s.runId??s.run_id)||h(f==null?void 0:f.run_id)||null,occurred_at:r.occurredAt,updated_at:r.occurredAt,sync_status:r.syncStatus??null,entity_type:"approval_history",entity_id:r.id,source:yt}});return[...n,...a].sort((r,s)=>h(s.occurred_at).localeCompare(h(r.occurred_at))||h(s.history_id).localeCompare(h(r.history_id)))}function xS(e,t){const n=h(t.get("approval_id"))||h(t.get("id")),a=h(t.get("action")),r=h(t.get("risk_level"));return ga(e,t).filter(s=>!n||h(s.approval_id)===n||h(s.history_id)===n||h(s.event_id)===n).filter(s=>!a||h(s.action)===a).filter(s=>!r||h(s.risk_level)===r)}function jN(e){const t=ye(e.payload)??{},n=ye(t.workflow)??{},a=Array.isArray(n.steps)?n.steps.map(p=>ye(p)??{}):[],r=h(n.current_step_id??n.currentStepId??t.current_step_id??t.currentStepId),s=Math.max(0,a.findIndex(p=>h(p.step_id??p.stepId??p.id)===r)),u=a[s]??null,f=a.slice(s+1).find(p=>["pending","delegated","timeout"].includes(h(p.status)||"pending"))??null;return{workflow_id:h(n.workflow_id??n.workflowId)||null,current_step_id:r||null,current_step_label:h((u==null?void 0:u.label)??(u==null?void 0:u.title)??(u==null?void 0:u.name))||null,current_participant:h((u==null?void 0:u.participant_label)??(u==null?void 0:u.participantLabel)??(u==null?void 0:u.participant_id)??(u==null?void 0:u.participantId))||null,step_index:a.length>0?s+1:null,step_count:a.length||null,next_step_label:h((f==null?void 0:f.label)??(f==null?void 0:f.title)??(f==null?void 0:f.name))||null}}function CN(e){const t=ye(e.payload)??{},n=ye(t.conflict)??{},a=ye(n.resolution)??{};return{active:n.active===!0,reason:h(n.reason)||null,remote_status:h(n.remote_status??n.remoteStatus)||null,detected_at:h(n.detected_at??n.detectedAt)||null,local_status:h(n.local_status??n.localStatus)||null,remote_current_step_id:h(n.remote_current_step_id??n.remoteCurrentStepId)||null,resolved_at:h(a.resolved_at??a.resolvedAt)||null,resolution:h(a.resolution)||null,resolution_actor:h(a.actor)||null,resolution_event_id:h(a.event_id??a.eventId)||null}}function TN(e,t,n){const a=Cg(e).filter(b=>h(b.approval_id)===t),r=a[0],s=a.find(b=>h(b.risk_level)),u=a.find(b=>{const v=h(b.sla_status);return!!(v&&v!=="untracked")}),f=a.find(b=>h(b.delegate_to)),p=ye(n.payload),m=h(u==null?void 0:u.due_at)||h((p==null?void 0:p.due_at)??(p==null?void 0:p.dueAt)??(p==null?void 0:p.timeout_at)??(p==null?void 0:p.timeoutAt)),g=h(u==null?void 0:u.sla_status)||EN(m);return{risk_level:h(s==null?void 0:s.risk_level)||"normal",sla_status:g,due_at:m||null,last_action:h(r==null?void 0:r.action)||null,last_actor:h(r==null?void 0:r.actor)||null,comment_count:a.filter(b=>h(b.action)==="comment").length,delegate_to:h(f==null?void 0:f.delegate_to)||null}}function EN(e){if(!e)return"untracked";const t=Date.parse(e);return Number.isFinite(t)?t<Date.now()?"timeout":"tracked":"untracked"}function kS(e){return Dt(e).filter(t=>["skill_call_allowed","skill_call_rejected","skill_call_observed"].includes(t.kind)).map(t=>{const n=ye(t.payload)??{};return{audit_id:t.id,event_id:t.id,remote_id:t.remoteId??null,decision:h(n.decision)||t.kind.replace("skill_call_",""),source:h(n.source)||null,server_id:h(n.server_id)||null,tool_name:h(n.tool_name)||null,skill_id:h(n.skill_id)||null,call_id:h(n.call_id)||null,session_id:h(n.session_id)||null,task_id:(t.taskId??h(n.task_id))||null,run_id:(t.runId??h(n.run_id))||null,reason_codes:Array.isArray(n.reason_codes)?n.reason_codes:[],message:t.message,occurred_at:t.occurredAt,sync_status:t.syncStatus??null,payload:n}}).sort((t,n)=>h(n.occurred_at).localeCompare(h(t.occurred_at)))}function AN(e){const t=kS(e).map(a=>({audit_id:h(a.audit_id),category:"skill_call_audit",decision:h(a.decision),status:h(a.decision)||"observed",skill_id:h(a.skill_id)||null,tool_name:h(a.tool_name)||null,server_id:h(a.server_id)||null,source:h(a.source)||yt,risk_level:h(a.risk_level)||null,session_id:h(a.session_id)||null,task_id:h(a.task_id)||null,run_id:h(a.run_id)||null,message:h(a.message)||`${h(a.tool_name)||h(a.skill_id)||"skill"} ${h(a.decision)}`,occurred_at:h(a.occurred_at),updated_at:h(a.occurred_at),payload_preview:xf("skill_call_audit",ye(a.payload)??{}),payload:a.payload,entity_type:"skill_audit",entity_id:h(a.audit_id)})),n=Ff(e).filter(a=>["tool_call_audit","sandbox_audit","token_cost"].includes(h(a.category))).map(a=>({audit_id:h(a.audit_id),category:h(a.category),decision:h(a.decision)||h(a.status)||h(a.level),status:h(a.status)||h(a.level)||"info",skill_id:h(a.skill_id)||null,tool_name:h(a.tool_name)||null,server_id:h(a.server_id)||null,source:h(a.source)||yt,risk_level:h(a.risk_level)||null,model:h(a.model)||null,total_tokens:Wt(a.total_tokens),estimated_cost_usd:Wt(a.estimated_cost_usd),session_id:h(a.session_id)||null,task_id:h(a.task_id)||null,run_id:h(a.run_id)||null,message:h(a.message)||h(a.action)||h(a.category),occurred_at:h(a.occurred_at),updated_at:h(a.updated_at)||h(a.occurred_at),payload_preview:xf(h(a.category),ye(a.payload)??{}),payload:a.payload,entity_type:"skill_audit",entity_id:h(a.audit_id)}));return[...t,...n].sort((a,r)=>Tn(r).localeCompare(Tn(a))||h(a.audit_id).localeCompare(h(r.audit_id)))}function NN(e,t){const n=h(t.get("skill_id")),a=h(t.get("server_id")),r=h(t.get("tool_name")),s=h(t.get("decision")),u=h(t.get("category")),f=h(t.get("status"));return e.filter(p=>!n||h(p.skill_id)===n).filter(p=>!a||h(p.server_id)===a).filter(p=>!r||h(p.tool_name)===r).filter(p=>!s||h(p.decision)===s).filter(p=>!u||h(p.category)===u).filter(p=>!f||h(p.status)===f)}function SS(e){const n=((e==null?void 0:e.uiState)??dn()).opsWorkbenchStateById??{},a=Pf(e).results.filter(f=>f.severity==="warn"||f.severity==="error").map(f=>{const p=`diagnostic:${h(f.id)||h(f.category)||f.message}`;return Lc({ops_id:p,kind:"diagnostic",title:f.message||"诊断项需要处理",status:f.severity,priority:f.severity,entity_type:"diagnostic",entity_id:h(f.id)||h(f.category)||p,category:f.category,recommended_action:"mark_reviewed",reason_codes:[h(f.category)||"doctor_issue"],occurred_at:f.created_at??(e==null?void 0:e.generatedAt)??new Date().toISOString(),updated_at:f.created_at??(e==null?void 0:e.generatedAt)??new Date().toISOString(),payload:f},n[p])}),r=tr(e).filter(f=>f.requires_human_action||f.status==="degraded"||f.status==="stopped").map(f=>{const p=`service:${f.service_id}`,m=wS(f.service_id);return Lc({ops_id:p,kind:"service",title:f.name,status:f.status,priority:f.status==="stopped"?"error":"warn",entity_type:"managed_service",entity_id:f.service_id,service_id:f.service_id,recommended_action:m?"safe_restart_service":"mark_reviewed",reason_codes:[f.status,m?"safe_restart_service":"manual_review_required"],summary:f.error||f.status_label,occurred_at:f.last_seen_at,updated_at:f.last_seen_at,payload:f},n[p])}),s=Ff(e).filter(f=>["warn","error"].includes(h(f.level))).map(f=>{const p=`audit:${h(f.audit_id)}`;return Lc({ops_id:p,kind:"audit",title:h(f.message)||h(f.action)||"审计风险",status:h(f.level),priority:h(f.level),entity_type:h(f.entity_type)||"audit",entity_id:h(f.entity_id)||h(f.audit_id),audit_id:h(f.audit_id),recommended_action:"mark_reviewed",reason_codes:[h(f.category)||"audit_risk"],occurred_at:h(f.occurred_at),updated_at:h(f.updated_at)||h(f.occurred_at),payload:f},n[p])}),u=RN(e,n);return[...a,...r,...s,...u].filter(f=>h(f.status)!=="dismissed").sort((f,p)=>Tn(p).localeCompare(Tn(f))||h(f.ops_id).localeCompare(h(p.ops_id)))}function RN(e,t){const n=(e==null?void 0:e.uiState)??dn();return[{id:"plan_step_dispatch",title:"PlanStep 派发策略",error:ar(n).last_pull_error,pulledAt:ar(n).last_pulled_at,recommended:"retry_policy_pull"},{id:"risk_approval",title:"风险审批策略",error:ro(n).last_pull_error,pulledAt:ro(n).last_pulled_at,recommended:"retry_policy_pull"},{id:"route_decision",title:"入口路由策略",error:so(n).last_pull_error,pulledAt:so(n).last_pulled_at,recommended:"retry_policy_pull"}].filter(r=>!!r.error).map(r=>{const s=`policy:${r.id}`;return Lc({ops_id:s,kind:"policy",title:r.title,status:"error",priority:"warn",entity_type:"policy",entity_id:r.id,policy_id:r.id,recommended_action:r.recommended,reason_codes:["policy_pull_error"],summary:r.error,occurred_at:r.pulledAt??(e==null?void 0:e.generatedAt)??new Date().toISOString(),updated_at:r.pulledAt??(e==null?void 0:e.generatedAt)??new Date().toISOString(),payload:r},t[s])})}function DN(e){const t=Ma(e);return Yf(e,t).map(n=>({notification_id:n.notification_id,kind:n.kind,title:n.title,status:n.status,priority:n.level,level:n.level,entity_type:"notification",entity_id:n.notification_id,plan_id:n.plan_id||null,task_id:n.task_id||null,run_id:null,recommended_action:n.status==="unread"?"mark_read":n.status==="dismissed"?null:"dismiss",body:n.body,reason_codes:[n.kind,n.level],occurred_at:n.created_at,updated_at:n.read_at||n.dismissed_at||n.replied_at||n.created_at,payload:n})).sort((n,a)=>Tn(a).localeCompare(Tn(n)))}function MN(e){const n=((e==null?void 0:e.uiState)??dn()).dailyReportWorkbenchStateById??{};return C_(e).map(a=>{const r=h(a.report_id),s=BN(e,r),u=De(a.artifact_sources),f=h(a.status)||"ready",p=s.approval_status!=="requested";return Lc({report_id:r,date:h(a.date),title:h(a.title)||"数字员工日报",status:f,priority:f==="ready"?"info":"warn",entity_type:"daily_report",entity_id:r,artifact_id:h(a.artifact_id),artifact_count:u.length,delivery_status:s.delivery_status,confirmation_status:s.confirmation_status,approval_status:s.approval_status,recommended_action:s.confirmation_status!=="confirmed"?"confirm_report":p?"request_approval":"open_report",reason_codes:["daily_report_workbench"],occurred_at:h(a.generated_at),updated_at:h(a.updated_at)||h(a.generated_at),payload:{...a,delivery:s}},n[r])}).sort((a,r)=>Tn(r).localeCompare(Tn(a)))}function Lc(e,t){return t?{...e,status:t.status||e.status,last_action:t.last_action??null,reviewed_at:t.last_action==="mark_reviewed"?t.updated_at??null:e.reviewed_at,dismissed_at:t.last_action==="dismiss"?t.updated_at??null:e.dismissed_at,updated_at:t.updated_at||e.updated_at,actor:t.actor??e.actor,reason:t.reason??e.reason}:e}function $N(e,t){const n=h(t.get("kind")),a=h(t.get("priority"));return ga(e,t).filter(r=>!n||n==="all"||h(r.kind)===n).filter(r=>!a||h(r.priority)===a||h(r.status)===a)}function zN(e,t){const n=h(t.get("kind")),a=h(t.get("level"));return ga(e,t).filter(r=>!n||n==="all"||h(r.kind)===n).filter(r=>!a||h(r.level)===a||h(r.priority)===a)}function ON(e,t){const n=h(t.get("date"));return ga(e,t).filter(a=>!n||h(a.date)===n)}async function LN(e,t){const n=h(e.action)||"mark_reviewed";if(!["mark_reviewed","dismiss","open_related_view","retry_policy_pull","safe_restart_service"].includes(n))return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_ops_workbench_action"]};const a=tt([...De(e.ops_ids),...De(e.opsIds)].map(h)).slice(0,100);if(a.length===0)return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["ops_ids_required"]};const r=SS(t),s=new Map(r.map(g=>[h(g.ops_id),g])),u=(t==null?void 0:t.uiState)??await bi()??dn(),f={...u.opsWorkbenchStateById??{}},p=[];for(const g of a){const b=s.get(g);if(!b){p.push({ops_id:g,ok:!1,status:"rejected",reason_codes:["ops_item_not_found"]});continue}if(n==="safe_restart_service"){const k=h(b.service_id);if(!wS(k)){p.push({ops_id:g,service_id:k,ok:!1,status:"rejected",reason_codes:["safe_restart_service_not_allowed"]});continue}const C=await iS(k,{reason:h(e.reason)||"ops_workbench_safe_restart",actor:h(e.actor)||"digital_employee_operator"});p.push({ops_id:g,service_id:k,ok:C.ok,status:C.status,reason_codes:C.ok?["safe_restart_service"]:[C.error||"safe_restart_service_failed"],result:C});continue}if(n==="retry_policy_pull"){const k=h(b.policy_id||b.entity_id),C=await qN(k,t);p.push({ops_id:g,policy_id:k,ok:C.ok!==!1,status:C.ok===!1?"failed":"recorded",reason_codes:[C.error?"policy_pull_failed":"policy_pull_requested"],result:C});continue}const v=new Date().toISOString();f[g]={status:n==="dismiss"?"dismissed":n==="mark_reviewed"?"reviewed":h(b.status),last_action:n,actor:h(e.actor)||"digital_employee_operator",reason:h(e.reason)||null,updated_at:v},p.push({ops_id:g,ok:!0,status:f[g].status,reason_codes:["ops_workbench_action_recorded"]})}await na({...sr(u),opsWorkbenchStateById:f},"ops_workbench_action_recorded",void 0,{action:n,ops_ids:a,reason:h(e.reason)||null});const m=p.filter(g=>g.ok!==!1).length;return{ok:m>0,action:n,total:a.length,recorded:m,rejected:a.length-m,items:p,reason_codes:["ops_workbench_action_recorded"]}}async function IN(e,t){const n=h(e.action)||"mark_read";if(!["mark_read","dismiss","pull_updates","open_desktop_settings"].includes(n))return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_notification_workbench_action"]};if(n==="pull_updates"){const f=await Q1();return{ok:f.ok!==!1,action:n,total:1,recorded:f.ok===!1?0:1,rejected:f.ok===!1?1:0,items:[{ok:f.ok!==!1,result:f}],reason_codes:["notification_workbench_action_recorded"]}}if(n==="open_desktop_settings"){const f=await X1();return{ok:f.success!==!1,action:n,total:1,recorded:f.success===!1?0:1,rejected:f.success===!1?1:0,items:[{ok:f.success!==!1,result:f}],reason_codes:["notification_workbench_action_recorded"]}}const a=tt([...De(e.notification_ids),...De(e.notificationIds)].map(h)).slice(0,100);if(a.length===0)return{ok:!1,action:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["notification_ids_required"]};const r=[];for(const f of a){const p=await BS(f,n==="mark_read"?"read":"dismiss",{},t);r.push({notification_id:f,ok:p.ok,status:p.status,reason_codes:p.ok?["notification_workbench_action_recorded"]:["notification_action_failed"],result:p})}const s=(t==null?void 0:t.uiState)??await bi()??dn();await na(s,"notification_workbench_action_recorded",void 0,{action:n,notification_ids:a});const u=r.filter(f=>f.ok!==!1).length;return{ok:u>0,action:n,total:a.length,recorded:u,rejected:a.length-u,items:r,reason_codes:["notification_workbench_action_recorded"]}}function BN(e,t){var a,r;const n=Dt(e).filter(s=>["daily_report_send_recorded","daily_report_confirmed","daily_report_approval_requested"].includes(s.kind)).filter(s=>{var u,f;return h(((u=ye(s.payload))==null?void 0:u.report_id)??((f=ye(s.payload))==null?void 0:f.reportId))===t}).sort((s,u)=>u.occurredAt.localeCompare(s.occurredAt));return{delivery_status:n.some(s=>s.kind==="daily_report_send_recorded")?"sent":"pending",confirmation_status:n.some(s=>s.kind==="daily_report_confirmed")?"confirmed":"pending",approval_status:n.some(s=>s.kind==="daily_report_approval_requested")?"requested":"not_requested",latest_event_id:((a=n[0])==null?void 0:a.id)??null,latest_event_at:((r=n[0])==null?void 0:r.occurredAt)??null}}function wS(e){return e==="fileServer"||e==="guiServer"}async function qN(e,t){return e==="plan_step_dispatch"?await IS(t):e==="risk_approval"?await Y1():e==="route_decision"?await K1():{ok:!1,error:"unknown_policy_id"}}function UN(e,t){const n=h(t.get("skill_id")),a=h(t.get("server_id")),r=h(t.get("tool_name")),s=h(t.get("decision"));return e.filter(u=>!n||h(u.skill_id)===n).filter(u=>!a||h(u.server_id)===a).filter(u=>!r||h(u.tool_name)===r).filter(u=>!s||h(u.decision)===s)}function jS(e){return Dt(e).filter(t=>["artifact_access_allowed","artifact_access_rejected"].includes(t.kind)).map(t=>{const n=ye(t.payload)??{};return{access_id:t.id,event_id:t.id,remote_id:t.remoteId??null,artifact_id:h(n.artifact_id)||null,action:h(n.action)||null,status:h(n.status)||t.kind.replace("artifact_access_",""),reason_codes:Array.isArray(n.reason_codes)?n.reason_codes:[],actor:h(n.actor)||null,source:h(n.source)||null,plan_id:(t.planId??h(n.plan_id))||null,task_id:(t.taskId??h(n.task_id))||null,run_id:(t.runId??h(n.run_id))||null,message:t.message,occurred_at:t.occurredAt,sync_status:t.syncStatus??null,payload:n}}).sort((t,n)=>h(n.occurred_at).localeCompare(h(t.occurred_at)))}function HN(e,t){const n=h(t.get("artifact_id")),a=h(t.get("action")),r=h(t.get("status"));return e.filter(s=>!n||h(s.artifact_id)===n).filter(s=>!a||h(s.action)===a).filter(s=>!r||h(s.status)===r)}function CS(e){return Dt(e).filter(t=>["artifact_retention_marked","artifact_retention_rejected","artifact_version_observed"].includes(t.kind)).map(t=>{const n=ye(t.payload)??{};return{lifecycle_id:t.id,event_id:t.id,kind:t.kind,artifact_id:h(n.artifact_id)||null,action:h(n.action)||null,status:h(n.status)||null,retention_status:h(n.retention_status)||null,retention_until:h(n.retention_until)||null,reason:h(n.reason)||null,actor:h(n.actor)||null,source:h(n.source)||null,plan_id:(t.planId??h(n.plan_id))||null,task_id:(t.taskId??h(n.task_id))||null,run_id:(t.runId??h(n.run_id))||null,message:t.message,occurred_at:t.occurredAt,sync_status:t.syncStatus??null,payload:n}}).sort((t,n)=>h(n.occurred_at).localeCompare(h(t.occurred_at)))}function TS(e){return Dt(e).filter(t=>["artifact_cleanup_executed","artifact_cleanup_rejected","artifact_cleanup_failed"].includes(t.kind)).map(t=>{const n=ye(t.payload)??{};return{cleanup_event_id:t.id,event_id:t.id,kind:t.kind,artifact_id:h(n.artifact_id)||null,status:h(n.status)||null,cleanup_status:h(n.status)||null,cleanup_reason:h(n.reason)||null,reason_codes:tt(De(n.reason_codes??n.reasonCodes).map(h)),actor:h(n.actor)||null,source:h(n.source)||null,deleted_at:h(n.deleted_at)||null,plan_id:(t.planId??h(n.plan_id))||null,task_id:(t.taskId??h(n.task_id))||null,run_id:(t.runId??h(n.run_id))||null,message:t.message,occurred_at:t.occurredAt,sync_status:t.syncStatus??null,payload:n}}).sort((t,n)=>h(n.occurred_at).localeCompare(h(t.occurred_at)))}function ES(e,t,n){var s;const a=ye((s=ye(n==null?void 0:n.payload))==null?void 0:s.cleanup)??{},r=TS(e).find(u=>h(u.artifact_id)===t)??null;return{cleanup_status:h(r==null?void 0:r.cleanup_status)||h(a.status)||null,deleted_at:h(r==null?void 0:r.deleted_at)||h(a.deleted_at)||null,cleanup_reason:h(r==null?void 0:r.cleanup_reason)||h(a.cleanup_reason)||null,cleanup_event_id:h(r==null?void 0:r.cleanup_event_id)||h(a.event_id)||null}}function Tg(e,t){const n=CS(e).find(a=>h(a.artifact_id)===t&&h(a.kind)==="artifact_retention_marked");return{retention_status:h(n==null?void 0:n.retention_status)||"unmanaged",retention_until:h(n==null?void 0:n.retention_until)||null,last_retention_action:h(n==null?void 0:n.action)||null,last_retention_at:h(n==null?void 0:n.occurred_at)||null}}function PN(e,t,n){return{previous_status:h(e.retention_status)||"unmanaged",retention_status:FN(t),retention_until:h(n.retention_until??n.retentionUntil)||null,reason:h(n.reason)||null}}function FN(e){return e==="mark_keep"?"keep":e==="mark_expire"?"expire_candidate":e==="mark_review"?"review_required":e==="clear_retention"?"unmanaged":null}function GN(e){return{version:h(e.version)||null,version_key:h(e.version_key)||null,version_rank:Wt(e.version_rank),file_id:h(e.file_id)||null,workspace_id:h(e.workspace_id)||null,project_id:h(e.project_id)||null,created_at:h(e.created_at)||null,name:h(e.name)||null}}function Vf(e){return{delivery_status:h(e.delivery_status)||null,delivery_stage:h(e.delivery_stage)||null,workspace_id:h(e.workspace_id)||null,project_id:h(e.project_id)||null,file_id:h(e.file_id)||null,version:h(e.version)||null,file_size:Wt(e.file_size),source_tool:h(e.source_tool)||null}}function Eg(e,t){const n=vf(t),a=e.filter(u=>vf(u)===n).sort((u,f)=>h(u.created_at).localeCompare(h(f.created_at))),r=h(t.artifact_id)||h(t.subject_id),s=Math.max(0,a.findIndex(u=>h(u.artifact_id)===r||h(u.subject_id)===r));return{version:h(t.version)||`local-v${s+1}`,version_key:`${n}:v${h(t.version)||s+1}`,version_rank:s+1}}function vf(e){const t=h(e.file_id),n=h(e.workspace_id),a=h(e.name);if(t)return`file:${n}:${t}:${a}`;const r=h(e.artifact_id)||h(e.subject_id);return r?`artifact:${r}`:`fallback:${n}:${h(e.project_id)}:${a||h(e.uri)}`}function C_(e){return Yr(e).filter(VN).map(t=>{const n=ye(t.payload)??{},a=h(t.artifact_id)||h(n.artifact_id)||h(t.subject_id),r=h(n.report_id)||h(t.report_id)||a.replace(/:artifact:text$/,""),s=h(n.generated_at)||h(t.created_at)||new Date().toISOString(),u=h(n.date)||s.slice(0,10);return{report_id:r,artifact_id:a,event_id:h(n.event_id)||`${r}:event:generated`,date:u,title:h(n.title)||h(t.name)||`${u} 数字员工日报`,status:h(n.status)||"ready",summary:h(n.summary)||h(t.value)||"",totals:ye(n.totals)??{},detail_lines:De(n.detail_lines),artifact_sources:De(n.artifact_sources),filename:h(n.filename)||h(t.name)||Dg(u),html_artifact_id:h(n.html_artifact_id)||`${r}:artifact:html`,pdf_artifact_id:h(n.pdf_artifact_id)||`${r}:artifact:pdf`,html_filename:h(n.html_filename)||Mg(u),pdf_filename:h(n.pdf_filename)||$g(u),format:h(n.format)||"text",text_content:h(n.text_content)||h(t.value),html_content:h(n.html_content)||"",generated_at:s,sync_status:h(t.sync_status)||null,entity_type:"artifact",entity_id:a,plan_id:h(t.plan_id)||null,task_id:h(t.task_id)||null,run_id:h(t.run_id)||null,created_at:h(t.created_at)||s,updated_at:s,payload:n}}).sort((t,n)=>h(n.generated_at).localeCompare(h(t.generated_at)))}function VN(e){const t=ye(e.payload)??{},n=h(t.format)||"text";return h(e.kind)==="daily_report"&&n!=="html"&&n!=="pdf"}function YN(e){const t=ye(e.payload)??{};return h(e.kind)==="daily_report"||h(t.kind)==="daily_report"||!!(h(t.report_id)&&h(t.text_content))}function KN(e,t){const n=h(t.get("date"));return ga(e,t).filter(a=>!n||h(a.date)===n)}function ga(e,t){const n=h(t.get("entity_id")),a=h(t.get("remote_id")),r=h(t.get("status")),s=h(t.get("sync_status")),u=h(t.get("updated_from")),f=h(t.get("updated_to"));return e.filter(p=>!n||Ag(p).includes(n)).filter(p=>!a||h(p.remote_id)===a).filter(p=>!r||h(p.status)===r).filter(p=>!s||h(p.sync_status)===s).filter(p=>{const m=Tn(p);return!(u&&(!m||m<u)||f&&(!m||m>f))})}function mi(e,t){const n=Math.max(1,Math.floor(Wt(t.get("page_no"))??1)),a=Math.max(1,Math.min(Math.floor(Wt(t.get("page_size"))??20),100)),r=(n-1)*a;return{items:e.slice(r,r+a),page_no:n,page_size:a,total:e.length}}function AS(e){const t=h(e.run_id);if(t)return{entity_type:"run",entity_id:t};const n=h(e.task_id);if(n)return{entity_type:"task",entity_id:n};const a=h(e.plan_id);return a?{entity_type:"plan",entity_id:a}:{entity_type:h(e.fallback_type)||"record",entity_id:h(e.fallback_id)||null}}function Ag(e){return tt([e.entity_id,e.intervention_id,e.route_decision_id,e.plan_id,e.task_id,e.run_id,e.event_id,e.audit_id,e.memory_id,e.history_id,e.step_id,e.node_id,e.artifact_id,e.approval_id,e.notification_id,e.report_id])}function Tn(e){return h(e.updated_at)||h(e.finished_at)||h(e.started_at)||h(e.occurred_at)||h(e.latest_event_at)||h(e.created_at)}function QN(e,t){if(!e||!t)return null;const n=Date.parse(e),a=Date.parse(t);return!Number.isFinite(n)||!Number.isFinite(a)||a<n?null:a-n}function XN(e){const t=ye(e.payload)??{},n=ZN(e.kind),r=xf(e.kind,t)??t,s=e.runId?"run":e.taskId?"task":e.planId?"plan":"event";return{audit_id:e.id,category:n,action:e.kind,level:JN(e,r),message:e.message||e.kind,actor:h(t.actor)||h(t.source)||"qimingclaw-runtime",entity_type:s,entity_id:e.runId??e.taskId??e.planId??e.id,occurred_at:e.occurredAt,...r,payload:r}}function ZN(e){return e==="sandbox_audit"?"sandbox_audit":e==="token_cost"?"token_cost":e==="tool_call_audit"?"tool_call_audit":e.startsWith("governance_")?"governance":e==="route_decision"?"route":e==="approval_decision"?"approval":"runtime"}function JN(e,t){const n=h(t.status).toLowerCase(),a=`${e.kind} ${e.message} ${n}`;return/fail|error|reject|denied|blocked|cancel/i.test(a)?"error":(e.kind==="sandbox_audit"||e.kind==="tool_call_audit")&&/warn|timeout|retry/i.test(a)?"warn":"info"}function xf(e,t){if(e==="sandbox_audit")return{session_id:h(t.session_id??t.sessionId)||null,operation:h(t.operation??t.action)||null,status:h(t.status)||null,exit_code:Wt(t.exit_code??t.exitCode),duration_ms:Wt(t.duration_ms??t.durationMs),command_preview:h(t.command_preview??t.commandPreview)||null,reason_codes:tt(De(t.reason_codes??t.reasonCodes).map(h))};if(e==="token_cost"){const n=S_(t,h(t.updated_at??t.updatedAt)||null);return{session_id:h(t.session_id??t.sessionId)||null,model:(n==null?void 0:n.model)??(h(t.model)||null),status:h(t.status)||null,input_tokens:(n==null?void 0:n.input_tokens)??null,output_tokens:(n==null?void 0:n.output_tokens)??null,total_tokens:(n==null?void 0:n.total_tokens)??null,estimated_cost_usd:(n==null?void 0:n.estimated_cost_usd)??null,estimated:(n==null?void 0:n.estimated)??!0}}return e==="tool_call_audit"?{session_id:h(t.session_id??t.sessionId)||null,server_id:h(t.server_id??t.serverId)||null,tool_name:h(t.tool_name??t.toolName)||null,operation:h(t.operation??t.action)||null,status:h(t.status)||null,exit_code:Wt(t.exit_code??t.exitCode),duration_ms:Wt(t.duration_ms??t.durationMs),input_length:Wt(t.input_length??t.inputLength),reason_codes:tt(De(t.reason_codes??t.reasonCodes).map(h))}:null}function WN(e){const t=h(e.delivery_status);return t?[{audit_id:`artifact_delivery:${e.artifact_id??e.subject_id}`,category:"artifact",action:h(e.delivery_stage)||"artifact_delivery",level:t==="failed"||t==="error"?"error":"info",message:`${e.name||e.kind||"Artifact"}:${t}`,actor:h(e.source_tool)||"qimingclaw-file-server",entity_type:"artifact",entity_id:e.artifact_id??e.subject_id,occurred_at:h(e.created_at)||new Date().toISOString(),payload:e}]:[]}function Ng(e,t,n){var f;const a=Dt(e).map(p=>({event_id:p.id,aggregate_type:p.runId?"run":p.taskId?"task":"plan",aggregate_id:p.runId??p.taskId??p.planId??p.id,event_type:p.kind,kind:p.kind,message:p.message,occurred_at:p.occurredAt,timestamp:p.occurredAt,plan_id:p.planId??null,task_id:p.taskId??null})),r=n.flatMap(p=>(p.events??[]).map(m=>({event_id:m.event_id??`${p.run_id}:${m.kind??"event"}:${m.occurred_at??p.created_at}`,aggregate_type:"run",aggregate_id:p.run_id,event_type:m.kind??p.lifecycle,kind:m.kind??p.lifecycle,message:m.message??p.lifecycle,occurred_at:m.occurred_at??p.completed_at??p.created_at,timestamp:m.occurred_at??p.completed_at??p.created_at,plan_id:p.plan_id??null,task_id:p.task_id||null}))),s=t.map(p=>({event_id:`task-status-${p.task_id}`,aggregate_type:"task",aggregate_id:p.task_id,event_type:"task_status",kind:p.status,message:`${p.title}:${ma(p.status)}`,occurred_at:p.updated_at??p.created_at,timestamp:p.updated_at??p.created_at,plan_id:p.plan_id??null,task_id:p.task_id})),u=(((f=e==null?void 0:e.sync)==null?void 0:f.recentFailures)??[]).map(p=>({event_id:`digital-sync-failure-${p.id}`,aggregate_type:"sync_outbox",aggregate_id:p.id,event_type:"digital_sync_failed",kind:"digital_sync_failed",message:lu(p),occurred_at:p.lastAttemptAt??p.updatedAt??p.createdAt,timestamp:p.lastAttemptAt??p.updatedAt??p.createdAt,plan_id:null,task_id:null}));return eR([...a,...r,...s,...u]).sort((p,m)=>(m.occurred_at??"").localeCompare(p.occurred_at??""))}function eR(e){const t=new Set;return e.filter(n=>!n.event_id||t.has(n.event_id)?!1:(t.add(n.event_id),!0))}function dr(e){var r;const t=iu(e).map(s=>({approval_id:s.id,task_id:s.taskId??"",status:s.status,created_at:s.createdAt,plan_id:s.planId??null,run_id:s.runId??null,title:s.title,reversible:s.status==="pending",source:"qimingclaw-runtime",sync_status:s.syncStatus,sync_error:s.syncError,payload:s.payload})),a=(((r=e==null?void 0:e.sync)==null?void 0:r.recentFailures)??[]).filter(s=>s.dueForRetry===!1||/credential|auth|token|unauthor/i.test(s.error??"")).slice(0,20).map(s=>({approval_id:`sync-review-${s.id}`,task_id:s.entityId,status:"pending",created_at:s.createdAt,title:`同步异常待处理:${s.entityType}/${s.entityId}`,reversible:!1,source:"qimingclaw-sync",error:s.error}));return[...t,...a]}function NS(e,t){const n=dr(t).find(m=>h(m.approval_id)===e)??null,a=iu(t).find(m=>m.id===e)??null,r=ye((n==null?void 0:n.payload)??(a==null?void 0:a.payload)),s=RS(r),u={approvalId:e,planId:h(n==null?void 0:n.plan_id)||(a==null?void 0:a.planId)||"",taskId:h(n==null?void 0:n.task_id)||(a==null?void 0:a.taskId)||"",runId:h(n==null?void 0:n.run_id)||(a==null?void 0:a.runId)||"",permissionId:s.permissionId,sessionId:s.sessionId},f=h(n==null?void 0:n.created_at)||(a==null?void 0:a.createdAt)||(a==null?void 0:a.updatedAt)||"",p=[];if(n||a){const m=h(n==null?void 0:n.title)||(a==null?void 0:a.title)||"待确认事项",g=h(n==null?void 0:n.status)||(a==null?void 0:a.status)||"pending";p.push({event_id:`${e}:approval_record`,kind:"approval_record",status:g,message:`审批记录:${m} -> ${g}`,occurred_at:f||new Date().toISOString(),payload:r,source_type:"approval"})}for(const m of Dt(t)){if(!tR(m,u))continue;const g=ye(m.payload);p.push({event_id:m.id,kind:m.kind,status:nR(m,g),message:m.message||m.kind,occurred_at:m.occurredAt,payload:g,source_type:h(g==null?void 0:g.source)||"runtime_event"})}return{approval_id:e,approval:n,events:iR(p).sort((m,g)=>m.occurred_at.localeCompare(g.occurred_at)||m.event_id.localeCompare(g.event_id))}}function RS(e){const t=ye(e==null?void 0:e.acpPermission)??ye(e==null?void 0:e.acp_permission)??ye(e==null?void 0:e.permission);return{permissionId:h(t==null?void 0:t.permission_id)||h(t==null?void 0:t.permissionId)||h(e==null?void 0:e.permission_id)||h(e==null?void 0:e.permissionId),sessionId:h(t==null?void 0:t.session_id)||h(t==null?void 0:t.sessionId)||h(e==null?void 0:e.session_id)||h(e==null?void 0:e.sessionId)}}function tR(e,t){const n=ye(e.payload);if((h(n==null?void 0:n.approvalId)||h(n==null?void 0:n.approval_id)||h(n==null?void 0:n.decision_id)||h(n==null?void 0:n.decisionId))===t.approvalId||e.id.startsWith(`${t.approvalId}:`))return!0;const r=RS(n);return t.permissionId&&r.permissionId===t.permissionId||t.sessionId&&r.sessionId===t.sessionId?!0:e.kind.includes("approval")||e.kind.includes("permission")?!!(t.runId&&e.runId===t.runId||t.taskId&&e.taskId===t.taskId||t.planId&&e.planId===t.planId):!1}function nR(e,t){return h(t==null?void 0:t.nextStatus)||h(t==null?void 0:t.next_status)||h(t==null?void 0:t.status)||h(t==null?void 0:t.decision)||(e.kind==="approval_decision"?"completed":null)}function iR(e){const t=new Set;return e.filter(n=>t.has(n.event_id)?!1:(t.add(n.event_id),!0))}function Ma(e){return e!=null&&e.uiState?sr(e.uiState):dn()}function aR(e,t){const n=Yf(t,Ma(t)),a=(e||"all").toLowerCase();return a==="all"?{notifications:n.filter(r=>r.status!=="dismissed")}:{notifications:n.filter(r=>r.status===a)}}function Yf(e,t){return DS(e,t).filter(n=>LS(n,t.notificationPreferences))}function DS(e,t){const n=bR([...cR(e),...uR(e),...dR(e),...fR(e),...mR(e),...hR(e),..._R(e),...gR(e),...pR(e)]),a=t.notificationStateById??{};return n.map(r=>yR(r,a[r.notification_id])).sort((r,s)=>s.created_at.localeCompare(r.created_at)||s.notification_id.localeCompare(r.notification_id))}function MS(){return{enabled:!0,desktop_enabled:!0,muted_kinds:[],muted_levels:[],updated_at:null}}function $S(){return{enabled:!0,subscribed_actions:[...G1],subscribed_risk_levels:["high","critical"],notify_on_timeout:!0,updated_at:null}}function zS(){return{enabled:!0,max_per_sweep:3,auto_dispatch_ready_steps:!0,updated_at:null,source:"local",remote_updated_at:null,last_pulled_at:null,last_pull_error:null}}function OS(){return{enabled:!0,approval_required_risk_levels:["high","critical"],approval_required_actions:[],auto_reject_actions:[],updated_at:null,source:"local",remote_updated_at:null,last_pulled_at:null,last_pull_error:null}}function kf(){return{enabled:!0,auto_create_governance_commands:!0,approval_required_intents:[],blocked_intents:[],preferred_route_kinds:[],updated_at:null,source:"local",remote_updated_at:null,last_pulled_at:null,last_pull_error:null}}function Sf(e){const t=e==null?void 0:e.approvalSubscriptionPreferences,n=$S();if(!t||typeof t!="object")return n;const a=Array.isArray(t.subscribed_actions)?t.subscribed_actions.filter(s=>G1.includes(s)):n.subscribed_actions,r=Array.isArray(t.subscribed_risk_levels)?t.subscribed_risk_levels.filter(s=>oA.includes(s)):n.subscribed_risk_levels;return{enabled:t.enabled!==!1,subscribed_actions:[...new Set(a)],subscribed_risk_levels:[...new Set(r)],notify_on_timeout:t.notify_on_timeout!==!1,updated_at:typeof t.updated_at=="string"?t.updated_at:n.updated_at}}function ar(e){const t=e==null?void 0:e.planStepDispatchPolicy,n=zS();if(!t||typeof t!="object")return n;const a=Number(t.max_per_sweep);return{enabled:t.enabled!==!1,max_per_sweep:Number.isFinite(a)?Math.max(1,Math.min(Math.floor(a),10)):n.max_per_sweep,auto_dispatch_ready_steps:t.auto_dispatch_ready_steps!==!1,updated_at:typeof t.updated_at=="string"?t.updated_at:n.updated_at,source:t.source==="remote"?"remote":"local",remote_updated_at:typeof t.remote_updated_at=="string"?t.remote_updated_at:null,last_pulled_at:typeof t.last_pulled_at=="string"?t.last_pulled_at:null,last_pull_error:typeof t.last_pull_error=="string"?t.last_pull_error:null}}function ro(e){const t=e==null?void 0:e.riskApprovalPolicy,n=OS();if(!t||typeof t!="object")return n;const a=tt(De(t.approval_required_risk_levels).map(r=>h(r).toLowerCase())).filter(r=>["normal","medium","high","critical"].includes(r));return{enabled:t.enabled!==!1,approval_required_risk_levels:a.length>0?a:n.approval_required_risk_levels,approval_required_actions:tt(De(t.approval_required_actions)),auto_reject_actions:tt(De(t.auto_reject_actions)),updated_at:typeof t.updated_at=="string"?t.updated_at:n.updated_at,source:t.source==="remote"?"remote":"local",remote_updated_at:typeof t.remote_updated_at=="string"?t.remote_updated_at:null,last_pulled_at:typeof t.last_pulled_at=="string"?t.last_pulled_at:null,last_pull_error:typeof t.last_pull_error=="string"?t.last_pull_error:null}}function so(e){const t=e==null?void 0:e.routeDecisionPolicy,n=kf();return!t||typeof t!="object"?n:{enabled:t.enabled!==!1,auto_create_governance_commands:t.auto_create_governance_commands!==!1,approval_required_intents:tt(De(t.approval_required_intents).map(wf)),blocked_intents:tt(De(t.blocked_intents).map(wf)),preferred_route_kinds:tt(De(t.preferred_route_kinds)),updated_at:typeof t.updated_at=="string"?t.updated_at:n.updated_at,source:t.source==="remote"?"remote":"local",remote_updated_at:typeof t.remote_updated_at=="string"?t.remote_updated_at:null,last_pulled_at:typeof t.last_pulled_at=="string"?t.last_pulled_at:null,last_pull_error:typeof t.last_pull_error=="string"?t.last_pull_error:null}}function wf(e){return h(e).trim().toLowerCase().replace(/[^a-z0-9_.:-]+/g,"_")||"chat"}function oo(e){const t=e==null?void 0:e.notificationPreferences,n=MS();if(!t||typeof t!="object")return n;const a=Array.isArray(t.muted_kinds)?t.muted_kinds.filter(s=>sA.includes(s)):[],r=Array.isArray(t.muted_levels)?t.muted_levels.filter(s=>rA.includes(s)):[];return{enabled:t.enabled!==!1,desktop_enabled:t.desktop_enabled!==!1,muted_kinds:[...new Set(a)],muted_levels:[...new Set(r)],updated_at:typeof t.updated_at=="string"?t.updated_at:n.updated_at}}function LS(e,t){const n=oo({notificationPreferences:t});return!n.enabled||n.muted_levels.includes(e.level)?!1:!n.muted_kinds.includes(e.kind)}async function lR(e,t){const n=(t==null?void 0:t.uiState)??await bi()??dn(),a=oo(n),r=oo({notificationPreferences:{...a,...e,updated_at:new Date().toISOString()}});return await na({...sr(n),notificationPreferences:r},"update_notification_preferences",void 0,{notification_preferences:r}),r}async function rR(e,t){const n=(t==null?void 0:t.uiState)??await bi()??dn(),a=Sf(n),r=Sf({approvalSubscriptionPreferences:{...a,...e,updated_at:new Date().toISOString()}});return await na({...sr(n),approvalSubscriptionPreferences:r},"update_approval_subscriptions",void 0,{approval_subscriptions:r}),r}async function sR(e,t){const n=(t==null?void 0:t.uiState)??await bi()??dn(),a=ar(n),r=ar({planStepDispatchPolicy:{...a,...e,updated_at:new Date().toISOString()}});return await na({...sr(n),planStepDispatchPolicy:r},"update_plan_step_dispatch_policy",void 0,{plan_step_dispatch_policy:r}),r}async function oR(e,t){const n=(t==null?void 0:t.uiState)??await bi()??dn(),a=ro(n),r=ro({riskApprovalPolicy:{...a,...e,source:"local",updated_at:new Date().toISOString(),last_pull_error:null}});return await na({...sr(n),riskApprovalPolicy:r},"update_risk_approval_policy",void 0,{risk_approval_policy:r}),r}async function IS(e){var a,r,s;const t=ar((e==null?void 0:e.uiState)??dn()),n=await((s=(r=(a=window.QimingClawBridge)==null?void 0:a.digital)==null?void 0:r.pullPlanStepDispatchPolicy)==null?void 0:s.call(r).catch(u=>({ok:!1,endpoint:null,pulled_at:new Date().toISOString(),policy:t,error:u instanceof Error?u.message:"plan step dispatch policy pull failed"})));return n||{ok:!1,endpoint:null,pulled_at:new Date().toISOString(),policy:t,error:"qimingclaw_bridge_unavailable"}}function cR(e){const t=new Map(mo(e).map(n=>[h(n.approval_id),n]));return dr(e).filter(n=>h(n.source)==="qimingclaw-runtime").map(n=>{const a=h(n.status)||"pending",r=qS(a),s=t.get(h(n.approval_id)),u=h(s==null?void 0:s.sla_status),f=h(s==null?void 0:s.risk_level),p=r&&(u==="timeout"||f==="high");return{notification_id:`approval:${h(n.approval_id)}`,plan_id:h(n.plan_id),task_id:h(n.task_id),kind:r?"need_approval":"confirmation_resolved",title:p?"审批需要关注":r?"审批待处理":"审批已处理",body:h(n.title)||"待确认事项",level:p?"warn":r?"action":"info",status:r?"unread":"resolved",correlation_id:h(n.approval_id),created_at:h(n.created_at)||new Date().toISOString()}})}function uR(e){return Cg(e).filter(t=>h(t.kind)==="approval_action_recorded").filter(t=>["delegate","mark_timeout","mark_risk"].includes(h(t.action))).map(t=>{const n=h(t.action),a=h(t.approval_id),r=n==="mark_timeout",s=n==="mark_risk";return{notification_id:`approval-action:${a}:${n}:${Ft(h(t.occurred_at))}`,plan_id:h(t.plan_id),task_id:h(t.task_id),kind:"need_approval",title:r?"审批已超时":s?"审批已标记风险":"审批已转交",body:h(t.message)||a,level:r||s?"warn":"action",status:"unread",correlation_id:a,created_at:h(t.occurred_at)||new Date().toISOString()}})}function dR(e){var t;return(((t=e==null?void 0:e.sync)==null?void 0:t.recentFailures)??[]).map(n=>({notification_id:`sync_failure:${n.id}`,plan_id:"",task_id:n.entityId,kind:"task_failed",title:`同步失败:${n.entityType}`,body:lu(n),level:n.dueForRetry===!1?"error":"warn",status:"unread",correlation_id:n.id,created_at:n.lastAttemptAt??n.updatedAt??n.createdAt}))}function fR(e){return tr(e).filter(t=>t.requires_human_action||t.status==="degraded"||t.status==="stopped").map(t=>{var n;return{notification_id:`service:${t.service_id}`,plan_id:"",task_id:((n=t.dependent_tasks)==null?void 0:n[0])??"",kind:"need_input",title:`服务需要处理:${t.name}`,body:t.error||`${t.name} 当前状态:${t.status_label||t.status}`,level:t.status==="stopped"?"error":"warn",status:"unread",correlation_id:t.service_id,created_at:t.last_seen_at||new Date().toISOString()}})}function pR(e){return un(e).flatMap(t=>{const n=t.status.toLowerCase(),a=["completed","succeeded","success","done"].includes(n),r=["failed","error","rejected","cancelled","skipped"].includes(n);if(!a&&!r)return[];const s=t.updatedAt||t.createdAt||new Date().toISOString();return[{notification_id:`task:${t.id}:${Ft(s)}`,plan_id:t.planId??"",task_id:t.id,kind:a?"task_finished":"task_failed",title:a?"任务已完成":"任务需要关注",body:`${t.title}:${ma(t.status)}`,level:a?"info":"error",status:"unread",correlation_id:t.id,created_at:s}]})}function mR(e){return Dt(e).filter(t=>t.kind==="plan_step_dispatch_failed").map(t=>{const n=ye(t.payload)??{},a=h(n.step_id)||t.id,r=h(n.reason);return{notification_id:`plan-step-dispatch:${a}:${Ft(t.occurredAt)}`,plan_id:t.planId??h(n.plan_id),task_id:t.taskId??h(n.task_id),kind:"task_failed",title:"Ready 步骤派发失败",body:r?`${a}:${r}`:t.message||a,level:"error",status:"unread",correlation_id:a,created_at:t.occurredAt}})}function hR(e){return su(e).filter(t=>["warn","error","action"].includes(h(t.attention_level))).map(t=>{var u,f;const n=h(t.attention_level),a=h(t.route_decision_id)||h(t.event_id),r=h(t.created_command_id),s=De(t.reason_codes).map(h).filter(Boolean).join(" / ");return{notification_id:`route-decision:${a}:${Ft(h(t.recorded_at))}`,plan_id:h((u=ye(t.context_refs))==null?void 0:u.plan_id),task_id:h((f=ye(t.context_refs))==null?void 0:f.task_id),kind:n==="action"?"task_progress":"task_failed",title:n==="action"?"入口路由已映射":"入口路由需要关注",body:r?`${t.route_kind} / ${t.intent_kind} -> ${r}`:`${t.route_kind} / ${t.intent_kind}${s?`:${s}`:""}`,level:n==="error"?"error":n==="warn"?"warn":"action",status:"unread",correlation_id:a,created_at:h(t.recorded_at)||new Date().toISOString()}})}function _R(e){return Pf(e).results.filter(t=>t.severity==="error"||t.severity==="warn").map(t=>{const n=t.severity==="error"?"error":"warn",a=h(t.id)||`${h(t.category)||"diagnostic"}:${n}`;return{notification_id:`diagnostic:${a}`,plan_id:"",task_id:"",kind:n==="error"?"task_failed":"need_input",title:n==="error"?"诊断发现异常":"诊断需要关注",body:t.message,level:n,status:"unread",correlation_id:a,created_at:t.created_at??new Date().toISOString()}})}function gR(e){return Ff(e).filter(t=>["error","warn"].includes(h(t.level))).map(t=>{const n=h(t.level)==="error"?"error":"warn",a=h(t.audit_id)||h(t.entity_id)||"audit";return{notification_id:`audit:${a}`,plan_id:h(t.plan_id),task_id:h(t.task_id)||(h(t.entity_type)==="task"?h(t.entity_id):""),kind:n==="error"?"task_failed":"need_input",title:n==="error"?"审计发现异常":"审计需要关注",body:h(t.message)||h(t.action)||a,level:n,status:"unread",correlation_id:a,created_at:h(t.occurred_at)||new Date().toISOString()}})}function yR(e,t){return t?{...e,status:t.status??e.status,read_at:t.read_at??e.read_at??null,dismissed_at:t.dismissed_at??e.dismissed_at??null,reply:t.reply??e.reply??null,replied_at:t.replied_at??e.replied_at??null}:e}function bR(e){const t=new Set;return e.filter(n=>!n.notification_id||t.has(n.notification_id)?!1:(t.add(n.notification_id),!0))}async function BS(e,t,n,a){var C;const r=(a==null?void 0:a.uiState)??await bi()??dn(),s=Yf(a,r).find(D=>D.notification_id===e),u=new Date().toISOString(),f=(C=r.notificationStateById)==null?void 0:C[e],p=!!(f!=null&&f.replied_at),m={...f??{}};let g="";t==="read"?(m.status=(s==null?void 0:s.status)==="resolved"?"resolved":"read",m.read_at=m.read_at??u):t==="dismiss"?(m.status="dismissed",m.dismissed_at=u):(m.status=(s==null?void 0:s.status)==="resolved"?"resolved":"read",m.read_at=m.read_at??u,g=h(n.content??n.reply??n.message),m.reply=g,m.replied_at=u);const b={...r,notificationStateById:{...r.notificationStateById??{},[e]:m}};await na(b,`notification_${t}`,void 0,{notification_id:e,action:t});const v=await vR({notification_id:e,action:t,status:m.status??(s==null?void 0:s.status)??null,read_at:m.read_at??null,dismissed_at:m.dismissed_at??null,reply:t==="reply"?g:m.reply??null,replied_at:m.replied_at??null,acted_at:t==="dismiss"?m.dismissed_at??u:t==="reply"?m.replied_at??u:m.read_at??u,actor:"digital_employee_ui",source:"sgrobot-digital-adapter"}),k=t==="reply"&&(s==null?void 0:s.kind)==="need_input"&&s.task_id&&g&&!p?await xR(s,g,a):null;return{ok:!0,task_id:s==null?void 0:s.task_id,status:m.status,...v.ok?{}:{notification_sync_error:v.error},task_input_recorded:!!(k!=null&&k.accepted),governance_command_id:k==null?void 0:k.command_id,governance_event_id:kR(k)}}async function vR(e){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.submitNotificationAction))return{ok:!1,error:"qimingclaw_bridge_unavailable"};try{const a=await t.submitNotificationAction(e);return{ok:(a==null?void 0:a.ok)!==!1,...a!=null&&a.error?{error:a.error}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function xR(e,t,n){const a=Date.now();return fr({command_kind:"provide_task_input",context_refs:{plan_id:e.plan_id||void 0,task_id:e.task_id},payload:{input:t,source:"notification_reply",notification_id:e.notification_id,plan_id:e.plan_id||void 0,task_id:e.task_id},correlation_id:`qimingclaw-notification-reply-${Ft(e.notification_id)}-${a}`,idempotency_key:`qimingclaw-notification-reply-${e.notification_id}`},n)}function kR(e){var n;const t=Re((n=e==null?void 0:e.result)==null?void 0:n.run_id);if(!(!(e!=null&&e.accepted)||!t||!e.command_id))return`${t}:provide_task_input:${SR(e.command_id)}`}function SR(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function wR(e,t,n){var f;const a=new Map(ea(n).map(p=>[p.id,p])),r=new Map(un(n).map(p=>[p.id,p])),s=new Map(mo(n).map(p=>[h(p.approval_id),p])),u=((f=e.decisionResultsByDate)==null?void 0:f[t])??{};return dr(n).filter(p=>h(p.source)==="qimingclaw-runtime").map(p=>{const m=ye(p.payload),g=h(p.approval_id)||`approval-${Ft(h(p.task_id)||h(p.title)||"item")}`,b=u[g],v=CR(b,h(p.status)||"pending"),k=h(p.plan_id),C=h(p.task_id),D=k?a.get(k):null,A=C?r.get(C):null,x=s.get(g),T=(x==null?void 0:x.approval_conflict_active)===!0;return{id:g,title:h(p.title)||h(m==null?void 0:m.title)||"待确认事项",scenario:jR(p,m),status:v,status_label:TR(v,b),plan_title:(D==null?void 0:D.title)||h(m==null?void 0:m.plan_title)||h(p.plan_id)||"qimingclaw 本地记录",task_title:(A==null?void 0:A.title)||h(m==null?void 0:m.task_title)||h(p.task_id)||"待确认任务",risk_level:h(x==null?void 0:x.risk_level)||"normal",sla_status:h(x==null?void 0:x.sla_status)||"untracked",due_at:h(x==null?void 0:x.due_at)||null,last_action:h(x==null?void 0:x.last_action)||null,last_actor:h(x==null?void 0:x.last_actor)||null,comment_count:Wt(x==null?void 0:x.comment_count)??0,delegate_to:h(x==null?void 0:x.delegate_to)||null,workflow_id:h(x==null?void 0:x.workflow_id)||null,current_step_id:h(x==null?void 0:x.current_step_id)||null,current_step_label:h(x==null?void 0:x.current_step_label)||null,current_participant:h(x==null?void 0:x.current_participant)||null,approval_step_index:Wt(x==null?void 0:x.approval_step_index),approval_step_count:Wt(x==null?void 0:x.approval_step_count),next_step_label:h(x==null?void 0:x.next_step_label)||null,conflict:T?{active:!0,reason:h(x==null?void 0:x.approval_conflict_reason)||null,remote_status:h(x==null?void 0:x.approval_conflict_remote_status)||null,detected_at:h(x==null?void 0:x.approval_conflict_detected_at)||null,local_status:h(x==null?void 0:x.approval_conflict_local_status)||null,remote_current_step_id:h(x==null?void 0:x.approval_conflict_remote_current_step_id)||null}:null,actions:qS(v)&&!T?[{id:"approved",label:"同意",tone:"primary"},{id:"rejected",label:"驳回",tone:"secondary"}]:[]}})}function jR(e,t){return h(t==null?void 0:t.scenario)||h(t==null?void 0:t.summary)||h(t==null?void 0:t.reason)||h(t==null?void 0:t.message)||h(e.error)||"来自 qimingclaw 本地运行记录的人工确认项。"}function CR(e,t){const n=String(e||"").toLowerCase();return["approve","approved","accept","accepted"].includes(n)?"approved":["reject","rejected","deny","denied"].includes(n)?"rejected":["dismiss","dismissed","skip","skipped"].includes(n)?"dismissed":t||"pending"}function TR(e,t){return t?e==="approved"?"已同意":e==="rejected"?"已驳回":e==="dismissed"?"已忽略":"已处理":e==="approved"?"已同意":e==="rejected"?"已驳回":e==="completed"?"已完成":e==="failed"?"异常":"待确认"}function qS(e){return["pending","requested"].includes(String(e||"").toLowerCase())}function Yr(e){const t=[...qf(e).map(AR),...ta(e).flatMap(a=>US(a,Dt(e))),...Dt(e).flatMap(a=>T_(a.id,a.payload,a.occurredAt,{sourceType:"event",sourceEventId:a.id,sourceLabel:`Event ${a.kind}`,planId:a.planId,taskId:a.taskId,runId:a.runId}))],n=PS(t);return n.map(a=>ER(a,e,n))}function ER(e,t,n){var k;const a=h(e.artifact_id)||h(e.subject_id),r=jS(t).find(C=>h(C.artifact_id)===a)??null,s=RR(h(e.uri)),u=YN(e)&&!!h((k=ye(e.payload))==null?void 0:k.text_content),f=qf(t).some(C=>C.id===a||C.remoteId===a),p=f&&(u||s),m=Tg(t,a),g=ES(t,a,e),b=h(g.cleanup_status)==="deleted",v=Eg(n,e);return{...e,version:v.version,version_key:v.version_key,version_rank:v.version_rank,retention_status:m.retention_status,retention_until:m.retention_until,last_retention_action:m.last_retention_action,cleanup_status:h(g.cleanup_status)||null,deleted_at:h(g.deleted_at)||null,cleanup_reason:h(g.cleanup_reason)||null,cleanup_event_id:h(g.cleanup_event_id)||null,delivery_summary:Vf(e),access:{previewable:!b&&p,downloadable:!b&&f&&s,openable:!b&&f&&s,access_policy:f?"qimingclaw-local-artifact-policy":"runtime-projection-readonly",last_access_status:h(r==null?void 0:r.status)||null}}}function AR(e){const t=ye(e.payload),n=ye(t==null?void 0:t.delivery),a=h(n==null?void 0:n.source_tool),r=h(n==null?void 0:n.uri),s=h(n==null?void 0:n.filename);return{artifact_id:e.id,subject_id:e.runId??e.taskId??e.planId??e.id,kind:e.kind,name:e.name||s||h((t==null?void 0:t.name)??(t==null?void 0:t.title))||E_(e.uri??r)||e.kind,uri:e.uri||r||h((t==null?void 0:t.uri)??(t==null?void 0:t.url)??(t==null?void 0:t.path))||void 0,value:h((t==null?void 0:t.value)??(t==null?void 0:t.summary)??(t==null?void 0:t.text))||e.uri||r||e.name||s||e.kind,plan_id:e.planId??null,task_id:e.taskId??null,run_id:e.runId??null,created_at:e.createdAt,source:"qimingclaw-runtime",source_type:"artifact",source_label:a?`File Server: ${a}`:jf("artifact",e.id),sync_status:e.syncStatus,sync_error:e.syncError,payload:e.payload,...HS(n)}}function US(e,t){return PS([...T_(e.id,e.payload,e.finishedAt??e.startedAt??e.createdAt,{sourceType:"run",sourceLabel:jf("run",e.id),planId:e.planId,taskId:e.taskId,runId:e.id}),...t.filter(n=>n.runId===e.id).flatMap(n=>T_(e.id,n.payload,n.occurredAt,{sourceType:"event",sourceEventId:n.id,sourceLabel:`Event ${n.kind}`,planId:n.planId,taskId:n.taskId,runId:n.runId}))])}function T_(e,t,n,a){const r=ye(t);if(!r)return typeof t=="string"?[Nh(e,t,0,n,a)]:[];const u=[...De(r.artifacts),...De(r.outputs),...De(r.files),...De(r.attachments)].map((f,p)=>Nh(e,f,p,n,a));for(const f of["artifact","outputPath","output_path","filePath","file_path","path","uri","url"])r[f]&&u.push(Nh(e,r[f],u.length,n,a));return u.filter(f=>f.name||f.uri||f.value)}function Nh(e,t,n,a,r){const s=ye(t);if(s){const f=ye(s.delivery),p=h(f==null?void 0:f.source_tool),m=h(f==null?void 0:f.uri),g=h(s.uri??s.url??s.path??s.filePath??s.file_path??s.outputPath??s.output_path),b=h(s.name??s.title??s.filename)||h(f==null?void 0:f.filename)||E_(g||m)||`产物 ${n+1}`;return{artifact_id:h(s.artifact_id??s.id)||`artifact-${Ft(e)}-${n+1}`,subject_id:h(s.subject_id)||e,kind:h(s.kind??s.type)||"artifact",name:b,uri:g||m,value:h(s.value??s.summary??s.text)||g||m,created_at:(h(s.created_at??s.createdAt)||a)??void 0,source:"qimingclaw-runtime",source_type:h(s.source_type)||(r==null?void 0:r.sourceType)||"payload",source_event_id:h(s.source_event_id)||(r==null?void 0:r.sourceEventId)||null,source_label:p?`File Server: ${p}`:h(s.source_label)||(r==null?void 0:r.sourceLabel)||jf("payload",e),plan_id:h(s.plan_id)||(r==null?void 0:r.planId)||null,task_id:h(s.task_id)||(r==null?void 0:r.taskId)||null,run_id:h(s.run_id)||(r==null?void 0:r.runId)||null,...HS(f)}}const u=String(t??"").trim();return{artifact_id:`artifact-${Ft(e)}-${n+1}`,subject_id:e,kind:"artifact",name:E_(u)||`产物 ${n+1}`,uri:NR(u)?u:void 0,value:u,created_at:a??void 0,source:"qimingclaw-runtime",source_type:(r==null?void 0:r.sourceType)||"payload",source_event_id:(r==null?void 0:r.sourceEventId)||null,source_label:(r==null?void 0:r.sourceLabel)||jf("payload",e),plan_id:(r==null?void 0:r.planId)||null,task_id:(r==null?void 0:r.taskId)||null,run_id:(r==null?void 0:r.runId)||null}}function HS(e){return e?{delivery_status:h(e.status)||null,delivery_stage:h(e.stage)||null,workspace_id:h(e.workspace_id)||null,project_id:h(e.project_id)||null,file_id:h(e.file_id)||null,version:h(e.version)||null,file_size:Wt(e.size),source_tool:h(e.source_tool)||null}:{}}function jf(e,t){const n=t?` ${t}`:"";switch(e){case"artifact":return`Artifact${n}`;case"event":return`Event${n}`;case"run":return`Run${n}`;case"task":return`Task${n}`;case"plan":return`Plan${n}`;default:return`Payload${n}`}}function PS(e){const t=new Set;return e.filter(n=>{const a=n.artifact_id||`${n.subject_id}:${n.uri||n.value||n.name}`;return!a||t.has(a)?!1:(t.add(a),!!(n.name||n.uri||n.value))})}function ye(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function De(e){return Array.isArray(e)?e:[]}function h(e){return typeof e=="string"?e.trim():""}function Wt(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:null}return null}function NR(e){return/^(file|https?):\/\//i.test(e)||e.includes("/")||e.includes("\\")}function RR(e){return e?/^file:\/\//i.test(e)?!0:/^[a-z][a-z0-9+.-]*:/i.test(e)?!1:e.startsWith("/")||/^[a-z]:[\\/]/i.test(e):!1}function E_(e){return e?(e.split(/[?#]/)[0]||e).split(/[\\/]/).filter(Boolean).pop()??"":""}function Ft(e){const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(t)return t;let n=0;for(let a=0;a<e.length;a+=1)n=n*31+e.charCodeAt(a)>>>0;return`item-${n.toString(36)}`}function Rg(e,t=null){const n=(e??"").trim().toLowerCase(),a=xg(t);return n?a.filter(r=>r.title.toLowerCase().includes(n)||r.plan_id.toLowerCase().includes(n)||(r.objective??"").toLowerCase().includes(n)):a}function DR(e){const t=new Map(ea(e).map(r=>[r.id,r])),n=new Map(un(e).map(r=>[r.id,r])),a=Dt(e).map(r=>{const s=r.taskId?n.get(r.taskId):void 0,u=r.planId??(s==null?void 0:s.planId)??null,f=u?t.get(u):void 0,p=(s==null?void 0:s.status)??(f==null?void 0:f.status)??(r.kind.includes("failed")||r.kind.includes("error")?"failed":"running"),m=qt(p);return{id:r.id,time:yf(r.occurredAt),plan_title:(f==null?void 0:f.title)??"qimingclaw 本地执行",task_title:(s==null?void 0:s.title)??r.message,step_title:r.kind,detail:r.message||r.kind,status:p,status_label:ma(p),status_tone:m,updated_at:r.occurredAt,conversation_id:u??(s==null?void 0:s.id)??r.id}});return a.length>0?a:un(e).map(r=>{const s=r.planId?t.get(r.planId):void 0;return{id:`task-event-${r.id}`,time:yf(r.updatedAt),plan_title:(s==null?void 0:s.title)??"qimingclaw 本地任务",task_title:r.title,step_title:r.assignedSkillId||"qimingclaw-runtime",detail:r.syncError||`${r.title}:${ma(r.status)},同步状态 ${r.syncStatus}`,status:r.status,status_label:ma(r.status),status_tone:qt(r.status),updated_at:r.updatedAt,conversation_id:r.planId??r.id}})}function MR(e,t,n){if(ur(n)){const s=DR(n);return sk(s,n)}if(!t)return[{id:"event-await-confirmation",time:"待确认",plan_title:"任务设置",task_title:"等待确认今日任务",step_title:"选择职责",detail:"请先确认今天要执行的任务,确认后数字员工会开始执行。",status:"pending",status_label:"待确认",status_tone:"waiting",updated_at:new Date().toISOString(),conversation_id:null}];const r=e.filter(s=>s.selected).map(s=>({id:`event-${s.id}`,time:s.status==="running"?"实时":"待执行",plan_title:s.title,task_title:s.title,step_title:s.status==="running"?"同步 qimingclaw 服务状态":"等待调度",detail:s.status==="running"?`${s.result_text}。快照时间:${(n==null?void 0:n.generatedAt)??"未连接 bridge"}`:"任务已确认,将在后续阶段接入 ACP/MCP 真实执行事件。",status:s.status==="running"?"running":"pending",status_label:s.status==="running"?"执行中":"待执行",status_tone:s.status==="running"?"running":"waiting",updated_at:new Date().toISOString(),conversation_id:s.conversation_id}));return sk(r,n)}function sk(e,t){const n=t==null?void 0:t.sync;if(n&&(n.pending>0||n.failed>0||n.lastSyncAt)){const a=(n.recentFailures||[]).slice(0,3).map(lu).join(";");return[...e,{id:"event-management-sync",time:n.syncing?"实时":"同步",plan_title:"管理端联动",task_title:"同步数字员工本地状态",step_title:n.failed>0?"同步补偿":"outbox 推送",detail:[Bf(t),n.lastSyncError?`错误:${n.lastSyncError}`:"",a?`最近失败:${a}`:""].filter(Boolean).join("。"),status:n.failed>0?"failed":n.syncing||n.pending>0?"running":"completed",status_label:n.failed>0?"异常":n.syncing||n.pending>0?"同步中":"已同步",status_tone:n.failed>0?"danger":n.syncing||n.pending>0?"running":"success",updated_at:n.lastSyncAt??new Date().toISOString(),conversation_id:"qimingclaw-management-sync"}]}return e}function $R(e,t){return(e.some(a=>a.selected)?e.filter(a=>a.selected):e).map(a=>{const r=t.filter(m=>m.conversation_id===a.conversation_id),s=r.filter(m=>m.status==="running").length,u=r.filter(m=>m.status==="completed").length,f=r.filter(m=>qt(m.status)==="danger").length,p=Math.max(0,r.length-s-u-f);return{id:a.id,plan_id:a.id,title:a.title,description:a.summary,selected:a.selected,total_count:Math.max(r.length,1),success_count:u,failure_count:f,running_count:s,waiting_count:r.length===0?1:p,latest_status_label:f>0?"异常":s>0?"执行中":u>0?"已完成":"待执行",latest_status_tone:f>0?"danger":s>0?"running":u>0?"success":"waiting",business_summary:a.result_text,ai_summary:"当前由 qimingclaw 本地运行记录生成。"}})}function zR(e){return e.map(t=>({id:`run-detail-${t.id}`,time:t.time,task_name:t.task_title,step_name:t.step_title,operation_name:t.plan_title,status_label:t.status_label,status_tone:t.status_tone,business_detail:t.detail,raw_detail:t.detail,updated_at:t.updated_at,conversation_id:t.conversation_id}))}function FS(e,t){const n=(t==null?void 0:t.uiState)??dn(),a=n.confirmedDates[e]??null,r=!!a,s=eN(n,e,t),u=MR(s,r,t),f=$R(s,u),p=n.reportGeneratedAtByDate[e]??null,m=s.filter(K=>K.selected).length,g=u.filter(K=>K.status==="running").length,b=u.filter(K=>qt(K.status)==="success").length,v=u.filter(K=>qt(K.status)==="danger").length,k=ea(t).length+un(t).length,C=ur(t),D=t==null?void 0:t.sync,A=UR(Yr(t)),x=zR(u),T=tr(t),N=T.filter(K=>K.requires_human_action||K.status==="degraded"),F=T.filter(K=>K.running).length,L=VA(t),B=YA(t),P=B.filter(K=>K.can_retry||K.can_skip||K.can_cancel);return{source:"live",date:e,employee:{name:n.profile.name,title:"数字员工",major:"qimingclaw 客户端任务执行",company:n.profile.company,position:n.profile.position,current_status:n.profile.currentStatus,current_status_label:n.profile.currentStatus==="resting"?"休息中":"工作中",motto:"承接客户端任务,调度 ACP 与 MCP 能力完成执行。"},workday:{confirmed:r,confirmed_at:a,current_status:n.profile.currentStatus,current_status_label:n.profile.currentStatus==="resting"?"休息中":"工作中",status_label:C?v>0||N.length>0?"有异常":g>0?"执行中":"已同步":r?"运行中":"待确认",status_tone:C?v>0||N.length>0?"danger":g>0?"running":"success":r?"running":"waiting",summary:C?`当前日期 ${lf(e)} 已读取 ${k} 条 qimingclaw 本地运行记录,${ek(T)}。`:r?`当前日期 ${lf(e)} 已确认 ${m} 项任务。`:`当前日期 ${lf(e)} 待确认今日任务。`,bubble_text:C?N.length>0?`我发现 ${N.length} 项常驻服务需要处理,会把影响到的任务标出来。`:"我已接入 qimingclaw 本地运行记录,会持续展示真实任务、事件和同步状态。":r?"我已接入 qimingclaw 客户端执行链路,正在等待真实 Run/Event 数据接入。":"请先确认今天要执行的任务,我会把它们映射到 qimingclaw 执行链路。"},overview:{title:"今日执行",status_label:C?"本地真实记录":r?"真实数据":"待确认",status_tone:v>0?"danger":C||r?"success":"waiting",metrics:[{label:"已选任务",value:String(m)},{label:"运行记录",value:String(u.length)},{label:"执行中",value:String(g)},{label:"已完成",value:String(b)},{label:"异常",value:String(v)},{label:"待同步",value:String((D==null?void 0:D.pending)??0)},{label:"同步异常",value:String((D==null?void 0:D.failed)??0)},{label:"服务运行",value:`${F}/${T.length}`},{label:"需处理服务",value:String(N.length)},{label:"Plan Agent",value:String(L.length)},{label:"Task Agent",value:String(B.length)},{label:"可治理任务",value:String(P.length)}]},managed_services:T,plan_agents:L,task_agents:B,duties:s,events:u,execution_summaries:f,run_details:x,decisions:wR(n,e,t),delivery:{headline:C?"qimingclaw 本地记录已接入":r?"qimingclaw 执行链路已接入":"等待确认任务设置",summary:C?"数字员工页面正在读取本地 Plan / Task / Run / Event,并同步展示管理端 outbox 状态。":"当前阶段已将数字员工页面切换到 qimingclaw adapter,并开始读取客户端服务状态。",lines:["已吸收 sgRobot 数字员工 UI 和核心展示模型。",C?`已读取本地记录:Plan ${ea(t).length} / Task ${un(t).length} / Run ${ta(t).length} / Event ${Dt(t).length}。`:"已建立 qimingclaw workday/plans/tasks/skills API adapter。",er(t,"agent","Agent"),er(t,"mcp","MCP"),er(t,"computerServer","Computer Server"),ek(T),...N.slice(0,3).map(IA),`Plan Agent:${L.length} 个计划代理,Task Agent:${B.length} 个任务代理。`,P[0]?`待治理任务:${P[0].title},下一步 ${P[0].next_action}。`:"Task Agent:暂无需要重试、跳过或取消的任务。",Bf(t),`活跃会话:${(t==null?void 0:t.sessions.active)??0} / ${(t==null?void 0:t.sessions.total)??0}`],artifacts:[{name:"数字员工运行摘要",status:p?"ready":"pending"},...A.slice(0,4).map(K=>({name:K.name,status:p?"ready":"available",uri:K.uri??null,source_label:K.source_label??null,source_type:K.source_type??null}))]},route_summary:bN(t),diagnostic_summary:rN(t),daily_report:OR({date:e,state:n,generatedAt:p,selectedCount:m,events:u,executionSummaries:f,runDetails:x,artifactSources:A,successCount:b,failureCount:v,runningCount:g,snapshot:t})}}function OR(e){const t=`${lf(e.date)} 飞天数字员工日报`,n=e.generatedAt?`今日已完成数字员工页面到 qimingclaw adapter 的接入,并读取了 qimingclaw 服务状态。${Bf(e.snapshot)}。`:"日报将在生成后汇总任务选择、运行明细和后续接入建议。",a={task_count:e.selectedCount,execution_count:e.events.length,success_count:e.successCount,failure_count:e.failureCount,running_count:e.runningCount},r=e.events.map(b=>`${b.time} ${b.task_title}:${b.detail}`),s=e.generatedAt?qR(e.date,e.generatedAt):null,u=Dg(e.date),f=Mg(e.date),p=$g(e.date),m={report_id:s,artifact_id:s?`${s}:artifact:text`:null,html_artifact_id:s?`${s}:artifact:html`:null,pdf_artifact_id:s?`${s}:artifact:pdf`:null,event_id:s?`${s}:event:generated`:null,date:e.date,title:t,report_schedule_time:e.state.reportScheduleTime,status:e.generatedAt?"ready":"not_generated",generated_at:e.generatedAt,generated_by:e.generatedAt?"ai":"fallback",model:"qimingclaw-adapter",source:"qimingclaw",summary:n,totals:a,task_sections:e.executionSummaries,detail_lines:r,artifact_sources:e.artifactSources,download_filename:u,html_filename:f,pdf_filename:p,text_content:null,html_content:null,pdf_available:!!e.generatedAt,pdf_url:null},g=e.generatedAt?LR(m,e.runDetails,e.artifactSources):null;return{...m,text_content:g,html_content:g?GS(m,g):null}}function LR(e,t,n){return[e.title||`${e.date} 数字员工日报`,`日期:${e.date}`,`生成时间:${e.generated_at||"暂未生成"}`,`生成来源:${e.generated_by==="ai"?"AI":"qimingclaw adapter"}`,"","## 摘要",e.summary||"暂无摘要。","","## 指标",`任务总数:${e.totals.task_count}`,`执行次数:${e.totals.execution_count}`,`成功次数:${e.totals.success_count}`,`失败次数:${e.totals.failure_count}`,`运行中:${e.totals.running_count??0}`,"","## 任务汇总",...e.task_sections.length>0?e.task_sections.map(a=>`- ${a.title}:${a.latest_status_label},执行 ${a.total_count} 次,成功 ${a.success_count},失败 ${a.failure_count}。${a.ai_summary||a.business_summary||""}`):["暂无任务汇总。"],"","## 运行明细",...t.length>0?t.map(a=>`- ${a.time||"--:--"} ${a.task_name} / ${a.step_name||a.operation_name||"任务执行"}:${a.status_label},${a.business_detail}`):["暂无运行明细。"],"","## 产物来源",...n.length>0?n.map(a=>`- ${a.name}:${a.source_label||a.source_type||"未知来源"}${a.uri?`,${a.uri}`:""}`):["暂无产物来源。"],"","## 详情",...(e.detail_lines??[]).length>0?e.detail_lines:["暂无详情。"]].join(`
|
||
`)}function Dg(e){return`qimingclaw-digital-report-${e}.txt`}function Mg(e){return`qimingclaw-digital-report-${e}.html`}function $g(e){return`qimingclaw-digital-report-${e}.pdf`}function GS(e,t){const n=t.split(`
|
||
`).map(a=>a.startsWith("## ")?`<h2>${wc(a.slice(3))}</h2>`:a.startsWith("- ")?`<li>${wc(a.slice(2))}</li>`:a.trim()?`<p>${wc(a)}</p>`:"").join(`
|
||
`);return`<!doctype html><html><head><meta charset="utf-8"><title>${wc(e.title)}</title><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.65;padding:32px;color:#172033;}article{max-width:860px;margin:0 auto;}h1{font-size:28px;}h2{font-size:18px;margin-top:24px;}li{margin:4px 0;}</style></head><body><article><h1>${wc(e.title)}</h1>${n}</article></body></html>`}function IR(e,t){const s=`${e.title}
|
||
|
||
${t}`.replace(/[^\x20-\x7E\n]/g,"?").slice(0,3600).split(`
|
||
`).slice(0,48).map((g,b)=>`BT /F1 11 Tf 48 ${760-b*14} Td (${BR(g)}) Tj ET`).join(`
|
||
`)||"BT /F1 11 Tf 48 760 Td (Daily Report) Tj ET",u=["1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj","2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 >> endobj","3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 4 0 R >> >> /Contents 5 0 R >> endobj","4 0 obj << /Type /Font /Subtype /Type1 /BaseFont /Helvetica >> endobj",`5 0 obj << /Length ${s.length} >> stream
|
||
${s}
|
||
endstream endobj`];let f=9;const p=["0000000000 65535 f "];for(const g of u)p.push(`${String(f).padStart(10,"0")} 00000 n `),f+=g.length+1;const m=`%PDF-1.4
|
||
${u.join(`
|
||
`)}
|
||
xref
|
||
0 ${u.length+1}
|
||
${p.join(`
|
||
`)}
|
||
trailer << /Size ${u.length+1} /Root 1 0 R >>
|
||
startxref
|
||
${f}
|
||
%%EOF`;return window.btoa(m)}function BR(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function wc(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qR(e,t){return`daily-report:${e}:${Ft(t)}`}function UR(e){return e.slice(0,20).map(t=>({id:h(t.artifact_id)||`${h(t.subject_id)}:${h(t.uri??t.name)}`,name:h(t.name)||h(t.uri)||h(t.value)||"未命名产物",kind:h(t.kind)||null,uri:h(t.uri)||null,delivery_status:h(t.delivery_status)||null,delivery_stage:h(t.delivery_stage)||null,workspace_id:h(t.workspace_id)||null,project_id:h(t.project_id)||null,file_id:h(t.file_id)||null,version:h(t.version)||null,version_key:h(t.version_key)||null,version_rank:Wt(t.version_rank),retention_status:h(t.retention_status)||null,retention_until:h(t.retention_until)||null,last_retention_action:h(t.last_retention_action)||null,cleanup_status:h(t.cleanup_status)||null,deleted_at:h(t.deleted_at)||null,cleanup_reason:h(t.cleanup_reason)||null,cleanup_event_id:h(t.cleanup_event_id)||null,file_size:typeof t.file_size=="number"?t.file_size:null,source_tool:h(t.source_tool)||null,source_label:h(t.source_label)||null,source_type:h(t.source_type)||null,source_event_id:h(t.source_event_id)||null,plan_id:h(t.plan_id)||null,task_id:h(t.task_id)||null,run_id:h(t.run_id)||null,created_at:h(t.created_at)||null,access:t.access,delivery_summary:t.delivery_summary??null}))}async function HR(e,t){var p,m,g;const n=(t==null?void 0:t.uiState)??await bi()??dn(),a=e.date||nu();e.action==="confirm_workday"&&(n.selectedDutyIdsByDate[a]=e.duty_ids??[],n.confirmedDates[a]=new Date().toISOString()),e.action==="update_profile"&&(n.profile={name:e.name||n.profile.name,company:e.company||n.profile.company,position:e.position||n.profile.position,currentStatus:e.current_status||n.profile.currentStatus}),e.action==="update_report_schedule"&&(n.reportScheduleTime=e.report_schedule_time||n.reportScheduleTime),e.action==="generate_daily_report"&&(e.duty_ids&&(n.selectedDutyIdsByDate[a]=e.duty_ids),e.report_schedule_time&&(n.reportScheduleTime=e.report_schedule_time),n.reportGeneratedAtByDate[a]=new Date().toISOString()),e.action==="decide_approval"&&e.decision_id&&(n.decisionResultsByDate=n.decisionResultsByDate??{},n.decisionResultsByDate[a]={...n.decisionResultsByDate[a]??{},[e.decision_id]:e.decision||"resolved"});const r=e.action==="decide_approval"?await GR(e,t):null,s=await na(n,e.action,a,e.action==="decide_approval"?{decision_id:e.decision_id,decision:e.decision,acp_permission:r}:void 0),u={...t??{generatedAt:new Date().toISOString(),services:{},sessions:{total:0,active:0,items:[]}},uiState:s};e.action==="decide_approval"&&await((g=(m=(p=window.QimingClawBridge)==null?void 0:p.digital)==null?void 0:m.submitApprovalDecision)==null?void 0:g.call(m,{approval_id:e.decision_id,decision:e.decision,date:a,actor:"digital_employee_operator",source:"sgrobot-digital-adapter",acp_permission:r}).catch(()=>null));const f=FS(a,u);return e.action==="generate_daily_report"&&f.daily_report&&await PR(f.daily_report),f}async function PR(e){var t,n,a;if(!(!e.report_id||!e.generated_at||!e.text_content))try{await((a=(n=(t=window.QimingClawBridge)==null?void 0:t.digital)==null?void 0:n.recordDailyReport)==null?void 0:a.call(n,{reportId:e.report_id,date:e.date,title:e.title,summary:e.summary,totals:e.totals,detailLines:e.detail_lines,artifactSources:e.artifact_sources??[],filename:e.download_filename||Dg(e.date),textContent:e.text_content,htmlFilename:e.html_filename||Mg(e.date),htmlContent:e.html_content||GS(e,e.text_content),pdfFilename:e.pdf_filename||$g(e.date),pdfContentBase64:IR(e,e.text_content),generatedAt:e.generated_at,reportScheduleTime:e.report_schedule_time,source:e.source??"qimingclaw",model:e.model??"qimingclaw-adapter"}))}catch(r){console.warn("[qimingclawAdapter] record daily report failed:",r)}}async function FR(e){var f,p;const t=h(e.reportId);if(!t)return{eventId:""};const n=(p=(f=window.QimingClawBridge)==null?void 0:f.digital)==null?void 0:p.recordDailyReportDelivery,a={reportId:t,action:e.action,status:e.status,actor:e.actor??"digital_employee_operator",endpoint:e.endpoint??"management-console",remoteId:e.remoteId??null,message:e.message??null},r=n?await n(a)??{eventId:""}:{eventId:""},s=await bi()??dn(),u=new Date().toISOString();return await na({...sr(s),dailyReportWorkbenchStateById:{...s.dailyReportWorkbenchStateById??{},[t]:{status:e.action==="confirm"?"confirmed":e.action==="request_approval"?"approval_requested":"sent",last_action:e.action,actor:a.actor,reason:e.message??null,updated_at:u}}},"daily_report_workbench_action_recorded",void 0,{report_id:t,action:e.action,status:e.status,event_id:r.eventId||null}),r}async function GR(e,t){var u,f;if(!e.decision_id||!e.decision)return null;const n=VR(e.decision_id,t);if(!n)return null;const a=YR(n);if(!a)return null;const r=KR(e.decision),s=(f=(u=window.QimingClawBridge)==null?void 0:u.digital)==null?void 0:f.respondPermission;if(!s)return null;try{const p=await s(a.sessionId,a.permissionId,r);return{permission_id:a.permissionId,session_id:a.sessionId,response:r,success:(p==null?void 0:p.success)!==!1,error:p==null?void 0:p.error}}catch(p){return{permission_id:a.permissionId,session_id:a.sessionId,response:r,success:!1,error:p instanceof Error?p.message:String(p)}}}function VR(e,t){return dr(t).find(n=>h(n.approval_id)===e)??null}function YR(e){const t=ye(e.payload),n=ye(t==null?void 0:t.payload),a=h(t==null?void 0:t.permissionId)||h(t==null?void 0:t.permission_id)||h(t==null?void 0:t.id)||h(n==null?void 0:n.permissionId)||h(n==null?void 0:n.permission_id)||h(n==null?void 0:n.id),r=h(t==null?void 0:t.sessionId)||h(t==null?void 0:t.session_id)||h(n==null?void 0:n.sessionId)||h(n==null?void 0:n.session_id),s=h(t==null?void 0:t.source);return!a||!r||s&&s!=="acp-permission"?null:{permissionId:a,sessionId:r}}function KR(e){const t=e.toLowerCase();return t.includes("always")?"always":t.includes("reject")||t.includes("deny")?"reject":"once"}async function ok(e,t,n,a={}){const r=XR(t),s=`plan-action-${Ft(e)}-${Ft(t)}-${Date.now()}`;return r?fr({command_kind:r,context_refs:{plan_id:e},payload:{...a,plan_id:e,requested_action:`plan_${t}`,action_endpoint:`/api/debug/plan/${e}/${t}`},correlation_id:s},n):{command_id:`qimingclaw-digital-plan-action-${Date.now()}`,accepted:!1,correlation_id:s,message:`暂不支持计划动作:${t}`,error:"unsupported_command"}}async function QR(e,t,n,a={}){const r=ZR(t),s=un(n).find(b=>b.id===e),u=Hf(ta(n),e),f=(s==null?void 0:s.planId)??(h(a.plan_id)||void 0),p=(u==null?void 0:u.id)??(h(a.run_id)||void 0),m=s?hl(s):h(a.step_id)||void 0,g=`task-action-${Ft(e)}-${Ft(t)}-${Date.now()}`;return r?fr({command_kind:r,context_refs:{plan_id:f,task_id:e,run_id:p,step_id:m},payload:{...a,task_id:e,plan_id:f??a.plan_id,run_id:p??a.run_id,step_id:m??a.step_id,requested_action:`task_${t}`,action_endpoint:`/api/task/${e}/${t}`},correlation_id:g},n):{command_id:`qimingclaw-digital-task-action-${Date.now()}`,accepted:!1,correlation_id:g,message:`暂不支持任务动作:${t}`,error:"unsupported_command"}}function XR(e){switch(e.toLowerCase()){case"submit":return"submit_plan";case"approve":return"approve_plan";case"activate":return"activate_plan";case"pause":return"pause_plan";case"resume":return"resume_plan";case"cancel":return"cancel_plan";case"amend":return"amend_plan";default:return null}}function ZR(e){switch(e.toLowerCase()){case"retry":return"retry_task";case"skip":return"skip_task";case"pause":return"pause_task";case"resume":return"resume_task";case"cancel":return"cancel_task";case"start":return"start_run";default:return null}}function JR(e,t){const n=Dt(t).filter(a=>a.planId===e&&a.kind.startsWith("governance_")).sort((a,r)=>r.occurredAt.localeCompare(a.occurredAt)||r.createdAt.localeCompare(a.createdAt)).map(a=>{const r=ye(a.payload)??{},s=ye(r.result)??{},u=h(r.commandKind)||a.kind.replace(/^governance_/,"");return{revision_id:a.id,plan_id:e,event_id:a.id,command_kind:u,action:u.replace(/_plan$/,""),status:h(s.status)||h(r.status)||"recorded",message:a.message,created_at:a.occurredAt,payload:r}});return{plan_id:e,revisions:n}}async function WR(e=80){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.listRouteDecisions))return{has_route_decision_state:!1,decisions:[]};try{return{has_route_decision_state:!0,decisions:await t.listRouteDecisions({limit:e})??[]}}catch(a){return console.warn("[qimingclawAdapter] list route decisions failed:",a),{has_route_decision_state:!1,decisions:[]}}}async function Kf(e=80){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.listRouteInterventions))return{has_route_intervention_state:!1,interventions:[]};try{return{has_route_intervention_state:!0,interventions:await t.listRouteInterventions({limit:e})??[]}}catch(a){return console.warn("[qimingclawAdapter] list route interventions failed:",a),{has_route_intervention_state:!1,interventions:[]}}}async function VS(e,t,n){const a=h(t.decision)||"reject",r=h(t.approval_id)||nD(e,n),u=(await Kf(160)).interventions.find(v=>v.route_decision_id===e)??null,f=zg(e,n),p=(f==null?void 0:f.decision)??YS(u,e);if(!p){const v=await A_({routeDecisionId:e,approvalId:r,decision:a,commandAccepted:!1,commandError:"route_intervention_missing_context",actor:t.actor??"digital_employee_operator",occurredAt:new Date().toISOString()});return{accepted:!1,route_decision_id:e,intervention:v,error:"invalid_context",message:"入口路由上下文缺失,无法恢复执行。"}}await iD(r,a,t.actor??"digital_employee_operator",n);let m=null,g=null;if(N_(a)){const v=KS(p,(f==null?void 0:f.body)??tD(p),n);v.command?(m=await fr(v.command,n),m.accepted||(g=m.error||"route_intervention_command_rejected")):g=v.reasonCode||"route_intervention_missing_context"}const b=await A_({routeDecisionId:e,approvalId:r,decision:a,createdCommandId:(m==null?void 0:m.command_id)??null,commandAccepted:(m==null?void 0:m.accepted)===!0,commandError:g,blockedReason:p.blocked_reason??null,policyResult:p.policy_result??null,policySource:p.policy_source??null,matchedIntent:p.matched_intent??null,routeKind:p.route_kind,intentKind:p.intent_kind,reasonCodes:p.reason_codes,candidateSkills:p.candidate_skills,contextRefs:p.context_refs,entrypoint:p.entrypoint??null,actor:t.actor??"digital_employee_operator",correlationId:p.correlation_id,payload:{comment:t.comment??null},occurredAt:new Date().toISOString()});return{accepted:b.intervention_status!=="failed",route_decision_id:e,intervention:b,command:m,error:g||void 0,message:b.resolution_duplicate?"入口路由干预已处理。":N_(a)?m!=null&&m.command_id?"入口路由干预已通过并恢复执行。":"入口路由干预已通过。":"入口路由干预已拒绝。"}}async function eD(e,t){const n=h(e.decision)||"mark_reviewed";if(!["mark_reviewed","dismiss","retry_policy_check"].includes(n))return{ok:!1,decision:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["invalid_route_intervention_batch_decision"]};const a=tt([...De(e.route_decision_ids),...De(e.routeDecisionIds)]).slice(0,50);if(a.length===0)return{ok:!1,decision:n,total:0,recorded:0,rejected:0,items:[],reason_codes:["route_decision_ids_required"]};const r=await Kf(200),s=[];for(const f of a){const p=zg(f,t),m=r.interventions.find(v=>v.route_decision_id===f)??null,g=(p==null?void 0:p.decision)??YS(m,f);if(!g){s.push({route_decision_id:f,ok:!1,status:"rejected",error:"route_intervention_missing_context",reason_codes:["route_intervention_missing_context"]});continue}const b=await A_({routeDecisionId:f,approvalId:g.approval_id??(m==null?void 0:m.approval_id)??null,decision:n,commandAccepted:!1,commandError:null,blockedReason:g.blocked_reason??null,policyResult:g.policy_result??null,policySource:g.policy_source??null,matchedIntent:g.matched_intent??null,routeKind:g.route_kind,intentKind:g.intent_kind,reasonCodes:g.reason_codes,candidateSkills:g.candidate_skills,contextRefs:g.context_refs,entrypoint:g.entrypoint??null,actor:h(e.actor)||"digital_employee_operator",correlationId:g.correlation_id,payload:{comment:h(e.comment)||null,batch_decision:n},occurredAt:new Date().toISOString()});s.push({route_decision_id:f,ok:b.intervention_status!=="failed",status:b.intervention_status,intervention:b,reason_codes:b.reason_codes??[]})}const u=s.filter(f=>f.ok===!0).length;return{ok:u>0,decision:n,total:a.length,recorded:u,rejected:a.length-u,items:s,reason_codes:tt(s.flatMap(f=>De(f.reason_codes)))}}async function A_(e){var n;const t=(n=window.QimingClawBridge)==null?void 0:n.digital;return t!=null&&t.recordRouteInterventionResolution?t.recordRouteInterventionResolution(e):{route_decision_id:e.routeDecisionId,approval_id:e.approvalId??null,route_kind:e.routeKind??"ChatOnly",intent_kind:e.intentKind??"chat",policy_result:e.policyResult??null,intervention_status:e.commandError?"failed":N_(e.decision)?"approved":"rejected",decision:e.decision,created_command_id:e.createdCommandId??null,blocked_reason:e.blockedReason??null,matched_intent:e.matchedIntent??null,policy_source:e.policySource??null,reason_codes:e.reasonCodes??[],candidate_skills:e.candidateSkills??[],context_refs:e.contextRefs??{},entrypoint:e.entrypoint??null,actor:e.actor??null,correlation_id:e.correlationId??null,approval_status:null,recorded_at:e.occurredAt??new Date().toISOString(),resolved_at:e.occurredAt??new Date().toISOString(),resolution_duplicate:!1}}function zg(e,t){const n=Dt(t).find(u=>{if(u.kind!=="route_decision")return!1;const f=ye(u.payload)??{};return j_(f,u).id===e});if(!n)return null;const a=ye(n.payload)??{},r=j_(a,n),s=ye(a.envelope)??{};return{decision:r,body:{entrypoint:r.entrypoint??"chat",actor:r.actor??void 0,text:h(s.text)||void 0,payload:ye(s.payload)??{},attachments:De(s.attachments).filter(u=>typeof u=="string"),timestamp:r.recorded_at,correlation_id:r.correlation_id,idempotency_key:`route-intervention:${r.id}`,context_refs:r.context_refs}}}function YS(e,t){return e?{id:t,route_kind:e.route_kind,intent_kind:e.intent_kind,reason_codes:e.reason_codes??[],candidate_skills:e.candidate_skills??[],context_refs:e.context_refs??{},created_command_id:e.created_command_id,correlation_id:e.correlation_id||t,creates_plan:e.route_kind==="PlanControl"||e.route_kind==="PlanExecution",creates_task_run:e.route_kind==="DirectRun"||e.route_kind==="PlanExecution",approval_mode:e.approval_id?"manual":null,policy_result:e.policy_result,policy_source:e.policy_source,blocked_reason:e.blocked_reason,approval_id:e.approval_id,matched_intent:e.matched_intent,recorded_at:e.recorded_at,entrypoint:e.entrypoint,actor:e.actor}:null}function tD(e){return{entrypoint:e.entrypoint??"chat",actor:e.actor??void 0,payload:{},attachments:[],timestamp:e.recorded_at,correlation_id:e.correlation_id,idempotency_key:`route-intervention:${e.id}`,context_refs:e.context_refs}}function nD(e,t){const n=zg(e,t);if(n!=null&&n.decision.approval_id)return n.decision.approval_id;const a=su(t).find(r=>h(r.route_decision_id)===e);return h(a==null?void 0:a.approval_id)||null}async function iD(e,t,n,a){var u,f,p;if(!e)return;const r=nu(),s=(a==null?void 0:a.uiState)??await bi()??dn();s.decisionResultsByDate=s.decisionResultsByDate??{},s.decisionResultsByDate[r]={...s.decisionResultsByDate[r]??{},[e]:t},await na(s,"decide_approval",r,{decision_id:e,decision:t,actor:n}),await((p=(f=(u=window.QimingClawBridge)==null?void 0:u.digital)==null?void 0:f.submitApprovalDecision)==null?void 0:p.call(f,{approval_id:e,decision:t,date:r,actor:n,source:"sgrobot-route-intervention"}).catch(()=>null))}function N_(e){return["approve","approved","accept","accepted"].includes(e.toLowerCase())}async function aD(e,t){var F,L,B,P,K;const n=e.timestamp||new Date().toISOString(),a=e.correlation_id||`route-${Date.now()}`,r=e.idempotency_key||a,s=cD(e),u=uD(e,s,t),f=await fD(u.candidateSkills),p=f.allCandidatesDisabled?[...u.reasonCodes,"candidate_skills_disabled"]:u.reasonCodes,m={id:`route-decision-${Ft(r)}`,route_kind:u.routeKind,intent_kind:u.intentKind,reason_codes:p,candidate_skills:f.candidateSkills,context_refs:s,created_command_id:null,correlation_id:a,creates_plan:u.createsPlan,creates_task_run:u.createsTaskRun,approval_mode:null,policy_result:"accepted",policy_source:null,blocked_reason:null,approval_id:null,matched_intent:null,recorded_at:n,entrypoint:e.entrypoint??null,actor:e.actor??null},g=await SA({routeDecisionId:m.id,routeKind:m.route_kind,intentKind:m.intent_kind,reasonCodes:m.reason_codes,candidateSkills:m.candidate_skills,contextRefs:m.context_refs,correlationId:a,idempotencyKey:e.idempotency_key,entrypoint:e.entrypoint??null,actor:e.actor??null,source:"qimingclaw-ingress-route",payload:{text:e.text??null,payload:e.payload??null,attachments:e.attachments??[]},occurredAt:n}),b=h(g.decision)||"allowed";m.policy_result=g.policy_result||(b==="allowed"?"accepted":b),m.policy_source=g.policy_source??((F=g.policy)==null?void 0:F.source)??null,m.blocked_reason=g.blocked_reason??null,m.approval_id=g.approval_id??null,m.matched_intent=g.matched_intent??null,m.reason_codes=tt([...m.reason_codes,...g.reason_codes??[]]);const v=((L=g.policy)==null?void 0:L.preferred_route_kinds)??[];v.length>0&&!v.includes(m.route_kind)&&(m.reason_codes=tt([...m.reason_codes,"route_kind_not_preferred"]));const k=b==="allowed"&&((B=g.policy)==null?void 0:B.auto_create_governance_commands)!==!1;b==="allowed"&&((P=g.policy)==null?void 0:P.auto_create_governance_commands)===!1&&(m.reason_codes=tt([...m.reason_codes,"route_command_auto_create_disabled"]));const C=k?KS(m,e,t):{command:null,reasonCode:b==="allowed"?"route_command_auto_create_disabled":`route_policy_${m.policy_result}`},D=C.command?await fr(C.command,t):null;D!=null&&D.accepted&&D.command_id?(m.created_command_id=D.command_id,m.reason_codes=tt([...m.reason_codes,"route_action_mapped"])):C.reasonCode&&(m.reason_codes=tt([...m.reason_codes,C.reasonCode]));const A=(K=window.QimingClawBridge)==null?void 0:K.digital,T=(A!=null&&A.recordRouteDecision?await A.recordRouteDecision({id:m.id,idempotencyKey:e.idempotency_key,correlationId:a,routeKind:m.route_kind,intentKind:m.intent_kind,reasonCodes:m.reason_codes,candidateSkills:m.candidate_skills,contextRefs:m.context_refs,createdCommandId:m.created_command_id,createsPlan:m.creates_plan,createsTaskRun:m.creates_task_run,approvalMode:m.approval_mode,policyResult:m.policy_result,policySource:m.policy_source,blockedReason:m.blocked_reason,approvalId:m.approval_id,matchedIntent:m.matched_intent,entrypoint:m.entrypoint,actor:m.actor,message:`入口路由决策:${m.route_kind} / ${m.intent_kind}`,envelope:{text:e.text??null,payload:e.payload??null,attachments:e.attachments??[]},recordedAt:n}):null)??m,N=oD(D);return b!=="allowed"?{accepted:!1,envelope:{entrypoint:e.entrypoint??"chat",text:e.text??null,payload:e.payload??null,attachments:e.attachments??[],context_refs:s},response_kind:"route_decision",route_decision:T,command:null,created_plan_id:null,created_schedule_id:null,created_task_ids:[],created_run_ids:[],projection_name:null,projection_payload:null,error:"policy_blocked",message:b==="approval_required"?`入口路由需要审批:${T.route_kind} / ${T.intent_kind}`:`入口路由已被策略阻断:${T.route_kind} / ${T.intent_kind}`}:{accepted:!0,envelope:{entrypoint:e.entrypoint??"chat",text:e.text??null,payload:e.payload??null,attachments:e.attachments??[],context_refs:s},response_kind:"route_decision",route_decision:T,command:D,created_plan_id:N.createdPlanId,created_schedule_id:N.createdScheduleId,created_task_ids:N.createdTaskIds,created_run_ids:N.createdRunIds,projection_name:null,projection_payload:null,message:D!=null&&D.command_id?`已记录入口路由并映射治理动作:${T.route_kind} / ${T.intent_kind}`:`已记录入口路由:${T.route_kind} / ${T.intent_kind}`}}function KS(e,t,n){if(e.reason_codes.includes("candidate_skills_disabled"))return{command:null,reasonCode:"route_action_not_mapped"};const a=e.context_refs??{},r=ye(t.payload)??{},s=gi({...r,source:"qimingclaw-ingress-route",route_decision_id:e.id,route_kind:e.route_kind,intent_kind:e.intent_kind,reason_codes:e.reason_codes,ingress_text:t.text??null}),u=(f,p)=>({command_kind:f,context_refs:gi({...a,...p}),payload:gi({...s,...p}),correlation_id:e.correlation_id,idempotency_key:`route-command:${e.id}`});if(e.route_kind==="PlanExecution"&&e.intent_kind==="schedule"){const f=h(a.schedule_id)||h(r.schedule_id)||h(r.scheduleId);if(!f)return{command:null,reasonCode:"route_action_missing_context"};const p="run_schedule_now",m=Rh(p);return m?{command:null,reasonCode:m}:{command:u(p,{schedule_id:f}),reasonCode:"route_action_mapped"}}if(e.route_kind==="PlanExecution"&&e.intent_kind==="execute"){const f=h(a.step_id)||h(r.step_id)||h(r.stepId),p=h(a.task_id)||h(r.task_id)||h(r.taskId)||lD(n,f);if(!p)return{command:null,reasonCode:"route_action_missing_context"};const m=un(n).find(v=>v.id===p)??null,g="start_run",b=Rh(g);return b?{command:null,reasonCode:b}:{command:u(g,{plan_id:h(a.plan_id)||(m==null?void 0:m.planId)||h(r.plan_id)||h(r.planId),task_id:p,step_id:f||(m?hl(m):""),run_id:h(a.run_id)||h(r.run_id)||h(r.runId)}),reasonCode:"route_action_mapped"}}if(e.route_kind==="PlanControl"&&e.intent_kind==="control"){const f=rD(t),p=h(a.task_id)||h(r.task_id)||h(r.taskId),m=h(a.plan_id)||h(r.plan_id)||h(r.planId),g=sD(f,!!p);if(!g||!p&&!m)return{command:null,reasonCode:"route_action_missing_context"};const b=Rh(g);return b?{command:null,reasonCode:b}:{command:u(g,{plan_id:m,task_id:p,step_id:h(a.step_id)||h(r.step_id)||h(r.stepId),run_id:h(a.run_id)||h(r.run_id)||h(r.runId)}),reasonCode:"route_action_mapped"}}return{command:null,reasonCode:"route_action_not_mapped"}}function lD(e,t){var a;return!t||!Vr(e).some(r=>r.id===t&&r.status.toLowerCase()==="ready")?"":((a=un(e).find(r=>hl(r)===t))==null?void 0:a.id)??""}function rD(e){const t=ye(e.payload)??{};return[e.text,t.action,t.command,t.intent,t.requested_action].map(h).filter(Boolean).join(" ").toLowerCase()}function sD(e,t){return t?Bn(e,["retry","重试"])?"retry_task":Bn(e,["skip","跳过"])?"skip_task":Bn(e,["pause","暂停"])?"pause_task":Bn(e,["resume","恢复"])?"resume_task":Bn(e,["cancel","取消"])?"cancel_task":Bn(e,["start","run","execute","begin","启动","开始","执行"])?"start_run":null:Bn(e,["submit","提交"])?"submit_plan":Bn(e,["approve","批准","同意"])?"approve_plan":Bn(e,["pause","暂停"])?"pause_plan":Bn(e,["resume","恢复"])?"resume_plan":Bn(e,["cancel","取消"])?"cancel_plan":Bn(e,["amend","edit","revise","修改","调整"])?"amend_plan":Bn(e,["activate","start","run","execute","启动","开始","执行"])?"activate_plan":null}function oD(e){const t=ye(e==null?void 0:e.result)??{},n=tt([t.task_id,t.taskId,...De(t.dispatched_tasks).map(a=>{var r,s;return((r=ye(a))==null?void 0:r.task_id)??((s=ye(a))==null?void 0:s.taskId)})]);return{createdPlanId:h(t.plan_id)||h(t.planId)||null,createdScheduleId:h(t.schedule_id)||h(t.scheduleId)||null,createdTaskIds:n,createdRunIds:tt([t.run_id,t.runId])}}function cD(e){const t=ye(e.payload)??{},n=ye(e.context_refs)??{};return gi({...n,entrypoint:e.entrypoint??n.entrypoint,plan_id:h(n.plan_id)||h(t.plan_id)||h(t.planId),task_id:h(n.task_id)||h(t.task_id)||h(t.taskId),run_id:h(n.run_id)||h(t.run_id)||h(t.runId),step_id:h(n.step_id)||h(t.step_id)||h(t.stepId),schedule_id:h(n.schedule_id)||h(t.schedule_id)||h(t.scheduleId)})}function uD(e,t,n){const a=ye(e.payload)??{},r=`${e.text??""} ${h(a.action)} ${h(a.command)} ${h(a.intent)}`.toLowerCase(),s=Object.keys(a).length>0,u=["plan_id","task_id","step_id","schedule_id"].some(m=>!!h(t[m])),f=h(t.step_id),p=f&&Vr(n).some(m=>m.id===f&&m.status.toLowerCase()==="ready");return u&&Bn(r,["start","run","retry","skip","cancel","pause","resume","approve","启动","开始","执行","重试","跳过","取消","暂停","恢复","批准"])?qs("PlanControl","control",["context_control_action"],t,a,!1,!1):e.entrypoint==="cron"||Bn(r,["cron","schedule","scheduled","定时","调度","周期"])?qs("PlanExecution","schedule",["scheduled_entrypoint"],t,a,!1,!0):Bn(r,["status","progress","result","report","artifact","memory","状态","进度","结果","日报","产物","记忆"])?qs("ProjectionQuery","query",["projection_query_text"],t,a,!1,!1):p||Bn(r,["execute","dispatch","delegate","run task","执行","开始","委托","派发"])?qs("PlanExecution","execute",p?["ready_step_context"]:["execution_text"],t,a,!1,!0):!e.text&&!s&&!u?qs("AskClarification","chat",["empty_ingress"],t,a,!1,!1):qs("ChatOnly","chat",["default_chat"],t,a,!1,!1)}function qs(e,t,n,a,r,s,u){return{routeKind:e,intentKind:t,reasonCodes:n,candidateSkills:dD(e,a,r),createsPlan:s,createsTaskRun:u}}function dD(e,t,n){const a=tt([...De(t.skill_ids),...De(t.skills),...De(t.candidate_skills),...De(n.skill_ids),...De(n.skills),...De(n.candidate_skills),h(t.skill_id),h(n.skill_id)]);return a.length>0?a:e==="PlanControl"?["qimingclaw-acp-session"]:e==="ProjectionQuery"?["qimingclaw-artifact-reporting"]:e==="PlanExecution"?["qimingclaw-computer-control"]:[]}async function fD(e){var n;if(e.length===0)return{candidateSkills:e,allCandidatesDisabled:!1};const t=(n=window.QimingClawBridge)==null?void 0:n.digital;if(!(t!=null&&t.getSkillCapabilities))return{candidateSkills:e,allCandidatesDisabled:!1};try{const a=await t.getSkillCapabilities();if(!Array.isArray(a==null?void 0:a.skills))return{candidateSkills:e,allCandidatesDisabled:!1};const r=new Map;for(const u of a.skills){const f=h(u.skill_id);f&&r.set(f,u.enabled!==!1)}const s=e.filter(u=>r.get(u)!==!1);return{candidateSkills:s,allCandidatesDisabled:e.length>0&&s.length===0}}catch(a){return console.warn("[qimingclawAdapter] filter route candidate skills failed:",a),{candidateSkills:e,allCandidatesDisabled:!1}}}function tt(e){return[...new Set(e.map(h).filter(Boolean))]}function Bn(e,t){return t.some(n=>e.includes(n.toLowerCase()))}function gi(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""))}const pD=new Set(["submit_plan","approve_plan","amend_plan","resume_plan","pause_plan","retry_task","skip_task","resume_task","provide_task_input"]),mD=new Set(["activate_plan","run_schedule_now","start_run","cancel_run","cancel_task","delete_schedule"]);function Rh(e){return pD.has(e)||mD.has(e)?null:"route_action_policy_blocked"}function hD(e){return["activate_plan","run_schedule_now","start_run","cancel_run","cancel_task"].includes(e)?"high":["delete_schedule","pause_schedule","skip_task","retry_task","provide_task_input"].includes(e)?"medium":"normal"}async function fr(e,t){var v,k,C,D,A,x,T,N,F,L,B,P,K,se,I,q,Z,Q,R,U,O,G;const n=`qimingclaw-digital-${e.command_kind}-${Date.now()}`,a=e.correlation_id||n,r=Re((v=e.context_refs)==null?void 0:v.plan_id)||Re((k=e.payload)==null?void 0:k.plan_id)||Re((C=e.payload)==null?void 0:C.original_plan_id),s=Re((D=e.context_refs)==null?void 0:D.task_id)||Re((A=e.payload)==null?void 0:A.task_id)||Re((x=e.payload)==null?void 0:x.original_task_id),u=Re((T=e.context_refs)==null?void 0:T.run_id)||Re((N=e.payload)==null?void 0:N.run_id)||Re((F=e.payload)==null?void 0:F.latest_run_id),f=Re((L=e.context_refs)==null?void 0:L.step_id)||Re((B=e.payload)==null?void 0:B.step_id)||Re((P=e.payload)==null?void 0:P.stepId),p=Re((K=e.context_refs)==null?void 0:K.schedule_id)||Re((se=e.payload)==null?void 0:se.schedule_id),m=await or({actionKind:`governance.${e.command_kind}`,actionLabel:`治理命令:${e.command_kind}`,riskLevel:hD(e.command_kind),reasonCodes:["governance_command"],actor:h((I=e.payload)==null?void 0:I.actor)||"digital_employee_ui",source:"sgrobot-digital-adapter",planId:r||null,taskId:s||null,runId:u||null,correlationId:a,payload:{command_kind:e.command_kind,schedule_id:p||null,step_id:f||null}}),g=cr(m);if(g){const ae={command_id:n,accepted:!1,correlation_id:a,error:"policy_blocked",message:g.status==="approval_required"?"高风险治理命令需要审批后执行。":"高风险治理命令已被风险策略拒绝。",result:g};return await Ra(e,ae),ae}if(e.command_kind==="create_plan"){const ae=`qimingclaw-local-${Ft(Re((q=e.payload)==null?void 0:q.title)||r||"plan")}-${Date.now()}`,ie=Wl(n,a,"已在 qimingclaw 兼容层创建本地计划草稿。",{plan_id:ae,status:"draft",source:"qimingclaw-adapter",requested_action:(Z=e.payload)==null?void 0:Z.requested_action,original_plan_id:((Q=e.payload)==null?void 0:Q.original_plan_id)??r});return await Ra(e,ie),ie}if(e.command_kind==="activate_plan"||e.command_kind==="run_schedule_now"){const ae=r||((R=vg(t)[0])==null?void 0:R.plan_id)||((U=pl(t)[0])==null?void 0:U.plan_id)||"qimingclaw-client-readiness",ie=await XS(ae,t,{recordCommand:!1}),z=Wl(n,a,"已映射为 qimingclaw 本地任务激活。",{plan_id:ae,schedule_id:e.command_kind==="run_schedule_now"?p:null,status:"active",dispatched_tasks:ie.dispatched_tasks,source:"qimingclaw-adapter"});return await Ra(e,z),z}if(e.command_kind==="create_schedule"){const ae=Wl(n,a,"已记录 qimingclaw 兼容定时任务请求。",{schedule_id:p||`qimingclaw-schedule-${Date.now()}`,plan_id:r,status:"enabled",source:"qimingclaw-adapter"});return await Ra(e,ae),ae}if(["update_schedule","pause_schedule","resume_schedule","delete_schedule"].includes(e.command_kind)){const ae=e.command_kind==="pause_schedule"?"paused":e.command_kind==="delete_schedule"?"deleted":"enabled",ie=Wl(n,a,`已接受 ${e.command_kind},并更新 qimingclaw 本地定时任务状态。`,{schedule_id:p||`qimingclaw-schedule-${Date.now()}`,plan_id:r,status:ae,source:"qimingclaw-adapter"});return await Ra(e,ie),ie}if(["submit_plan","approve_plan","amend_plan","resume_plan","pause_plan","cancel_plan"].includes(e.command_kind)){const ae=Wl(n,a,`已接受 ${e.command_kind},当前由 qimingclaw 本地 adapter 记录兼容状态。`,{plan_id:r,status:e.command_kind==="approve_plan"?"approved":e.command_kind==="submit_plan"?"reviewing":"accepted",source:"qimingclaw-adapter"});return await Ra(e,ae),ae}if(["retry_task","skip_task","pause_task","resume_task","provide_task_input","cancel_task","start_run","cancel_run"].includes(e.command_kind)){const ae=s||((O=un(t)[0])==null?void 0:O.id)||"qimingclaw-task-agent",ie=un(t).find($=>$.id===ae),z=u||((G=Hf(ta(t),ae))==null?void 0:G.id)||null,M=f||(ie?hl(ie):null),J=Wl(n,a,`已接受 ${e.command_kind},并记录到 qimingclaw Task Agent 控制平面。`,{plan_id:r||(ie==null?void 0:ie.planId)||"qimingclaw-task-agent-plan",task_id:ae,run_id:z,step_id:M,task_agent_id:`task-agent-${Ft(ae)}`,status:_D(e.command_kind),next_action:gD(e.command_kind),source:"qimingclaw-task-agent"});return await Ra(e,J),J}const b={command_id:n,accepted:!1,correlation_id:a,error:"missing_capability",message:`qimingclaw 数字员工兼容层尚未支持 ${e.command_kind}。`};return await Ra(e,b),b}function Wl(e,t,n,a){return{command_id:e,accepted:!0,correlation_id:t,message:n,result:a}}function _D(e){switch(e){case"retry_task":case"start_run":case"resume_task":return"running";case"skip_task":return"skipped";case"cancel_task":case"cancel_run":return"cancelled";case"pause_task":return"paused";default:return"accepted"}}function gD(e){switch(e){case"retry_task":return"start_retry_run";case"skip_task":return"continue_next_task";case"pause_task":return"await_resume";case"resume_task":return"watch_progress";case"provide_task_input":return"resume_with_input";case"cancel_task":case"cancel_run":return"close_execution";case"start_run":return"watch_progress";default:return"record_control_event"}}function Re(e){return typeof e=="string"&&e.trim()?e.trim():""}function QS(e,t=null){var r,s,u,f;if(ur(t)){const p=ea(t).find(x=>x.id===e),m=_l(e,t),g=rS(t,e),b=po(e,t).runs,v=Dt(t).filter(x=>x.planId===e||m.some(T=>T.task_id===x.taskId)),k=(p==null?void 0:p.title)??((r=m[0])==null?void 0:r.title)??e,C=(p==null?void 0:p.objective)??"qimingclaw 本地运行记录",D=[];let A=2;if(g.length>0){const x=new Set(g.map(N=>N.id));for(const N of g){D.push({seq:A++,lane:"qimingclaw",label:N.title,sub_label:`${ma(N.status)} · 依赖 ${N.dependsOn.length} · 技能 ${N.preferredSkillIds.length}`,timestamp:N.updatedAt,color:"#22c55e",source_type:"plan_step"});for(const F of m.filter(L=>L.step_id===N.id))D.push(Dh(F,A++))}const T=m.filter(N=>!x.has(N.step_id||""));if(T.length>0){D.push({seq:A++,lane:"qimingclaw",label:"未归属步骤",sub_label:`包含 ${T.length} 个任务`,timestamp:((s=T[0])==null?void 0:s.updated_at)??new Date().toISOString(),color:"#22c55e",source_type:"plan_step"});for(const N of T)D.push(Dh(N,A++))}}else for(const x of m)D.push(Dh(x,A++));return{plan_id:e,plan_title:k,plan_status:p?Uf(p,au(t,p.id)):(u=m[0])==null?void 0:u.status,plan_objective:C,lanes:[{key:"intent",label:"目标",color:"#38bdf8"},{key:"qimingclaw",label:"qimingclaw",color:"#22c55e"},{key:"execution",label:"执行",color:"#f59e0b"}],steps:[{seq:1,lane:"intent",label:k,sub_label:C,timestamp:(p==null?void 0:p.createdAt)??((f=m[0])==null?void 0:f.created_at)??new Date().toISOString(),color:"#38bdf8",source_type:"plan"},...D,...b.map((x,T)=>({seq:A+T,lane:"execution",label:x.lifecycle||"Run",sub_label:x.run_id,timestamp:x.completed_at??x.created_at,color:"#f59e0b",source_type:"run"}))],events:v.map(x=>({event_id:x.id,kind:x.kind,occurred_at:x.occurredAt,message:x.message}))}}const n=ru(pl(t).find(p=>p.plan_id===e)??pl(t)[0],t),a=new Date().toISOString();return{plan_id:n.plan_id,plan_title:n.title,plan_status:n.status,plan_objective:n.objective,lanes:[{key:"intent",label:"目标",color:"#38bdf8"},{key:"qimingclaw",label:"qimingclaw",color:"#22c55e"},{key:"execution",label:"执行",color:"#f59e0b"}],steps:[{seq:1,lane:"intent",label:n.title,sub_label:n.objective,timestamp:n.created_at,color:"#38bdf8",source_type:"plan"},{seq:2,lane:"qimingclaw",label:"接入客户端能力",sub_label:"ACP / MCP / computer server adapter",timestamp:a,color:"#22c55e",source_type:"adapter"},{seq:3,lane:"execution",label:n.status==="running"?"已读取 qimingclaw 服务状态":"等待调度",sub_label:cS(n,t),timestamp:a,color:"#f59e0b",source_type:"run"}],events:[{event_id:`${n.plan_id}-adapter-event`,kind:"qimingclaw_adapter",occurred_at:a,message:"数字员工页面已通过 qimingclaw adapter 获取数据。"}]}}function Dh(e,t){return{seq:t,lane:"qimingclaw",label:e.title,sub_label:`${ma(e.status)} · ${e.assigned_skill_id||"qimingclaw-runtime"}`,timestamp:e.updated_at,color:"#22c55e",source_type:"task"}}function yD(e,t=null){const n=un(t).find(u=>u.id===e);if(!n)return QS(e,t);const a=n.planId?ea(t).find(u=>u.id===n.planId):null,r=ta(t).filter(u=>u.taskId===n.id),s=Dt(t).filter(u=>u.taskId===n.id||r.some(f=>f.id===u.runId));return{plan_id:n.planId??n.id,plan_title:(a==null?void 0:a.title)??n.title,plan_status:n.status,plan_objective:(a==null?void 0:a.objective)??"qimingclaw 本地任务记录",lanes:[{key:"task",label:"任务",color:"#38bdf8"},{key:"execution",label:"执行",color:"#22c55e"},{key:"event",label:"事件",color:"#f59e0b"}],steps:[{seq:1,lane:"task",label:n.title,sub_label:`${ma(n.status)} · ${n.assignedSkillId||"qimingclaw-runtime"}`,timestamp:n.updatedAt,color:"#38bdf8",source_type:"task"},...r.map((u,f)=>({seq:f+2,lane:"execution",label:u.status||"Run",sub_label:u.id,timestamp:u.finishedAt??u.startedAt??u.createdAt,color:"#22c55e",source_type:"run"})),...s.map((u,f)=>({seq:r.length+f+2,lane:"event",label:u.kind,sub_label:u.message,timestamp:u.occurredAt,color:"#f59e0b",source_type:"event"}))],events:s.map(u=>({event_id:u.id,kind:u.kind,occurred_at:u.occurredAt,message:u.message}))}}async function XS(e,t=null,n={}){const a=(t==null?void 0:t.uiState)??await bi()??dn(),r=nu(),s=xg(t).find(g=>g.plan_id===e),u=Date.now(),f=`dispatch-${e}-${u}`,p=new Set(a.selectedDutyIdsByDate[r]??[]);p.add(e),a.selectedDutyIdsByDate[r]=[...p],a.confirmedDates[r]=a.confirmedDates[r]??new Date().toISOString(),await na(a,"confirm_workday",r);const m=_l(e,t).map(g=>({task_id:g.task_id,title:g.title,status:g.status==="pending"?"running":g.status}));return n.recordCommand!==!1&&await Ra({command_kind:"activate_plan",context_refs:{plan_id:e},payload:{plan_id:e,title:s==null?void 0:s.title,objective:s==null?void 0:s.objective,requested_action:"dispatch_plan"},correlation_id:f},Wl(`qimingclaw-digital-dispatch-${Ft(e)}-${u}`,f,"已将数字员工模板执行写入 qimingclaw 本地运行记录。",{plan_id:e,status:"active",dispatched_tasks:m,source:"qimingclaw-adapter"})),{ok:!0,plan_id:e,source_plan_id:e,dispatched_tasks:m}}async function bD(e,t=null){var C,D,A,x,T,N,F;const n=h(e),a=await or({actionKind:"plan_step.dispatch_ready_steps",actionLabel:"派发 Ready PlanStep",riskLevel:"high",reasonCodes:["plan_step_dispatch"],actor:"digital_employee_ui",source:"sgrobot-digital-adapter",planId:n||null,correlationId:`plan-step-dispatch:${n||"unknown"}`,payload:{plan_id:n||null,trigger_source:"manual"}}),r=cr(a);if(r)return{ok:!1,plan_id:n||null,trigger_source:"manual",orchestration_id:h(r.event_id)||`risk-blocked-${Ft(n||"unknown")}`,candidates:0,dispatched:0,skipped:0,failed:1,dispatched_step_ids:[],skipped_step_ids:[],failed_step_ids:[],errors:[{stepId:n||"unknown",error:String(r.error||r.status||"risk_policy_blocked")}]};const s=n?await((A=(D=(C=window.QimingClawBridge)==null?void 0:C.digital)==null?void 0:D.dispatchPlanReadySteps)==null?void 0:A.call(D,n).catch(()=>null)):null;if(s)return s;const u=new Date().toISOString(),f=`manual-ready-steps-${Ft(n||"unknown")}-${Ft(u)}`,p=Gf(t).filter(L=>h(L.plan_id)===n&&h(L.status).toLowerCase()==="ready"),m=Ma(t),g=ar(m),b={ok:!0,plan_id:n||null,trigger_source:"manual",orchestration_id:f,candidates:p.length,dispatched:0,skipped:0,failed:0,dispatched_step_ids:[],skipped_step_ids:[],failed_step_ids:[],errors:[]};if(!n||!g.enabled)return b.skipped=p.length,b.skipped_step_ids=p.map(L=>h(L.step_id)).filter(Boolean),b;const v=Math.max(1,Math.min(Math.floor(g.max_per_sweep),10));let k=0;for(const L of p){const B=h(L.step_id),P=h(L.task_id);if(k>=v||L.dispatchable!==!0||!P){b.skipped+=1,B&&((x=b.skipped_step_ids)==null||x.push(B));continue}k+=1;try{const K=h(L.latest_run_id)||`${P}:run:start_run:${Ft(f)}`,se=`manual-ready-step-${Ft(B)}-${Date.now()}`;await Ra({command_kind:"start_run",context_refs:{plan_id:n,task_id:P,run_id:K,step_id:B},payload:{source:"digital-home-plan-orchestration",plan_id:n,task_id:P,run_id:K,step_id:B,trigger_source:"manual",orchestration_id:f,candidate_count:p.length},correlation_id:se},Wl(se,se,"已手动推进 Ready PlanStep。",{plan_id:n,task_id:P,run_id:K,step_id:B,status:"running",trigger_source:"manual",orchestration_id:f,source:"qimingclaw-plan-orchestration"})),b.dispatched+=1,B&&((T=b.dispatched_step_ids)==null||T.push(B))}catch(K){b.failed+=1,B&&((N=b.failed_step_ids)==null||N.push(B)),(F=b.errors)==null||F.push({stepId:B,error:K instanceof Error?K.message:"dispatch failed"})}}return b}function vD(e,t=null){const n=ea(t).find(r=>r.id===e);if(n){const r=Dt(t).filter(s=>s.planId===e).slice(0,12);return[{role:"user",content:`查看 qimingclaw 本地任务:${n.title}`,created_at:n.createdAt},...r.map(s=>({role:"assistant",content:`${s.kind}:${s.message}`,created_at:s.occurredAt}))]}const a=pl(t).find(r=>r.plan_id===e)??pl(t)[0];return[{role:"user",content:`执行数字员工任务:${a.title}`,created_at:a.created_at},{role:"assistant",content:`已接入 qimingclaw adapter。目标:${a.objective??a.title}`,created_at:new Date().toISOString()}]}const xD=9e3,ho=2e4,Cf=7e4;class kD extends Error{constructor(){super("Unauthorized"),this.name="UnauthorizedError"}}async function $e(e,t={}){const n=await fA(e,t);if(n!==void 0)return n;const{timeoutMs:a=xD,...r}=t,s=yg(),u=new Headers(r.headers),f=new AbortController;let p=!1;const m=window.setTimeout(()=>{p=!0,f.abort()},a),g=r.signal,b=()=>f.abort();g&&(g.aborted?f.abort():g.addEventListener("abort",b,{once:!0})),s&&u.set("Authorization",`Bearer ${s}`),r.body&&typeof r.body=="string"&&!u.has("Content-Type")&&u.set("Content-Type","application/json");let v;try{v=await fetch(`${H1()}${gg}${e}`,{...r,headers:u,signal:f.signal})}catch(k){throw k instanceof DOMException&&k.name==="AbortError"&&p?new Error(`API request timed out after ${a/1e3}s: ${e}`):k}finally{window.clearTimeout(m),g==null||g.removeEventListener("abort",b)}if(v.status===401)throw aA(),window.dispatchEvent(new Event("qimingclaw-digital-unauthorized")),new kD;if(!v.ok){const k=await v.text().catch(()=>"");let C=k||v.statusText;if(k)try{const D=JSON.parse(k);typeof D.message=="string"&&D.message.trim()?C=D.message.trim():typeof D.error=="string"&&D.error.trim()&&(C=D.error.trim())}catch{C=k}throw new Error(`API ${v.status}: ${C}`)}if(v.status!==204)return v.json()}function ZS(e,t){if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&t in e){const n=e[t];if(n!==void 0)return n}return e}function JS(){return $e("/api/scheduler/jobs").then(e=>ZS(e,"jobs"))}function SD(e){return $e(`/api/cron/${encodeURIComponent(e)}`,{method:"DELETE"})}function wD(e,t){return $e(`/api/cron/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}).then(n=>typeof n.job=="object"?n.job:n)}function jD(e,t=20){const n=new URLSearchParams({limit:String(t)});return $e(`/api/cron/${encodeURIComponent(e)}/runs?${n}`).then(a=>ZS(a,"runs"))}function CD(){return $e("/api/cron/settings")}function TD(e){return $e("/api/cron/settings",{method:"PATCH",body:JSON.stringify(e)})}async function ED(){const[e,t]=await Promise.all([JS(),CD().catch(()=>({enabled:!1,catch_up_on_startup:!1,max_run_history:20}))]),n=await Promise.all(e.slice(0,30).map(async r=>{const s=await jD(r.id,5).catch(()=>[]);return[r.id,s]})),a=new Map(n);return{items:e.map(r=>{const s=a.get(r.id)??[],u=s[0],f=r.schedule&&typeof r.schedule=="object"?r.schedule:{};return{schedule_id:r.id,name:r.name||r.id,enabled:r.enabled!==!1,status:r.enabled===!1?"paused":String(r.last_status||f.status||"enabled"),cron_expr:r.expression||String(f.expression||""),next_run:r.next_run||null,last_run:r.last_run||(u==null?void 0:u.finished_at)||(u==null?void 0:u.started_at)||null,last_status:r.last_status||(u==null?void 0:u.status)||null,latest_run_error:r.last_output||(u==null?void 0:u.output)||null,run_count:s.length,payload:{job:r,runs:s}}}),settings:t,source:"qimingclaw-adapter"}}function R_(e){return $e(`/api/plan/${encodeURIComponent(e)}/messages`).then(t=>({messages:t.messages||[]}))}function AD(e,t){return $e("/api/route-decisions/interventions/batch",{method:"POST",body:JSON.stringify({route_decision_ids:e,...t})})}function ND(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/interventions/workbench${n?`?${n}`:""}`)}function RD(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/memory-governance${n?`?${n}`:""}`)}function DD(e,t,n={}){return $e("/api/digital-employee/memory-governance/status/batch",{method:"POST",body:JSON.stringify({memory_ids:e,action:t,...n})})}function MD(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/skill-audit-workbench${n?`?${n}`:""}`)}function $D(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/ops-workbench${n?`?${n}`:""}`)}function zD(e,t,n={}){return $e("/api/digital-employee/ops-workbench/actions/batch",{method:"POST",body:JSON.stringify({ops_ids:e,action:t,...n}),timeoutMs:ho})}function OD(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/notifications/workbench${n?`?${n}`:""}`)}function LD(e,t,n={}){return $e("/api/digital-employee/notifications/actions/batch",{method:"POST",body:JSON.stringify({notification_ids:e,action:t,...n}),timeoutMs:ho})}function ID(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/daily-reports/workbench${n?`?${n}`:""}`)}function Tf(e){return $e("/api/governance/command",{method:"POST",body:JSON.stringify(e)})}function BD(){return $e("/api/plan-step/dispatch-policy")}function qD(e){return $e("/api/plan-step/dispatch-policy",{method:"PATCH",body:JSON.stringify(e)})}function WS(){return $e("/api/plan-step/dispatch-policy/pull",{method:"POST"})}function ew(){return $e("/api/skill/policies/pull",{method:"POST"})}function tw(){return $e("/api/risk-approval/policy/pull",{method:"POST"})}function nw(){return $e("/api/risk-approval/policy")}function iw(e){return $e("/api/risk-approval/policy",{method:"PATCH",body:JSON.stringify(e)})}function aw(){return $e("/api/route-decision/policy/pull",{method:"POST"})}async function UD(){const[e,t]=await Promise.all([BD(),nw()]);return{plan_step_dispatch_policy:e,risk_approval_policy:t,source:"qimingclaw-adapter",items:[{policy_id:"plan_step_dispatch",title:"PlanStep 派发策略",status:e.enabled?"enabled":"disabled",source:e.source,updated_at:e.updated_at,last_pulled_at:e.last_pulled_at,last_pull_error:e.last_pull_error,summary:`max_per_sweep=${e.max_per_sweep}; auto_dispatch_ready_steps=${e.auto_dispatch_ready_steps}`,payload:e},{policy_id:"risk_approval",title:"风险审批策略",status:t.enabled?"enabled":"disabled",source:t.source,updated_at:t.updated_at,last_pulled_at:t.last_pulled_at,last_pull_error:t.last_pull_error,summary:`approval_required=${t.approval_required_risk_levels.join(",")}; auto_reject_actions=${t.auto_reject_actions.length}`,payload:t},{policy_id:"route_decision",title:"入口路由策略",status:"pull_available",source:"remote_pull",summary:"通过 /api/route-decision/policy/pull 获取管理端路由策略快照。"},{policy_id:"skill",title:"技能策略",status:"pull_available",source:"remote_pull",summary:"通过 /api/skill/policies/pull 同步远端技能启停策略。"}]}}async function HD(){const e=[{policy_id:"plan_step_dispatch",run:WS},{policy_id:"risk_approval",run:tw},{policy_id:"route_decision",run:aw},{policy_id:"skill",run:ew}],t=[];for(const a of e)try{const r=await a.run(),s=r;t.push({policy_id:a.policy_id,ok:s.ok!==!1,error:s.error??null,result:r})}catch(r){t.push({policy_id:a.policy_id,ok:!1,error:r instanceof Error?r.message:String(r)})}const n=t.filter(a=>a.ok).length;return{ok:n>0,total:t.length,pulled:n,failed:t.length-n,items:t}}function PD(e={}){const t=new URLSearchParams;Object.entries(e).forEach(([a,r])=>{r!=null&&`${r}`.trim()!==""&&t.set(a,`${r}`)});const n=t.toString();return $e(`/api/digital-employee/plan-step-graph${n?`?${n}`:""}`)}function FD(e,t={}){const n={plans:"/api/digital-employee/plans",tasks:"/api/digital-employee/tasks",runs:"/api/digital-employee/runs",events:"/api/digital-employee/events",artifacts:"/api/digital-employee/artifacts","artifact-groups":"/api/digital-employee/artifact-groups",approvals:"/api/digital-employee/approvals"},a=new URLSearchParams;Object.entries(t).forEach(([s,u])=>{u!=null&&`${u}`.trim()!==""&&a.set(s,`${u}`)});const r=a.toString();return $e(`${n[e]}${r?`?${r}`:""}`)}function GD(e,t){return $e(`/api/notifications/${encodeURIComponent(e)}/reply`,{method:"POST",body:JSON.stringify({content:t})})}function rf(e){const t=e?`?date=${encodeURIComponent(e)}`:"";return $e(`/api/digital-employee/workday${t}`,{timeoutMs:ho})}function Ws(e){return $e("/api/digital-employee/workday/actions",{method:"POST",body:JSON.stringify(e)})}function ck(e,t){return $e("/api/digital-employee/workday/actions",{method:"POST",body:JSON.stringify({action:"update_task_selection",date:e,duty_ids:t}),timeoutMs:ho})}function VD(e){return $e("/api/digital-employee/workday/actions",{method:"POST",body:JSON.stringify({...e,action:"generate_daily_report"}),timeoutMs:Cf})}function YD(e){return`${H1()}${gg}/api/digital-employee/reports/${encodeURIComponent(e)}/pdf`}function KD(e){return $e(`/api/digital-employee/reports/${encodeURIComponent(e)}/reveal`,{method:"POST",timeoutMs:Cf})}async function QD(e){const t=yg(),n=new Headers;t&&n.set("Authorization",`Bearer ${t}`);const a=new AbortController,r=window.setTimeout(()=>a.abort(),Cf);let s;try{s=await fetch(YD(e),{headers:n,signal:a.signal})}catch(f){throw f instanceof DOMException&&f.name==="AbortError"?new Error(`API request timed out after ${Cf/1e3}s: /api/digital-employee/reports/${e}/pdf`):f}finally{window.clearTimeout(r)}if(!s.ok){const f=await s.text().catch(()=>"");let p=f||s.statusText;if(f)try{const m=JSON.parse(f);typeof m.message=="string"&&m.message.trim()?p=m.message.trim():typeof m.error=="string"&&m.error.trim()&&(p=m.error.trim())}catch{p=f}throw new Error(`API ${s.status}: ${p}`)}const u=await s.blob();if(u.size===0)throw new Error("日报 PDF 内容为空,请重新生成后再下载。");return{blob:u,filename:`智能数字人系统日报-${e}.pdf`}}function XD(e,t){const n=window.URL.createObjectURL(e),a=document.createElement("a");a.href=n,a.download=t,document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>window.URL.revokeObjectURL(n),3e4)}function ZD(e){return $e(`/api/debug/plan/${encodeURIComponent(e)}/dispatch`,{method:"POST",timeoutMs:ho})}function uk(e){return $e(`/api/digital-employee/plans/${encodeURIComponent(e)}/dispatch-ready-steps`,{method:"POST",timeoutMs:ho})}function JD(){return $e("/api/debug/plans?limit=80").then(e=>e.plans??[])}function dk(e,t=50){const n=new URLSearchParams({limit:String(t),q:e});return $e(`/api/debug/plans?${n}`).then(a=>a.plans??[])}function WD(e){const t=new URLSearchParams({limit:"50",plan_id:e});return $e(`/api/debug/tasks?${t}`).then(n=>({tasks:n.tasks??[],runs:n.runs??[],total:n.total,truncated:n.truncated}))}function eM(e){return $e(`/api/debug/plan/${encodeURIComponent(e)}/flow`)}function tM(){return $e("/api/skill").then(e=>e.skills??[])}function nM(e,t){return $e(`/api/skill/${encodeURIComponent(e)}/enabled`,{method:"POST",body:JSON.stringify({enabled:t})})}function iM(){return $e("/api/cron/check",{method:"POST"})}function lw(e,t){return $e(`/api/digital-employee/artifacts/${encodeURIComponent(e)}/access`,{method:"POST",body:JSON.stringify({action:t})})}function rw(e){return $e("/api/digital-employee/daily-reports/delivery",{method:"POST",body:JSON.stringify(e)})}function Bd(e){return $e(`/api/digital-employee/artifacts/${encodeURIComponent(e)}`).then(t=>t.item??null)}function qd(e){return $e(`/api/digital-employee/artifacts/${encodeURIComponent(e)}/versions`).then(t=>t.items??[])}function aM(e,t,n={}){return $e(`/api/digital-employee/artifacts/${encodeURIComponent(e)}/retention`,{method:"POST",body:JSON.stringify({action:t,...n})})}function sw(e,t,n={}){return $e("/api/digital-employee/artifacts/retention/batch",{method:"POST",body:JSON.stringify({artifact_ids:e,action:t,...n})})}function lM(e,t={}){return $e(`/api/digital-employee/artifacts/${encodeURIComponent(e)}/cleanup`,{method:"POST",body:JSON.stringify(t)})}function rM(e,t){return $e(`/api/approval/${encodeURIComponent(e)}/conflict/resolve`,{method:"POST",body:JSON.stringify(t)})}function sM(e,t,n={}){return $e("/api/approval/conflicts/resolve/batch",{method:"POST",body:JSON.stringify({approval_ids:e,resolution:t,...n})})}function oM(){return $e("/api/approval/updates/pull",{method:"POST",body:JSON.stringify({})})}const cM=new Set(["reject","rejected","defer","deferred"]);function uM(e){return["pending","requested"].includes(String(e||"").toLowerCase())}function Ic(e){return e.approval_id||e.id}function dM(e){return cM.has(e.toLowerCase())?"reject":"approve"}async function fM(e,t,n){const a=Ic(e);if(!a)throw new Error("缺少 approval_id,无法处理审批。");const r=dM(t),s=e.actions.find(g=>g.id===t),u=n.comment||(s==null?void 0:s.label)||(r==="reject"?"驳回":"同意"),f=Date.now(),p=(n.correlationPrefix||n.source||"approval").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-"),m=await Tf({command_kind:r==="reject"?"reject_approval":"approve_approval",context_refs:{approval_id:a,plan_id:e.plan_id||void 0,task_id:e.task_id||void 0,run_id:e.run_id||void 0},payload:{source:n.source,comment:u,target_kind:e.target_kind||void 0,target_id:e.target_id||void 0},correlation_id:`${p}-${a}-${r}-${f}`,idempotency_key:`${p}-${a}-${r}-${f}`});if(!m.accepted)throw new Error(m.message||`审批命令未被接受:${m.command_id||a}`);return m}function pM({decision:e,busyAction:t,disabled:n=!1,compact:a=!1,className:r="",onResolve:s,onViewContext:u}){const f=Ic(e),p=uM(e.status),m=t!=null,g=[e.plan_title,e.task_title].map(b=>b==null?void 0:b.trim()).filter(Boolean).join(" / ");return c.jsxs("div",{className:r,style:{display:"grid",gap:a?8:10,padding:a?"10px 12px":"14px 16px",border:"1px solid rgba(255, 159, 10, 0.24)",background:"rgba(255, 159, 10, 0.08)",borderRadius:8},children:[c.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[c.jsx(tA,{size:16,style:{color:"var(--color-status-warning, #f59e0b)",flex:"0 0 auto",marginTop:2}}),c.jsxs("div",{style:{minWidth:0,flex:1},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[c.jsx("strong",{style:{color:"var(--pc-text-primary, #f8fafc)",fontSize:a?12:14},children:e.title||"真实执行事项需要确认"}),c.jsx("span",{style:{color:"var(--color-status-warning, #f59e0b)",fontSize:11,fontWeight:600},children:e.status_label||"待决策"})]}),c.jsx("p",{style:{margin:"4px 0 0",color:"var(--pc-text-muted, #94a3b8)",fontSize:a?12:13,lineHeight:1.45},children:e.scenario||"请确认下一步处理方式。"}),g&&c.jsx("p",{style:{margin:"4px 0 0",color:"var(--pc-text-secondary, #cbd5e1)",fontSize:11},children:g})]})]}),c.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[e.actions.map(b=>{const v=t===`${f}:${b.id}`,k=b.tone==="primary";return c.jsxs("button",{type:"button",disabled:n||m||!p,onClick:()=>s(e,b.id),style:{display:"inline-flex",alignItems:"center",gap:4,borderRadius:999,border:k?"1px solid rgba(48, 209, 88, 0.3)":"1px solid rgba(255, 59, 48, 0.28)",background:k?"rgba(48, 209, 88, 0.15)":"rgba(255, 59, 48, 0.10)",color:k?"#30d158":"var(--color-status-error, #ef4444)",fontSize:11,fontWeight:700,padding:"5px 10px",opacity:n||!p?.55:1,cursor:n||m||!p?"not-allowed":"pointer"},children:[k?c.jsx(mg,{size:13}):c.jsx(KE,{size:13}),v?"处理中...":b.label]},b.id)}),u&&c.jsxs("button",{type:"button",onClick:()=>u(e),style:{display:"inline-flex",alignItems:"center",gap:4,borderRadius:999,border:"1px solid var(--pc-border, rgba(148, 163, 184, 0.24))",background:"var(--pc-bg-surface, rgba(15, 23, 42, 0.72))",color:"var(--pc-text-secondary, #cbd5e1)",fontSize:11,fontWeight:700,padding:"5px 10px"},children:[c.jsx(b_,{size:13}),"查看上下文"]})]})]})}function mM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_M=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gM={};function fk(e,t){return(gM.jsx?_M:hM).test(e)}const yM=/[ \t\n\f\r]/g;function bM(e){return typeof e=="object"?e.type==="text"?pk(e.value):!1:pk(e)}function pk(e){return e.replace(yM,"")===""}class ou{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function ow(e,t){const n={},a={};for(const r of e)Object.assign(n,r.property),Object.assign(a,r.normal);return new ou(n,a,t)}function D_(e){return e.toLowerCase()}class vi{constructor(t,n){this.attribute=n,this.property=t}}vi.prototype.attribute="";vi.prototype.booleanish=!1;vi.prototype.boolean=!1;vi.prototype.commaOrSpaceSeparated=!1;vi.prototype.commaSeparated=!1;vi.prototype.defined=!1;vi.prototype.mustUseProperty=!1;vi.prototype.number=!1;vi.prototype.overloadedBoolean=!1;vi.prototype.property="";vi.prototype.spaceSeparated=!1;vi.prototype.space=void 0;let vM=0;const Fe=Kr(),yn=Kr(),M_=Kr(),he=Kr(),$t=Kr(),Ur=Kr(),Ni=Kr();function Kr(){return 2**++vM}const $_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:yn,commaOrSpaceSeparated:Ni,commaSeparated:Ur,number:he,overloadedBoolean:M_,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Mh=Object.keys($_);class Og extends vi{constructor(t,n,a,r){let s=-1;if(super(t,n),mk(this,"space",r),typeof a=="number")for(;++s<Mh.length;){const u=Mh[s];mk(this,Mh[s],(a&$_[u])===$_[u])}}}Og.prototype.defined=!0;function mk(e,t,n){n&&(e[t]=n)}function _o(e){const t={},n={};for(const[a,r]of Object.entries(e.properties)){const s=new Og(a,e.transform(e.attributes||{},a),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(s.mustUseProperty=!0),t[a]=s,n[D_(a)]=a,n[D_(s.attribute)]=a}return new ou(t,n,e.space)}const cw=_o({properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:$t,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:he,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:$t,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:yn,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uw(e,t){return t in e?e[t]:t}function dw(e,t){return uw(e,t.toLowerCase())}const xM=_o({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ur,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alpha:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:$t,autoFocus:Fe,autoPlay:Fe,blocking:$t,capture:null,charSet:null,checked:Fe,cite:null,className:$t,closedBy:null,colorSpace:null,cols:he,colSpan:he,command:null,commandFor:null,content:null,contentEditable:yn,controls:Fe,controlsList:$t,coords:he|Ur,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:M_,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:$t,height:he,hidden:M_,high:he,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:$t,itemRef:$t,itemScope:Fe,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Fe,optimum:he,pattern:null,ping:$t,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:$t,required:Fe,reversed:Fe,rows:he,rowSpan:he,sandbox:$t,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootCustomElementRegistry:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shadowRootSerializable:Fe,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:yn,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Fe,disablePictureInPicture:Fe,disableRemotePlayback:Fe,exportParts:Ur,part:$t,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:dw}),kM=_o({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ni,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ur,g2:Ur,glyphName:Ur,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Ni,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ni,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ni,rev:Ni,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ni,requiredFeatures:Ni,requiredFonts:Ni,requiredFormats:Ni,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Ni,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ni,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ni,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uw}),fw=_o({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),pw=_o({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dw}),mw=_o({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),SM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wM=/[A-Z]/g,hk=/-[a-z]/g,jM=/^data[-\w.:]+$/i;function CM(e,t){const n=D_(t);let a=t,r=vi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&jM.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(hk,EM);a="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!hk.test(s)){let u=s.replace(wM,TM);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}r=Og}return new r(a,t)}function TM(e){return"-"+e.toLowerCase()}function EM(e){return e.charAt(1).toUpperCase()}const AM=ow([cw,xM,fw,pw,mw],"html"),Lg=ow([cw,kM,fw,pw,mw],"svg");function NM(e){return e.join(" ").trim()}var Us={},$h,_k;function RM(){if(_k)return $h;_k=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
|
||
`,m="/",g="*",b="",v="comment",k="declaration";function C(A,x){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];x=x||{};var T=1,N=1;function F(R){var U=R.match(t);U&&(T+=U.length);var O=R.lastIndexOf(p);N=~O?R.length-O:N+R.length}function L(){var R={line:T,column:N};return function(U){return U.position=new B(R),se(),U}}function B(R){this.start=R,this.end={line:T,column:N},this.source=x.source}B.prototype.content=A;function P(R){var U=new Error(x.source+":"+T+":"+N+": "+R);if(U.reason=R,U.filename=x.source,U.line=T,U.column=N,U.source=A,!x.silent)throw U}function K(R){var U=R.exec(A);if(U){var O=U[0];return F(O),A=A.slice(O.length),U}}function se(){K(n)}function I(R){var U;for(R=R||[];U=q();)U!==!1&&R.push(U);return R}function q(){var R=L();if(!(m!=A.charAt(0)||g!=A.charAt(1))){for(var U=2;b!=A.charAt(U)&&(g!=A.charAt(U)||m!=A.charAt(U+1));)++U;if(U+=2,b===A.charAt(U-1))return P("End of comment missing");var O=A.slice(2,U-2);return N+=2,F(O),A=A.slice(U),N+=2,R({type:v,comment:O})}}function Z(){var R=L(),U=K(a);if(U){if(q(),!K(r))return P("property missing ':'");var O=K(s),G=R({type:k,property:D(U[0].replace(e,b)),value:O?D(O[0].replace(e,b)):b});return K(u),G}}function Q(){var R=[];I(R);for(var U;U=Z();)U!==!1&&(R.push(U),I(R));return R}return se(),Q()}function D(A){return A?A.replace(f,b):b}return $h=C,$h}var gk;function DM(){if(gk)return Us;gk=1;var e=Us&&Us.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.default=n;const t=e(RM());function n(a,r){let s=null;if(!a||typeof a!="string")return s;const u=(0,t.default)(a),f=typeof r=="function";return u.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:g}=p;f?r(m,g,p):g&&(s=s||{},s[m]=g)}),s}return Us}var jc={},yk;function MM(){if(yk)return jc;yk=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(m){return!m||n.test(m)||e.test(m)},u=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},p=function(m,g){return g===void 0&&(g={}),s(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(r,f):m=m.replace(a,f),m.replace(t,u))};return jc.camelCase=p,jc}var Cc,bk;function $M(){if(bk)return Cc;bk=1;var e=Cc&&Cc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(DM()),n=MM();function a(r,s){var u={};return!r||typeof r!="string"||(0,t.default)(r,function(f,p){f&&p&&(u[(0,n.camelCase)(f,s)]=p)}),u}return a.default=a,Cc=a,Cc}var zM=$M();const OM=W_(zM),hw=_w("end"),Ig=_w("start");function _w(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function LM(e){const t=Ig(e),n=hw(e);if(t&&n)return{start:t,end:n}}function Bc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vk(e.position):"start"in e||"end"in e?vk(e):"line"in e||"column"in e?z_(e):""}function z_(e){return xk(e&&e.line)+":"+xk(e&&e.column)}function vk(e){return z_(e&&e.start)+"-"+z_(e&&e.end)}function xk(e){return e&&typeof e=="number"?e:1}class Xn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let r="",s={},u=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(u=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof a=="string"){const p=a.indexOf(":");p===-1?s.ruleId=a:(s.source=a.slice(0,p),s.ruleId=a.slice(p+1))}if(!s.place&&s.ancestors&&s.ancestors){const p=s.ancestors[s.ancestors.length-1];p&&(s.place=p.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=f?f.line:void 0,this.name=Bc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xn.prototype.file="";Xn.prototype.name="";Xn.prototype.reason="";Xn.prototype.message="";Xn.prototype.stack="";Xn.prototype.column=void 0;Xn.prototype.line=void 0;Xn.prototype.ancestors=void 0;Xn.prototype.cause=void 0;Xn.prototype.fatal=void 0;Xn.prototype.place=void 0;Xn.prototype.ruleId=void 0;Xn.prototype.source=void 0;const Bg={}.hasOwnProperty,IM=new Map,BM=/[A-Z]/g,qM=new Set(["table","tbody","thead","tfoot","tr"]),UM=new Set(["td","th"]),gw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function HM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=XM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=QM(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lg:AM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=yw(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function yw(e,t,n){if(t.type==="element")return PM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VM(e,t,n);if(t.type==="mdxjsEsm")return GM(e,t);if(t.type==="root")return YM(e,t,n);if(t.type==="text")return KM(e,t)}function PM(e,t,n){const a=e.schema;let r=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const s=vw(e,t.tagName,!1),u=ZM(e,t);let f=Ug(e,t);return qM.has(t.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!bM(p):!0})),bw(e,u,s,t),qg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,s,u,n)}function FM(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Qc(e,t.position)}function GM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qc(e,t.position)}function VM(e,t,n){const a=e.schema;let r=a;t.name==="svg"&&a.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:vw(e,t.name,!0),u=JM(e,t),f=Ug(e,t);return bw(e,u,s,t),qg(u,f),e.ancestors.pop(),e.schema=a,e.create(t,s,u,n)}function YM(e,t,n){const a={};return qg(a,Ug(e,t)),e.create(t,e.Fragment,a,n)}function KM(e,t){return t.value}function bw(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function qg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QM(e,t,n){return a;function a(r,s,u,f){const m=Array.isArray(u.children)?n:t;return f?m(s,u,f):m(s,u)}}function XM(e,t){return n;function n(a,r,s,u){const f=Array.isArray(s.children),p=Ig(a);return t(r,s,u,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function ZM(e,t){const n={};let a,r;for(r in t.properties)if(r!=="children"&&Bg.call(t.properties,r)){const s=WM(e,r,t.properties[r]);if(s){const[u,f]=s;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&UM.has(t.tagName)?a=f:n[u]=f}}if(a){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function JM(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const s=a.data.estree.body[0];s.type;const u=s.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Qc(e,t.position);else{const r=a.name;let s;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else Qc(e,t.position);else s=a.value===null?!0:a.value;n[r]=s}return n}function Ug(e,t){const n=[];let a=-1;const r=e.passKeys?new Map:IM;for(;++a<t.children.length;){const s=t.children[a];let u;if(e.passKeys){const p=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(p){const m=r.get(p)||0;u=p+"-"+m,r.set(p,m+1)}}const f=yw(e,s,u);f!==void 0&&n.push(f)}return n}function WM(e,t,n){const a=CM(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?mM(n):NM(n)),a.property==="style"){let r=typeof n=="object"?n:e$(e,String(n));return e.stylePropertyNameCase==="css"&&(r=t$(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&a.space?SM[a.property]||a.property:a.attribute,n]}}function e$(e,t){try{return OM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,r=new Xn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=gw+"#cannot-parse-style-attribute",r}}function vw(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let s=-1,u;for(;++s<r.length;){const f=fk(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}a=u}else a=fk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const r=a.value;return Bg.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(a);Qc(e)}function Qc(e,t){const n=new Xn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=gw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function t$(e){const t={};let n;for(n in e)Bg.call(e,n)&&(t[n$(n)]=e[n]);return t}function n$(e){let t=e.replace(BM,i$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function i$(e){return"-"+e.toLowerCase()}const zh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},a$={};function Hg(e,t){const n=a$,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return xw(e,a,r)}function xw(e,t,n){if(l$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return kk(e.children,t,n)}return Array.isArray(e)?kk(e,t,n):""}function kk(e,t,n){const a=[];let r=-1;for(;++r<e.length;)a[r]=xw(e[r],t,n);return a.join("")}function l$(e){return!!(e&&typeof e=="object")}const Sk=document.createElement("i");function Pg(e){const t="&"+e+";";Sk.innerHTML=t;const n=Sk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ri(e,t,n,a){const r=e.length;let s=0,u;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);s<a.length;)u=a.slice(s,s+1e4),u.unshift(t,0),e.splice(...u),s+=1e4,t+=1e4}function Zi(e,t){return e.length>0?(Ri(e,e.length,0,t),e):t}const wk={}.hasOwnProperty;function kw(e){const t={};let n=-1;for(;++n<e.length;)r$(t,e[n]);return t}function r$(e,t){let n;for(n in t){const r=(wk.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let u;if(s)for(u in s){wk.call(r,u)||(r[u]=[]);const f=s[u];s$(r[u],Array.isArray(f)?f:f?[f]:[])}}}function s$(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Ri(e,0,0,a)}function Sw(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"<22>":String.fromCodePoint(n)}function ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ai=pr(/[A-Za-z]/),Qn=pr(/[\dA-Za-z]/),o$=pr(/[#-'*+\--9=?A-Z^-~]/);function Ef(e){return e!==null&&(e<32||e===127)}const O_=pr(/\d/),c$=pr(/[\dA-Fa-f]/),u$=pr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function Ot(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Qf=pr(new RegExp("\\p{P}|\\p{S}","u")),Hr=pr(/\s/);function pr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function go(e){const t=[];let n=-1,a=0,r=0;for(;++n<e.length;){const s=e.charCodeAt(n);let u="";if(s===37&&Qn(e.charCodeAt(n+1))&&Qn(e.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(n+1);s<56320&&f>56319&&f<57344?(u=String.fromCharCode(s,f),r=1):u="<22>"}else u=String.fromCharCode(s);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+r+1,u=""),r&&(n+=r,r=0)}return t.join("")+e.slice(a)}function dt(e,t,n,a){const r=a?a-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(p){return et(p)?(e.enter(n),f(p)):t(p)}function f(p){return et(p)&&s++<r?(e.consume(p),f):(e.exit(n),t(p))}}const d$={tokenize:f$};function f$(e){const t=e.attempt(this.parser.constructs.contentInitial,a,r);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),dt(e,t,"linePrefix")}function r(f){return e.enter("paragraph"),s(f)}function s(f){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Oe(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),u)}}const p$={tokenize:m$},jk={tokenize:h$};function m$(e){const t=this,n=[];let a=0,r,s,u;return f;function f(N){if(a<n.length){const F=n[a];return t.containerState=F[1],e.attempt(F[0].continuation,p,m)(N)}return m(N)}function p(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&T();const F=t.events.length;let L=F,B;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){B=t.events[L][1].end;break}x(a);let P=F;for(;P<t.events.length;)t.events[P][1].end={...B},P++;return Ri(t.events,L+1,0,t.events.slice(F)),t.events.length=P,m(N)}return f(N)}function m(N){if(a===n.length){if(!r)return v(N);if(r.currentConstruct&&r.currentConstruct.concrete)return C(N);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(jk,g,b)(N)}function g(N){return r&&T(),x(a),v(N)}function b(N){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,C(N)}function v(N){return t.containerState={},e.attempt(jk,k,C)(N)}function k(N){return a++,n.push([t.currentConstruct,t.containerState]),v(N)}function C(N){if(N===null){r&&T(),x(0),e.consume(N);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),D(N)}function D(N){if(N===null){A(e.exit("chunkFlow"),!0),x(0),e.consume(N);return}return Oe(N)?(e.consume(N),A(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(N),D)}function A(N,F){const L=t.sliceStream(N);if(F&&L.push(null),N.previous=s,s&&(s.next=N),s=N,r.defineSkip(N.start),r.write(L),t.parser.lazy[N.start.line]){let B=r.events.length;for(;B--;)if(r.events[B][1].start.offset<u&&(!r.events[B][1].end||r.events[B][1].end.offset>u))return;const P=t.events.length;let K=P,se,I;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){if(se){I=t.events[K][1].end;break}se=!0}for(x(a),B=P;B<t.events.length;)t.events[B][1].end={...I},B++;Ri(t.events,K+1,0,t.events.slice(P)),t.events.length=B}}function x(N){let F=n.length;for(;F-- >N;){const L=n[F];t.containerState=L[1],L[0].exit.call(t,e)}n.length=N}function T(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function h$(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function co(e){if(e===null||Ot(e)||Hr(e))return 1;if(Qf(e))return 2}function Xf(e,t,n){const a=[];let r=-1;for(;++r<e.length;){const s=e[r].resolveAll;s&&!a.includes(s)&&(t=s(t,n),a.push(s))}return t}const L_={name:"attention",resolveAll:_$,tokenize:g$};function _$(e,t){let n=-1,a,r,s,u,f,p,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const b={...e[a][1].end},v={...e[n][1].start};Ck(b,-p),Ck(v,p),u={type:p>1?"strongSequence":"emphasisSequence",start:b,end:{...e[a][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},s={type:p>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},r={type:p>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=Zi(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=Zi(m,[["enter",r,t],["enter",u,t],["exit",u,t],["enter",s,t]]),m=Zi(m,Xf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=Zi(m,[["exit",s,t],["enter",f,t],["exit",f,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=Zi(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Ri(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function g$(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,r=co(a);let s;return u;function u(p){return s=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===s)return e.consume(p),f;const m=e.exit("attentionSequence"),g=co(p),b=!g||g===2&&r||n.includes(p),v=!r||r===2&&g||n.includes(a);return m._open=!!(s===42?b:b&&(r||!v)),m._close=!!(s===42?v:v&&(g||!b)),t(p)}}function Ck(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const y$={name:"autolink",tokenize:b$};function b$(e,t,n){let a=0;return r;function r(k){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(k){return ai(k)?(e.consume(k),u):k===64?n(k):m(k)}function u(k){return k===43||k===45||k===46||Qn(k)?(a=1,f(k)):m(k)}function f(k){return k===58?(e.consume(k),a=0,p):(k===43||k===45||k===46||Qn(k))&&a++<32?(e.consume(k),f):(a=0,m(k))}function p(k){return k===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),t):k===null||k===32||k===60||Ef(k)?n(k):(e.consume(k),p)}function m(k){return k===64?(e.consume(k),g):o$(k)?(e.consume(k),m):n(k)}function g(k){return Qn(k)?b(k):n(k)}function b(k){return k===46?(e.consume(k),a=0,g):k===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),t):v(k)}function v(k){if((k===45||Qn(k))&&a++<63){const C=k===45?v:b;return e.consume(k),C}return n(k)}}const cu={partial:!0,tokenize:v$};function v$(e,t,n){return a;function a(s){return et(s)?dt(e,r,"linePrefix")(s):r(s)}function r(s){return s===null||Oe(s)?t(s):n(s)}}const ww={continuation:{tokenize:k$},exit:S$,name:"blockQuote",tokenize:x$};function x$(e,t,n){const a=this;return r;function r(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),s}return n(u)}function s(u){return et(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function k$(e,t,n){const a=this;return r;function r(u){return et(u)?dt(e,s,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(ww,t,n)(u)}}function S$(e){e.exit("blockQuote")}const jw={name:"characterEscape",tokenize:w$};function w$(e,t,n){return a;function a(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),r}function r(s){return u$(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Cw={name:"characterReference",tokenize:j$};function j$(e,t,n){const a=this;let r=0,s,u;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),p}function p(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),s=31,u=Qn,g(b))}function m(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=c$,g):(e.enter("characterReferenceValue"),s=7,u=O_,g(b))}function g(b){if(b===59&&r){const v=e.exit("characterReferenceValue");return u===Qn&&!Pg(a.sliceSerialize(v))?n(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(b)&&r++<s?(e.consume(b),g):n(b)}}const Tk={partial:!0,tokenize:T$},Ek={concrete:!0,name:"codeFenced",tokenize:C$};function C$(e,t,n){const a=this,r={partial:!0,tokenize:L};let s=0,u=0,f;return p;function p(B){return m(B)}function m(B){const P=a.events[a.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,f=B,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(B)}function g(B){return B===f?(u++,e.consume(B),g):u<3?n(B):(e.exit("codeFencedFenceSequence"),et(B)?dt(e,b,"whitespace")(B):b(B))}function b(B){return B===null||Oe(B)?(e.exit("codeFencedFence"),a.interrupt?t(B):e.check(Tk,D,F)(B)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(B))}function v(B){return B===null||Oe(B)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(B)):et(B)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),dt(e,k,"whitespace")(B)):B===96&&B===f?n(B):(e.consume(B),v)}function k(B){return B===null||Oe(B)?b(B):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(B))}function C(B){return B===null||Oe(B)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(B)):B===96&&B===f?n(B):(e.consume(B),C)}function D(B){return e.attempt(r,F,A)(B)}function A(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),x}function x(B){return s>0&&et(B)?dt(e,T,"linePrefix",s+1)(B):T(B)}function T(B){return B===null||Oe(B)?e.check(Tk,D,F)(B):(e.enter("codeFlowValue"),N(B))}function N(B){return B===null||Oe(B)?(e.exit("codeFlowValue"),T(B)):(e.consume(B),N)}function F(B){return e.exit("codeFenced"),t(B)}function L(B,P,K){let se=0;return I;function I(U){return B.enter("lineEnding"),B.consume(U),B.exit("lineEnding"),q}function q(U){return B.enter("codeFencedFence"),et(U)?dt(B,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):Z(U)}function Z(U){return U===f?(B.enter("codeFencedFenceSequence"),Q(U)):K(U)}function Q(U){return U===f?(se++,B.consume(U),Q):se>=u?(B.exit("codeFencedFenceSequence"),et(U)?dt(B,R,"whitespace")(U):R(U)):K(U)}function R(U){return U===null||Oe(U)?(B.exit("codeFencedFence"),P(U)):K(U)}}}function T$(e,t,n){const a=this;return r;function r(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const Oh={name:"codeIndented",tokenize:A$},E$={partial:!0,tokenize:N$};function A$(e,t,n){const a=this;return r;function r(m){return e.enter("codeIndented"),dt(e,s,"linePrefix",5)(m)}function s(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(m):n(m)}function u(m){return m===null?p(m):Oe(m)?e.attempt(E$,u,p)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),u(m)):(e.consume(m),f)}function p(m){return e.exit("codeIndented"),t(m)}}function N$(e,t,n){const a=this;return r;function r(u){return a.parser.lazy[a.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),r):dt(e,s,"linePrefix",5)(u)}function s(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Oe(u)?r(u):n(u)}}const R$={name:"codeText",previous:M$,resolve:D$,tokenize:$$};function D$(e){let t=e.length-4,n=3,a,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)r===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(r=a):(a===t||e[a][1].type==="lineEnding")&&(e[r][1].type="codeTextData",a!==r+2&&(e[r][1].end=e[a-1][1].end,e.splice(r+2,a-r-2),t-=a-r-2,a=r+2),r=void 0);return e}function M$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $$(e,t,n){let a=0,r,s;return u;function u(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),a++,f):(e.exit("codeTextSequence"),p(b))}function p(b){return b===null?n(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),p):b===96?(s=e.enter("codeTextSequence"),r=0,g(b)):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(b))}function m(b){return b===null||b===32||b===96||Oe(b)?(e.exit("codeTextData"),p(b)):(e.consume(b),m)}function g(b){return b===96?(e.consume(b),r++,g):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(b)):(s.type="codeTextData",m(b))}}class z${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return a&&Tc(this.left,a),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Tc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Tc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Tc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Tc(this.left,n.reverse())}}}function Tc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Tw(e){const t={};let n=-1,a,r,s,u,f,p,m;const g=new z$(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(p=a[1]._tokenizer.events,s=0,s<p.length&&p[s][1].type==="lineEndingBlank"&&(s+=2),s<p.length&&p[s][1].type==="content"))for(;++s<p.length&&p[s][1].type!=="content";)p[s][1].type==="chunkText"&&(p[s][1]._isInFirstContentOfListItem=!0,s++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,O$(g,n)),n=t[n],m=!0);else if(a[1]._container){for(s=n,r=void 0;s--;)if(u=g.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(r&&(g.get(r)[1].type="lineEndingBlank"),u[1].type="lineEnding",r=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;r&&(a[1].end={...g.get(r)[1].start},f=g.slice(r,n),f.unshift(a),g.splice(r,n-r+1,f))}}return Ri(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function O$(e,t){const n=e.get(t)[1],a=e.get(t)[2];let r=t-1;const s=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,p=[],m={};let g,b,v=-1,k=n,C=0,D=0;const A=[D];for(;k;){for(;e.get(++r)[1]!==k;);s.push(r),k._tokenizer||(g=a.sliceStream(k),k.next||g.push(null),b&&u.defineSkip(k.start),k._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),k._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),b=k,k=k.next}for(k=n;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(D=v+1,A.push(D),k._tokenizer=void 0,k.previous=void 0,k=k.next);for(u.events=[],k?(k._tokenizer=void 0,k.previous=void 0):A.pop(),v=A.length;v--;){const x=f.slice(A[v],A[v+1]),T=s.pop();p.push([T,T+x.length-1]),e.splice(T,2,x)}for(p.reverse(),v=-1;++v<p.length;)m[C+p[v][0]]=C+p[v][1],C+=p[v][1]-p[v][0]-1;return m}const L$={resolve:B$,tokenize:q$},I$={partial:!0,tokenize:U$};function B$(e){return Tw(e),e}function q$(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(f)}function r(f){return f===null?s(f):Oe(f)?e.check(I$,u,s)(f):(e.consume(f),r)}function s(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function U$(e,t,n){const a=this;return r;function r(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),dt(e,s,"linePrefix")}function s(u){if(u===null||Oe(u))return n(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function Ew(e,t,n,a,r,s,u,f,p){const m=p||Number.POSITIVE_INFINITY;let g=0;return b;function b(x){return x===60?(e.enter(a),e.enter(r),e.enter(s),e.consume(x),e.exit(s),v):x===null||x===32||x===41||Ef(x)?n(x):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),D(x))}function v(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(r),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),k(x))}function k(x){return x===62?(e.exit("chunkString"),e.exit(f),v(x)):x===null||x===60||Oe(x)?n(x):(e.consume(x),x===92?C:k)}function C(x){return x===60||x===62||x===92?(e.consume(x),k):k(x)}function D(x){return!g&&(x===null||x===41||Ot(x))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(x)):g<m&&x===40?(e.consume(x),g++,D):x===41?(e.consume(x),g--,D):x===null||x===32||x===40||Ef(x)?n(x):(e.consume(x),x===92?A:D)}function A(x){return x===40||x===41||x===92?(e.consume(x),D):D(x)}}function Aw(e,t,n,a,r,s){const u=this;let f=0,p;return m;function m(k){return e.enter(a),e.enter(r),e.consume(k),e.exit(r),e.enter(s),g}function g(k){return f>999||k===null||k===91||k===93&&!p||k===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(k):k===93?(e.exit(s),e.enter(r),e.consume(k),e.exit(r),e.exit(a),t):Oe(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===null||k===91||k===93||Oe(k)||f++>999?(e.exit("chunkString"),g(k)):(e.consume(k),p||(p=!et(k)),k===92?v:b)}function v(k){return k===91||k===92||k===93?(e.consume(k),f++,b):b(k)}}function Nw(e,t,n,a,r,s){let u;return f;function f(v){return v===34||v===39||v===40?(e.enter(a),e.enter(r),e.consume(v),e.exit(r),u=v===40?41:v,p):n(v)}function p(v){return v===u?(e.enter(r),e.consume(v),e.exit(r),e.exit(a),t):(e.enter(s),m(v))}function m(v){return v===u?(e.exit(s),p(u)):v===null?n(v):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),dt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===u||v===null||Oe(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?b:g)}function b(v){return v===u||v===92?(e.consume(v),g):g(v)}}function qc(e,t){let n;return a;function a(r){return Oe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,a):et(r)?dt(e,a,n?"linePrefix":"lineSuffix")(r):t(r)}}const H$={name:"definition",tokenize:F$},P$={partial:!0,tokenize:G$};function F$(e,t,n){const a=this;let r;return s;function s(k){return e.enter("definition"),u(k)}function u(k){return Aw.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function f(k){return r=ha(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),p):n(k)}function p(k){return Ot(k)?qc(e,m)(k):m(k)}function m(k){return Ew(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function g(k){return e.attempt(P$,b,b)(k)}function b(k){return et(k)?dt(e,v,"whitespace")(k):v(k)}function v(k){return k===null||Oe(k)?(e.exit("definition"),a.parser.defined.push(r),t(k)):n(k)}}function G$(e,t,n){return a;function a(f){return Ot(f)?qc(e,r)(f):n(f)}function r(f){return Nw(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return et(f)?dt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Oe(f)?t(f):n(f)}}const V$={name:"hardBreakEscape",tokenize:Y$};function Y$(e,t,n){return a;function a(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Oe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const K$={name:"headingAtx",resolve:Q$,tokenize:X$};function Q$(e,t){let n=e.length-2,a=3,r,s;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(r={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},s={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Ri(e,a,n-a+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function X$(e,t,n){let a=0;return r;function r(g){return e.enter("atxHeading"),s(g)}function s(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||Ot(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||Oe(g)?(e.exit("atxHeading"),t(g)):et(g)?dt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Ot(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const Z$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ak=["pre","script","style","textarea"],J$={concrete:!0,name:"htmlFlow",resolveTo:tz,tokenize:nz},W$={partial:!0,tokenize:az},ez={partial:!0,tokenize:iz};function tz(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function nz(e,t,n){const a=this;let r,s,u,f,p;return m;function m($){return g($)}function g($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),b}function b($){return $===33?(e.consume($),v):$===47?(e.consume($),s=!0,D):$===63?(e.consume($),r=3,a.interrupt?t:z):ai($)?(e.consume($),u=String.fromCharCode($),A):n($)}function v($){return $===45?(e.consume($),r=2,k):$===91?(e.consume($),r=5,f=0,C):ai($)?(e.consume($),r=4,a.interrupt?t:z):n($)}function k($){return $===45?(e.consume($),a.interrupt?t:z):n($)}function C($){const _e="CDATA[";return $===_e.charCodeAt(f++)?(e.consume($),f===_e.length?a.interrupt?t:Z:C):n($)}function D($){return ai($)?(e.consume($),u=String.fromCharCode($),A):n($)}function A($){if($===null||$===47||$===62||Ot($)){const _e=$===47,we=u.toLowerCase();return!_e&&!s&&Ak.includes(we)?(r=1,a.interrupt?t($):Z($)):Z$.includes(u.toLowerCase())?(r=6,_e?(e.consume($),x):a.interrupt?t($):Z($)):(r=7,a.interrupt&&!a.parser.lazy[a.now().line]?n($):s?T($):N($))}return $===45||Qn($)?(e.consume($),u+=String.fromCharCode($),A):n($)}function x($){return $===62?(e.consume($),a.interrupt?t:Z):n($)}function T($){return et($)?(e.consume($),T):I($)}function N($){return $===47?(e.consume($),I):$===58||$===95||ai($)?(e.consume($),F):et($)?(e.consume($),N):I($)}function F($){return $===45||$===46||$===58||$===95||Qn($)?(e.consume($),F):L($)}function L($){return $===61?(e.consume($),B):et($)?(e.consume($),L):N($)}function B($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),p=$,P):et($)?(e.consume($),B):K($)}function P($){return $===p?(e.consume($),p=null,se):$===null||Oe($)?n($):(e.consume($),P)}function K($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Ot($)?L($):(e.consume($),K)}function se($){return $===47||$===62||et($)?N($):n($)}function I($){return $===62?(e.consume($),q):n($)}function q($){return $===null||Oe($)?Z($):et($)?(e.consume($),q):n($)}function Z($){return $===45&&r===2?(e.consume($),O):$===60&&r===1?(e.consume($),G):$===62&&r===4?(e.consume($),M):$===63&&r===3?(e.consume($),z):$===93&&r===5?(e.consume($),ie):Oe($)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(W$,J,Q)($)):$===null||Oe($)?(e.exit("htmlFlowData"),Q($)):(e.consume($),Z)}function Q($){return e.check(ez,R,J)($)}function R($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),U}function U($){return $===null||Oe($)?Q($):(e.enter("htmlFlowData"),Z($))}function O($){return $===45?(e.consume($),z):Z($)}function G($){return $===47?(e.consume($),u="",ae):Z($)}function ae($){if($===62){const _e=u.toLowerCase();return Ak.includes(_e)?(e.consume($),M):Z($)}return ai($)&&u.length<8?(e.consume($),u+=String.fromCharCode($),ae):Z($)}function ie($){return $===93?(e.consume($),z):Z($)}function z($){return $===62?(e.consume($),M):$===45&&r===2?(e.consume($),z):Z($)}function M($){return $===null||Oe($)?(e.exit("htmlFlowData"),J($)):(e.consume($),M)}function J($){return e.exit("htmlFlow"),t($)}}function iz(e,t,n){const a=this;return r;function r(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):n(u)}function s(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function az(e,t,n){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(cu,t,n)}}const lz={name:"htmlText",tokenize:rz};function rz(e,t,n){const a=this;let r,s,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),p}function p(z){return z===33?(e.consume(z),m):z===47?(e.consume(z),L):z===63?(e.consume(z),N):ai(z)?(e.consume(z),K):n(z)}function m(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),s=0,C):ai(z)?(e.consume(z),T):n(z)}function g(z){return z===45?(e.consume(z),k):n(z)}function b(z){return z===null?n(z):z===45?(e.consume(z),v):Oe(z)?(u=b,G(z)):(e.consume(z),b)}function v(z){return z===45?(e.consume(z),k):b(z)}function k(z){return z===62?O(z):z===45?v(z):b(z)}function C(z){const M="CDATA[";return z===M.charCodeAt(s++)?(e.consume(z),s===M.length?D:C):n(z)}function D(z){return z===null?n(z):z===93?(e.consume(z),A):Oe(z)?(u=D,G(z)):(e.consume(z),D)}function A(z){return z===93?(e.consume(z),x):D(z)}function x(z){return z===62?O(z):z===93?(e.consume(z),x):D(z)}function T(z){return z===null||z===62?O(z):Oe(z)?(u=T,G(z)):(e.consume(z),T)}function N(z){return z===null?n(z):z===63?(e.consume(z),F):Oe(z)?(u=N,G(z)):(e.consume(z),N)}function F(z){return z===62?O(z):N(z)}function L(z){return ai(z)?(e.consume(z),B):n(z)}function B(z){return z===45||Qn(z)?(e.consume(z),B):P(z)}function P(z){return Oe(z)?(u=P,G(z)):et(z)?(e.consume(z),P):O(z)}function K(z){return z===45||Qn(z)?(e.consume(z),K):z===47||z===62||Ot(z)?se(z):n(z)}function se(z){return z===47?(e.consume(z),O):z===58||z===95||ai(z)?(e.consume(z),I):Oe(z)?(u=se,G(z)):et(z)?(e.consume(z),se):O(z)}function I(z){return z===45||z===46||z===58||z===95||Qn(z)?(e.consume(z),I):q(z)}function q(z){return z===61?(e.consume(z),Z):Oe(z)?(u=q,G(z)):et(z)?(e.consume(z),q):se(z)}function Z(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),r=z,Q):Oe(z)?(u=Z,G(z)):et(z)?(e.consume(z),Z):(e.consume(z),R)}function Q(z){return z===r?(e.consume(z),r=void 0,U):z===null?n(z):Oe(z)?(u=Q,G(z)):(e.consume(z),Q)}function R(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Ot(z)?se(z):(e.consume(z),R)}function U(z){return z===47||z===62||Ot(z)?se(z):n(z)}function O(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function G(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),ae}function ae(z){return et(z)?dt(e,ie,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):ie(z)}function ie(z){return e.enter("htmlTextData"),u(z)}}const Fg={name:"labelEnd",resolveAll:uz,resolveTo:dz,tokenize:fz},sz={tokenize:pz},oz={tokenize:mz},cz={tokenize:hz};function uz(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const r=a.type==="labelImage"?4:2;a.type="data",t+=r}}return e.length!==n.length&&Ri(e,0,e.length,n),e}function dz(e,t){let n=e.length,a=0,r,s,u,f;for(;n--;)if(r=e[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){a=2;break}}else r.type==="labelEnd"&&(u=n);const p={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[s][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[s+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",p,t],["enter",m,t]],f=Zi(f,e.slice(s+1,s+a+3)),f=Zi(f,[["enter",g,t]]),f=Zi(f,Xf(t.parser.constructs.insideSpan.null,e.slice(s+a+4,u-3),t)),f=Zi(f,[["exit",g,t],e[u-2],e[u-1],["exit",m,t]]),f=Zi(f,e.slice(u+1)),f=Zi(f,[["exit",p,t]]),Ri(e,s,e.length,f),e}function fz(e,t,n){const a=this;let r=a.events.length,s,u;for(;r--;)if((a.events[r][1].type==="labelImage"||a.events[r][1].type==="labelLink")&&!a.events[r][1]._balanced){s=a.events[r][1];break}return f;function f(v){return s?s._inactive?b(v):(u=a.parser.defined.includes(ha(a.sliceSerialize({start:s.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):n(v)}function p(v){return v===40?e.attempt(sz,g,u?g:b)(v):v===91?e.attempt(oz,g,u?m:b)(v):u?g(v):b(v)}function m(v){return e.attempt(cz,g,b)(v)}function g(v){return t(v)}function b(v){return s._balanced=!0,n(v)}}function pz(e,t,n){return a;function a(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),r}function r(b){return Ot(b)?qc(e,s)(b):s(b)}function s(b){return b===41?g(b):Ew(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function u(b){return Ot(b)?qc(e,p)(b):g(b)}function f(b){return n(b)}function p(b){return b===34||b===39||b===40?Nw(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):g(b)}function m(b){return Ot(b)?qc(e,g)(b):g(b)}function g(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),t):n(b)}}function mz(e,t,n){const a=this;return r;function r(f){return Aw.call(a,e,s,u,"reference","referenceMarker","referenceString")(f)}function s(f){return a.parser.defined.includes(ha(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function hz(e,t,n){return a;function a(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),r}function r(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const _z={name:"labelStartImage",resolveAll:Fg.resolveAll,tokenize:gz};function gz(e,t,n){const a=this;return r;function r(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const yz={name:"labelStartLink",resolveAll:Fg.resolveAll,tokenize:bz};function bz(e,t,n){const a=this;return r;function r(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const Lh={name:"lineEnding",tokenize:vz};function vz(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),dt(e,t,"linePrefix")}}const sf={name:"thematicBreak",tokenize:xz};function xz(e,t,n){let a=0,r;return s;function s(m){return e.enter("thematicBreak"),u(m)}function u(m){return r=m,f(m)}function f(m){return m===r?(e.enter("thematicBreakSequence"),p(m)):a>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===r?(e.consume(m),a++,p):(e.exit("thematicBreakSequence"),et(m)?dt(e,f,"whitespace")(m):f(m))}}const hi={continuation:{tokenize:jz},exit:Tz,name:"list",tokenize:wz},kz={partial:!0,tokenize:Ez},Sz={partial:!0,tokenize:Cz};function wz(e,t,n){const a=this,r=a.events[a.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,u=0;return f;function f(k){const C=a.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!a.containerState.marker||k===a.containerState.marker:O_(k)){if(a.containerState.type||(a.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(sf,n,m)(k):m(k);if(!a.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(k)}return n(k)}function p(k){return O_(k)&&++u<10?(e.consume(k),p):(!a.interrupt||u<2)&&(a.containerState.marker?k===a.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),m(k)):n(k)}function m(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||k,e.check(cu,a.interrupt?n:g,e.attempt(kz,v,b))}function g(k){return a.containerState.initialBlankLine=!0,s++,v(k)}function b(k){return et(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),v):n(k)}function v(k){return a.containerState.size=s+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(k)}}function jz(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(cu,r,s);function r(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,dt(e,t,"listItemIndent",a.containerState.size+1)(f)}function s(f){return a.containerState.furtherBlankLines||!et(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Sz,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,dt(e,e.attempt(hi,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Cz(e,t,n){const a=this;return dt(e,r,"listItemIndent",a.containerState.size+1);function r(s){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(s):n(s)}}function Tz(e){e.exit(this.containerState.type)}function Ez(e,t,n){const a=this;return dt(e,r,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const u=a.events[a.events.length-1];return!et(s)&&u&&u[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Nk={name:"setextUnderline",resolveTo:Az,tokenize:Nz};function Az(e,t){let n=e.length,a,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",u,t]),e.splice(s+1,0,["exit",e[a][1],t]),e[a][1].end={...e[s][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function Nz(e,t,n){const a=this;let r;return s;function s(m){let g=a.events.length,b;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){b=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||b)?(e.enter("setextHeadingLine"),r=m,u(m)):n(m)}function u(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===r?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),et(m)?dt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const Rz={tokenize:Dz};function Dz(e){const t=this,n=e.attempt(cu,a,e.attempt(this.parser.constructs.flowInitial,r,dt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(L$,r)),"linePrefix")));return n;function a(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mz={resolveAll:Dw()},$z=Rw("string"),zz=Rw("text");function Rw(e){return{resolveAll:Dw(e==="text"?Oz:void 0),tokenize:t};function t(n){const a=this,r=this.parser.constructs[e],s=n.attempt(r,u,f);return u;function u(g){return m(g)?s(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),p}function p(g){return m(g)?(n.exit("data"),s(g)):(n.consume(g),p)}function m(g){if(g===null)return!0;const b=r[g];let v=-1;if(b)for(;++v<b.length;){const k=b[v];if(!k.previous||k.previous.call(a,a.previous))return!0}return!1}}}function Dw(e){return t;function t(n,a){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return e?e(n,a):n}}function Oz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],r=t.sliceStream(a);let s=r.length,u=-1,f=0,p;for(;s--;){const m=r[s];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(m===-2)p=!0,f++;else if(m!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:a.start._bufferIndex+u,_index:a.start._index+s,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const Lz={42:hi,43:hi,45:hi,48:hi,49:hi,50:hi,51:hi,52:hi,53:hi,54:hi,55:hi,56:hi,57:hi,62:ww},Iz={91:H$},Bz={[-2]:Oh,[-1]:Oh,32:Oh},qz={35:K$,42:sf,45:[Nk,sf],60:J$,61:Nk,95:sf,96:Ek,126:Ek},Uz={38:Cw,92:jw},Hz={[-5]:Lh,[-4]:Lh,[-3]:Lh,33:_z,38:Cw,42:L_,60:[y$,lz],91:yz,92:[V$,jw],93:Fg,95:L_,96:R$},Pz={null:[L_,Mz]},Fz={null:[42,95]},Gz={null:[]},Vz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Fz,contentInitial:Iz,disable:Gz,document:Lz,flow:qz,flowInitial:Bz,insideSpan:Pz,string:Uz,text:Hz},Symbol.toStringTag,{value:"Module"}));function Yz(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let u=[],f=[];const p={attempt:P(L),check:P(B),consume:T,enter:N,exit:F,interrupt:P(B,{interrupt:!0})},m={code:null,containerState:{},defineSkip:D,events:[],now:C,parser:e,previous:null,sliceSerialize:v,sliceStream:k,write:b};let g=t.tokenize.call(m,p);return t.resolveAll&&s.push(t),m;function b(q){return u=Zi(u,q),A(),u[u.length-1]!==null?[]:(K(t,0),m.events=Xf(s,m.events,m),m.events)}function v(q,Z){return Qz(k(q),Z)}function k(q){return Kz(u,q)}function C(){const{_bufferIndex:q,_index:Z,line:Q,column:R,offset:U}=a;return{_bufferIndex:q,_index:Z,line:Q,column:R,offset:U}}function D(q){r[q.line]=q.column,I()}function A(){let q;for(;a._index<u.length;){const Z=u[a._index];if(typeof Z=="string")for(q=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===q&&a._bufferIndex<Z.length;)x(Z.charCodeAt(a._bufferIndex));else x(Z)}}function x(q){g=g(q)}function T(q){Oe(q)?(a.line++,a.column=1,a.offset+=q===-3?2:1,I()):q!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=q}function N(q,Z){const Q=Z||{};return Q.type=q,Q.start=C(),m.events.push(["enter",Q,m]),f.push(Q),Q}function F(q){const Z=f.pop();return Z.end=C(),m.events.push(["exit",Z,m]),Z}function L(q,Z){K(q,Z.from)}function B(q,Z){Z.restore()}function P(q,Z){return Q;function Q(R,U,O){let G,ae,ie,z;return Array.isArray(R)?J(R):"tokenize"in R?J([R]):M(R);function M(be){return Ee;function Ee(Ie){const ue=Ie!==null&&be[Ie],me=Ie!==null&&be.null,Xe=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(me)?me:me?[me]:[]];return J(Xe)(Ie)}}function J(be){return G=be,ae=0,be.length===0?O:$(be[ae])}function $(be){return Ee;function Ee(Ie){return z=se(),ie=be,be.partial||(m.currentConstruct=be),be.name&&m.parser.constructs.disable.null.includes(be.name)?we():be.tokenize.call(Z?Object.assign(Object.create(m),Z):m,p,_e,we)(Ie)}}function _e(be){return q(ie,z),U}function we(be){return z.restore(),++ae<G.length?$(G[ae]):O}}}function K(q,Z){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&Ri(m.events,Z,m.events.length-Z,q.resolve(m.events.slice(Z),m)),q.resolveTo&&(m.events=q.resolveTo(m.events,m))}function se(){const q=C(),Z=m.previous,Q=m.currentConstruct,R=m.events.length,U=Array.from(f);return{from:R,restore:O};function O(){a=q,m.previous=Z,m.currentConstruct=Q,m.events.length=R,f=U,I()}}function I(){a.line in r&&a.column<2&&(a.column=r[a.line],a.offset+=r[a.line]-1)}}function Kz(e,t){const n=t.start._index,a=t.start._bufferIndex,r=t.end._index,s=t.end._bufferIndex;let u;if(n===r)u=[e[n].slice(a,s)];else{if(u=e.slice(n,r),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}s>0&&u.push(e[r].slice(0,s))}return u}function Qz(e,t){let n=-1;const a=[];let r;for(;++n<e.length;){const s=e[n];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
|
||
`;break}case-3:{u=`\r
|
||
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&r)continue;u=" ";break}default:u=String.fromCharCode(s)}r=s===-2,a.push(u)}return a.join("")}function Xz(e){const a={constructs:kw([Vz,...(e||{}).extensions||[]]),content:r(d$),defined:[],document:r(p$),flow:r(Rz),lazy:{},string:r($z),text:r(zz)};return a;function r(s){return u;function u(f){return Yz(a,s,f)}}}function Zz(e){for(;!Tw(e););return e}const Rk=/[\0\t\n\r]/g;function Jz(){let e=1,t="",n=!0,a;return r;function r(s,u,f){const p=[];let m,g,b,v,k;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),b=0,t="",n&&(s.charCodeAt(0)===65279&&b++,n=void 0);b<s.length;){if(Rk.lastIndex=b,m=Rk.exec(s),v=m&&m.index!==void 0?m.index:s.length,k=s.charCodeAt(v),!m){t=s.slice(b);break}if(k===10&&b===v&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),b<v&&(p.push(s.slice(b,v)),e+=v-b),k){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:a=!0,e=1}b=v+1}return f&&(a&&p.push(-5),t&&p.push(t),p.push(null)),p}}const Wz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e3(e){return e.replace(Wz,t3)}function t3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return Sw(n.slice(s?2:1),s?16:10)}return Pg(n)||e}const Mw={}.hasOwnProperty;function n3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),i3(n)(Zz(Xz(n).document().write(Jz()(e,t,!0))))}function i3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(at),autolinkProtocol:se,autolinkEmail:se,atxHeading:s(vt),blockQuote:s(me),characterEscape:se,characterReference:se,codeFenced:s(Xe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Xe,u),codeText:s(it,u),codeTextData:se,data:se,codeFlowValue:se,definition:s(bt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(Lt),hardBreakEscape:s(Ue),hardBreakTrailing:s(Ue),htmlFlow:s(ft,u),htmlFlowData:se,htmlText:s(ft,u),htmlTextData:se,image:s(wt),label:u,link:s(at),listItem:s(xt),listItemValue:v,listOrdered:s(qe,b),listUnordered:s(qe),paragraph:s(lt),reference:$,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(vt),strong:s(ia),thematicBreak:s(Oa)},exit:{atxHeading:p(),atxHeadingSequence:L,autolink:p(),autolinkEmail:ue,autolinkProtocol:Ie,blockQuote:p(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:be,characterReference:Ee,codeFenced:p(A),codeFencedFence:D,codeFencedFenceInfo:k,codeFencedFenceMeta:C,codeFlowValue:I,codeIndented:p(x),codeText:p(U),codeTextData:I,data:I,definition:p(),definitionDestinationString:F,definitionLabelString:T,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(Z),hardBreakTrailing:p(Z),htmlFlow:p(Q),htmlFlowData:I,htmlText:p(R),htmlTextData:I,image:p(G),label:ie,labelText:ae,lineEnding:q,link:p(O),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:_e,resourceDestinationString:z,resourceTitleString:M,resource:J,setextHeading:p(K),setextHeadingLineSequence:P,setextHeadingText:B,strong:p(),thematicBreak:p()}};$w(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ge={type:"root",children:[]};const ze={stack:[ge],tokenStack:[],config:t,enter:f,exit:m,buffer:u,resume:g,data:n},He=[];let Pe=-1;for(;++Pe<le.length;)if(le[Pe][1].type==="listOrdered"||le[Pe][1].type==="listUnordered")if(le[Pe][0]==="enter")He.push(Pe);else{const Gt=He.pop();Pe=r(le,Gt,Pe)}for(Pe=-1;++Pe<le.length;){const Gt=t[le[Pe][0]];Mw.call(Gt,le[Pe][1].type)&&Gt[le[Pe][1].type].call(Object.assign({sliceSerialize:le[Pe][2].sliceSerialize},ze),le[Pe][1])}if(ze.tokenStack.length>0){const Gt=ze.tokenStack[ze.tokenStack.length-1];(Gt[1]||Dk).call(ze,void 0,Gt[0])}for(ge.position={start:Zl(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Zl(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)ge=t.transforms[Pe](ge)||ge;return ge}function r(le,ge,ze){let He=ge-1,Pe=-1,Gt=!1,fn,rn,kt,wn;for(;++He<=ze;){const pt=le[He];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Pe++:Pe--,wn=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(fn&&!wn&&!Pe&&!kt&&(kt=He),wn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wn=void 0}if(!Pe&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Pe===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(fn){let Zn=He;for(rn=void 0;Zn--;){const Bt=le[Zn];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;rn&&(le[rn][1].type="lineEndingBlank",Gt=!0),Bt[1].type="lineEnding",rn=Zn}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}kt&&(!rn||kt<rn)&&(fn._spread=!0),fn.end=Object.assign({},rn?le[rn][1].start:pt[1].end),le.splice(rn||He,0,["exit",fn,pt[2]]),He++,ze++}if(pt[1].type==="listItemPrefix"){const Zn={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};fn=Zn,le.splice(He,0,["enter",Zn,pt[2]]),He++,ze++,kt=void 0,wn=!0}}}return le[ge][1]._spread=Gt,ze}function s(le,ge){return ze;function ze(He){f.call(this,le(He),He),ge&&ge.call(this,He)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(le,ge,ze){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ge,ze||void 0]),le.position={start:Zl(ge.start),end:void 0}}function p(le){return ge;function ge(ze){le&&le.call(this,ze),m.call(this,ze)}}function m(le,ge){const ze=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==le.type&&(ge?ge.call(this,le,He[0]):(He[1]||Dk).call(this,le,He[0]));else throw new Error("Cannot close `"+le.type+"` ("+Bc({start:le.start,end:le.end})+"): it’s not open");ze.position.end=Zl(le.end)}function g(){return Hg(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function v(le){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function k(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=le}function C(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=le}function D(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.value=le.replace(/(\r?\n|\r)$/g,"")}function T(le){const ge=this.resume(),ze=this.stack[this.stack.length-1];ze.label=ge,ze.identifier=ha(this.sliceSerialize(le)).toLowerCase()}function N(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.title=le}function F(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.url=le}function L(le){const ge=this.stack[this.stack.length-1];if(!ge.depth){const ze=this.sliceSerialize(le).length;ge.depth=ze}}function B(){this.data.setextHeadingSlurpLineEnding=!0}function P(le){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function se(le){const ze=this.stack[this.stack.length-1].children;let He=ze[ze.length-1];(!He||He.type!=="text")&&(He=It(),He.position={start:Zl(le.start),end:void 0},ze.push(He)),this.stack.push(He)}function I(le){const ge=this.stack.pop();ge.value+=this.sliceSerialize(le),ge.position.end=Zl(le.end)}function q(le){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=ge.children[ge.children.length-1];ze.position.end=Zl(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(se.call(this,le),I.call(this,le))}function Z(){this.data.atHardBreak=!0}function Q(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.value=le}function R(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.value=le}function U(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.value=le}function O(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ge,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function G(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ge,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ae(le){const ge=this.sliceSerialize(le),ze=this.stack[this.stack.length-2];ze.label=e3(ge),ze.identifier=ha(ge).toLowerCase()}function ie(){const le=this.stack[this.stack.length-1],ge=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const He=le.children;ze.children=He}else ze.alt=ge}function z(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.url=le}function M(){const le=this.resume(),ge=this.stack[this.stack.length-1];ge.title=le}function J(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function _e(le){const ge=this.resume(),ze=this.stack[this.stack.length-1];ze.label=ge,ze.identifier=ha(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function we(le){this.data.characterReferenceType=le.type}function be(le){const ge=this.sliceSerialize(le),ze=this.data.characterReferenceType;let He;ze?(He=Sw(ge,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Pg(ge);const Pe=this.stack[this.stack.length-1];Pe.value+=He}function Ee(le){const ge=this.stack.pop();ge.position.end=Zl(le.end)}function Ie(le){I.call(this,le);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(le)}function ue(le){I.call(this,le);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(le)}function me(){return{type:"blockquote",children:[]}}function Xe(){return{type:"code",lang:null,meta:null,value:""}}function it(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Lt(){return{type:"emphasis",children:[]}}function vt(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function ft(){return{type:"html",value:""}}function wt(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function qe(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function xt(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function ia(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function Oa(){return{type:"thematicBreak"}}}function Zl(e){return{line:e.line,column:e.column,offset:e.offset}}function $w(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?$w(e,a):a3(e,a)}}function a3(e,t){let n;for(n in t)if(Mw.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Dk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bc({start:t.start,end:t.end})+") is still open")}function l3(e){const t=this;t.parser=n;function n(a){return n3(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function r3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function s3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
||
`}]}function o3(e,t){const n=t.value?t.value+`
|
||
`:"",a={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(a.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function c3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),r=go(a.toLowerCase()),s=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=s+1,f+=1,e.footnoteCounts.set(a,f);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function f3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zw(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const u=r[r.length-1];return u&&u.type==="text"?u.value+=a:r.push({type:"text",value:a}),r}function m3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return zw(e,t);const r={src:go(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(r.title=a.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function h3(e,t){const n={src:go(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function _3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function g3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return zw(e,t);const r={href:go(a.url||"")};a.title!==null&&a.title!==void 0&&(r.title=a.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function y3(e,t){const n={href:go(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function b3(e,t,n){const a=e.all(t),r=n?v3(n):Ow(t),s={},u=[];if(typeof t.checked=="boolean"){const g=a[0];let b;g&&g.type==="element"&&g.tagName==="p"?b=g:(b={type:"element",tagName:"p",properties:{},children:[]},a.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(r||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
||
`}),g.type==="element"&&g.tagName==="p"&&!r?u.push(...g.children):u.push(g)}const p=a[a.length-1];p&&(r||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
|
||
`});const m={type:"element",tagName:"li",properties:s,children:u};return e.patch(t,m),e.applyData(t,m)}function v3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=Ow(n[a])}return t}function Ow(e){const t=e.spread;return t??e.children.length>1}function x3(e,t){const n={},a=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<a.length;){const u=a[r];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function k3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function w3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j3(e,t){const n=e.all(t),a=n.shift(),r=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),r.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Ig(t.children[1]),p=hw(t.children[t.children.length-1]);f&&p&&(u.position={start:f,end:p}),r.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function C3(e,t,n){const a=n?n.children:void 0,s=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let p=-1;const m=[];for(;++p<f;){const b=t.children[p],v={},k=u?u[p]:void 0;k&&(v.align=k);let C={type:"element",tagName:s,properties:v,children:[]};b&&(C.children=e.all(b),e.patch(b,C),C=e.applyData(b,C)),m.push(C)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function T3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Mk=9,$k=32;function E3(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),r=0;const s=[];for(;a;)s.push(zk(t.slice(r,a.index),r>0,!0),a[0]),r=a.index+a[0].length,a=n.exec(t);return s.push(zk(t.slice(r),r>0,!1)),s.join("")}function zk(e,t,n){let a=0,r=e.length;if(t){let s=e.codePointAt(a);for(;s===Mk||s===$k;)a++,s=e.codePointAt(a)}if(n){let s=e.codePointAt(r-1);for(;s===Mk||s===$k;)r--,s=e.codePointAt(r-1)}return r>a?e.slice(a,r):""}function A3(e,t){const n={type:"text",value:E3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function N3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const R3={blockquote:r3,break:s3,code:o3,delete:c3,emphasis:u3,footnoteReference:d3,heading:f3,html:p3,imageReference:m3,image:h3,inlineCode:_3,linkReference:g3,link:y3,listItem:b3,list:x3,paragraph:k3,root:S3,strong:w3,table:j3,tableCell:T3,tableRow:C3,text:A3,thematicBreak:N3,toml:Ud,yaml:Ud,definition:Ud,footnoteDefinition:Ud};function Ud(){}const Lw=-1,Zf=0,Uc=1,Af=2,Gg=3,Vg=4,Yg=5,Kg=6,Iw=7,Bw=8,D3=typeof self=="object"?self:globalThis,Ok=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new D3[e](t)},M3=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),a=r=>{if(e.has(r))return e.get(r);const[s,u]=t[r];switch(s){case Zf:case Lw:return n(u,r);case Uc:{const f=n([],r);for(const p of u)f.push(a(p));return f}case Af:{const f=n({},r);for(const[p,m]of u)f[a(p)]=a(m);return f}case Gg:return n(new Date(u),r);case Vg:{const{source:f,flags:p}=u;return n(new RegExp(f,p),r)}case Yg:{const f=n(new Map,r);for(const[p,m]of u)f.set(a(p),a(m));return f}case Kg:{const f=n(new Set,r);for(const p of u)f.add(a(p));return f}case Iw:{const{name:f,message:p}=u;return n(Ok(f,p),r)}case Bw:return n(BigInt(u),r);case"BigInt":return n(Object(BigInt(u)),r);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(Ok(s,u),r)};return a},Lk=e=>M3(new Map,e)(0),Hs="",{toString:$3}={},{keys:z3}=Object,Ec=e=>{const t=typeof e;if(t!=="object"||!e)return[Zf,t];const n=$3.call(e).slice(8,-1);switch(n){case"Array":return[Uc,Hs];case"Object":return[Af,Hs];case"Date":return[Gg,Hs];case"RegExp":return[Vg,Hs];case"Map":return[Yg,Hs];case"Set":return[Kg,Hs];case"DataView":return[Uc,n]}return n.includes("Array")?[Uc,n]:n.includes("Error")?[Iw,n]:[Af,n]},Hd=([e,t])=>e===Zf&&(t==="function"||t==="symbol"),O3=(e,t,n,a)=>{const r=(u,f)=>{const p=a.push(u)-1;return n.set(f,p),p},s=u=>{if(n.has(u))return n.get(u);let[f,p]=Ec(u);switch(f){case Zf:{let g=u;switch(p){case"bigint":f=Bw,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return r([Lw],u)}return r([f,g],u)}case Uc:{if(p){let v=u;return p==="DataView"?v=new Uint8Array(u.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(u)),r([p,[...v]],u)}const g=[],b=r([f,g],u);for(const v of u)g.push(s(v));return b}case Af:{if(p)switch(p){case"BigInt":return r([p,u.toString()],u);case"Boolean":case"Number":case"String":return r([p,u.valueOf()],u)}if(t&&"toJSON"in u)return s(u.toJSON());const g=[],b=r([f,g],u);for(const v of z3(u))(e||!Hd(Ec(u[v])))&&g.push([s(v),s(u[v])]);return b}case Gg:return r([f,u.toISOString()],u);case Vg:{const{source:g,flags:b}=u;return r([f,{source:g,flags:b}],u)}case Yg:{const g=[],b=r([f,g],u);for(const[v,k]of u)(e||!(Hd(Ec(v))||Hd(Ec(k))))&&g.push([s(v),s(k)]);return b}case Kg:{const g=[],b=r([f,g],u);for(const v of u)(e||!Hd(Ec(v)))&&g.push(s(v));return b}}const{message:m}=u;return r([f,{name:p,message:m}],u)};return s},Ik=(e,{json:t,lossy:n}={})=>{const a=[];return O3(!(t||n),!!t,new Map,a)(e),a},Nf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Lk(Ik(e,t)):structuredClone(e):(e,t)=>Lk(Ik(e,t));function L3(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function I3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function B3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||L3,a=e.options.footnoteBackLabel||I3,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const g=e.all(m),b=String(m.identifier).toUpperCase(),v=go(b.toLowerCase());let k=0;const C=[],D=e.footnoteCounts.get(b);for(;D!==void 0&&++k<=D;){C.length>0&&C.push({type:"text",value:" "});let T=typeof n=="string"?n:n(p,k);typeof T=="string"&&(T={type:"text",value:T}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(p,k),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const A=g[g.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const T=A.children[A.children.length-1];T&&T.type==="text"?T.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...C)}else g.push(...C);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,x),f.push(x)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Nf(u),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
||
`}]}}const Jf=(function(e){if(e==null)return P3;if(typeof e=="function")return Wf(e);if(typeof e=="object")return Array.isArray(e)?q3(e):U3(e);if(typeof e=="string")return H3(e);throw new Error("Expected function, string, or object as test")});function q3(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jf(e[n]);return Wf(a);function a(...r){let s=-1;for(;++s<t.length;)if(t[s].apply(this,r))return!0;return!1}}function U3(e){const t=e;return Wf(n);function n(a){const r=a;let s;for(s in e)if(r[s]!==t[s])return!1;return!0}}function H3(e){return Wf(t);function t(n){return n&&n.type===e}}function Wf(e){return t;function t(n,a,r){return!!(F3(n)&&e.call(this,n,typeof a=="number"?a:void 0,r||void 0))}}function P3(){return!0}function F3(e){return e!==null&&typeof e=="object"&&"type"in e}const qw=[],G3=!0,I_=!1,V3="skip";function Uw(e,t,n,a){let r;typeof t=="function"&&typeof n!="function"?(a=n,n=t):r=t;const s=Jf(r),u=a?-1:1;f(e,void 0,[])();function f(p,m,g){const b=p&&typeof p=="object"?p:{};if(typeof b.type=="string"){const k=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(k?"<"+k+">":""))+")"})}return v;function v(){let k=qw,C,D,A;if((!t||s(p,m,g[g.length-1]||void 0))&&(k=Y3(n(p,g)),k[0]===I_))return k;if("children"in p&&p.children){const x=p;if(x.children&&k[0]!==V3)for(D=(a?x.children.length:-1)+u,A=g.concat(x);D>-1&&D<x.children.length;){const T=x.children[D];if(C=f(T,D,A)(),C[0]===I_)return C;D=typeof C[1]=="number"?C[1]:D+u}}return k}}}function Y3(e){return Array.isArray(e)?e:typeof e=="number"?[G3,e]:e==null?qw:[e]}function Qg(e,t,n,a){let r,s,u;typeof t=="function"&&typeof n!="function"?(s=void 0,u=t,r=n):(s=t,u=n,r=a),Uw(e,s,f,r);function f(p,m){const g=m[m.length-1],b=g?g.children.indexOf(p):void 0;return u(p,b,g)}}const B_={}.hasOwnProperty,K3={};function Q3(e,t){const n=t||K3,a=new Map,r=new Map,s=new Map,u={...R3,...n.handlers},f={all:m,applyData:Z3,definitionById:a,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:u,one:p,options:n,patch:X3,wrap:W3};return Qg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const b=g.type==="definition"?a:r,v=String(g.identifier).toUpperCase();b.has(v)||b.set(v,g)}}),f;function p(g,b){const v=g.type,k=f.handlers[v];if(B_.call(f.handlers,v)&&k)return k(f,g,b);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:D,...A}=g,x=Nf(A);return x.children=f.all(g),x}return Nf(g)}return(f.options.unknownHandler||J3)(f,g,b)}function m(g){const b=[];if("children"in g){const v=g.children;let k=-1;for(;++k<v.length;){const C=f.one(v[k],g);if(C){if(k&&v[k-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Bk(C.value)),!Array.isArray(C)&&C.type==="element")){const D=C.children[0];D&&D.type==="text"&&(D.value=Bk(D.value))}Array.isArray(C)?b.push(...C):b.push(C)}}}return b}}function X3(e,t){e.position&&(t.position=LM(e))}function Z3(e,t){let n=t;if(e&&e.data){const a=e.data.hName,r=e.data.hChildren,s=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&s&&Object.assign(n.properties,Nf(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function J3(e,t){const n=t.data||{},a="value"in t&&!(B_.call(n,"hProperties")||B_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function W3(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
||
`});++a<e.length;)a&&n.push({type:"text",value:`
|
||
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
||
`}),n}function Bk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function qk(e,t){const n=Q3(e,t),a=n.one(e,void 0),r=B3(n),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
|
||
`},r),s}function eO(e,t){return e&&"run"in e?async function(n,a){const r=qk(n,{file:a,...t});await e.run(r,a)}:function(n,a){return qk(n,{file:a,...e||t})}}function Uk(e){if(e)throw e}var Ih,Hk;function tO(){if(Hk)return Ih;Hk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},s=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),b=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!b)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},u=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return Ih=function p(){var m,g,b,v,k,C,D=arguments[0],A=1,x=arguments.length,T=!1;for(typeof D=="boolean"&&(T=D,D=arguments[1]||{},A=2),(D==null||typeof D!="object"&&typeof D!="function")&&(D={});A<x;++A)if(m=arguments[A],m!=null)for(g in m)b=f(D,g),v=f(m,g),D!==v&&(T&&v&&(s(v)||(k=r(v)))?(k?(k=!1,C=b&&r(b)?b:[]):C=b&&s(b)?b:{},u(D,{name:g,newValue:p(T,C,v)})):typeof v<"u"&&u(D,{name:g,newValue:v}));return D},Ih}var nO=tO();const Bh=W_(nO);function q_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function iO(){const e=[],t={run:n,use:a};return t;function n(...r){let s=-1;const u=r.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...r);function f(p,...m){const g=e[++s];let b=-1;if(p){u(p);return}for(;++b<r.length;)(m[b]===null||m[b]===void 0)&&(m[b]=r[b]);r=m,g?aO(g,f)(...m):u(null,...m)}}function a(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function aO(e,t){let n;return a;function a(...u){const f=e.length>u.length;let p;f&&u.push(r);try{p=e.apply(this,u)}catch(m){const g=m;if(f&&n)throw g;return r(g)}f||(p&&p.then&&typeof p.then=="function"?p.then(s,r):p instanceof Error?r(p):s(p))}function r(u,...f){n||(n=!0,t(u,...f))}function s(u){r(null,u)}}const Da={basename:lO,dirname:rO,extname:sO,join:oO,sep:"/"};function lO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uu(e);let n=0,a=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else u<0&&(s=!0,u=r+1),f>-1&&(e.codePointAt(r)===t.codePointAt(f--)?f<0&&(a=r):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function rO(e){if(uu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sO(e){uu(e);let t=e.length,n=-1,a=0,r=-1,s=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===a+1?"":e.slice(r,n)}function oO(...e){let t=-1,n;for(;++t<e.length;)uu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cO(n)}function cO(e){uu(e);const t=e.codePointAt(0)===47;let n=uO(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uO(e,t){let n="",a=0,r=-1,s=0,u=-1,f,p;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(r===u-1||s===1))if(r!==u-1&&s===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",a=0):(n=n.slice(0,p),a=n.length-1-n.lastIndexOf("/")),r=u,s=0;continue}}else if(n.length>0){n="",a=0,r=u,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(r+1,u):n=e.slice(r+1,u),a=u-r-1;r=u,s=0}else f===46&&s>-1?s++:s=-1}return n}function uu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dO={cwd:fO};function fO(){return"/"}function U_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pO(e){if(typeof e=="string")e=new URL(e);else if(!U_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mO(e)}function mO(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const qh=["history","path","basename","stem","extname","dirname"];class Hw{constructor(t){let n;t?U_(t)?n={path:t}:typeof t=="string"||hO(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<qh.length;){const s=qh[a];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)qh.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Da.basename(this.path):void 0}set basename(t){Hh(t,"basename"),Uh(t,"basename"),this.path=Da.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Da.dirname(this.path):void 0}set dirname(t){Pk(this.basename,"dirname"),this.path=Da.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Da.extname(this.path):void 0}set extname(t){if(Uh(t,"extname"),Pk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Da.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){U_(t)&&(t=pO(t)),Hh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Da.basename(this.path,this.extname):void 0}set stem(t){Hh(t,"stem"),Uh(t,"stem"),this.path=Da.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const r=this.message(t,n,a);throw r.fatal=!0,r}info(t,n,a){const r=this.message(t,n,a);return r.fatal=void 0,r}message(t,n,a){const r=new Xn(t,n,a);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Uh(e,t){if(e&&e.includes(Da.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Da.sep+"`")}function Hh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Pk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _O=(function(e){const a=this.constructor.prototype,r=a[e],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,a),s}),gO={}.hasOwnProperty;class Xg extends _O{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=iO()}copy(){const t=new Xg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Bh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gh("data",this.frozen),this.namespace[t]=n,this):gO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const r=n.call(t,...a);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pd(t),a=this.parser||this.Parser;return Ph("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Ph("process",this.parser||this.Parser),Fh("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,u){const f=Pd(t),p=a.parse(f);a.run(p,f,function(g,b,v){if(g||!b||!v)return m(g);const k=b,C=a.stringify(k,v);vO(C)?v.value=C:v.result=C,m(g,v)});function m(g,b){g||!b?u(g):s?s(b):n(void 0,b)}}}processSync(t){let n=!1,a;return this.freeze(),Ph("processSync",this.parser||this.Parser),Fh("processSync",this.compiler||this.Compiler),this.process(t,r),Gk("processSync","process",n),a;function r(s,u){n=!0,Uk(s),a=u}}run(t,n,a){Fk(t),this.freeze();const r=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?s(void 0,a):new Promise(s);function s(u,f){const p=Pd(n);r.run(t,p,m);function m(g,b,v){const k=b||t;g?f(g):u?u(k):a(void 0,k,v)}}}runSync(t,n){let a=!1,r;return this.run(t,n,s),Gk("runSync","run",a),r;function s(u,f){Uk(u),r=f,a=!0}}stringify(t,n){this.freeze();const a=Pd(n),r=this.compiler||this.Compiler;return Fh("stringify",r),Fk(t),r(t,a)}use(t,...n){const a=this.attachers,r=this.namespace;if(Gh("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...b]=m;p(g,b)}else u(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function u(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(m.plugins),m.settings&&(r.settings=Bh(!0,r.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const b=m[g];s(b)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,g){let b=-1,v=-1;for(;++b<a.length;)if(a[b][0]===m){v=b;break}if(v===-1)a.push([m,...g]);else if(g.length>0){let[k,...C]=g;const D=a[v][1];q_(D)&&q_(k)&&(k=Bh(!0,D,k)),a[v]=[m,k,...C]}}}}const yO=new Xg().freeze();function Ph(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fk(e){if(!q_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pd(e){return bO(e)?e:new Hw(e)}function bO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vO(e){return typeof e=="string"||xO(e)}function xO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vk=[],Yk={allowDangerousHtml:!0},SO=/^(https?|ircs?|mailto|xmpp)$/i,wO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jO(e){const t=CO(e),n=TO(e);return EO(t.runSync(t.parse(n),n),e)}function CO(e){const t=e.rehypePlugins||Vk,n=e.remarkPlugins||Vk,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yk}:Yk;return yO().use(l3).use(n).use(eO,a).use(t)}function TO(e){const t=e.children||"",n=new Hw;return typeof t=="string"&&(n.value=t),n}function EO(e,t){const n=t.allowedElements,a=t.allowElement,r=t.components,s=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,p=t.urlTransform||AO;for(const g of wO)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+kO+g.id,void 0);return Qg(e,m),HM(e,{Fragment:c.Fragment,components:r,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function m(g,b,v){if(g.type==="raw"&&v&&typeof b=="number")return u?v.children.splice(b,1):v.children[b]={type:"text",value:g.value},b;if(g.type==="element"){let k;for(k in zh)if(Object.hasOwn(zh,k)&&Object.hasOwn(g.properties,k)){const C=g.properties[k],D=zh[k];(D===null||D.includes(g.tagName))&&(g.properties[k]=p(String(C||""),k,g))}}if(g.type==="element"){let k=n?!n.includes(g.tagName):s?s.includes(g.tagName):!1;if(!k&&a&&typeof b=="number"&&(k=!a(g,b,v)),k&&v&&typeof b=="number")return f&&g.children?v.children.splice(b,1,...g.children):v.children.splice(b,1),b}}}function AO(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||a!==-1&&t>a||SO.test(e.slice(0,t))?e:""}function Kk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(t);for(;r!==-1;)a++,r=n.indexOf(t,r+t.length);return a}function NO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function RO(e,t,n){const r=Jf((n||{}).ignore||[]),s=DO(t);let u=-1;for(;++u<s.length;)Uw(e,"text",f);function f(m,g){let b=-1,v;for(;++b<g.length;){const k=g[b],C=v?v.children:void 0;if(r(k,C?C.indexOf(k):void 0,v))return;v=k}if(v)return p(m,g)}function p(m,g){const b=g[g.length-1],v=s[u][0],k=s[u][1];let C=0;const A=b.children.indexOf(m);let x=!1,T=[];v.lastIndex=0;let N=v.exec(m.value);for(;N;){const F=N.index,L={index:N.index,input:N.input,stack:[...g,m]};let B=k(...N,L);if(typeof B=="string"&&(B=B.length>0?{type:"text",value:B}:void 0),B===!1?v.lastIndex=F+1:(C!==F&&T.push({type:"text",value:m.value.slice(C,F)}),Array.isArray(B)?T.push(...B):B&&T.push(B),C=F+N[0].length,x=!0),!v.global)break;N=v.exec(m.value)}return x?(C<m.value.length&&T.push({type:"text",value:m.value.slice(C)}),b.children.splice(A,1,...T)):T=[m],A+T.length}}function DO(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const r=n[a];t.push([MO(r[0]),$O(r[1])])}return t}function MO(e){return typeof e=="string"?new RegExp(NO(e),"g"):e}function $O(e){return typeof e=="function"?e:function(){return e}}const Vh="phrasing",Yh=["autolink","link","image","label"];function zO(){return{transforms:[HO],enter:{literalAutolink:LO,literalAutolinkEmail:Kh,literalAutolinkHttp:Kh,literalAutolinkWww:Kh},exit:{literalAutolink:UO,literalAutolinkEmail:qO,literalAutolinkHttp:IO,literalAutolinkWww:BO}}}function OO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vh,notInConstruct:Yh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vh,notInConstruct:Yh},{character:":",before:"[ps]",after:"\\/",inConstruct:Vh,notInConstruct:Yh}]}}function LO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kh(e){this.config.enter.autolinkProtocol.call(this,e)}function IO(e){this.config.exit.autolinkProtocol.call(this,e)}function BO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function qO(e){this.config.exit.autolinkEmail.call(this,e)}function UO(e){this.exit(e)}function HO(e){RO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),FO]],{ignore:["link","linkReference"]})}function PO(e,t,n,a,r){let s="";if(!Pw(r)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!GO(n)))return!1;const u=VO(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:s+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function FO(e,t,n,a){return!Pw(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function GO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function VO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const r=Kk(e,"(");let s=Kk(e,")");for(;a!==-1&&r>s;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),s++;return[e,n]}function Pw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Hr(n)||Qf(n))&&(!t||n!==47)}Fw.peek=t4;function YO(){this.buffer()}function KO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function QO(){this.buffer()}function XO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JO(e){this.exit(e)}function WO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function e4(e){this.exit(e)}function t4(){return"["}function Fw(e,t,n,a){const r=n.createTracker(a);let s=r.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),f(),u(),s+=r.move("]"),s}function n4(){return{enter:{gfmFootnoteCallString:YO,gfmFootnoteCall:KO,gfmFootnoteDefinitionLabelString:QO,gfmFootnoteDefinition:XO},exit:{gfmFootnoteCallString:ZO,gfmFootnoteCall:JO,gfmFootnoteDefinitionLabelString:WO,gfmFootnoteDefinition:e4}}}function i4(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,r,s,u){const f=s.createTracker(u);let p=f.move("[^");const m=s.enter("footnoteDefinition"),g=s.enter("label");return p+=f.move(s.safe(s.associationId(a),{before:p,after:"]"})),g(),p+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),p+=f.move((t?`
|
||
`:" ")+s.indentLines(s.containerFlow(a,f.current()),t?Gw:a4))),m(),p}}function a4(e,t,n){return t===0?e:Gw(e,t,n)}function Gw(e,t,n){return(n?"":" ")+e}const l4=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Vw.peek=u4;function r4(){return{canContainEols:["delete"],enter:{strikethrough:o4},exit:{strikethrough:c4}}}function s4(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:l4}],handlers:{delete:Vw}}}function o4(e){this.enter({type:"delete",children:[]},e)}function c4(e){this.exit(e)}function Vw(e,t,n,a){const r=n.createTracker(a),s=n.enter("strikethrough");let u=r.move("~~");return u+=n.containerPhrasing(e,{...r.current(),before:u,after:"~"}),u+=r.move("~~"),s(),u}function u4(){return"~"}function d4(e){return e.length}function f4(e,t){const n=t||{},a=(n.align||[]).concat(),r=n.stringLength||d4,s=[],u=[],f=[],p=[];let m=0,g=-1;for(;++g<e.length;){const D=[],A=[];let x=-1;for(e[g].length>m&&(m=e[g].length);++x<e[g].length;){const T=p4(e[g][x]);if(n.alignDelimiters!==!1){const N=r(T);A[x]=N,(p[x]===void 0||N>p[x])&&(p[x]=N)}D.push(T)}u[g]=D,f[g]=A}let b=-1;if(typeof a=="object"&&"length"in a)for(;++b<m;)s[b]=Qk(a[b]);else{const D=Qk(a);for(;++b<m;)s[b]=D}b=-1;const v=[],k=[];for(;++b<m;){const D=s[b];let A="",x="";D===99?(A=":",x=":"):D===108?A=":":D===114&&(x=":");let T=n.alignDelimiters===!1?1:Math.max(1,p[b]-A.length-x.length);const N=A+"-".repeat(T)+x;n.alignDelimiters!==!1&&(T=A.length+T+x.length,T>p[b]&&(p[b]=T),k[b]=T),v[b]=N}u.splice(1,0,v),f.splice(1,0,k),g=-1;const C=[];for(;++g<u.length;){const D=u[g],A=f[g];b=-1;const x=[];for(;++b<m;){const T=D[b]||"";let N="",F="";if(n.alignDelimiters!==!1){const L=p[b]-(A[b]||0),B=s[b];B===114?N=" ".repeat(L):B===99?L%2?(N=" ".repeat(L/2+.5),F=" ".repeat(L/2-.5)):(N=" ".repeat(L/2),F=N):F=" ".repeat(L)}n.delimiterStart!==!1&&!b&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||b)&&x.push(" "),n.alignDelimiters!==!1&&x.push(N),x.push(T),n.alignDelimiters!==!1&&x.push(F),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||b!==m-1)&&x.push("|")}C.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return C.join(`
|
||
`)}function p4(e){return e==null?"":String(e)}function Qk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function m4(e,t,n,a){const r=n.enter("blockquote"),s=n.createTracker(a);s.move("> "),s.shift(2);const u=n.indentLines(n.containerFlow(e,s.current()),h4);return r(),u}function h4(e,t,n){return">"+(n?"":" ")+e}function _4(e,t){return Xk(e,t.inConstruct,!0)&&!Xk(e,t.notInConstruct,!1)}function Xk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Zk(e,t,n,a){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
||
`&&_4(n.stack,n.unsafe[r]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
||
`}function g4(e,t){const n=String(e);let a=n.indexOf(t),r=a,s=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===r?++s>u&&(u=s):s=1,r=a+t.length,a=n.indexOf(t,r);return u}function y4(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function b4(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function v4(e,t,n,a){const r=b4(n),s=e.value||"",u=r==="`"?"GraveAccent":"Tilde";if(y4(e,n)){const b=n.enter("codeIndented"),v=n.indentLines(s,x4);return b(),v}const f=n.createTracker(a),p=r.repeat(Math.max(g4(s,r)+1,3)),m=n.enter("codeFenced");let g=f.move(p);if(e.lang){const b=n.enter(`codeFencedLang${u}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=n.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
|
||
`,encode:["`"],...f.current()})),b()}return g+=f.move(`
|
||
`),s&&(g+=f.move(s+`
|
||
`)),g+=f.move(p),m(),g}function x4(e,t,n){return(n?"":" ")+e}function Zg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function k4(e,t,n,a){const r=Zg(n),s=r==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const p=n.createTracker(a);let m=p.move("[");return m+=p.move(n.safe(n.associationId(e),{before:m,after:"]",...p.current()})),m+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(n.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=n.enter("destinationRaw"),m+=p.move(n.safe(e.url,{before:m,after:e.title?" ":`
|
||
`,...p.current()}))),f(),e.title&&(f=n.enter(`title${s}`),m+=p.move(" "+r),m+=p.move(n.safe(e.title,{before:m,after:r,...p.current()})),m+=p.move(r),f()),u(),m}function S4(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rf(e,t,n){const a=co(e),r=co(t);return a===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Yw.peek=w4;function Yw(e,t,n,a){const r=S4(n),s=n.enter("emphasis"),u=n.createTracker(a),f=u.move(r);let p=u.move(n.containerPhrasing(e,{after:r,before:f,...u.current()}));const m=p.charCodeAt(0),g=Rf(a.before.charCodeAt(a.before.length-1),m,r);g.inside&&(p=Xc(m)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Rf(a.after.charCodeAt(0),b,r);v.inside&&(p=p.slice(0,-1)+Xc(b));const k=u.move(r);return s(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},f+p+k}function w4(e,t,n){return n.options.emphasis||"*"}function j4(e,t){let n=!1;return Qg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,I_}),!!((!e.depth||e.depth<3)&&Hg(e)&&(t.options.setext||n))}function C4(e,t,n,a){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(a);if(j4(e,n)){const g=n.enter("headingSetext"),b=n.enter("phrasing"),v=n.containerPhrasing(e,{...s.current(),before:`
|
||
`,after:`
|
||
`});return b(),g(),v+`
|
||
`+(r===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
||
`))+1))}const u="#".repeat(r),f=n.enter("headingAtx"),p=n.enter("phrasing");s.move(u+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
||
`,...s.current()});return/^[\t ]/.test(m)&&(m=Xc(m.charCodeAt(0))+m.slice(1)),m=m?u+" "+m:u,n.options.closeAtx&&(m+=" "+u),p(),f(),m}Kw.peek=T4;function Kw(e){return e.value||""}function T4(){return"<"}Qw.peek=E4;function Qw(e,t,n,a){const r=Zg(n),s=r==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const p=n.createTracker(a);let m=p.move("![");return m+=p.move(n.safe(e.alt,{before:m,after:"]",...p.current()})),m+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(n.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=n.enter("destinationRaw"),m+=p.move(n.safe(e.url,{before:m,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=n.enter(`title${s}`),m+=p.move(" "+r),m+=p.move(n.safe(e.title,{before:m,after:r,...p.current()})),m+=p.move(r),f()),m+=p.move(")"),u(),m}function E4(){return"!"}Xw.peek=A4;function Xw(e,t,n,a){const r=e.referenceType,s=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(a);let p=f.move("![");const m=n.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const b=n.safe(n.associationId(e),{before:p,after:"]",...f.current()});return u(),n.stack=g,s(),r==="full"||!m||m!==b?p+=f.move(b+"]"):r==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function A4(){return"!"}Zw.peek=N4;function Zw(e,t,n){let a=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(a);)r+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++s<n.unsafe.length;){const u=n.unsafe[s],f=n.compilePattern(u);let p;if(u.atBreak)for(;p=f.exec(a);){let m=p.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(p.index+1)}}return r+a+r}function N4(){return"`"}function Jw(e,t){const n=Hg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ww.peek=R4;function Ww(e,t,n,a){const r=Zg(n),s=r==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,p;if(Jw(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let b=u.move("<");return b+=u.move(n.containerPhrasing(e,{before:b,after:">",...u.current()})),b+=u.move(">"),f(),n.stack=g,b}f=n.enter("link"),p=n.enter("label");let m=u.move("[");return m+=u.move(n.containerPhrasing(e,{before:m,after:"](",...u.current()})),m+=u.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=n.enter("destinationLiteral"),m+=u.move("<"),m+=u.move(n.safe(e.url,{before:m,after:">",...u.current()})),m+=u.move(">")):(p=n.enter("destinationRaw"),m+=u.move(n.safe(e.url,{before:m,after:e.title?" ":")",...u.current()}))),p(),e.title&&(p=n.enter(`title${s}`),m+=u.move(" "+r),m+=u.move(n.safe(e.title,{before:m,after:r,...u.current()})),m+=u.move(r),p()),m+=u.move(")"),f(),m}function R4(e,t,n){return Jw(e,n)?"<":"["}ej.peek=D4;function ej(e,t,n,a){const r=e.referenceType,s=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(a);let p=f.move("[");const m=n.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const b=n.safe(n.associationId(e),{before:p,after:"]",...f.current()});return u(),n.stack=g,s(),r==="full"||!m||m!==b?p+=f.move(b+"]"):r==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function D4(){return"["}function Jg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function M4(e){const t=Jg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $4(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function tj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function z4(e,t,n,a){const r=n.enter("list"),s=n.bulletCurrent;let u=e.ordered?$4(n):Jg(n);const f=e.ordered?u==="."?")":".":M4(n);let p=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(p=!0),tj(n)===u&&g){let b=-1;for(;++b<e.children.length;){const v=e.children[b];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(u=f),n.bulletCurrent=u;const m=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=s,r(),m}function O4(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function L4(e,t,n,a){const r=O4(n);let s=n.bulletCurrent||Jg(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let u=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(s+" ".repeat(u-s.length)),f.shift(u);const p=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,f.current()),g);return p(),m;function g(b,v,k){return v?(k?"":" ".repeat(u))+b:(k?s:s+" ".repeat(u-s.length))+b}}function I4(e,t,n,a){const r=n.enter("paragraph"),s=n.enter("phrasing"),u=n.containerPhrasing(e,a);return s(),r(),u}const B4=Jf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function q4(e,t,n,a){return(e.children.some(function(u){return B4(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function U4(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}nj.peek=H4;function nj(e,t,n,a){const r=U4(n),s=n.enter("strong"),u=n.createTracker(a),f=u.move(r+r);let p=u.move(n.containerPhrasing(e,{after:r,before:f,...u.current()}));const m=p.charCodeAt(0),g=Rf(a.before.charCodeAt(a.before.length-1),m,r);g.inside&&(p=Xc(m)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Rf(a.after.charCodeAt(0),b,r);v.inside&&(p=p.slice(0,-1)+Xc(b));const k=u.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},f+p+k}function H4(e,t,n){return n.options.strong||"*"}function P4(e,t,n,a){return n.safe(e.value,a)}function F4(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function G4(e,t,n){const a=(tj(n)+(n.options.ruleSpaces?" ":"")).repeat(F4(n));return n.options.ruleSpaces?a.slice(0,-1):a}const ij={blockquote:m4,break:Zk,code:v4,definition:k4,emphasis:Yw,hardBreak:Zk,heading:C4,html:Kw,image:Qw,imageReference:Xw,inlineCode:Zw,link:Ww,linkReference:ej,list:z4,listItem:L4,paragraph:I4,root:q4,strong:nj,text:P4,thematicBreak:G4};function V4(){return{enter:{table:Y4,tableData:Jk,tableHeader:Jk,tableRow:Q4},exit:{codeText:X4,table:K4,tableData:Qh,tableHeader:Qh,tableRow:Qh}}}function Y4(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function K4(e){this.exit(e),this.data.inTable=void 0}function Q4(e){this.enter({type:"tableRow",children:[]},e)}function Qh(e){this.exit(e)}function Jk(e){this.enter({type:"tableCell",children:[]},e)}function X4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Z4));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Z4(e,t){return t==="|"?t:e}function J4(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:u,tableCell:p,tableRow:f}};function u(k,C,D,A){return m(g(k,D,A),k.align)}function f(k,C,D,A){const x=b(k,D,A),T=m([x]);return T.slice(0,T.indexOf(`
|
||
`))}function p(k,C,D,A){const x=D.enter("tableCell"),T=D.enter("phrasing"),N=D.containerPhrasing(k,{...A,before:s,after:s});return T(),x(),N}function m(k,C){return f4(k,{align:C,alignDelimiters:a,padding:n,stringLength:r})}function g(k,C,D){const A=k.children;let x=-1;const T=[],N=C.enter("table");for(;++x<A.length;)T[x]=b(A[x],C,D);return N(),T}function b(k,C,D){const A=k.children;let x=-1;const T=[],N=C.enter("tableRow");for(;++x<A.length;)T[x]=p(A[x],k,C,D);return N(),T}function v(k,C,D){let A=ij.inlineCode(k,C,D);return D.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function W4(){return{exit:{taskListCheckValueChecked:Wk,taskListCheckValueUnchecked:Wk,paragraph:tL}}}function eL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nL}}}function Wk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const r=t.children;let s=-1,u;for(;++s<r.length;){const f=r[s];if(f.type==="paragraph"){u=f;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function nL(e,t,n,a){const r=e.children[0],s=typeof e.checked=="boolean"&&r&&r.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);s&&f.move(u);let p=ij.listItem(e,t,n,{...a,...f.current()});return s&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),p;function m(g){return g+u}}function iL(){return[zO(),n4(),r4(),V4(),W4()]}function aL(e){return{extensions:[OO(),i4(e),s4(),J4(e),eL()]}}const lL={tokenize:dL,partial:!0},aj={tokenize:fL,partial:!0},lj={tokenize:pL,partial:!0},rj={tokenize:mL,partial:!0},rL={tokenize:hL,partial:!0},sj={name:"wwwAutolink",tokenize:cL,previous:cj},oj={name:"protocolAutolink",tokenize:uL,previous:uj},gl={name:"emailAutolink",tokenize:oL,previous:dj},za={};function sL(){return{text:za}}let zr=48;for(;zr<123;)za[zr]=gl,zr++,zr===58?zr=65:zr===91&&(zr=97);za[43]=gl;za[45]=gl;za[46]=gl;za[95]=gl;za[72]=[gl,oj];za[104]=[gl,oj];za[87]=[gl,sj];za[119]=[gl,sj];function oL(e,t,n){const a=this;let r,s;return u;function u(b){return!H_(b)||!dj.call(a,a.previous)||Wg(a.events)?n(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return H_(b)?(e.consume(b),f):b===64?(e.consume(b),p):n(b)}function p(b){return b===46?e.check(rL,g,m)(b):b===45||b===95||Qn(b)?(s=!0,e.consume(b),p):g(b)}function m(b){return e.consume(b),r=!0,p}function g(b){return s&&r&&ai(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(b)):n(b)}}function cL(e,t,n){const a=this;return r;function r(u){return u!==87&&u!==119||!cj.call(a,a.previous)||Wg(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(lL,e.attempt(aj,e.attempt(lj,s),n),n)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function uL(e,t,n){const a=this;let r="",s=!1;return u;function u(b){return(b===72||b===104)&&uj.call(a,a.previous)&&!Wg(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(b),e.consume(b),f):n(b)}function f(b){if(ai(b)&&r.length<5)return r+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const v=r.toLowerCase();if(v==="http"||v==="https")return e.consume(b),p}return n(b)}function p(b){return b===47?(e.consume(b),s?m:(s=!0,p)):n(b)}function m(b){return b===null||Ef(b)||Ot(b)||Hr(b)||Qf(b)?n(b):e.attempt(aj,e.attempt(lj,g),n)(b)}function g(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(b)}}function dL(e,t,n){let a=0;return r;function r(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),r):u===46&&a===3?(e.consume(u),s):n(u)}function s(u){return u===null?n(u):t(u)}}function fL(e,t,n){let a,r,s;return u;function u(m){return m===46||m===95?e.check(rj,p,f)(m):m===null||Ot(m)||Hr(m)||m!==45&&Qf(m)?p(m):(s=!0,e.consume(m),u)}function f(m){return m===95?a=!0:(r=a,a=void 0),e.consume(m),u}function p(m){return r||a||!s?n(m):t(m)}}function pL(e,t){let n=0,a=0;return r;function r(u){return u===40?(n++,e.consume(u),r):u===41&&a<n?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(rj,t,s)(u):u===null||Ot(u)||Hr(u)?t(u):(e.consume(u),r)}function s(u){return u===41&&a++,e.consume(u),r}}function mL(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),s):f===93?(e.consume(f),r):f===60||f===null||Ot(f)||Hr(f)?t(f):n(f)}function r(f){return f===null||f===40||f===91||Ot(f)||Hr(f)?t(f):a(f)}function s(f){return ai(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):ai(f)?(e.consume(f),u):n(f)}}function hL(e,t,n){return a;function a(s){return e.consume(s),r}function r(s){return Qn(s)?n(s):t(s)}}function cj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ot(e)}function uj(e){return!ai(e)}function dj(e){return!(e===47||H_(e))}function H_(e){return e===43||e===45||e===46||e===95||Qn(e)}function Wg(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const _L={tokenize:wL,partial:!0};function gL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xL,continuation:{tokenize:kL},exit:SL}},text:{91:{name:"gfmFootnoteCall",tokenize:vL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yL,resolveTo:bL}}}}function yL(e,t,n){const a=this;let r=a.events.length;const s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;r--;){const p=a.events[r][1];if(p.type==="labelImage"){u=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!u||!u._balanced)return n(p);const m=ha(a.sliceSerialize({start:u.end,end:a.now()}));return m.codePointAt(0)!==94||!s.includes(m.slice(1))?n(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function bL(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function vL(e,t,n){const a=this,r=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s=0,u;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),p}function p(b){return b!==94?n(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(b){if(s>999||b===93&&!u||b===null||b===91||Ot(b))return n(b);if(b===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return r.includes(ha(a.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(b)}return Ot(b)||(u=!0),s++,e.consume(b),b===92?g:m}function g(b){return b===91||b===92||b===93?(e.consume(b),s++,m):m(b)}}function xL(e,t,n){const a=this,r=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s,u=0,f;return p;function p(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(C)}function g(C){if(u>999||C===93&&!f||C===null||C===91||Ot(C))return n(C);if(C===93){e.exit("chunkString");const D=e.exit("gfmFootnoteDefinitionLabelString");return s=ha(a.sliceSerialize(D)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Ot(C)||(f=!0),u++,e.consume(C),C===92?b:g}function b(C){return C===91||C===92||C===93?(e.consume(C),u++,g):g(C)}function v(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),r.includes(s)||r.push(s),dt(e,k,"gfmFootnoteDefinitionWhitespace")):n(C)}function k(C){return t(C)}}function kL(e,t,n){return e.check(cu,t,e.attempt(_L,t,n))}function SL(e){e.exit("gfmFootnoteDefinition")}function wL(e,t,n){const a=this;return dt(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(s):n(s)}}function jL(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function r(u,f){let p=-1;for(;++p<u.length;)if(u[p][0]==="enter"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._close){let m=p;for(;m--;)if(u[m][0]==="exit"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._open&&u[p][1].end.offset-u[p][1].start.offset===u[m][1].end.offset-u[m][1].start.offset){u[p][1].type="strikethroughSequence",u[m][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[m][1].start),end:Object.assign({},u[p][1].end)},b={type:"strikethroughText",start:Object.assign({},u[m][1].end),end:Object.assign({},u[p][1].start)},v=[["enter",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["enter",b,f]],k=f.parser.constructs.insideSpan.null;k&&Ri(v,v.length,0,Xf(k,u.slice(m+1,p),f)),Ri(v,v.length,0,[["exit",b,f],["enter",u[p][1],f],["exit",u[p][1],f],["exit",g,f]]),Ri(u,m-1,p-m+3,v),p=m+v.length-2;break}}for(p=-1;++p<u.length;)u[p][1].type==="strikethroughSequenceTemporary"&&(u[p][1].type="data");return u}function s(u,f,p){const m=this.previous,g=this.events;let b=0;return v;function v(C){return m===126&&g[g.length-1][1].type!=="characterEscape"?p(C):(u.enter("strikethroughSequenceTemporary"),k(C))}function k(C){const D=co(m);if(C===126)return b>1?p(C):(u.consume(C),b++,k);if(b<2&&!n)return p(C);const A=u.exit("strikethroughSequenceTemporary"),x=co(C);return A._open=!x||x===2&&!!D,A._close=!D||D===2&&!!x,f(C)}}}class CL{constructor(){this.map=[]}add(t,n,a){TL(this,t,n,a)}consume(t){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let r=a.pop();for(;r;){for(const s of r)t.push(s);r=a.pop()}this.map.length=0}}function TL(e,t,n,a){let r=0;if(!(n===0&&a.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...a);return}r+=1}e.map.push([t,n,a])}}function EL(e,t){let n=!1;const a=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=a.length-1;a[s]=a[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function AL(){return{flow:{null:{name:"table",tokenize:NL,resolveAll:RL}}}}function NL(e,t,n){const a=this;let r=0,s=0,u;return f;function f(I){let q=a.events.length-1;for(;q>-1;){const R=a.events[q][1].type;if(R==="lineEnding"||R==="linePrefix")q--;else break}const Z=q>-1?a.events[q][1].type:null,Q=Z==="tableHead"||Z==="tableRow"?B:p;return Q===B&&a.parser.lazy[a.now().line]?n(I):Q(I)}function p(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(u=!0,s+=1),g(I)}function g(I){return I===null?n(I):Oe(I)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),k):n(I):et(I)?dt(e,g,"whitespace")(I):(s+=1,u&&(u=!1,r+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),b(I)))}function b(I){return I===null||I===124||Ot(I)?(e.exit("data"),g(I)):(e.consume(I),I===92?v:b)}function v(I){return I===92||I===124?(e.consume(I),b):b(I)}function k(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),u=!1,et(I)?dt(e,C,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):C(I))}function C(I){return I===45||I===58?A(I):I===124?(u=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),D):L(I)}function D(I){return et(I)?dt(e,A,"whitespace")(I):A(I)}function A(I){return I===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):I===45?(s+=1,x(I)):I===null||Oe(I)?F(I):L(I)}function x(I){return I===45?(e.enter("tableDelimiterFiller"),T(I)):L(I)}function T(I){return I===45?(e.consume(I),T):I===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(I))}function N(I){return et(I)?dt(e,F,"whitespace")(I):F(I)}function F(I){return I===124?C(I):I===null||Oe(I)?!u||r!==s?L(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):L(I)}function L(I){return n(I)}function B(I){return e.enter("tableRow"),P(I)}function P(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),P):I===null||Oe(I)?(e.exit("tableRow"),t(I)):et(I)?dt(e,P,"whitespace")(I):(e.enter("data"),K(I))}function K(I){return I===null||I===124||Ot(I)?(e.exit("data"),P(I)):(e.consume(I),I===92?se:K)}function se(I){return I===92||I===124?(e.consume(I),K):K(I)}}function RL(e,t){let n=-1,a=!0,r=0,s=[0,0,0,0],u=[0,0,0,0],f=!1,p=0,m,g,b;const v=new CL;for(;++n<e.length;){const k=e[n],C=k[1];k[0]==="enter"?C.type==="tableHead"?(f=!1,p!==0&&(e0(v,t,p,m,g),g=void 0,p=0),m={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(n,0,[["enter",m,t]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(a=!0,b=void 0,s=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(n,0,[["enter",g,t]])),r=C.type==="tableDelimiterRow"?2:g?3:1):r&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],b=Fd(v,t,s,r,void 0,b),s=[0,0,0,0]),u[2]=n)):C.type==="tableCellDivider"&&(a?a=!1:(s[1]!==0&&(u[0]=u[1],b=Fd(v,t,s,r,void 0,b)),s=u,u=[s[1],n,0,0])):C.type==="tableHead"?(f=!0,p=n):C.type==="tableRow"||C.type==="tableDelimiterRow"?(p=n,s[1]!==0?(u[0]=u[1],b=Fd(v,t,s,r,n,b)):u[1]!==0&&(b=Fd(v,t,u,r,n,b)),r=0):r&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(u[3]=n)}for(p!==0&&e0(v,t,p,m,g),v.consume(t.events),n=-1;++n<t.events.length;){const k=t.events[n];k[0]==="enter"&&k[1].type==="table"&&(k[1]._align=EL(t.events,n))}return e}function Fd(e,t,n,a,r,s){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(s.end=Object.assign({},Ks(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const p=Ks(t.events,n[1]);if(s={type:u,start:Object.assign({},p),end:Object.assign({},p)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const m=Ks(t.events,n[2]),g=Ks(t.events,n[3]),b={type:f,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",b,t]]),a!==2){const v=t.events[n[2]],k=t.events[n[3]];if(v[1].end=Object.assign({},k[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const C=n[2]+1,D=n[3]-n[2]-1;e.add(C,D,[])}}e.add(n[3]+1,0,[["exit",b,t]])}return r!==void 0&&(s.end=Object.assign({},Ks(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function e0(e,t,n,a,r){const s=[],u=Ks(t.events,n);r&&(r.end=Object.assign({},u),s.push(["exit",r,t])),a.end=Object.assign({},u),s.push(["exit",a,t]),e.add(n+1,0,s)}function Ks(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const DL={name:"tasklistCheck",tokenize:$L};function ML(){return{text:{91:DL}}}function $L(e,t,n){const a=this;return r;function r(p){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),s)}function s(p){return Ot(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),u):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),u):n(p)}function u(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(p)}function f(p){return Oe(p)?t(p):et(p)?e.check({tokenize:zL},t,n)(p):n(p)}}function zL(e,t,n){return dt(e,a,"whitespace");function a(r){return r===null?n(r):t(r)}}function OL(e){return kw([sL(),gL(),jL(e),AL(),ML()])}const LL={};function IL(e){const t=this,n=e||LL,a=t.data(),r=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);r.push(OL(n)),s.push(iL()),u.push(aL(n))}function Qi(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=globalThis.crypto,t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Array.from(t,a=>a.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}const BL=1e3,qL=3e4,t0="zeroclaw_session_id";function UL(){let e=sessionStorage.getItem(t0);return e||(e=Qi(),sessionStorage.setItem(t0,e)),e}class HL{constructor(t={}){pi(this,"ws",null);pi(this,"currentDelay");pi(this,"reconnectTimer",null);pi(this,"intentionallyClosed",!1);pi(this,"onMessage",null);pi(this,"onOpen",null);pi(this,"onClose",null);pi(this,"onError",null);pi(this,"baseUrl");pi(this,"reconnectDelay");pi(this,"maxReconnectDelay");pi(this,"autoReconnect");pi(this,"planId");let n;n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,this.baseUrl=t.baseUrl??n,this.reconnectDelay=t.reconnectDelay??BL,this.maxReconnectDelay=t.maxReconnectDelay??qL,this.autoReconnect=t.autoReconnect??!0,this.currentDelay=this.reconnectDelay,this.planId=t.planId}connect(){this.intentionallyClosed=!1,this.clearReconnectTimer();const t=yg(),n=UL(),a=new URLSearchParams;t&&a.set("token",t),a.set("session_id",n),this.planId&&a.set("plan_id",this.planId);const r=`${this.baseUrl}${gg}/ws/chat?${a.toString()}`,s=["zeroclaw.v1"];t&&s.push(`bearer.${t}`),this.ws=new WebSocket(r,s),this.ws.onopen=()=>{var u;this.currentDelay=this.reconnectDelay,(u=this.onOpen)==null||u.call(this)},this.ws.onmessage=u=>{var f;try{const p=JSON.parse(u.data);(f=this.onMessage)==null||f.call(this,p)}catch{}},this.ws.onclose=u=>{var f;(f=this.onClose)==null||f.call(this,u),this.scheduleReconnect()},this.ws.onerror=u=>{var f;(f=this.onError)==null||f.call(this,u)}}setPlanId(t){this.planId=t??void 0}sendMessage(t){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");const n={type:"message",content:t};this.planId&&(n.plan_id=this.planId),this.ws.send(JSON.stringify(n))}disconnect(){if(this.intentionallyClosed=!0,this.clearReconnectTimer(),this.ws){const t=this.ws;if(this.ws=null,t.readyState===WebSocket.CONNECTING){t.onopen=()=>t.close(),t.onmessage=null,t.onerror=null,t.onclose=null;return}t.close()}}get connected(){var t;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN}scheduleReconnect(){this.intentionallyClosed||!this.autoReconnect||(this.reconnectTimer=setTimeout(()=>{this.currentDelay=Math.min(this.currentDelay*2,this.maxReconnectDelay),this.connect()},this.currentDelay))}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const PL=["周日","周一","周二","周三","周四","周五","周六"];function n0(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function i0(e){return e<10?"0"+e:String(e)}function FL(e){if(!e)return"";const t=new Date(e);if(isNaN(t.getTime()))return"";const n=new Date,a=`${i0(t.getHours())}:${i0(t.getMinutes())}`;if(n0(t,n))return`今天 ${a}`;const r=new Date(n);return r.setDate(r.getDate()-1),n0(t,r)?`昨天 ${a}`:Math.floor((n.getTime()-t.getTime())/(1e3*60*60*24))<7&&t.getDay()!==n.getDay()?`${PL[t.getDay()]} ${a}`:t.getFullYear()===n.getFullYear()?`${t.getMonth()+1}月${t.getDate()}日`:`${t.getFullYear()}年${t.getMonth()+1}月${t.getDate()}日`}const a0={zh:{"nav.dashboard":"仪表盘","nav.plans":"计划","nav.execution":"执行","nav.governance":"治理","nav.scheduler":"调度器","nav.skills":"技能","nav.agent":"智能体","nav.tools":"工具","nav.cron":"Cron 任务","nav.integrations":"集成","nav.memory":"记忆","nav.config":"配置","nav.cost":"成本追踪","nav.logs":"日志","nav.devtools":"工具","nav.swimlane":"泳道","nav.doctor":"诊断","nav.canvas":"画布","planb.nav.chat":"对话","planb.nav.browser":"AI浏览器","planb.nav.monitor":"运行监测","planb.nav.dashboard":"仪表盘","planb.nav.settings":"设置","planb.nav.more":"更多工具","planb.layout.switch_to_wide":"切换到宽屏模式","planb.layout.switch_to_compact":"切换到紧凑模式","planb.layout.pop_out":"弹出独立窗口","planb.browser.title":"AI浏览器","planb.browser.subtitle":"启动 SuperRPA 浏览器自动化","planb.browser.launch":"启动浏览器","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"活跃会话","planb.browser.no_sessions":"没有活跃的浏览器会话,在上方输入 URL 启动。","planb.browser.status_launching":"启动中","planb.browser.status_running":"运行中","planb.browser.status_idle":"空闲","planb.browser.status_error":"错误","planb.browser.status_stopped":"已停止","planb.browser.launch_error":"启动浏览器失败","planb.browser.close_error":"关闭会话失败","planb.browser.backend_not_configured":"SuperRPA 未配置,请设置 SGCLAW_SUPERRPA_PATH 环境变量。","planb.chat.welcome":"今天我能帮你什么?","planb.chat.placeholder":"问点什么...","planb.chat.sessions":"对话历史","planb.chat.new_chat":"新对话","planb.chat.no_sessions":"暂无对话历史","planb.chat.untitled":"未命名对话","planb.chat.thought":"思考","planb.chat.chip_browse":"浏览网页","planb.chat.chip_code":"写代码","planb.chat.chip_analyze":"分析数据","planb.chat.chip_plan":"帮我规划","planb.chat.regenerate":"重新生成","planb.settings.quick":"快速设置","planb.settings.advanced":"高级配置","planb.settings.quick_hint":"快速设置功能即将推出。现在请使用高级配置编辑器修改 TOML 配置。","planb.settings.open_advanced":"打开高级配置","dashboard.title":"仪表盘","dashboard.provider":"提供商","dashboard.model":"模型","dashboard.uptime":"运行时间","dashboard.temperature":"温度","dashboard.gateway_port":"网关端口","dashboard.memory_backend":"记忆后端","dashboard.paired":"已配对","dashboard.channels":"频道","dashboard.health":"健康状态","dashboard.status":"状态","dashboard.overview":"概览","dashboard.system_info":"系统信息","dashboard.quick_actions":"快速操作","agent.title":"智能体对话","agent.send":"发送","agent.placeholder":"输入消息...","agent.start_conversation":"发送消息开始对话","agent.type_message":"输入消息...","agent.connecting":"连接中...","agent.connected":"已连接","agent.disconnected":"已断开","agent.reconnecting":"重新连接中...","agent.thinking":"思考中...","agent.tool_call":"工具调用","agent.tool_result":"工具结果","agent.connection_error":"连接错误,正在尝试重连...","agent.tool_call_prefix":"[工具调用]","agent.tool_result_prefix":"[工具结果]","agent.error_prefix":"[错误]","agent.unknown_error":"未知错误","agent.send_error":"发送消息失败,请重试。","agent.copy_message":"复制消息","agent.connected_status":"已连接","agent.disconnected_status":"已断开","tools.title":"可用工具","tools.name":"名称","tools.description":"描述","tools.parameters":"参数","tools.search":"搜索工具...","tools.empty":"暂无可用工具。","tools.count":"工具总数","tools.agent_tools":"智能体工具箱","tools.cli_tools":"CLI 工具箱","tools.parameter_schema":"参数结构","tools.path":"路径","tools.version":"版本","tools.category":"类别","tools.load_error":"加载工具失败","cron.title":"定时任务","cron.scheduled_tasks":"定时任务","cron.add":"添加任务","cron.add_job":"添加任务","cron.add_modal_title":"添加 Cron 任务","cron.delete":"删除","cron.enable":"启用","cron.disable":"禁用","cron.name":"名称","cron.name_optional":"名称(可选)","cron.command":"命令","cron.command_required":"命令","cron.schedule":"计划","cron.schedule_required":"计划","cron.next_run":"下次执行","cron.last_run":"上次执行","cron.last_status":"上次状态","cron.enabled":"已启用","cron.enabled_status":"启用","cron.disabled_status":"禁用","cron.empty":"暂无定时任务。","cron.confirm_delete":"确定要删除此任务吗?","cron.load_error":"加载定时任务失败","cron.validation_error":"计划和命令是必需的。","cron.add_error":"添加任务失败","cron.delete_error":"删除任务失败","cron.cancel":"取消","cron.adding":"添加中...","cron.id":"ID","cron.actions":"操作","cron.loading_run_history":"加载运行历史...","cron.load_run_history_error":"加载运行历史失败","cron.no_runs":"暂无运行记录。","cron.recent_runs":"最近运行","cron.yes":"是","cron.no":"否","cron.edit":"编辑","cron.edit_modal_title":"编辑 Cron 任务","cron.edit_error":"更新任务失败","cron.saving":"保存中...","cron.save":"保存","integrations.title":"集成","integrations.available":"可用","integrations.active":"活跃","integrations.coming_soon":"即将推出","integrations.category":"类别","integrations.status":"状态","integrations.search":"搜索集成...","integrations.empty":"未找到集成。","integrations.activate":"激活","integrations.deactivate":"停用","integrations.load_error":"加载集成失败","integrations.status_active":"活跃","integrations.status_available":"可用","integrations.status_coming_soon":"即将推出","memory.title":"记忆存储","memory.memory_title":"记忆","memory.search":"搜索记忆...","memory.search_placeholder":"搜索记忆条目...","memory.add":"存储记忆","memory.add_memory":"添加记忆","memory.add_modal_title":"添加记忆","memory.delete":"删除","memory.key":"键","memory.key_required":"键","memory.content":"内容","memory.content_required":"内容","memory.category":"类别","memory.category_optional":"类别(可选)","memory.timestamp":"时间戳","memory.session":"会话","memory.score":"分数","memory.empty":"未找到记忆条目。","memory.confirm_delete":"确定要删除此记忆条目吗?","memory.all_categories":"所有类别","memory.search_button":"搜索","memory.load_error":"加载记忆失败","memory.saving":"保存中...","memory.validation_error":"键和内容是必需的。","memory.store_error":"保存记忆失败","memory.delete_error":"删除记忆失败","memory.delete_confirm":"删除?","memory.yes":"是","memory.no":"否","memory.cancel":"取消","config.title":"配置","config.save":"保存","config.saving":"保存中...","config.reset":"重置","config.saved":"配置保存成功。","config.error":"配置保存失败。","config.loading":"加载配置中...","config.editor_placeholder":"TOML 配置...","config.configuration_title":"配置","config.sensitive_title":"敏感字段已隐藏","config.sensitive_hint":"API 密钥、令牌和密码已隐藏以保护安全。要更新已隐藏的字段,请将整个隐藏值替换为您的新值。","config.save_success":"配置保存成功。","config.save_error":"保存配置失败","config.toml_label":"TOML 配置","config.lines":"行","cost.title":"成本追踪","cost.session":"会话成本","cost.daily":"每日成本","cost.monthly":"每月成本","cost.total_tokens":"总 Tokens","cost.request_count":"请求数","cost.by_model":"按模型统计","cost.model":"模型","cost.tokens":"Token","cost.requests":"请求","cost.usd":"成本(美元)","cost.load_error":"加载成本数据失败","cost.session_cost":"会话成本","cost.daily_cost":"每日成本","cost.monthly_cost":"每月成本","cost.total_requests":"总请求数","cost.token_statistics":"Token 统计","cost.avg_tokens_per_request":"平均 Token / 请求","cost.cost_per_1k_tokens":"每 1K Token 成本","cost.model_breakdown":"模型细分","cost.no_model_data":"没有模型数据可用。","cost.cost":"成本","cost.share":"占比","logs.title":"实时日志","logs.live_logs":"实时日志","logs.clear":"清除","logs.pause":"暂停","logs.resume":"继续","logs.filter":"筛选日志...","logs.filter_label":"筛选","logs.empty":"暂无日志条目。","logs.connected":"已连接","logs.disconnected":"已断开","logs.events":"事件","logs.jump_to_bottom":"跳转到底部","logs.paused_hint":"日志流已暂停。","logs.waiting_hint":"等待事件...","doctor.title":"系统诊断","doctor.diagnostics_title":"系统诊断","doctor.run":"运行诊断","doctor.run_diagnostics":"运行诊断","doctor.running":"正在运行诊断...","doctor.running_btn":"运行中...","doctor.running_desc":"正在运行诊断...","doctor.running_hint":"这可能需要几秒钟。","doctor.ok":"正常","doctor.warn":"警告","doctor.error":"错误","doctor.severity":"严重程度","doctor.category":"类别","doctor.message":"消息","doctor.empty":"尚未运行诊断。","doctor.summary":"诊断摘要","doctor.issues_found":"发现问题","doctor.warnings_summary":"警告","doctor.all_clear":"一切正常","doctor.system_diagnostics":"系统诊断","doctor.empty_hint":'点击"运行诊断"检查您的 ZeroClaw 安装。',"auth.pair":"配对设备","auth.pairing_code":"配对码","auth.pair_button":"配对","auth.logout":"退出","auth.pairing_success":"配对成功!","auth.pairing_failed":"配对失败,请重试。","auth.enter_code":"请输入配对码以连接到智能体。","common.loading":"加载中...","common.error":"发生错误。","common.retry":"重试","common.cancel":"取消","common.confirm":"确认","common.save":"保存","common.delete":"删除","common.edit":"编辑","common.close":"关闭","common.yes":"是","common.no":"否","common.search":"搜索...","common.no_data":"暂无数据。","common.refresh":"刷新","common.back":"返回","common.actions":"操作","common.name":"名称","common.description":"描述","common.status":"状态","common.created":"创建时间","common.updated":"更新时间","health.title":"系统健康","health.component":"组件","health.status":"状态","health.last_ok":"上次正常","health.last_error":"上次错误","health.restart_count":"重启次数","health.pid":"进程 ID","health.uptime":"运行时间","health.updated_at":"最后更新","dashboard.provider_model":"提供商 / 模型","dashboard.since_last_restart":"自上次重启","dashboard.paired_yes":"是","dashboard.paired_no":"否","dashboard.cost_overview":"成本概览","dashboard.active_channels":"活跃频道","dashboard.filter_active":"活跃","dashboard.filter_all":"全部","dashboard.no_active_channels":"没有活跃频道","dashboard.component_health":"组件健康","dashboard.load_error":"加载仪表盘失败","dashboard.session_label":"会话","dashboard.daily_label":"每日","dashboard.monthly_label":"每月","dashboard.total_tokens_label":"总 Tokens","dashboard.requests_label":"请求","dashboard.no_channels":"未配置频道","dashboard.active":"活跃","dashboard.inactive":"非活跃","dashboard.no_components":"没有组件报告","dashboard.restarts":"重启次数","dashboard.tab_overview":"概览","dashboard.tab_sessions":"会话","dashboard.tab_channels":"频道","dashboard.sessions_title":"活跃会话","dashboard.no_sessions":"没有活跃会话","dashboard.session_id":"会话 ID","dashboard.session_channel":"频道","dashboard.session_started":"开始时间","dashboard.session_last_activity":"最近活动","dashboard.session_status":"状态","dashboard.session_messages":"消息数","dashboard.session_details":"会话详情","dashboard.session_history":"查看历史","dashboard.channels_title":"频道状态","dashboard.no_channels_detail":"没有频道详情","dashboard.channel_type":"类型","dashboard.channel_messages":"消息数","dashboard.channel_last_message":"最近消息","dashboard.channel_config":"配置摘要","dashboard.channel_enabled":"已启用","dashboard.channel_disabled":"已禁用","dashboard.loading_sessions":"加载会话中...","dashboard.loading_channels":"加载频道中...","dashboard.load_sessions_error":"加载会话失败","dashboard.load_channels_error":"加载频道失败","dashboard.never":"从未","settings.title":"设置","settings.tab.appearance":"外观","settings.tab.typography":"排版","settings.appearance":"外观设置","settings.typography":"字体设置","settings.fontUi":"界面字体","settings.fontMono":"代码字体","settings.fontSize":"界面字号","settings.fontMonoSize":"代码字号","settings.preview":"预览","settings.previewText":"界面字体预览文本","settings.fontNote":"字体设置需要刷新页面后生效","settings.language":"界面语言","theme.mode":"主题模式","theme.accent":"强调色","theme.system":"跟随系统","theme.dark":"深色","theme.light":"浅色","theme.oled":"纯黑","console.nav.commandDeck":"指挥舱","console.nav.missionCenter":"任务中心","console.nav.skillLibrary":"技能库","console.nav.dailyReport":"日报","console.nav.settings":"设置","console.role.finance":"财务","console.role.engineering":"工程","console.role.executive":"管理","console.role.hr":"人事","console.role.sales":"销售","console.state.loading":"加载中...","console.state.empty":"暂无数据","console.state.backendDown":"后端服务不可达","console.state.partialData":"部分数据源加载失败","console.state.stale":"数据已过期","console.state.unauthorized":"未授权","console.action.refresh":"刷新","console.action.approve":"批准","console.action.reject":"驳回","console.action.retry":"重试","console.action.create":"新建任务","console.skill.capabilityLevel":"能力等级","console.skill.enable":"启用","console.skill.disable":"停用","console.skill.core":"核心","console.skill.standard":"标准","console.skill.specialized":"专业","console.skill.experimental":"实验","console.report.dailyTitle":"日报","console.report.sourceLinks":"数据来源","console.report.noEvents":"当日无执行记录"},en:{"nav.dashboard":"Dashboard","nav.plans":"Plans","nav.execution":"Execution","nav.governance":"Governance","nav.scheduler":"Scheduler","nav.skills":"Skills","nav.agent":"Agent","nav.tools":"Tools","nav.cron":"Cron Jobs","nav.integrations":"Integrations","nav.memory":"Memory","nav.config":"Configuration","nav.cost":"Cost Tracker","nav.logs":"Logs","nav.devtools":"Tools","nav.swimlane":"Swimlane","nav.doctor":"Doctor","nav.canvas":"Canvas","planb.nav.chat":"Chat","planb.nav.browser":"AI Browser","planb.nav.dashboard":"Dashboard","planb.nav.settings":"Settings","planb.nav.more":"More Tools","planb.layout.switch_to_wide":"Switch to Desktop","planb.layout.switch_to_compact":"Switch to Compact","planb.layout.pop_out":"Pop Out Window","planb.browser.title":"AI Browser","planb.browser.subtitle":"Launch SuperRPA browser automation","planb.browser.launch":"Launch Browser","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"Active Sessions","planb.browser.no_sessions":"No active browser sessions. Launch one above.","planb.browser.status_launching":"Launching","planb.browser.status_running":"Running","planb.browser.status_idle":"Idle","planb.browser.status_error":"Error","planb.browser.status_stopped":"Stopped","planb.browser.launch_error":"Failed to launch browser","planb.browser.close_error":"Failed to close session","planb.browser.backend_not_configured":"SuperRPA is not configured. Set SGCLAW_SUPERRPA_PATH environment variable.","planb.chat.welcome":"How can I help you today?","planb.chat.placeholder":"Ask anything...","planb.chat.sessions":"Chat History","planb.chat.new_chat":"New Chat","planb.chat.no_sessions":"No chat history","planb.chat.untitled":"Untitled","planb.chat.thought":"Thought","planb.chat.chip_browse":"Browse Web","planb.chat.chip_code":"Write Code","planb.chat.chip_analyze":"Analyze Data","planb.chat.chip_plan":"Plan Project","planb.chat.regenerate":"Regenerate","planb.settings.quick":"Quick Settings","planb.settings.advanced":"Advanced","planb.settings.quick_hint":"Quick settings are coming soon. Use the advanced editor to modify TOML configuration for now.","planb.settings.open_advanced":"Open Advanced Editor","dashboard.title":"Dashboard","dashboard.provider":"Provider","dashboard.model":"Model","dashboard.uptime":"Uptime","dashboard.temperature":"Temperature","dashboard.gateway_port":"Gateway Port","dashboard.memory_backend":"Memory Backend","dashboard.paired":"Paired","dashboard.channels":"Channels","dashboard.health":"Health","dashboard.status":"Status","dashboard.overview":"Overview","dashboard.system_info":"System Information","dashboard.quick_actions":"Quick Actions","agent.title":"Agent Chat","agent.send":"Send","agent.placeholder":"Type a message...","agent.start_conversation":"Send a message to start the conversation","agent.type_message":"Type a message...","agent.connecting":"Connecting...","agent.connected":"Connected","agent.disconnected":"Disconnected","agent.reconnecting":"Reconnecting...","agent.thinking":"Thinking...","agent.tool_call":"Tool Call","agent.tool_result":"Tool Result","agent.connection_error":"Connection error. Attempting to reconnect...","agent.tool_call_prefix":"[Tool Call]","agent.tool_result_prefix":"[Tool Result]","agent.error_prefix":"[Error]","agent.unknown_error":"Unknown error","agent.send_error":"Failed to send message. Please try again.","agent.copy_message":"Copy message","agent.connected_status":"Connected","agent.disconnected_status":"Disconnected","tools.title":"Available Tools","tools.name":"Name","tools.description":"Description","tools.parameters":"Parameters","tools.search":"Search tools...","tools.empty":"No tools available.","tools.count":"Total tools","tools.agent_tools":"Agent Tools","tools.cli_tools":"CLI Tools","tools.parameter_schema":"Parameter Schema","tools.path":"Path","tools.version":"Version","tools.category":"Category","tools.load_error":"Failed to load tools","cron.title":"Scheduled Jobs","cron.scheduled_tasks":"Scheduled Tasks","cron.add":"Add Job","cron.add_job":"Add Job","cron.add_modal_title":"Add Cron Job","cron.delete":"Delete","cron.enable":"Enable","cron.disable":"Disable","cron.name":"Name","cron.name_optional":"Name (optional)","cron.command":"Command","cron.command_required":"Command","cron.schedule":"Schedule","cron.schedule_required":"Schedule","cron.next_run":"Next Run","cron.last_run":"Last Run","cron.last_status":"Last Status","cron.enabled":"Enabled","cron.enabled_status":"Enabled","cron.disabled_status":"Disabled","cron.empty":"No scheduled jobs.","cron.confirm_delete":"Are you sure you want to delete this job?","cron.load_error":"Failed to load cron jobs","cron.validation_error":"Schedule and command are required.","cron.add_error":"Failed to add job","cron.delete_error":"Failed to delete job","cron.cancel":"Cancel","cron.adding":"Adding...","cron.id":"ID","cron.actions":"Actions","cron.loading_run_history":"Loading run history...","cron.load_run_history_error":"Failed to load run history","cron.no_runs":"No runs recorded yet.","cron.recent_runs":"Recent Runs","cron.yes":"Yes","cron.no":"No","cron.edit":"Edit","cron.edit_modal_title":"Edit Cron Job","cron.edit_error":"Failed to update job","cron.saving":"Saving...","cron.save":"Save","integrations.title":"Integrations","integrations.available":"Available","integrations.active":"Active","integrations.coming_soon":"Coming Soon","integrations.category":"Category","integrations.status":"Status","integrations.search":"Search integrations...","integrations.empty":"No integrations found.","integrations.activate":"Activate","integrations.deactivate":"Deactivate","integrations.load_error":"Failed to load integrations","integrations.status_active":"Active","integrations.status_available":"Available","integrations.status_coming_soon":"Coming Soon","memory.title":"Memory Store","memory.memory_title":"Memory","memory.search":"Search memory...","memory.search_placeholder":"Search memory entries...","memory.add":"Store Memory","memory.add_memory":"Add Memory","memory.add_modal_title":"Add Memory","memory.delete":"Delete","memory.key":"Key","memory.key_required":"Key","memory.content":"Content","memory.content_required":"Content","memory.category":"Category","memory.category_optional":"Category (optional)","memory.timestamp":"Timestamp","memory.session":"Session","memory.score":"Score","memory.empty":"No memory entries found.","memory.confirm_delete":"Are you sure you want to delete this memory entry?","memory.all_categories":"All Categories","memory.search_button":"Search","memory.load_error":"Failed to load memory","memory.saving":"Saving...","memory.validation_error":"Key and content are required.","memory.store_error":"Failed to store memory","memory.delete_error":"Failed to delete memory","memory.delete_confirm":"Delete?","memory.yes":"Yes","memory.no":"No","memory.cancel":"Cancel","config.title":"Configuration","config.save":"Save","config.saving":"Saving...","config.reset":"Reset","config.saved":"Configuration saved successfully.","config.error":"Failed to save configuration.","config.loading":"Loading configuration...","config.editor_placeholder":"TOML configuration...","config.configuration_title":"Configuration","config.sensitive_title":"Sensitive fields are masked","config.sensitive_hint":"API keys, tokens, and passwords are hidden for security. To update a masked field, replace the entire masked value with your new value.","config.save_success":"Configuration saved successfully.","config.save_error":"Failed to save configuration","config.toml_label":"TOML Configuration","config.lines":"lines","cost.title":"Cost Tracker","cost.session":"Session Cost","cost.daily":"Daily Cost","cost.monthly":"Monthly Cost","cost.total_tokens":"Total Tokens","cost.request_count":"Requests","cost.by_model":"Cost by Model","cost.model":"Model","cost.tokens":"Tokens","cost.requests":"Requests","cost.usd":"Cost (USD)","cost.load_error":"Failed to load cost data","cost.session_cost":"Session Cost","cost.daily_cost":"Daily Cost","cost.monthly_cost":"Monthly Cost","cost.total_requests":"Total Requests","cost.token_statistics":"Token Statistics","cost.avg_tokens_per_request":"Avg Tokens / Request","cost.cost_per_1k_tokens":"Cost per 1K Tokens","cost.model_breakdown":"Model Breakdown","cost.no_model_data":"No model data available.","cost.cost":"Cost","cost.share":"Share","logs.title":"Live Logs","logs.live_logs":"Live Logs","logs.clear":"Clear","logs.pause":"Pause","logs.resume":"Resume","logs.filter":"Filter logs...","logs.filter_label":"Filter","logs.empty":"No log entries.","logs.connected":"Connected","logs.disconnected":"Disconnected","logs.events":"events","logs.jump_to_bottom":"Jump to bottom","logs.paused_hint":"Log streaming is paused.","logs.waiting_hint":"Waiting for events...","doctor.title":"System Diagnostics","doctor.diagnostics_title":"Diagnostics","doctor.run":"Run Diagnostics","doctor.run_diagnostics":"Run Diagnostics","doctor.running":"Running diagnostics...","doctor.running_btn":"Running...","doctor.running_desc":"Running diagnostics...","doctor.running_hint":"This may take a few seconds.","doctor.ok":"OK","doctor.warn":"Warning","doctor.error":"Error","doctor.severity":"Severity","doctor.category":"Category","doctor.message":"Message","doctor.empty":"No diagnostics have been run yet.","doctor.summary":"Diagnostic Summary","doctor.issues_found":"Issues Found","doctor.warnings_summary":"Warnings","doctor.all_clear":"All Clear","doctor.system_diagnostics":"System Diagnostics","doctor.empty_hint":'Click "Run Diagnostics" to check your ZeroClaw installation.',"auth.pair":"Pair Device","auth.pairing_code":"Pairing Code","auth.pair_button":"Pair","auth.logout":"Logout","auth.pairing_success":"Pairing successful!","auth.pairing_failed":"Pairing failed. Please try again.","auth.enter_code":"Enter your pairing code to connect to the agent.","common.loading":"Loading...","common.error":"An error occurred.","common.retry":"Retry","common.cancel":"Cancel","common.confirm":"Confirm","common.save":"Save","common.delete":"Delete","common.edit":"Edit","common.close":"Close","common.yes":"Yes","common.no":"No","common.search":"Search...","common.no_data":"No data available.","common.refresh":"Refresh","common.back":"Back","common.actions":"Actions","common.name":"Name","common.description":"Description","common.status":"Status","common.created":"Created","common.updated":"Updated","health.title":"System Health","health.component":"Component","health.status":"Status","health.last_ok":"Last OK","health.last_error":"Last Error","health.restart_count":"Restarts","health.pid":"Process ID","health.uptime":"Uptime","health.updated_at":"Last Updated","dashboard.provider_model":"Provider / Model","dashboard.since_last_restart":"Since last restart","dashboard.paired_yes":"Yes","dashboard.paired_no":"No","dashboard.cost_overview":"Cost Overview","dashboard.active_channels":"Active Channels","dashboard.filter_active":"Active","dashboard.filter_all":"All","dashboard.no_active_channels":"No active channels","dashboard.component_health":"Component Health","dashboard.load_error":"Failed to load dashboard","dashboard.session_label":"Session","dashboard.daily_label":"Daily","dashboard.monthly_label":"Monthly","dashboard.total_tokens_label":"Total Tokens","dashboard.requests_label":"Requests","dashboard.no_channels":"No channels configured","dashboard.active":"Active","dashboard.inactive":"Inactive","dashboard.no_components":"No components reporting","dashboard.restarts":"Restarts","dashboard.tab_overview":"Overview","dashboard.tab_sessions":"Sessions","dashboard.tab_channels":"Channels","dashboard.sessions_title":"Active Sessions","dashboard.no_sessions":"No active sessions","dashboard.session_id":"Session ID","dashboard.session_channel":"Channel","dashboard.session_started":"Started","dashboard.session_last_activity":"Last Activity","dashboard.session_status":"Status","dashboard.session_messages":"Messages","dashboard.session_details":"Session Details","dashboard.session_history":"View History","dashboard.channels_title":"Channel Status","dashboard.no_channels_detail":"No channel details available","dashboard.channel_type":"Type","dashboard.channel_messages":"Messages","dashboard.channel_last_message":"Last Message","dashboard.channel_config":"Configuration","dashboard.channel_enabled":"Enabled","dashboard.channel_disabled":"Disabled","dashboard.loading_sessions":"Loading sessions...","dashboard.loading_channels":"Loading channels...","dashboard.load_sessions_error":"Failed to load sessions","dashboard.load_channels_error":"Failed to load channels","dashboard.never":"Never","settings.title":"Settings","settings.tab.appearance":"Appearance","settings.tab.typography":"Typography","settings.appearance":"Appearance","settings.typography":"Typography","settings.fontUi":"UI Font","settings.fontMono":"Code Font","settings.fontSize":"UI Font Size","settings.fontMonoSize":"Code Font Size","settings.preview":"Preview","settings.previewText":"The quick brown fox jumps over the lazy dog.","settings.fontNote":"Font changes apply on page reload.","settings.language":"Language","theme.mode":"Theme Mode","theme.accent":"Accent Color","theme.system":"System","theme.dark":"Dark","theme.light":"Light","theme.oled":"OLED Black","console.nav.commandDeck":"Command Deck","console.nav.missionCenter":"Mission Center","console.nav.skillLibrary":"Skill Library","console.nav.dailyReport":"Daily Report","console.nav.settings":"Settings","console.role.finance":"Finance","console.role.engineering":"Engineering","console.role.executive":"Executive","console.role.hr":"HR","console.role.sales":"Sales","console.state.loading":"Loading...","console.state.empty":"No data","console.state.backendDown":"Backend unreachable","console.state.partialData":"Partial data loaded","console.state.stale":"Data stale","console.state.unauthorized":"Unauthorized","console.action.refresh":"Refresh","console.action.approve":"Approve","console.action.reject":"Reject","console.action.retry":"Retry","console.action.create":"Create","console.skill.capabilityLevel":"Capability Level","console.skill.enable":"Enable","console.skill.disable":"Disable","console.skill.core":"Core","console.skill.standard":"Standard","console.skill.specialized":"Specialized","console.skill.experimental":"Experimental","console.report.dailyTitle":"Daily Report","console.report.sourceLinks":"Source Links","console.report.noEvents":"No events today"},tr:{"nav.dashboard":"Kontrol Paneli","nav.plans":"Planlar","nav.execution":"Yürütme","nav.governance":"Yönetişim","nav.scheduler":"Zamanlayıcı","nav.skills":"Beceriler","nav.agent":"Ajan","nav.tools":"Araçlar","nav.cron":"Cron Görevleri","nav.integrations":"Entegrasyonlar","nav.memory":"Hafıza","nav.config":"Yapılandırma","nav.cost":"Maliyet Takibi","nav.logs":"Kayıtlar","nav.devtools":"Araçlar","nav.swimlane":"Yüzme Şeridi","nav.doctor":"Doktor","nav.canvas":"Tuval","planb.nav.chat":"Sohbet","planb.nav.browser":"AI Tarayıcı","planb.nav.dashboard":"Kontrol Paneli","planb.nav.settings":"Ayarlar","planb.nav.more":"Daha Fazla","planb.layout.switch_to_wide":"Masaüstüne Geç","planb.layout.switch_to_compact":"Kompakta Geç","planb.layout.pop_out":"Pencereyi Ayır","planb.browser.title":"AI Tarayıcı","planb.browser.subtitle":"SuperRPA tarayıcı otomasyonunu başlat","planb.browser.launch":"Tarayıcıyı Başlat","planb.browser.url_placeholder":"https://example.com","planb.browser.active_sessions":"Aktif Oturumlar","planb.browser.no_sessions":"Aktif tarayıcı oturumu yok.","planb.browser.status_launching":"Başlatılıyor","planb.browser.status_running":"Çalışıyor","planb.browser.status_idle":"Boşta","planb.browser.status_error":"Hata","planb.browser.status_stopped":"Durduruldu","planb.browser.launch_error":"Tarayıcı başlatılamadı","planb.browser.close_error":"Oturum kapatılamadı","planb.browser.backend_not_configured":"SuperRPA yapılandırılmamış.","planb.chat.welcome":"Bugün size nasıl yardımcı olabilirim?","planb.chat.placeholder":"Bir şey sor...","planb.chat.sessions":"Sohbet Geçmişi","planb.chat.new_chat":"Yeni Sohbet","planb.chat.no_sessions":"Sohbet geçmişi yok","planb.chat.untitled":"Başlıksız","planb.chat.thought":"Düşünce","planb.chat.chip_browse":"Webde Gezin","planb.chat.chip_code":"Kod Yaz","planb.chat.chip_analyze":"Veri Analizi","planb.chat.chip_plan":"Proje Planla","planb.chat.regenerate":"Yeniden Oluştur","planb.settings.quick":"Hızlı Ayarlar","planb.settings.advanced":"Gelişmiş","planb.settings.quick_hint":"Hızlı ayarlar yakında gelecek. Şimdilik gelişmiş düzenleyiciyi kullanın.","planb.settings.open_advanced":"Gelişmiş Düzenleyiciyi Aç","dashboard.title":"Kontrol Paneli","dashboard.provider":"Sağlayıcı","dashboard.model":"Model","dashboard.uptime":"Çalışma Süresi","dashboard.temperature":"Sıcaklık","dashboard.gateway_port":"Ağ Geçidi Portu","dashboard.locale":"Dil","dashboard.memory_backend":"Hafıza Motoru","dashboard.paired":"Eşleştirilmiş","dashboard.channels":"Kanallar","dashboard.health":"Sağlık","dashboard.status":"Durum","dashboard.overview":"Genel Bakış","dashboard.system_info":"Sistem Bilgisi","dashboard.quick_actions":"Hızlı İşlemler","dashboard.provider_model":"Sağlayıcı / Model","dashboard.since_last_restart":"Son Yeniden Başlatmadan Beri","dashboard.paired_yes":"Evet","dashboard.paired_no":"Hayır","dashboard.cost_overview":"Maliyet Genel Bakışı","dashboard.active_channels":"Aktif Kanallar","dashboard.filter_active":"Aktif","dashboard.filter_all":"Tümü","dashboard.no_active_channels":"Aktif kanal yok","dashboard.component_health":"Bileşen Sağlığı","dashboard.load_error":"Kontrol paneli yüklenemedi","dashboard.session_label":"Oturum","dashboard.daily_label":"Günlük","dashboard.monthly_label":"Aylık","dashboard.total_tokens_label":"Toplam Token","dashboard.requests_label":"İstekler","dashboard.no_channels":"Kanal yapılandırılmamış","dashboard.active":"Aktif","dashboard.inactive":"Aktif Değil","dashboard.no_components":"Bileşen raporlamıyor","dashboard.restarts":"Yeniden Başlatmalar","dashboard.tab_overview":"Genel Bakış","dashboard.tab_sessions":"Oturumlar","dashboard.tab_channels":"Kanallar","dashboard.sessions_title":"Aktif Oturumlar","dashboard.no_sessions":"Aktif oturum yok","dashboard.session_id":"Oturum Kimliği","dashboard.session_channel":"Kanal","dashboard.session_started":"Başlangıç","dashboard.session_last_activity":"Son Etkinlik","dashboard.session_status":"Durum","dashboard.session_messages":"Mesajlar","dashboard.session_details":"Oturum Ayrıntıları","dashboard.session_history":"Geçmişi Görüntüle","dashboard.channels_title":"Kanal Durumu","dashboard.no_channels_detail":"Kanal ayrıntısı yok","dashboard.channel_type":"Tür","dashboard.channel_messages":"Mesajlar","dashboard.channel_last_message":"Son Mesaj","dashboard.channel_config":"Yapılandırma","dashboard.channel_enabled":"Etkin","dashboard.channel_disabled":"Devre Dışı","dashboard.loading_sessions":"Oturumlar yükleniyor...","dashboard.loading_channels":"Kanallar yükleniyor...","dashboard.load_sessions_error":"Oturumlar yüklenemedi","dashboard.load_channels_error":"Kanallar yüklenemedi","dashboard.never":"Hiç","agent.title":"Ajan Sohbeti","agent.send":"Gönder","agent.placeholder":"Bir mesaj yazın...","agent.start_conversation":"Sohbeti başlatmak için mesaj gönderin","agent.type_message":"Bir mesaj yazın...","agent.connecting":"Bağlanıyor...","agent.connected":"Bağlandı","agent.disconnected":"Bağlantı kesildi","agent.reconnecting":"Yeniden bağlanıyor...","agent.thinking":"Düşünüyor...","agent.tool_call":"Araç Çağrısı","agent.tool_result":"Araç Sonucu","agent.connection_error":"Bağlantı hatası. Yeniden bağlanmaya çalışılıyor...","agent.tool_call_prefix":"[Araç Çağrısı]","agent.tool_result_prefix":"[Araç Sonucu]","agent.error_prefix":"[Hata]","agent.unknown_error":"Bilinmeyen hata","agent.send_error":"Mesaj gönderilemedi. Lütfen tekrar deneyin.","agent.copy_message":"Mesajı kopyala","agent.connected_status":"Bağlandı","agent.disconnected_status":"Bağlantı kesildi","tools.title":"Mevcut Araçlar","tools.name":"Ad","tools.description":"Açıklama","tools.parameters":"Parametreler","tools.search":"Araç ara...","tools.empty":"Araç bulunamadı.","tools.count":"Toplam araç","tools.agent_tools":"Ajan Araçları","tools.cli_tools":"CLI Araçları","tools.parameter_schema":"Parametre Şeması","tools.path":"Yol","tools.version":"Sürüm","tools.category":"Kategori","tools.load_error":"Araçlar yüklenemedi","cron.title":"Zamanlanmış Görevler","cron.scheduled_tasks":"Zamanlanmış Görevler","cron.add":"Görev Ekle","cron.add_job":"Görev Ekle","cron.add_modal_title":"Cron Görevi Ekle","cron.delete":"Sil","cron.enable":"Etkinleştir","cron.disable":"Devre Dışı Bırak","cron.name":"Ad","cron.name_optional":"Ad (isteğe bağlı)","cron.command":"Komut","cron.command_required":"Komut","cron.schedule":"Zamanlama","cron.schedule_required":"Zamanlama","cron.next_run":"Sonraki Çalıştırma","cron.last_run":"Son Çalıştırma","cron.last_status":"Son Durum","cron.enabled":"Etkin","cron.enabled_status":"Etkin","cron.disabled_status":"Devre Dışı","cron.empty":"Zamanlanmış görev bulunamadı.","cron.confirm_delete":"Bu görevi silmek istediğinizden emin misiniz?","cron.load_error":"Cron görevleri yüklenemedi","cron.validation_error":"Zamanlama ve komut gereklidir.","cron.add_error":"Görev eklenemedi","cron.delete_error":"Görev silinemedi","cron.cancel":"İptal","cron.adding":"Ekleniyor...","cron.id":"ID","cron.actions":"İşlemler","cron.loading_run_history":"Çalıştırma geçmişi yükleniyor...","cron.load_run_history_error":"Çalıştırma geçmişi yüklenemedi","cron.no_runs":"Henüz çalıştırma kaydı yok.","cron.recent_runs":"Son Çalıştırmalar","cron.yes":"Evet","cron.no":"Hayır","cron.edit":"Düzenle","cron.edit_modal_title":"Cron Görevini Düzenle","cron.edit_error":"Görev güncellenemedi","cron.saving":"Kaydediliyor...","cron.save":"Kaydet","integrations.title":"Entegrasyonlar","integrations.available":"Mevcut","integrations.active":"Aktif","integrations.coming_soon":"Yakında","integrations.category":"Kategori","integrations.status":"Durum","integrations.search":"Entegrasyon ara...","integrations.empty":"Entegrasyon bulunamadı.","integrations.activate":"Etkinleştir","integrations.deactivate":"Devre Dışı Bırak","integrations.load_error":"Entegrasyonlar yüklenemedi","integrations.all":"Tümü","integrations.status_active":"Aktif","integrations.status_available":"Mevcut","integrations.status_coming_soon":"Yakında","memory.title":"Hafıza Deposu","memory.memory_title":"Hafıza","memory.search":"Hafıza ara...","memory.search_placeholder":"Hafıza girişleri ara...","memory.add":"Hafıza Ekle","memory.add_memory":"Hafıza Ekle","memory.add_modal_title":"Hafıza Ekle","memory.delete":"Sil","memory.key":"Anahtar","memory.key_required":"Anahtar","memory.content":"İçerik","memory.content_required":"İçerik","memory.category":"Kategori","memory.category_optional":"Kategori (isteğe bağlı)","memory.timestamp":"Zaman Damgası","memory.session":"Oturum","memory.score":"Puan","memory.empty":"Hafıza girişi bulunamadı.","memory.confirm_delete":"Bu hafıza girişini silmek istediğinizden emin misiniz?","memory.all_categories":"Tüm Kategoriler","memory.search_button":"Ara","memory.load_error":"Hafıza yüklenemedi","memory.saving":"Kaydediliyor...","memory.validation_error":"Anahtar ve içerik gereklidir.","memory.store_error":"Hafıza kaydedilemedi","memory.delete_error":"Hafıza silinemedi","memory.delete_confirm":"Sil?","memory.yes":"Evet","memory.no":"Hayır","memory.cancel":"İptal","config.title":"Yapılandırma","config.save":"Kaydet","config.saving":"Kaydediliyor...","config.reset":"Sıfırla","config.saved":"Yapılandırma başarıyla kaydedildi.","config.error":"Yapılandırma kaydedilemedi.","config.loading":"Yapılandırma yükleniyor...","config.editor_placeholder":"TOML yapılandırması...","config.configuration_title":"Yapılandırma","config.sensitive_title":"Hassas alanlar gizlendi","config.sensitive_hint":"API anahtarları, belirteçler ve parolalar güvenlik için gizlendi. Maskeli bir alanı güncellemek için, tüm maskeli değeri yeni değerinizle değiştirin.","config.save_success":"Yapılandırma başarıyla kaydedildi.","config.save_error":"Yapılandırma kaydedilemedi","config.toml_label":"TOML Yapılandırması","config.lines":"satır","cost.title":"Maliyet Takibi","cost.session":"Oturum Maliyeti","cost.daily":"Günlük Maliyet","cost.monthly":"Aylık Maliyet","cost.total_tokens":"Toplam Token","cost.request_count":"İstek Sayısı","cost.by_model":"Modele Göre Maliyet","cost.model":"Model","cost.tokens":"Token","cost.requests":"İstekler","cost.usd":"Maliyet (USD)","cost.load_error":"Maliyet verileri yüklenemedi","cost.session_cost":"Oturum Maliyeti","cost.daily_cost":"Günlük Maliyet","cost.monthly_cost":"Aylık Maliyet","cost.total_requests":"Toplam İstek","cost.token_statistics":"Token İstatistikleri","cost.avg_tokens_per_request":"Ortalama Token / İstek","cost.cost_per_1k_tokens":"1K Token Başına Maliyet","cost.model_breakdown":"Model Detayı","cost.no_model_data":"Model verisi mevcut değil.","cost.cost":"Maliyet","cost.share":"Pay","logs.title":"Canlı Kayıtlar","logs.live_logs":"Canlı Kayıtlar","logs.clear":"Temizle","logs.pause":"Duraklat","logs.resume":"Devam Et","logs.filter":"Kayıtları filtrele...","logs.filter_label":"Filtre","logs.empty":"Kayıt girişi bulunamadı.","logs.connected":"Bağlandı","logs.disconnected":"Bağlantı kesildi","logs.events":"olay","logs.jump_to_bottom":"En alta atla","logs.paused_hint":"Kayıt akışı duraklatıldı.","logs.waiting_hint":"Olay bekleniyor...","doctor.title":"Sistem Tanıları","doctor.diagnostics_title":"Tanılar","doctor.run":"Tanı Çalıştır","doctor.run_diagnostics":"Tanı Çalıştır","doctor.running":"Tanı çalıştırılıyor...","doctor.running_btn":"Çalıştırılıyor...","doctor.running_desc":"Tanı çalıştırılıyor...","doctor.running_hint":"Bu birkaç saniye sürebilir.","doctor.ok":"Tamam","doctor.warn":"Uyarı","doctor.error":"Hata","doctor.severity":"Şiddet","doctor.category":"Kategori","doctor.message":"Mesaj","doctor.empty":"Henüz tanı çalıştırılmadı.","doctor.summary":"Tanı Özeti","doctor.issues_found":"Sorunlar Bulundu","doctor.warnings_summary":"Uyarılar","doctor.all_clear":"Her Şey Yolunda","doctor.system_diagnostics":"Sistem Tanıları","doctor.empty_hint":'ZeroClaw kurulumunuzu kontrol etmek için "Tanı Çalıştır" düğmesine tıklayın.',"auth.pair":"Cihaz Eşleştir","auth.pairing_code":"Eşleştirme Kodu","auth.pair_button":"Eşleştir","auth.logout":"Çıkış Yap","auth.pairing_success":"Eşleştirme başarılı!","auth.pairing_failed":"Eşleştirme başarısız. Lütfen tekrar deneyin.","auth.enter_code":"Akıllı birine bağlanmak için eşleştirme kodunuzu girin.","common.loading":"Yükleniyor...","common.error":"Bir hata oluştu.","common.retry":"Tekrar Dene","common.cancel":"İptal","common.confirm":"Onayla","common.save":"Kaydet","common.delete":"Sil","common.edit":"Düzenle","common.close":"Kapat","common.yes":"Evet","common.no":"Hayır","common.search":"Ara...","common.no_data":"Veri mevcut değil.","common.refresh":"Yenile","common.back":"Geri","common.actions":"İşlemler","common.name":"Ad","common.description":"Açıklama","common.status":"Durum","common.created":"Oluşturulma","common.updated":"Güncellenme","health.title":"Sistem Sağlığı","health.component":"Bileşen","health.status":"Durum","health.last_ok":"Son Başarılı","health.last_error":"Son Hata","health.restart_count":"Yeniden Başlatmalar","health.pid":"İşlem Kimliği","health.uptime":"Çalışma Süresi","health.updated_at":"Son Güncelleme","settings.title":"Ayarlar","settings.tab.appearance":"Görünüm","settings.tab.typography":"Tipografi","settings.appearance":"Görünüm","settings.typography":"Tipografi","settings.fontUi":"Arayüz Yazı Tipi","settings.fontMono":"Kod Yazı Tipi","settings.fontSize":"Arayüz Boyutu","settings.fontMonoSize":"Kod Boyutu","settings.preview":"Önizleme","settings.previewText":"Tembel köpek üzerinde hızlı kahverengi tilki zıplar.","settings.fontNote":"Yazı tipi değişiklikleri sayfa yeniden yüklendikten sonra geçerli olur.","settings.language":"Dil","theme.mode":"Tema Modu","theme.accent":"Vurgu Rengi","theme.system":"Sistem","theme.dark":"Koyu","theme.light":"Açık","theme.oled":"OLED Siyah","console.nav.commandDeck":"Command Deck","console.nav.missionCenter":"Mission Center","console.nav.skillLibrary":"Skill Library","console.nav.dailyReport":"Daily Report","console.nav.settings":"Settings","console.role.finance":"Finance","console.role.engineering":"Engineering","console.role.executive":"Executive","console.role.hr":"HR","console.role.sales":"Sales","console.state.loading":"Loading...","console.state.empty":"No data","console.state.backendDown":"Backend unreachable","console.state.partialData":"Partial data loaded","console.state.stale":"Data stale","console.state.unauthorized":"Unauthorized","console.action.refresh":"Refresh","console.action.approve":"Approve","console.action.reject":"Reject","console.action.retry":"Retry","console.action.create":"Create","console.skill.capabilityLevel":"Capability Level","console.skill.enable":"Enable","console.skill.disable":"Disable","console.skill.core":"Core","console.skill.standard":"Standard","console.skill.specialized":"Specialized","console.skill.experimental":"Experimental","console.report.dailyTitle":"Daily Report","console.report.sourceLinks":"Source Links","console.report.noEvents":"No events today"}};let GL="zh";function Zc(e){var t;return((t=a0[GL])==null?void 0:t[e])??a0.en[e]??e}function VL({value:e,onChange:t,onSend:n,connected:a,disabled:r}){const s=w.useRef(null);w.useEffect(()=>{s.current&&(s.current.style.height="auto",s.current.style.height=`${Math.min(s.current.scrollHeight,200)}px`)},[e]);const u=p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),n())},f=p=>{t(p.target.value)};return c.jsx("div",{className:"plan-chat-input border-t px-4 py-3",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:c.jsxs("div",{className:"flex items-end gap-2 max-w-3xl mx-auto",children:[c.jsx("textarea",{ref:s,rows:1,value:e,onChange:f,onKeyDown:u,placeholder:Zc(a?"planb.chat.placeholder":"agent.connecting"),disabled:!a||r,className:"input-electric flex-1 px-4 text-sm resize-none disabled:opacity-40 rounded-2xl",style:{minHeight:"44px",maxHeight:"200px",paddingTop:"11px",paddingBottom:"11px"}}),c.jsx("button",{type:"button",onClick:n,disabled:!a||!e.trim()||r,className:"flex-shrink-0 rounded-full flex items-center justify-center transition-all",style:{width:"40px",height:"40px",background:a&&e.trim()?"var(--pc-accent)":"var(--pc-bg-elevated)",border:a&&e.trim()?"none":"1px solid var(--pc-border)",color:a&&e.trim()?"white":"var(--pc-text-faint)",opacity:a&&e.trim()?1:.5},children:c.jsx(hg,{className:"h-4 w-4"})})]})})}const YL={draft:"草稿",reviewing:"待确认",approved:"已批准",active:"执行中",blocked:"已阻塞",completed:"已完成",failed:"失败",cancelled:"已取消",superseded:"已替换"};function KL(e){let t=0,n=0;for(const a of e.steps||[])for(const r of a.tasks||[])t++,(r.status==="succeeded"||r.status==="completed")&&n++;return{total:t,done:n}}function QL({plan:e,onBack:t,mode:n="plan-control",contextText:a=""}){const[r,s]=w.useState([]),[u,f]=w.useState(""),[p,m]=w.useState(!1),[g,b]=w.useState(!1),[v,k]=w.useState(null),[C,D]=w.useState(null),A=w.useRef(null),x=w.useRef(null),T=w.useRef(""),N=w.useRef(""),F=w.useRef(""),L=w.useRef(a),[B,P]=w.useState(""),[K,se]=w.useState("");w.useEffect(()=>{L.current=a},[a]),w.useEffect(()=>{let R=!1;return s([]),n==="conversation"?(s([{id:Qi(),role:"agent",content:`已进入“${e.title||e.plan_id}”执行单会话。
|
||
我已关联当前执行状态和待处理事项,你可以询问当前进展、需要提供什么材料或下一步安排。`,timestamp:new Date}]),()=>{R=!0}):(R_(e.plan_id).then(U=>{R||s((U.messages||[]).map(O=>({id:Qi(),role:O.role==="user"?"user":(O.role==="assistant","system"),content:O.content,timestamp:new Date})))}).catch(()=>{R||s([])}),()=>{R=!0})},[n,e.plan_id,e.title]),w.useEffect(()=>{const R=new HL(n==="conversation"?{}:{planId:e.plan_id});return R.onOpen=()=>{b(!0),k(null)},R.onClose=U=>{b(!1),U.code!==1e3&&U.code!==1001&&k(`Connection closed (code: ${U.code})`)},R.onError=()=>k("Connection error"),R.onMessage=U=>{switch(U.type){case"thinking":m(!0),N.current+=U.content??"",se(N.current);break;case"chunk":m(!0),T.current+=U.content??"",P(T.current);break;case"chunk_reset":F.current=N.current,T.current="",N.current="",P(""),se("");break;case"message":case"done":{const O=U.full_response??U.content??T.current,G=F.current||N.current||void 0;O&&s(ae=>[...ae,{id:Qi(),role:"agent",content:O,thinking:G,markdown:!0,timestamp:new Date}]),T.current="",N.current="",F.current="",P(""),se(""),m(!1);break}case"plan_msg_ack":break;case"plan_notification":s(O=>[...O,{id:Qi(),role:"system",content:U.content??"",timestamp:new Date}]);break;case"plan_need_input":s(O=>[...O,{id:Qi(),role:"system",content:U.question?`需要输入:${U.question}`:"需要用户输入",timestamp:new Date}]);break;case"plan_need_approval":s(O=>[...O,{id:Qi(),role:"system",content:U.action?`需要审批:${U.action}`:"需要用户审批",timestamp:new Date}]);break;case"plan_activity":s(O=>[...O,{id:Qi(),role:"agent",content:U.content??U.body??U.title??"执行进度已更新",timestamp:new Date}]),T.current="",N.current="",F.current="",P(""),se(""),(U.phase==="plan_done"||U.phase==="plan_failed")&&m(!1);break;case"governance":{!U.created_plan_id&&U.message&&s(O=>[...O,{id:Qi(),role:"system",content:U.message??"执行请求已受理",timestamp:new Date}]),T.current="",N.current="",F.current="",P(""),se(""),m(!1);break}case"ask":s(O=>[...O,{id:Qi(),role:"agent",content:U.question??U.message??"请补充信息。",timestamp:new Date}]),T.current="",N.current="",F.current="",P(""),se(""),m(!1);break;case"error":s(O=>[...O,{id:Qi(),role:"system",content:`Error: ${U.message??"Unknown error"}`,timestamp:new Date}]);break}},R.connect(),A.current=R,()=>{R.disconnect()}},[n,e.plan_id]),w.useEffect(()=>{var R;(R=x.current)==null||R.scrollIntoView({behavior:"smooth"})},[r,p]);const I=w.useCallback(()=>{var U;const R=u.trim();if(!(!R||!((U=A.current)!=null&&U.connected))){s(O=>[...O,{id:Qi(),role:"user",content:R,timestamp:new Date}]);try{const O=n==="conversation"?["你正在数字员工页面的“执行单会话”中。以下内容仅作为当前业务上下文:",L.current,"",`用户消息:${R}`,"","请使用自然、简洁的对话方式回答。优先结合上下文说明当前进展、是否需要用户处理以及下一步。","除非用户明确要求控制当前执行单,否则不要将消息解释为 Plan 控制命令,不要返回 retry、skip、pause、resume、status 命令帮助,也不要创建新的计划或任务。"].filter(Boolean).join(`
|
||
`):R;T.current="",N.current="",F.current="",P(""),se(""),m(!0),A.current.sendMessage(O)}catch{k("Send failed")}f("")}},[u,n]),q=w.useCallback((R,U)=>{var G;const O=()=>{D(R),setTimeout(()=>D(ae=>ae===R?null:ae),2e3)};(G=navigator.clipboard)!=null&&G.writeText&&navigator.clipboard.writeText(U).then(O).catch(()=>{})},[]),Z=KL(e),Q=e.status==="active"?"var(--color-status-success)":e.status==="blocked"?"var(--color-status-error)":e.status==="reviewing"?"#f59e0b":"var(--pc-text-muted)";return c.jsxs("div",{className:`plan-chat flex flex-col h-full min-h-0 ${n==="conversation"?"plan-chat--conversation":"plan-chat--control"}`,children:[n==="plan-control"&&c.jsxs("div",{className:"px-4 py-3 border-b flex-shrink-0",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("button",{onClick:t,className:"h-6 w-6 flex items-center justify-center rounded",style:{color:"var(--pc-text-muted)"},children:c.jsx(FE,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:e.title||e.plan_id})]}),c.jsxs("div",{className:"flex items-center gap-3 text-[10px] ml-8",style:{color:"var(--pc-text-muted)"},children:[c.jsxs("span",{children:[FL(e.created_at)," 创建"]}),c.jsx("span",{style:{color:Q},children:YL[e.status]||e.status}),Z.total>0&&c.jsxs("span",{children:[Z.done,"/",Z.total," steps"]})]}),e.objective&&c.jsxs("div",{className:"text-[10px] ml-8 mt-0.5 truncate",style:{color:"var(--pc-text-faint)"},children:['"',e.objective,'"']})]}),v&&c.jsxs("div",{className:"px-3 py-1.5 border-b flex items-center gap-2 text-xs flex-shrink-0",style:{background:"rgba(239,68,68,0.08)",borderColor:"rgba(239,68,68,0.2)",color:"#f87171"},children:[c.jsx(Zx,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"truncate",children:v}),c.jsx("button",{onClick:()=>k(null),className:"ml-auto shrink-0 text-xs underline",children:"Close"})]}),c.jsx("div",{className:"plan-chat-messages flex-1 overflow-y-auto px-3 min-h-0",children:r.length===0?c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("p",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:n==="conversation"?"执行单沟通已就绪,可以询问进展、待办事项或下一步安排":"Plan 对话就绪 — 发送命令或消息与 PlanAgent 互动"})}):c.jsxs("div",{className:"py-3 space-y-3",children:[r.map(R=>c.jsxs("div",{className:`group flex items-start gap-2 ${R.role==="user"?"flex-row-reverse":""}`,children:[c.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:R.role==="user"?"var(--pc-accent)":R.role==="system"?"var(--pc-bg-surface)":"var(--pc-bg-elevated)",borderColor:R.role==="user"?"var(--pc-accent)":"var(--pc-border)"},children:R.role==="user"?c.jsx(nA,{className:"h-3 w-3 text-white"}):R.role==="system"?c.jsx(Zx,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}}):c.jsx(Qx,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),c.jsxs("div",{className:"relative max-w-[85%] min-w-0",children:[c.jsxs("div",{className:"rounded-xl px-3 py-2 border",style:R.role==="user"?{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)",color:"var(--pc-text-primary)"}:R.role==="system"?{background:"var(--pc-bg-elevated)",borderColor:"rgba(167,139,250,0.2)",color:"var(--pc-text-muted)"}:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[R.thinking&&c.jsxs("details",{className:"mb-1.5",children:[c.jsx("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:"Thought"}),c.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:R.thinking})]}),R.markdown?c.jsx("div",{className:"text-[13px] break-words leading-relaxed chat-markdown",children:c.jsx(jO,{remarkPlugins:[IL],children:R.content})}):c.jsx("p",{className:"text-[13px] whitespace-pre-wrap break-words",children:R.content})]}),R.role==="agent"&&c.jsx("button",{onClick:()=>q(R.id,R.content),className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-all p-1 rounded-lg",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",color:"var(--pc-text-muted)"},children:C===R.id?c.jsx(GE,{className:"h-2.5 w-2.5",style:{color:"#34d399"}}):c.jsx(QE,{className:"h-2.5 w-2.5"})})]})]},R.id)),p&&c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("div",{className:"flex-shrink-0 w-7 h-7 rounded-lg flex items-center justify-center border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:c.jsx(Qx,{className:"h-3 w-3",style:{color:"var(--pc-accent)"}})}),c.jsxs("div",{className:"rounded-xl px-3 py-2 border max-w-[85%]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[K&&c.jsxs("details",{className:"mb-1.5",open:!B,children:[c.jsx("summary",{className:"text-[11px] cursor-pointer select-none font-medium",style:{color:"var(--pc-text-muted)"},children:"Thought"}),c.jsx("pre",{className:"text-[10px] mt-1 whitespace-pre-wrap break-words overflow-auto max-h-36 p-1.5 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:K})]}),B?c.jsxs("p",{className:"text-[13px] whitespace-pre-wrap break-words",children:[B,c.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 animate-pulse align-middle",style:{background:"var(--pc-accent)"}})]}):c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),c.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),c.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}})]})]})]}),c.jsx("div",{ref:x})]})}),c.jsx(VL,{value:u,onChange:f,onSend:I,connected:g})]})}const XL=iA,ZL=`${XL}/digital-assets`,fj=`${ZL}/avatars`,Ac=`${fj}/states`,JL=`${fj}/avatar-male-1.png`,WL="Asia/Shanghai",Xh=1440,Zh=820,eI=[{id:"all",label:"全部"},{id:"running",label:"执行中"},{id:"success",label:"已完成"},{id:"danger",label:"异常"}],pj="sgrobot:digital-workday-guide-dismissed-date",tI=80,l0=300,nI=1e4,iI=1100,aI=220,r0=8,Ps=[{id:"workOrder",label:"工单处理",detail:"督办、审批、缺陷跟踪 9 项",progress:60},{id:"inspection",label:"业务巡检",detail:"设备与系统巡检 12 轮",progress:74},{id:"phone",label:"电话沟通",detail:"类型一、类型二沟通 6 次",progress:52},{id:"mail",label:"信息处理",detail:"消息确认、材料同步 23 次",progress:68},{id:"collaboration",label:"人+AI协同",detail:"2 项转人工确认",progress:35}],lI=[{id:"serviceWorkOrder",label:"95598服务工单"},{id:"monitorWarning",label:"监测预警"},{id:"reportStats",label:"报表统计"},{id:"systemInspection",label:"系统巡检"},{id:"communication",label:"沟通协同"}],rI={workOrder:`${Ac}/employee-decision.png`,inspection:`${Ac}/employee-browser.png`,phone:`${Ac}/employee-redial.png`,mail:`${Ac}/employee-running.png`,collaboration:`${Ac}/employee-evidence.png`},sI=[{id:"instant",label:"即时"},{id:"today",label:"当日"},{id:"week",label:"本周"},{id:"month",label:"本月"},{id:"custom",label:"自定义"}],oI=[{title:"确认日期",body:"先确认今天的值班日期,避免把昨天或明天的任务混在一起。"},{title:"选择任务",body:"从岗位职责里勾选今天要执行的任务,未接入能力保持待扩展。"},{title:"任务执行",body:"点击任务执行后,数字员工开始按已选任务推进工作。"},{title:"查看过程",body:"右侧滚动显示运行明细,任务中心可继续查看明细。"}];function Mc(){const e=new Date;return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")}function cI(e){return(e||Mc()).split("-").join("/")}function uI(e){return e==="success"?"de-badge-success":e==="danger"?"de-badge-danger":e==="warning"||e==="running"?"de-badge-warning":"de-badge-info"}function dI(e,t){const n=["de-template-card-row","de-duty-card","de-duty-card--compact"];return e.implemented||n.push("de-duty-card--disabled"),t&&n.push("de-duty-card--selected"),e.statusTone==="running"&&n.push("de-duty-card--running"),n.join(" ")}function cn(e){return String(e||"").replace(/\s+/g," ").trim()}function fI(e){if(!e)return"";if(e.expression)return e.expression;if(typeof e.schedule=="string")return e.schedule;if(e.schedule&&typeof e.schedule=="object"){const t=e.schedule,n=t.expr??t.expression??t.cron;if(typeof n=="string")return n}return""}function pI(e){const t=fI(e);if(!t)return"未定时";const n=t.trim().split(/\s+/),a=n[0]??"",r=n[1]??"";return n.length>=2&&/^\d+$/.test(a)&&/^\d+$/.test(r)?`已定时 ${r.padStart(2,"0")}:${a.padStart(2,"0")} 执行`:`调度注册 ${t}`}function Df(e,t){if(!e||typeof e!="object")return"";const n=e;for(const a of t){const r=n[a];if(typeof r=="string"&&r.trim())return r.trim()}return""}function Qs(e){const t=cn(e.template_id);if(t)return t;const n=Df(e.delivery,["template_id","plan_template_id","templateId"]);if(n)return n;const a=Df(e.schedule,["template_id","plan_template_id","templateId"]);return a||e.id.replace(/^schedule-/,"")}function mI(e,t,n){return e.has(t)||n?!0:Array.from(e).some(a=>Jc(a,t))}function Jc(e,t){return e.startsWith(`${t}-`)?/^-\d{8,}$/.test(e.slice(t.length)):!1}function hI(e,t,n){if(e.id===t||e.conversation_id===t||Jc(e.id,t)||e.conversation_id&&Jc(e.conversation_id,t))return!0;const a=cn(n).toLowerCase();return!!(a&&cn(e.title).toLowerCase()===a)}function mj(e,t,n){const a=n.filter(r=>hI(r,e,t));return a.find(r=>r.selected)??a.find(r=>r.id===e||r.conversation_id===e)??a[0]??null}function _I(e,t){var n;return((n=mj(e.id,e.title,t))==null?void 0:n.id)??e.id}function gI(e){return typeof e.step_count=="number"&&Number.isFinite(e.step_count)?e.step_count:Array.isArray(e.skill_ids)?e.skill_ids.length:0}function yI(e){const t=cn(e.trigger_kind||Df(e.schedule,["kind"])).toLowerCase();return t==="cron"?"定时任务":t==="webhook"?"触发任务":"手动任务"}function bI(e,t,n){const a=Qs(e),r=mj(a,e.name,t),s=gI(e),u=Array.isArray(e.skill_ids)?e.skill_ids.length:s,f=(r==null?void 0:r.status)??e.last_status??(e.enabled?"plan_template":"disabled"),p=(r==null?void 0:r.status_label)??(e.enabled?yI(e):"已停用"),m=(r==null?void 0:r.status_tone)??(e.enabled?"info":"waiting");return{id:a,planId:a,title:cn(e.name)||a,summary:cn(e.prompt)||`任务:${a}`,implemented:e.enabled,selectable:!0,selected:n,status:f,statusLabel:p,statusTone:m,scheduleText:(r==null?void 0:r.schedule_text)??pI(e),resultText:(r==null?void 0:r.result_text)??`${s} 个步骤`,conversationId:(r==null?void 0:r.conversation_id)??a,stepCount:s,taskCount:u,readyStepCount:0,runningStepCount:0,blockedStepCount:0,leasedStepCount:0,schedulerJob:e,source:"plan_template"}}function vI(e){const t=new Map;return e.forEach(n=>{const a=n.plan_id||"";if(!a)return;const r=t.get(a)??{ready:0,running:0,blocked:0,leased:0},s=n.status.toLowerCase();n.lease_active||n.skip_reason==="lease_active"?(r.leased+=1,r.running+=1):s==="ready"&&n.dispatchable?r.ready+=1:["running","active","leased","queued"].includes(s)?r.running+=1:s==="blocked"&&(r.blocked+=1),t.set(a,r)}),t}function Fs(e){return e.implemented}function Gd(e){return e.implemented?"":"当前任务未接入执行能力。"}function Zs(e,t){const n=`${e.conversation_id??""} ${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`;return n.includes(t.id)||n.includes(t.title)}function Jh(e){const t=cn(e.statusLabel);return e.statusTone==="running"||/^(执行中|运行中|触发中|正在执行)$/.test(t)}function xI(e,t){const n=cn(e);if(!n)return`步骤 ${t+1}`;const a=n.split(/[.:/#]/).map(s=>s.trim()).filter(Boolean);return(a[a.length-1]||n).replace(/[-_]+/g," ")||`步骤 ${t+1}`}function kI(e){const t=`${(e==null?void 0:e.step_title)??""} ${(e==null?void 0:e.task_title)??""}`.match(/(?:步骤|step)\s*(\d+)/i)??`${(e==null?void 0:e.step_title)??""} ${(e==null?void 0:e.task_title)??""}`.match(/第\s*(\d+)\s*步/);if(!(t!=null&&t[1]))return null;const n=Number(t[1]);return Number.isFinite(n)&&n>0?n-1:null}function SI(e,t,n){var p;const a=((p=e.schedulerJob)==null?void 0:p.skill_ids)??[],r=Math.max(e.stepCount,a.length,1),s=t&&Zs(t,e)?t:null,u=kI(s),f=u!==null?Math.min(u,r-1):(n==null?void 0:n.latest_status_tone)==="success"?r:s?Math.min(Math.max((n==null?void 0:n.success_count)??0,0),r-1):-1;return Array.from({length:r},(m,g)=>{const b=g<f||(n==null?void 0:n.latest_status_tone)==="success"?"done":g===f?"active":"pending",v=a[g];return{id:`${e.id}-step-${g}`,title:xI(v,g),meta:v?`能力 ${v}`:`PlanTemplate 步骤 ${g+1}`,status:b}})}function Vd(e,t){const n=t.filter(p=>Zs(p,e)),a=n.filter(ey).length,r=n.filter(ty).length,s=n.filter(Wc).length,u=Math.max(n.length-a-r-s,0),f=n.length>0?n[n.length-1]:void 0;return{id:e.id,plan_id:e.planId,title:e.title,description:e.summary,selected:!0,total_count:n.length,success_count:a,failure_count:r,running_count:s,waiting_count:u,latest_status_label:(f==null?void 0:f.status_label)??e.statusLabel,latest_status_tone:(f==null?void 0:f.status_tone)??e.statusTone,business_summary:n.length>0?`${e.title} 今日执行 ${n.length} 次,成功 ${a} 次,失败 ${r} 次。`:`${e.title} 尚未产生执行记录。`,ai_summary:n.length>0?`${e.title} 今日执行 ${n.length} 次,成功 ${a} 次,失败 ${r} 次。`:`${e.title} 尚未产生执行记录。`}}function Yd(e,t){const n=e.plan_id??"";return e.id===t.id||n===t.planId||Jc(e.id,t.id)||Jc(n,t.planId)?!0:cn(e.title).toLowerCase()===cn(t.title).toLowerCase()}function s0(e){return{id:e.id,time:e.time,task_name:e.plan_title,step_name:e.step_title,operation_name:e.task_title,status_label:e.status_label,status_tone:e.status_tone,business_detail:Br(e),raw_detail:e.detail,updated_at:e.updated_at,conversation_id:e.conversation_id}}function o0(e){const[t="9",n="0"]=e.split(":"),a=Math.min(Math.max(Number(t)||9,0),23);return`${Math.min(Math.max(Number(n)||0,0),59)} ${a} * * *`}function c0(e){return e.status_label||e.status||"已同步"}function ep(e){return String(e||"").replace(/\s+/g," ").trim()}function hj(e){const n=`${e.plan_title} ${e.step_title??""}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);return n!=null&&n[1]&&n[2]?`${n[1].padStart(2,"0")}:${n[2]}`:ep(e.time)||"即时触发"}function P_(e){const t=ep(e);if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const a=new Intl.DateTimeFormat("zh-CN",{timeZone:WL,hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(n),r=s=>{var u;return((u=a.find(f=>f.type===s))==null?void 0:u.value)??""};return`${r("hour")}:${r("minute")}`}function Mf(e){const t=P_(e.updated_at);return t||ep(e.time)||"待同步"}function Br(e){const t=ep(e.detail).replace(/^触发来源[::]\s*$/u,"").replace(/触发来源[::]\s*(?=。|,|,|;|;|$)/u,"").trim();return t?/^runner unavailable/i.test(t)?"执行链路异常,点击查看详情。":t.length>72?`${t.slice(0,72)}...`:t:ey(e)?"真实事件已完成,结果详情未回传。":Wc(e)?"真实事件执行中,等待结果回传。":ty(e)?"执行异常,点击查看详情。":"结果详情待同步。"}function u0(e){return`计划时间 ${hj(e)} · 执行时间 ${Mf(e)}`}function wI(e,t){return t==="all"?!0:t==="running"?Wc(e):t==="success"?ey(e):ty(e)}function d0(e){const t=new Date(e.updated_at||"").getTime();if(Number.isFinite(t))return t;const n=new Date(e.time||"").getTime();return Number.isFinite(n)?n:0}function f0(e){const t=new Date(e.updated_at||"").getTime();if(Number.isFinite(t))return t;const n=new Date(e.time||"").getTime();return Number.isFinite(n)?n:0}function _j(e){return[e.id,e.conversation_id??"",e.updated_at??"",e.time??"",e.task_name,e.step_name??"",e.operation_name??"",e.status_label].join("|")}function p0(e){const t=new Map;return e.forEach(n=>{t.set(_j(n),n)}),Array.from(t.values()).sort((n,a)=>f0(a)-f0(n))}function gj(e){return P_(e.updated_at)||P_(e.time)||"待同步"}function jI(e){const t=cn(e.operation_name||e.step_name||e.task_name||"步骤"),n=cn(e.business_detail||e.raw_detail||"等待结果回传");return`${gj(e)} ${t} ${n}`}function CI(e){const t=cn(e.step_title||e.task_title||e.plan_title||"事件");return`${Mf(e)} ${t} ${Br(e)}`}function TI(e){return new Set(e.duties.filter(t=>t.selected).map(t=>t.id))}function m0(e){return["pending","requested"].includes(String(e||"").toLowerCase())}function h0(e){return e.plan_id||e.task_id||e.target_id||e.id}function Wc(e){const t=`${e.status} ${e.status_tone}`.toLowerCase();return t.includes("running")||t.includes("execut")||t.includes("progress")}function ey(e){const t=`${e.status} ${e.status_tone}`.toLowerCase();return t.includes("success")||t.includes("complete")||t.includes("done")}function ty(e){const t=`${e.status} ${e.status_tone}`.toLowerCase();return t.includes("danger")||t.includes("fail")||t.includes("error")||t.includes("异常")}function Wh(e,t){const n=`${e.conversation_id??""} ${e.task_name} ${e.step_name??""} ${e.operation_name??""} ${e.business_detail} ${e.raw_detail??""}`;return n.includes(t.id)||n.includes(t.planId)||n.includes(t.title)}function Jl(e){return e==="danger"?"danger":e==="warning"||e==="waiting"?"warning":e==="success"?"success":e==="running"?"running":"info"}function EI(e){return e==="phone"?k_:e==="mail"?v_:e==="inspection"?x_:e==="workOrder"?lo:e==="collaboration"?B1:lo}function AI(e){return e==="phone"?k_:e==="mail"?v_:e==="inspection"?x_:e==="workOrder"?lo:e==="collaboration"?B1:e==="mail-check"?v_:e==="device-monitoring"?x_:e==="fault-followup"?k_:e==="risk-control-report"?L1:lo}function _0(e,t){return t?"collaboration":/电话|外呼|重拨|拨打|通话|汇报/i.test(e)?"phone":/邮件|收件|发件|发送|短信|消息|即时通|mail|message/i.test(e)?"mail":/巡检|监测|设备|d5000|ecs|监控|浏览器|查询/i.test(e)?"inspection":/人工|协同|确认|决策|转人工/i.test(e)?"collaboration":/工单|督办|缺陷|异常|风险|作业|单据|审批|日报|报表|报告|汇总|分析|整理/i.test(e)?"workOrder":"mail"}function NI(e){return/95598|客户|用户|满意率|不满意|工单|诉求|供电服务|服务事项|报备/i.test(e)?"serviceWorkOrder":/预警|监测|监控|异常|风险|到期|超期|故障|负荷|余额|停电|复电|费控/i.test(e)?"monitorWarning":/日报|周报|月报|报表|报告|统计|汇总|分析|导出|明细表/i.test(e)?"reportStats":/巡检|设备|系统|平台|门户|d5000|ecs|浏览器|查询|健康检查/i.test(e)?"systemInspection":/电话|外呼|通话|短信|消息|邮件|即时通|i国网|沟通|协同|人工|确认|审批|会话/i.test(e)?"communication":"monitorWarning"}function g0(e){const t=`${e.title} ${e.summary} ${e.resultText}`.toLowerCase();return/95598|客户|用户|工单|满意率|供电服务/i.test(t)?"供电服务与工单处理人员":/电话|外呼|汇报|即时通|消息|同事|协同|人工/i.test(t)?"本人及协同处理同事":/巡检|监控|设备|系统|d5000|ecs/i.test(t)?"业务系统与设备运维人员":/日报|报告|报表|统计|分析/i.test(t)?"管理人员与日报接收人":"当前岗位职责关联人员"}function RI(e){const t=`${e.title} ${e.summary} ${e.resultText}`.toLowerCase(),n=[];return/人工|确认|审批|协同|同事|领导|会签|转人工|补充材料/i.test(t)&&n.push("需要人员协同或人工确认"),/i国网|国网|95598|系统|平台|门户|浏览器|d5000|ecs|邮件|消息|短信|电话|外呼|接口/i.test(t)&&n.push("需要外部系统或沟通渠道协同"),n.length===0&&n.push("数字员工自动执行为主"),e.stepCount>0&&n.push(`包含 ${e.stepCount} 个执行步骤`),n.join(",")}function DI(e){return`${e.plan_title} ${e.task_title} ${e.step_title??""} ${e.detail}`}function MI(e){return`${e.task_name} ${e.step_name??""} ${e.operation_name??""} ${e.business_detail} ${e.raw_detail??""}`}function $I(e){return/电话|外呼|拨打|通话|重拨|call/i.test(e)?/外呼|拨打|重拨|call/i.test(e)?"phoneTypeOne":"phoneTypeTwo":/邮件|邮箱|收件|发件|email|mail|i国网|国网|igw|i-gw|即时通|消息|短信|发送消息|message|sendmessage|ai|人工确认|确认继续|补充材料|会话|协同|决策/i.test(e)?"message":null}function zI(e){return/同事|协同|人工|转人工|领导|管理人员|班组|部门|县公司|供电所|运维|设备部|接收人|汇报/i.test(e)?"colleague":"self"}function OI(e,t){const n=Math.max(e*.04,26),a=Math.max(Math.min(e*.39,330),286),r=Math.max(Math.min(t*.26,118),104),s=Math.max(Math.min(e*.29,252),208),u=Math.max(Math.min(t*.18,74),66),f=Math.max(t*.13,34),p=Math.max(t*.09,30),m=Math.max((t-u)/2,150),g=t-u-f;return[{x:e-a-n,y:Math.max(t*.08,28),width:a,height:r},{x:n,y:p,width:s,height:u},{x:n,y:m,width:s,height:u},{x:n,y:g,width:s,height:u},{x:e-s-n,y:m,width:s,height:u},{x:e-s-n,y:g,width:s,height:u}]}function LI(){if(typeof window>"u")return null;try{return window.sessionStorage.getItem(pj)}catch{return null}}function II(e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(pj,e)}catch{}}function BI(e){if(typeof e=="number")return Number.isFinite(e)?e:null;const t=Number(String(e).replace(/[^\d.-]/g,""));return Number.isFinite(t)?t:null}function qI(e,t){return t>0?e.toFixed(t):String(Math.round(e))}function UI(e){const t=typeof e=="number"&&Number.isFinite(e)?e:0;return new Intl.NumberFormat("zh-CN",{notation:"compact",maximumFractionDigits:1}).format(t)}function HI(e){const t=typeof e=="number"&&Number.isFinite(e)?e:0;return t>0&&t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}function PI(e){switch(e){case"retry_task":return"重试前置";case"skip_task":return"跳过前置";case"provide_task_input":return"补充输入";default:return e}}function F_(e){return(e.blocked_dependency_details??[]).find(t=>!!t.task_id)??null}function FI(e){var a;const t=F_(e)??((a=e.blocked_dependency_details)==null?void 0:a[0])??null,n=t?`${t.title} ${t.status}`:`阻塞依赖 ${e.blocked_dependencies.length} 个`;return`${e.title} ${e.dependency_status||e.status},${n}`}function In({value:e,unit:t,decimals:n=0,className:a}){const r=w.useMemo(()=>BI(e),[e]),[s,u]=w.useState(0),f=w.useRef(0);return w.useEffect(()=>{if(r===null)return;const p=f.current??0;if(f.current=r,p===r||typeof window>"u"||window.matchMedia("(prefers-reduced-motion: reduce)").matches){u(r);return}const m={value:p},g=g_(m,{value:r,duration:760,ease:"outCubic",onUpdate:()=>u(m.value)});return()=>{g.cancel()}},[r]),r===null?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`dhv2-animated-number ${a??""}`,children:e}),t&&c.jsx("em",{children:t})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`dhv2-animated-number ${a??""}`,children:qI(s,n)}),t&&c.jsx("em",{children:t})]})}function GI({text:e,active:t}){const[n,a]=w.useState(e.length);w.useEffect(()=>{if(!t||typeof window>"u"||window.matchMedia("(prefers-reduced-motion: reduce)").matches){a(e.length);return}a(0);const u=Math.max(18,Math.min(46,Math.floor(900/Math.max(e.length,1)))),f=window.setInterval(()=>{a(p=>p>=e.length?(window.clearInterval(f),e.length):p+1)},u);return()=>window.clearInterval(f)},[t,e]);const r=t?e.slice(0,n):e,s=n>=e.length;return c.jsxs("strong",{className:`dhv2-run-log-text ${t?"is-typing":""}`,children:[c.jsx("span",{children:r}),t&&!s&&c.jsx("i",{"aria-hidden":"true"})]})}function VI({value:e,label:t,className:n}){const a=Math.min(Math.max(e,0),100);return c.jsx("span",{className:`dhv2-motion-progress ${n??""}`,"aria-label":t,role:t?"progressbar":void 0,"aria-valuemin":t?0:void 0,"aria-valuemax":t?100:void 0,"aria-valuenow":t?Math.round(a):void 0,children:c.jsx("span",{style:{width:`${a}%`}})})}function Aa({title:e,eyebrow:t,description:n,variant:a="modal",size:r="medium",className:s,surfaceClassName:u,bodyClassName:f,headerActions:p,actions:m,onClose:g,children:b}){return c.jsx("div",{className:`dhv2-overlay dhv2-overlay--${a} ${s??""}`,role:"presentation",onClick:g,children:c.jsxs("div",{className:`dhv2-overlay-surface dhv2-overlay-surface--${a} dhv2-overlay-surface--${r} ${u??""}`,role:"dialog","aria-modal":"true","aria-label":e,onClick:v=>v.stopPropagation(),children:[c.jsxs("header",{className:"dhv2-overlay-head",children:[c.jsxs("div",{children:[t&&c.jsx("span",{className:"dhv2-overlay-eyebrow",children:t}),c.jsx("h3",{children:e}),n&&c.jsx("p",{children:n})]}),p&&c.jsx("div",{className:"dhv2-overlay-head-actions",children:p}),c.jsx("button",{type:"button",className:"dhv2-overlay-close","aria-label":`关闭${e}`,onClick:g,children:"×"})]}),c.jsx("div",{className:`dhv2-overlay-body ${f??""}`,children:b}),m&&c.jsx("footer",{className:"dhv2-overlay-actions",children:m})]})})}function YI({onNavigate:e}){var Au,Nu;const[t,n]=w.useState(Mc()),[a,r]=w.useState(null),[s,u]=w.useState([]),[f,p]=w.useState(new Set),[m,g]=w.useState([]),[b,v]=w.useState([]),[k,C]=w.useState(null),[D,A]=w.useState({}),[x,T]=w.useState(!0),[N,F]=w.useState(null),[,L]=w.useState(null),[B,P]=w.useState(null),[,K]=w.useState(null),[se,I]=w.useState(!1),[q,Z]=w.useState("selected"),[Q,R]=w.useState("working"),[U,O]=w.useState(null),[G,ae]=w.useState(null),[,ie]=w.useState(!1),[z,M]=w.useState(!1),[J,$]=w.useState(null),[_e,we]=w.useState("all"),[be,Ee]=w.useState("mail"),[Ie,ue]=w.useState({width:0,height:0}),[me,Xe]=w.useState(!1),[it,bt]=w.useState(!1),[Lt,vt]=w.useState(!1),[Ue,ft]=w.useState(null),[wt,at]=w.useState(null),[qe,xt]=w.useState(null),[lt,ia]=w.useState(null),[It,Oa]=w.useState("09:00"),[le,ge]=w.useState(!1),[ze,He]=w.useState(!1),[Pe,Gt]=w.useState({name:"",company:"",position:"",currentStatus:"working"}),[fn,rn]=w.useState("18:00"),[kt,wn]=w.useState("today"),[pt,Zn]=w.useState(Mc()),[Bt,yl]=w.useState(Mc()),[La,Vt]=w.useState(!1),[ya,Ze]=w.useState(()=>LI()),ve=w.useRef(!1),li=w.useRef(!1),mr=w.useRef(null),bo=w.useRef(null),bl=w.useRef(new Map),ba=w.useRef(new Map),du=w.useRef(new Map),Qr=w.useRef(!1),[Xr,fu]=w.useState({width:Xh,height:Zh});w.useEffect(()=>(ve.current=!0,()=>{ve.current=!1}),[]),w.useLayoutEffect(()=>{const j=bo.current;if(!j||typeof ResizeObserver>"u")return;const Y=()=>{fu({width:Math.max(j.clientWidth,1),height:Math.max(j.clientHeight,1)})};Y();const oe=new ResizeObserver(Y);return oe.observe(j),()=>oe.disconnect()},[]);const Et=w.useCallback(async()=>{let j=null,Y=null;const oe=()=>{var Bi,Dn;if(li.current||!Y)return;const Se=((Bi=j==null?void 0:j.workday)==null?void 0:Bi.selection_initialized)===!0,Ae=Se?new Set(((Dn=j==null?void 0:j.workday)==null?void 0:Dn.selected_duty_ids)??[]):(j==null?void 0:j.source)==="live"?TI(j):new Set,pn=Y.map(ra=>Qs(ra)).filter(ra=>mI(Ae,ra));if(Se){p(new Set(pn));return}const Yt=pn.length>0?pn:Y.slice(0,3).map(ra=>Qs(ra));p(new Set(Yt))},fe=rf(t).then(Se=>{ve.current&&(j=Se,r(Se),P(null),oe())}).catch(Se=>{ve.current&&P(Se instanceof Error?Se.message:"数字员工首页数据同步失败")}),de=JS().then(Se=>{ve.current&&(Y=Se.filter(Ae=>Ae.job_type==="plan_template"||Df(Ae.delivery,["mode"])==="plan_template"),u(Y),K(null),oe())}).catch(Se=>{ve.current&&K(Se instanceof Error?Se.message:"任务加载失败")}),je=PD({page_size:80}).then(Se=>{if(!ve.current)return;const Ae=Se.items??[];g(Ae),v(Ae.filter(pn=>pn.status.toLowerCase()==="blocked"||pn.blocked_dependencies.length>0)),C(null)}).catch(Se=>{ve.current&&(g([]),v([]),C(Se instanceof Error?Se.message:"阻塞步骤加载失败"))});await Promise.allSettled([fe,de,je]),ve.current&&T(!1)},[t]);w.useEffect(()=>{T(!0),A({}),Et()},[Et]),w.useEffect(()=>{const j=window.setInterval(()=>{Et()},nI);return()=>window.clearInterval(j)},[Et]);const En=(a==null?void 0:a.source)==="live",hr=w.useMemo(()=>En?(a==null?void 0:a.duties)??[]:[],[En,a==null?void 0:a.duties]),vn=w.useMemo(()=>{const j=vI(m);return s.slice().sort((Y,oe)=>{const fe=Qs(Y),de=Qs(oe),je=f.has(fe)?1:0,Se=f.has(de)?1:0;if(je!==Se)return Se-je;const Ae=new Date(Y.next_run||"").getTime(),pn=new Date(oe.next_run||"").getTime(),Yt=Number.isFinite(Ae),Bi=Number.isFinite(pn);return Yt!==Bi?Yt?-1:1:Yt&&Bi&&Ae!==pn?Ae-pn:cn(Y.name).localeCompare(cn(oe.name),"zh-CN")}).map(Y=>{const oe=Qs(Y),fe=bI(Y,hr,f.has(oe)),de=j.get(fe.planId)??j.get(oe);return de?{...fe,readyStepCount:de.ready,runningStepCount:de.running,blockedStepCount:de.blocked,leasedStepCount:de.leased,resultText:de.ready>0||de.running>0||de.blocked>0||de.leased>0?`Ready ${de.ready} · 运行 ${de.running} · 阻塞 ${de.blocked}${de.leased>0?` · 租约 ${de.leased}`:""}`:fe.resultText}:fe})},[hr,m,s,f]),jt=w.useMemo(()=>vn.filter(j=>f.has(j.id)),[vn,f]),en=w.useMemo(()=>jt.map(j=>_I(j,hr)),[hr,jt]),xn=vn,Ia=vn.filter(j=>!f.has(j.id)),An=w.useMemo(()=>vn.find(j=>j.id===Ue)??jt[0]??vn[0]??null,[vn,jt,Ue]),Nn=w.useMemo(()=>(En?(a==null?void 0:a.events)??[]:[]).slice().sort((j,Y)=>d0(Y)-d0(j)),[En,a==null?void 0:a.events]),pu=Nn,va=(En?(a==null?void 0:a.decisions)??[]:[]).filter(j=>m0(j.status)),Ba=w.useMemo(()=>pu.filter(j=>wI(j,_e)),[_e,pu]),vo=Ba.slice(0,l0),xe=Nn.filter(Wc)[0]??Nn[0]??null,Pn=a==null?void 0:a.employee,Ut=a==null?void 0:a.workday,Me=En?a==null?void 0:a.daily_report:void 0,Jn=En?a==null?void 0:a.diagnostic_summary:null,xo=Jn?Jn.doctor.error+Jn.doctor.warn:0,xa=Jn?Jn.audit.error+Jn.audit.warn:0,Fn=(Jn==null?void 0:Jn.latest_issue)??null,ri=En?a==null?void 0:a.route_summary:null,gr=(ri==null?void 0:ri.latest)??null,qa=w.useMemo(()=>{var oe;if(!En)return[];const j=(oe=a==null?void 0:a.run_details)!=null&&oe.length?a.run_details:Nn.map(s0),Y=Object.values(D).flat();return p0([...j,...Y])},[Nn,En,D,a==null?void 0:a.run_details]),ko=qa.slice(0,tI),Zr=En?(a==null?void 0:a.execution_summaries)??[]:[],si=jt.map(j=>Zr.find(Y=>Yd(Y,j))??Vd(j,Nn)),xi=Ps.map(j=>{const Y=si.filter(je=>_0(`${je.title} ${je.description??""} ${je.business_summary??""} ${je.ai_summary??""}`,!1)===j.id),oe=Y.reduce((je,Se)=>je+Se.total_count,0),fe=Y.reduce((je,Se)=>je+Se.success_count,0),de=Y.reduce((je,Se)=>je+Se.failure_count,0);return{id:j.id,label:j.label,value:oe,success:fe,failure:de,unit:"次"}}),Wn=lI.map(j=>{const Y=si.filter(Se=>NI(`${Se.title} ${Se.description??""} ${Se.business_summary??""} ${Se.ai_summary??""}`)===j.id),oe=Y.length,fe=Y.reduce((Se,Ae)=>Se+Ae.total_count,0),de=Y.reduce((Se,Ae)=>Se+Ae.success_count,0),je=Y.reduce((Se,Ae)=>Se+Ae.failure_count,0);return{id:j.id,label:j.label,value:oe,total:fe,success:de,failure:je,unit:"项"}}),So=Math.max(...xi.map(j=>Math.max(j.value,j.success,j.failure)),1),St=w.useMemo(()=>xe?jt.find(j=>Zs(xe,j))??vn.find(j=>Zs(xe,j))??jt[0]??vn[0]??null:jt[0]??vn[0]??null,[xe,vn,jt]),ki=St?si.find(j=>Yd(j,St))??Vd(St,Nn):null,aa=lt?si.find(j=>Yd(j,lt))??Vd(lt,Nn):null,Ua=lt?Nn.find(j=>Zs(j,lt))??null:null,vl=w.useMemo(()=>lt?SI(lt,Ua,aa):[],[Ua,aa,lt]),Gn=vl.find(j=>j.status==="active")??vl.find(j=>j.status==="pending")??vl[vl.length-1]??null,$i=(xe==null?void 0:xe.conversation_id)??(St==null?void 0:St.conversationId)??(St==null?void 0:St.planId)??null,tn=va[0]??null,wo=jt.map(j=>{const Y=si.find(Ae=>Yd(Ae,j))??Vd(j,Nn),oe=qa.filter(Ae=>Wh(Ae,j)),fe=oe[0],de=Nn.find(Ae=>Zs(Ae,j)),je=cn(fe?jI(fe):(de?CI(de):"")||Y.business_summary||Y.ai_summary||`${j.title} 尚未产生执行记录。`),Se=cn(Y.business_summary||Y.ai_summary||j.resultText||"尚未产生执行记录。");return{id:j.id,title:j.title,total:Y.total_count,success:Y.success_count,failure:Y.failure_count,log:je,logTitle:cn((fe==null?void 0:fe.operation_name)||(fe==null?void 0:fe.step_name)||(de==null?void 0:de.step_title)||(de==null?void 0:de.task_title)||j.title),logTime:fe?gj(fe):de?Mf(de):"待同步",logStatus:(fe==null?void 0:fe.status_label)||(de==null?void 0:de.status_label)||Y.latest_status_label||j.statusLabel,logDetail:cn((fe==null?void 0:fe.business_detail)||(de==null?void 0:de.detail)||Se),logRaw:cn((fe==null?void 0:fe.raw_detail)||(de==null?void 0:de.detail)||Se),logKey:fe?_j(fe):(de==null?void 0:de.id)??`${j.id}-empty`,status:Y.latest_status_label||j.statusLabel,tone:Jl(Y.latest_status_tone||j.statusTone),active:(St==null?void 0:St.id)===j.id,streaming:Jl(Y.latest_status_tone||j.statusTone)==="running"||Jh(j)||oe.some(Ae=>Jl(Ae.status_tone)==="running")}}),zi=w.useMemo(()=>{const j=Nn.map(DI),Y=qa.map(MI),oe=va.map(Dn=>`${Dn.title} ${Dn.scenario} ${Dn.plan_title} ${Dn.task_title}`),fe=[...j,...Y,...oe].filter(Boolean),de=fe.length>0?fe:jt.map(Dn=>`${Dn.title} ${Dn.summary} ${Dn.resultText}`),je={message:va.length,phoneTypeOne:0,phoneTypeTwo:0},Se={self:tn?1:0,colleague:0};de.forEach(Dn=>{const ra=$I(Dn);ra&&(je[ra]+=1);const xp=zI(Dn);Se[xp]+=1});const Ae=[{id:"self",label:"与本人",value:Se.self},{id:"colleague",label:"与同事",value:Se.colleague}],pn=je.phoneTypeOne+je.phoneTypeTwo,Yt=[{id:"message",label:"信息",value:je.message},{id:"phone",label:"电话",value:pn}],Bi=[{id:"phoneTypeOne",label:"电话类型一",value:je.phoneTypeOne},{id:"phoneTypeTwo",label:"电话类型二",value:je.phoneTypeTwo}];return{targetMetrics:Ae,channelMetrics:Yt,phoneTypeMetrics:Bi}},[Nn,tn,va,qa,jt]),jo=((Au=zi.targetMetrics.find(j=>j.id==="self"))==null?void 0:Au.value)??0,Co=((Nu=zi.targetMetrics.find(j=>j.id==="colleague"))==null?void 0:Nu.value)??0,xl=jo+Co,ip=Math.max(...zi.channelMetrics.map(j=>j.value),1),Jr=w.useMemo(()=>{if(!St)return ko.slice(0,6);const j=qa.filter(Y=>Wh(Y,St));return(j.length>0?j:ko).slice(0,6)},[St,qa,ko]),Wr=Jr.slice().reverse(),Ge=Wr.find(j=>Jl(j.status_tone)==="running")??Wr[Wr.length-1]??null,ap=cI(t),lp=q==="all"?"全部任务":q==="pending"?"待选择任务":"今日已选任务",Rn=(Me==null?void 0:Me.status)==="ready"?Me.totals:null,la=(Rn==null?void 0:Rn.task_count)??si.length,To=(Rn==null?void 0:Rn.execution_count)??si.reduce((j,Y)=>j+Y.total_count,0),Eo=(Rn==null?void 0:Rn.success_count)??si.reduce((j,Y)=>j+Y.success_count,0),kl=(Rn==null?void 0:Rn.failure_count)??si.reduce((j,Y)=>j+Y.failure_count,0),ka=Me?[Me.summary,...Me.detail_lines??[]].filter(j=>!!(j&&j.trim())):[],mu=(Me==null?void 0:Me.status)==="ready"&&ka.length>0,es=((Ut==null?void 0:Ut.current_status)??(Pn==null?void 0:Pn.current_status)??"working")==="resting",Sl=(a==null?void 0:a.source)==="demo",Oi=Sl?"演示兜底":"真实数据",Ao=Sl?"de-badge-warning":"de-badge-success",yr=xn.length>0?`已加载 ${xn.length} 项任务,当前选择 ${jt.length} 项;右侧展示真实执行状态、运行明细和日报。`:(Ut==null?void 0:Ut.summary)??"等待同步当天任务计划。",Li=!!(Ut!=null&&Ut.confirmed||Nn.length>0||va.length>0),Ha=(St==null?void 0:St.title)??(xe==null?void 0:xe.plan_title)??"等待执行单",Pa=tn?`当前执行单停在“${tn.title}”,需要你确认后继续。`:xe?`正在执行“${xe.plan_title}”,当前动作是“${xe.task_title}”。${Br(xe)}`:(ki==null?void 0:ki.ai_summary)||(ki==null?void 0:ki.business_summary)||"选择并确认任务后,AI 会把执行单、步骤和需要人工介入的事项绑定到这里。",ts=(Ge==null?void 0:Ge.status_label)??(xe==null?void 0:xe.status_label)??(Li?"准备执行":"待命"),Fa=cn([Ge==null?void 0:Ge.operation_name,Ge==null?void 0:Ge.step_name,xe==null?void 0:xe.step_title,xe==null?void 0:xe.task_title,Ge==null?void 0:Ge.task_name,!xe&&!Ge?tn==null?void 0:tn.task_title:"",!xe&&!Ge?tn==null?void 0:tn.title:""].filter(Boolean).join(" ")),ns=!!(a&&!(Ut!=null&&Ut.confirmed)),_u=jt.length,jn=q==="selected"?jt:vn,Ii=wo.slice().sort((j,Y)=>{const oe=j.streaming||j.tone==="running",fe=Y.streaming||Y.tone==="running";return oe!==fe?Number(fe)-Number(oe):j.active!==Y.active?Number(Y.active)-Number(j.active):0}),Sa=w.useMemo(()=>_0(Fa,!!(tn&&!xe&&!Ge)),[Fa,xe,Ge,tn]),wl=!!(xe&&Wc(xe)||Jl(Ge==null?void 0:Ge.status_tone)==="running"),gu=$i?{plan_id:$i,title:Ha,objective:(ki==null?void 0:ki.business_summary)??(St==null?void 0:St.summary)??(xe==null?void 0:xe.detail)??Pa,status:wl?"active":Jl((Ge==null?void 0:Ge.status_tone)??(xe==null?void 0:xe.status_tone)),created_at:(xe==null?void 0:xe.updated_at)??(xe==null?void 0:xe.time)??(Ge==null?void 0:Ge.time)??null,steps:Jr.length>0?Jr.map((j,Y)=>({step_id:j.id||`${$i}-step-${Y}`,title:j.step_name||j.operation_name||j.task_name||`步骤 ${Y+1}`,tasks:[{task_id:j.id||`${$i}-task-${Y}`,title:j.operation_name||j.step_name||j.task_name||`任务 ${Y+1}`,status:Jl(j.status_tone)}]})):[{step_id:`${$i}-current`,title:(xe==null?void 0:xe.step_title)||(xe==null?void 0:xe.task_title)||Ha,tasks:[{task_id:(xe==null?void 0:xe.id)||`${$i}-task`,title:(xe==null?void 0:xe.task_title)||Ha,status:xe?Jl(xe.status_tone):"active"}]}]}:null,No=[`已进入“${Ha}”执行单会话。`,`当前状态:${ts}。`,Fa?`当前步骤:${Fa}。`:"",`当前进展:${Pa}`,tn?`需要你处理:${tn.title}。`:"当前没有必须由你确认的事项。","你可以继续询问任务进展、需要提供什么材料,或下一步如何处理。"].filter(Boolean).join(`
|
||
`),is=!!(xe||Ge||tn),Ga=Ps.find(j=>j.id===be)??Ps[0],jl=w.useMemo(()=>[be,...Ps.map(j=>j.id).filter(j=>j!==be)],[be]),yu=be===Sa&&(Ge||xe)&&((Ge==null?void 0:Ge.operation_name)||(Ge==null?void 0:Ge.step_name)||(xe==null?void 0:xe.task_title))||Ga.label,rp=be===Sa&&(xe||Ge)?`${(xe==null?void 0:xe.plan_title)??(St==null?void 0:St.title)??"当前任务"}:${(Ge==null?void 0:Ge.business_detail)||(Ge==null?void 0:Ge.raw_detail)||(xe?Br(xe):"等待结果回传")}(${xe?u0(xe):ts})`:Ga.detail,Ro=w.useMemo(()=>{const j=new Map,Y=new Map(Ii.map(fe=>[fe.id,fe])),oe=fe=>{!fe||j.has(fe.id)||j.set(fe.id,fe)};return oe(St),jt.forEach(fe=>{const de=Y.get(fe.id);(Jh(fe)||de!=null&&de.streaming||de!=null&&de.active)&&oe(fe)}),jt.slice(0,r0).forEach(oe),Array.from(j.values()).slice(0,r0)},[St,Ii,jt]),sp=Ro.map(j=>j.id).join("|");w.useEffect(()=>{is&&Ee(Sa)},[Sa,is]),w.useEffect(()=>{if(!En||Ro.length===0)return;let j=!1;const Y=[];return Ro.forEach((oe,fe)=>{const de=async()=>{var Se;try{const Ae=await rf(t);if(j||!ve.current)return;if(Ae.source==="live"){r(Yt=>!Yt||Yt.date!==Ae.date?Ae:{...Yt,overview:Ae.overview,workday:Ae.workday,employee:Ae.employee,duties:Ae.duties,events:Ae.events,execution_summaries:Ae.execution_summaries,run_details:Ae.run_details,decisions:Ae.decisions,delivery:Ae.delivery,daily_report:Ae.daily_report});const pn=(Se=Ae.run_details)!=null&&Se.length?Ae.run_details:Ae.events.map(s0);A(Yt=>({...Yt,[oe.id]:p0(pn.filter(Bi=>Wh(Bi,oe))).slice(0,12)}))}}catch{}},je=window.setTimeout(()=>{de();const Se=window.setInterval(()=>{de()},iI);Y.push(Se)},fe*aI);Y.push(je)}),()=>{j=!0,Y.forEach(oe=>{window.clearTimeout(oe),window.clearInterval(oe)})}},[En,sp,t]),w.useEffect(()=>{Qr.current=!1},[Q]);const Do=w.useCallback((j,Y)=>{if(Y){bl.current.set(j,Y);return}bl.current.delete(j)},[]),bu=w.useCallback((j,Y)=>{const oe=Y.getBoundingClientRect(),fe=286,de=174,je=Math.min(oe.right+12,Math.max(12,window.innerWidth-fe-12)),Se=Math.min(Math.max(12,oe.top-8),Math.max(12,window.innerHeight-de-12));O({title:j.title,audience:g0(j),description:j.summary||"暂无任务描述",schedule:j.scheduleText||"未配置任务周期",top:Se,left:je})},[]),vu=w.useCallback((j,Y)=>{const oe=Y.getBoundingClientRect(),fe=340,de=214,je=Math.min(oe.left,Math.max(12,window.innerWidth-fe-12)),Se=Math.min(oe.bottom+10,Math.max(12,window.innerHeight-de-12));ae({title:j.logTitle||j.title,time:j.logTime,status:j.logStatus,detail:j.logDetail||j.log,raw:j.logRaw||j.logDetail||j.log,top:Se,left:je})},[]),as=w.useCallback((j,Y)=>{var fe;const oe=bl.current.get(j);if(oe){if((fe=du.current.get(j))==null||fe.cancel(),me){oe.style.transform="";return}du.current.set(j,g_(oe,{scale:Y?1.045:1,duration:Y?180:150,ease:"outQuad"}))}},[me]),op=w.useCallback(j=>{const Y=j.currentTarget.getBoundingClientRect();j.currentTarget.style.setProperty("--spot-x",`${j.clientX-Y.left}px`),j.currentTarget.style.setProperty("--spot-y",`${j.clientY-Y.top}px`)},[]);w.useLayoutEffect(()=>{if(Q!=="working"||Ie.width<=0||Ie.height<=0)return;const j=OI(Ie.width,Ie.height),Y=Qr.current&&!me;return jl.forEach((oe,fe)=>{var Ae;const de=bl.current.get(oe),je=j[fe];if(!de||!je)return;const Se=oe===be;if((Ae=ba.current.get(oe))==null||Ae.cancel(),de.style.zIndex=Se?"4":"2",de.style.setProperty("--slot-index",String(fe)),!Y){Object.assign(de.style,{left:`${je.x}px`,top:`${je.y}px`,width:`${je.width}px`,height:`${je.height}px`,opacity:Se?"1":"0.78",scale:"1"});return}ba.current.set(oe,g_(de,{left:`${je.x}px`,top:`${je.y}px`,width:`${je.width}px`,height:`${je.height}px`,opacity:Se?1:.78,duration:440,ease:"outCubic"}))}),Qr.current=!0,()=>{ba.current.forEach(oe=>oe.cancel()),ba.current.clear()}},[Ie.height,Ie.width,jl,me,be,Q]),w.useEffect(()=>{if(!(x||!a)&&a.workday.confirmed){Vt(!1);return}},[ya,x,t,a]),w.useEffect(()=>{Pn&&Gt({name:Pn.name||"",company:Pn.company||"",position:Pn.position||Pn.major||"",currentStatus:Pn.current_status||(Ut==null?void 0:Ut.current_status)||"working"})},[Pn,Ut==null?void 0:Ut.current_status]),w.useEffect(()=>{rn((Me==null?void 0:Me.report_schedule_time)||"18:00")},[Me==null?void 0:Me.report_schedule_time]),w.useEffect(()=>{He(!1)},[t]),w.useEffect(()=>{kt!=="custom"&&(Zn(t),yl(t))},[kt,t]),w.useEffect(()=>{Li&&R("working")},[Li]),w.useEffect(()=>{if(typeof window>"u")return;const j=window.matchMedia("(prefers-reduced-motion: reduce)"),Y=()=>Xe(j.matches);return Y(),j.addEventListener("change",Y),()=>j.removeEventListener("change",Y)},[]),w.useEffect(()=>{const j=mr.current;if(!j||typeof ResizeObserver>"u")return;const Y=()=>{ue({width:j.clientWidth,height:j.clientHeight})};Y();const oe=new ResizeObserver(Y);return oe.observe(j),()=>oe.disconnect()},[Q]);const xu=w.useCallback(async(j,Y)=>{li.current=!0,I(!0),F("update_task_selection"),P(null),Y&&L(null);try{const oe=await ck(t,Array.from(j));if(!ve.current)return;r(oe),p(new Set(j)),li.current=!1,I(!1),Y&&L(Y)}catch(oe){ve.current&&P(oe instanceof Error?oe.message:"同步任务选择失败")}finally{ve.current&&F(null)}},[t]),ls=w.useCallback(j=>{if(!j.selectable||!j.implemented)return;const Y=new Set(f);Y.has(j.id)?Y.delete(j.id):Y.add(j.id),p(new Set(Y)),li.current=!0,I(!0),L(null),xu(Y)},[xu,f]),ku=w.useCallback(async()=>{if(f.size===0){P("请至少选择一项今天要执行的任务。");return}if(es){P("数字员工正在休息,请切换为工作中后再执行任务。");return}F("confirm_workday"),P(null),L(null);try{const j=await Ws({action:"confirm_workday",date:t,duty_ids:en});if(!ve.current)return;r(j),p(new Set(f)),li.current=!1,I(!1),Vt(!1),L("任务清单已确认,数字员工开始按任务执行。")}catch(j){ve.current&&P(j instanceof Error?j.message:"确认任务清单失败")}finally{ve.current&&F(null)}},[es,t,f,en]),cp=w.useCallback(async()=>{F("update_profile"),P(null),L(null);try{const j=await Ws({action:"update_profile",date:t,name:Pe.name,company:Pe.company,position:Pe.position,current_status:Pe.currentStatus});if(!ve.current)return;r(j),ge(!1),L("数字员工特性设置已保存。")}catch(j){ve.current&&P(j instanceof Error?j.message:"保存特性设置失败")}finally{ve.current&&F(null)}},[Pe,t]),up=w.useCallback(async()=>{F("update_report_schedule"),P(null),L(null);try{const j=await Ws({action:"update_report_schedule",date:t,report_schedule_time:fn});if(!ve.current)return;r(j),L(`日报生成时间已设置为 ${fn}。`)}catch(j){ve.current&&P(j instanceof Error?j.message:"设置日报时间失败")}finally{ve.current&&F(null)}},[fn,t]),dp=w.useCallback(async()=>{var j,Y;F("generate_daily_report"),P(null),L(null);try{const oe=await VD({date:t,duty_ids:en,report_schedule_time:fn});if(!ve.current)return;const fe=((j=oe.daily_report)==null?void 0:j.status)==="ready"?oe:await rf(t);if(!ve.current)return;r(fe),((Y=fe.daily_report)==null?void 0:Y.status)==="ready"&&fe.daily_report.generated_by==="ai"?(L("AI 日报已生成,可打开所在文件夹查看 PDF。"),He(!0)):L("AI 日报尚未生成,请稍后重试。")}catch(oe){ve.current&&P(oe instanceof Error?oe.message:"生成日报失败")}finally{ve.current&&F(null)}},[fn,t,f,en]),rs=w.useCallback(async()=>{F("open_report_folder"),P(null),L(null);try{if(await KD(t),!ve.current)return;L("日报 PDF 已生成,已打开所在文件夹。")}catch(j){ve.current&&P(j instanceof Error?j.message:"打开日报文件夹失败")}finally{ve.current&&F(null)}},[t]),Su=w.useCallback(async()=>{F("download_report_pdf"),P(null),L(null);try{const{blob:j,filename:Y}=await QD(t);if(XD(j,Y),!ve.current)return;L("日报 PDF 已开始下载。")}catch(j){ve.current&&P(j instanceof Error?j.message:"下载日报 PDF 失败")}finally{ve.current&&F(null)}},[t]),fp=w.useCallback(async()=>{F("pull_approval_updates"),P(null),L(null);try{const j=await oM();if(!ve.current||(await Et(),!ve.current))return;L(j.ok?`审批更新已拉取:应用 ${j.applied??0} 条,忽略 ${j.ignored??0} 条,冲突 ${j.conflicted??0} 项。`:`审批更新拉取失败:${j.error||"未知错误"}。`)}catch(j){ve.current&&P(j instanceof Error?j.message:"拉取审批更新失败")}finally{ve.current&&F(null)}},[Et]),pp=w.useCallback(async(j,Y)=>{const oe=Ic(j),fe=`${oe}:conflict:${Y}`;F(fe),P(null),L(null);try{if(await rM(oe,{resolution:Y,actor:"digital_employee_operator",comment:Y==="keep_local"?"首页冲突保护:保留本地审批事实":Y==="accept_remote"?"首页冲突处理:采纳管理端快照":"首页冲突处理:标记已复核"}),!ve.current)return;L("审批冲突处理已记录。"),await Et()}catch(de){ve.current&&P(de instanceof Error?de.message:"处理审批冲突失败")}finally{ve.current&&F(null)}},[Et]),wu=w.useCallback(async()=>{F("pull_plan_step_dispatch_policy"),P(null),L(null);try{const j=await WS();if(!ve.current||(await Et(),!ve.current))return;const Y=j.policy;L(j.ok?`PlanStep 派发策略已拉取:${Y.enabled?"启用":"停用"},每轮最多 ${Y.max_per_sweep} 个。`:`PlanStep 派发策略拉取失败,已沿用本地策略:${j.error||"未知错误"}。`)}catch(j){ve.current&&P(j instanceof Error?j.message:"拉取PlanStep派发策略失败")}finally{ve.current&&F(null)}},[Et]),mp=w.useCallback(async()=>{F("pull_risk_approval_policy"),P(null),L(null);try{const j=await tw();if(!ve.current||(await Et(),!ve.current))return;L(j.ok?"风险审批策略已拉取。":`风险审批策略拉取失败,已沿用本地策略:${j.error||"未知错误"}。`)}catch(j){ve.current&&P(j instanceof Error?j.message:"拉取风险审批策略失败")}finally{ve.current&&F(null)}},[Et]),hp=w.useCallback(async()=>{F("pull_route_decision_policy"),P(null),L(null);try{const j=await aw();if(!ve.current||(await Et(),!ve.current))return;L(j.ok?"入口路由策略已拉取。":`入口路由策略拉取失败,已沿用本地策略:${j.error||"未知错误"}。`)}catch(j){ve.current&&P(j instanceof Error?j.message:"拉取入口路由策略失败")}finally{ve.current&&F(null)}},[Et]),_p=w.useCallback(async j=>{var Y,oe;F(`ready-steps:${j.id}`),P(null),L(null);try{const fe=await uk(j.planId);if(fe.ok===!1)throw new Error(((oe=(Y=fe.errors)==null?void 0:Y[0])==null?void 0:oe.error)||"计划推进未被接受");L(`已推进:${j.title},派发 ${fe.dispatched??0} 个,跳过 ${fe.skipped??0} 个${(fe.failed??0)>0?`,失败 ${fe.failed}`:""}。`),await Et()}catch(fe){ve.current&&P(fe instanceof Error?fe.message:"推进 Ready 步骤失败")}finally{ve.current&&F(null)}},[Et]),Mo=w.useCallback(async(j,Y,oe={})=>{const fe=F_(j),de=Y==="retry_task"||Y==="skip_task"?fe:null,je=(de==null?void 0:de.step_id)??j.step_id,Se=(de==null?void 0:de.task_id)??j.task_id??null,Ae=(de==null?void 0:de.latest_run_id)??j.latest_run_id??null;if(!Se){P("当前阻塞步骤缺少可治理任务,无法发送处理命令");return}const pn=`blocked-plan-step:${j.step_id}:${Y}`;F(pn),P(null),L(null);try{const Yt=await Tf({command_kind:Y,context_refs:{plan_id:j.plan_id,task_id:Se,run_id:Ae,step_id:je,blocked_step_id:j.step_id},payload:{source:"digital-home-blocked-plan-step",blocked_step_title:j.title,blocked_dependency_step_id:(de==null?void 0:de.step_id)??null,requested_action:Y,input:oe.input},correlation_id:`digital-home-blocked-step-${j.step_id}-${Y}-${Date.now()}`});if(!Yt.accepted)throw new Error(Yt.message||`阻塞步骤处理未被接受:${Yt.command_id||Y}`);L(`阻塞步骤已${PI(Y)}:${j.title}。`),await Et()}catch(Yt){ve.current&&P(Yt instanceof Error?Yt.message:"阻塞步骤处理失败")}finally{ve.current&&F(null)}},[Et]),ju=w.useCallback(async(j,Y)=>{var fe;const oe=Ic(j);F(`${oe}:${Y}`),P(null),L(null);try{const de=((fe=j.actions.find(je=>je.id===Y))==null?void 0:fe.label)??Y;if(await fM(j,Y,{source:"digital-home",comment:de,correlationPrefix:"digital-home-approval"}),!ve.current)return;L(`${de}已提交,审批状态已同步。`),await Et()}catch(de){ve.current&&P(de instanceof Error?de.message:"处理决策失败")}finally{ve.current&&F(null)}},[Et]),Cu=w.useCallback(j=>{e({tab:"missions",date:t,missionId:j.conversationId||j.id})},[e,t]),gp=w.useCallback(async j=>{const Y=o0(It),oe=Date.now(),fe=`digital-home-${j.planId}-${It.replace(":","")}`;F(`schedule:${j.id}`),P(null),L(null);try{const de=await Tf({command_kind:"create_schedule",context_refs:{plan_id:j.planId,schedule_id:fe},payload:{source:"digital-home",plan_id:j.planId,name:`定时执行:${j.title}`,description:`按首页任务管理定时任务:${j.title}`,prompt:`请按计划执行:${j.title}。${j.summary}`,cron_expr:Y,schedule:Y},correlation_id:`digital-home-create-schedule-${j.planId}-${oe}`,idempotency_key:`digital-home-create-schedule-${j.planId}-${It}-${oe}`});if(!de.accepted)throw new Error(de.message||`调度命令未被接受:${de.command_id||"create_schedule"}`);at(null),L(`已提交定时:${j.title},${It} 按 cron 计划执行。`),await Et()}catch(de){ve.current&&P(de instanceof Error?de.message:"定时执行失败")}finally{ve.current&&F(null)}},[Et,It]),yp=w.useCallback(async j=>{var Y;if(!Fs(j)){P(Gd(j)),L(null);return}F(`execute:${j.id}`),P(null),L(null);try{const oe=new Set(f);if(oe.add(j.id),p(new Set(oe)),await ck(t,Array.from(oe)),!ve.current)return;li.current=!1,I(!1);const fe=await ZD(j.planId);if(fe.ok!==!0)throw new Error(fe.error||"执行接口未接受请求");const de=((Y=fe.dispatched_tasks)==null?void 0:Y.length)??0,Se=(await uk(j.planId)).dispatched??0;xt(null),L(`已触发执行:${j.title},已派发 ${de} 个步骤${Se>0?`,推进 ${Se} 个 Ready 步骤`:""}。`),await Et()}catch(oe){ve.current&&P(oe instanceof Error?oe.message:"执行失败")}finally{ve.current&&F(null)}},[Et,t,f]),Tu=w.useCallback(()=>{Vt(!1),Ze(t),II(t)},[t]),ss=w.useCallback((j,Y)=>{const oe=f.has(j.id),fe=Gd(j),de=Y==="manager"&&(An==null?void 0:An.id)===j.id;return c.jsxs("div",{className:`${dI(j,oe)} ${Y==="guide"?"de-duty-card--guide":""} ${de?"de-duty-card--previewed":""}`,title:j.summary,onMouseEnter:Y==="manager"?()=>ft(j.id):void 0,onFocus:Y==="manager"?()=>ft(j.id):void 0,children:[c.jsxs("label",{className:"de-task-manager-duty-check",children:[c.jsx("input",{type:"checkbox",checked:oe,disabled:!j.selectable||!j.implemented,onChange:()=>ls(j)}),c.jsx("span",{children:oe?"已选":j.implemented?"未选":"待扩展"})]}),c.jsxs("div",{className:"de-template-card-main",children:[c.jsxs("div",{className:"de-template-card-head",children:[c.jsx("span",{className:"de-template-card-name",children:j.title}),Y==="guide"?c.jsx("span",{className:`de-badge ${uI(j.statusTone)}`,children:j.implemented?j.statusLabel:"待扩展"}):null]}),Y==="guide"?c.jsx("p",{className:"de-template-card-desc",children:j.summary}):null,c.jsxs("div",{className:"de-template-card-meta",children:[c.jsx("span",{children:j.scheduleText}),Y==="guide"?c.jsx("span",{children:j.resultText}):null]}),Y==="guide"?c.jsxs("div",{className:"de-duty-card-foot",children:[c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!j.implemented,onClick:()=>{vt(!1),Vt(!1),ia(j)},children:[c.jsx(lo,{size:13,"aria-hidden":"true"}),c.jsx("span",{children:"执行流程"})]}),c.jsxs("div",{className:"de-duty-card-actions",children:[c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!j.implemented||N===`schedule:${j.id}`,onClick:()=>at(j),children:[c.jsx(Wx,{size:13,"aria-hidden":"true"}),c.jsx("span",{children:"定时"})]}),c.jsxs("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:!j.implemented||N===`execute:${j.id}`,title:fe||"立即执行此任务",onClick:()=>xt(j),children:[c.jsx(YE,{size:13,"aria-hidden":"true"}),c.jsx("span",{children:"执行"})]})]}),!j.implemented&&c.jsx("span",{className:"de-duty-selected-mark",children:"待扩展"})]}):null]})]},`${Y}-${j.id}`)},[N,f,An,ls]),Cl=w.useCallback(()=>{$(null),ie(!1)},[]),bp=w.useCallback(()=>{M(!1),ie(!1)},[]),$o=w.useCallback(()=>{M(!0),ie(!0)},[]),Eu=w.useCallback(j=>{$(null),M(!1),ie(!1),e({tab:"missions",date:t,missionId:j.conversation_id||j.id})},[e,t]),zo=w.useCallback(()=>{if(!$i){vt(!0);return}bt(!0)},[$i]),os=Math.min(Xr.width/Xh,Xr.height/Zh),Oo=Number.isFinite(os)&&os>0?os:1,Tl=Math.max(Xh,Math.ceil(Xr.width/Oo)),vp={"--dhv2-scale":String(Oo),"--dhv2-design-width":`${Tl}px`,"--dhv2-design-height":`${Zh}px`};return c.jsxs("div",{className:"de-dashboard de-dashboard--compact",style:{position:"relative",height:"100%",minHeight:0,display:"flex",flexDirection:"column",overflow:"auto"},children:[c.jsx("div",{className:"de-connection-layer","aria-hidden":"true",children:c.jsxs("svg",{className:"de-connection-svg",viewBox:"0 0 1200 800",preserveAspectRatio:"none",children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"connGrad1",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[c.jsx("stop",{offset:"0%",stopColor:"rgba(79,172,254,0.25)"}),c.jsx("stop",{offset:"100%",stopColor:"rgba(0,242,254,0.1)"})]}),c.jsx("filter",{id:"connGlow",children:c.jsx("feGaussianBlur",{stdDeviation:"3"})})]}),c.jsx("path",{d:"M 80 180 Q 420 400, 580 350",stroke:"url(#connGrad1)",strokeWidth:"1.5",fill:"none",filter:"url(#connGlow)"}),c.jsx("path",{d:"M 120 620 Q 380 400, 560 380",stroke:"url(#connGrad1)",strokeWidth:"1.2",fill:"none",filter:"url(#connGlow)"}),c.jsx("path",{d:"M 640 360 Q 780 200, 1100 160",stroke:"url(#connGrad1)",strokeWidth:"1.3",fill:"none",filter:"url(#connGlow)"})]})}),c.jsx("div",{ref:bo,className:"dhv2-scale-viewport",children:c.jsx("div",{className:"dhv2-scale-stage",style:vp,children:c.jsxs("div",{className:"dhv2-home",children:[c.jsx("aside",{className:"dhv2-left","aria-label":"任务清单",children:c.jsxs("section",{className:"dhv2-panel dhv2-tasks",children:[c.jsxs("header",{className:"dhv2-panel-head dhv2-task-head",children:[c.jsx("h2",{children:"任务清单"}),c.jsxs("label",{className:"dhv2-date-field",children:[c.jsx(Wx,{size:15,"aria-hidden":"true"}),c.jsx("input",{type:"date",value:t,onChange:j=>{li.current=!1,I(!1),L(null),n(j.target.value||Mc())}})]}),c.jsx("button",{type:"button",disabled:x||N==="pull_plan_step_dispatch_policy",onClick:()=>{wu()},title:"从管理端拉取 PlanStep 派发策略",children:N==="pull_plan_step_dispatch_policy"?"拉取中...":"拉取策略"}),c.jsx("button",{type:"button",disabled:x||N==="pull_risk_approval_policy",onClick:()=>{mp()},title:"从管理端拉取风险审批策略",children:N==="pull_risk_approval_policy"?"拉取中...":"风险策略"}),c.jsx("button",{type:"button",disabled:x||N==="pull_route_decision_policy",onClick:()=>{hp()},title:"从管理端拉取入口路由策略",children:N==="pull_route_decision_policy"?"拉取中...":"路由策略"})]}),c.jsxs("div",{className:"dhv2-task-tabs",role:"tablist","aria-label":"任务清单筛选",children:[c.jsx("button",{type:"button",role:"tab","aria-selected":q!=="selected",className:q!=="selected"?"active":"",onClick:()=>Z("all"),children:"可选任务"}),c.jsxs("button",{type:"button",role:"tab","aria-selected":q==="selected",className:q==="selected"?"active":"",onClick:()=>Z("selected"),children:["已选任务 (",_u,")"]})]}),c.jsx("div",{className:"dhv2-task-list","aria-label":`${lp} ${jn.length} 项`,children:jn.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无任务模板,请先维护 PlanTemplate。"}):jn.map(j=>{const Y=Jh(j),oe=N===`execute:${j.id}`,fe=Gd(j);return c.jsxs("label",{className:`dhv2-task-row ${f.has(j.id)?"is-selected":""}`,onMouseEnter:de=>bu(j,de.currentTarget),onMouseLeave:()=>O(null),onFocus:de=>bu(j,de.currentTarget),onBlur:()=>O(null),children:[c.jsx("input",{type:"checkbox",checked:f.has(j.id),disabled:!j.selectable||!j.implemented||N==="update_task_selection",onChange:()=>ls(j)}),c.jsxs("span",{className:"dhv2-task-main",children:[c.jsx("strong",{children:j.title}),c.jsx("small",{children:j.scheduleText||"未配置任务周期"})]}),c.jsx("button",{type:"button",className:`dhv2-task-run-button ${Y||oe?"is-running":""}`,disabled:!Fs(j)||oe,title:Y||oe?"任务执行中":fe||"单独执行此任务","aria-label":`${Y||oe?"执行中":"执行"}:${j.title}`,onClick:de=>{de.preventDefault(),de.stopPropagation(),Fs(j)&&!oe&&(O(null),xt(j))},children:Y||oe?c.jsx("span",{"aria-hidden":"true"}):"执行"}),j.readyStepCount>0&&c.jsx("button",{type:"button",className:"dhv2-task-run-button",disabled:!!N,title:"推进此计划的 Ready 步骤","aria-label":`推进 Ready 步骤:${j.title}`,onClick:de=>{de.preventDefault(),de.stopPropagation(),_p(j)},children:"推进"})]},j.id)})}),(b.length>0||k)&&c.jsxs("div",{className:"de-task-agent-control-strip de-blocked-step-control-strip","aria-label":"PlanStep 阻塞处理",children:[k&&c.jsx("p",{className:"de-empty-text",children:k}),b.slice(0,2).map(j=>{const Y=F_(j);return c.jsxs("article",{className:"de-blocked-input-field",children:[c.jsxs("div",{children:[c.jsx("strong",{children:j.title}),c.jsx("small",{children:FI(j)})]}),c.jsx("button",{type:"button",disabled:!!N||!(Y!=null&&Y.task_id),onClick:()=>{Mo(j,"retry_task")},children:"重试前置"}),c.jsx("button",{type:"button",disabled:!!N||!(Y!=null&&Y.task_id),onClick:()=>{Mo(j,"skip_task")},children:"跳过前置"}),c.jsx("button",{type:"button",disabled:!!N||!j.task_id,onClick:()=>{var fe;const oe=(fe=window.prompt("补充阻塞步骤输入"))==null?void 0:fe.trim();oe&&Mo(j,"provide_task_input",{input:oe})},children:"补充输入"})]},j.step_id)})]}),c.jsx("footer",{className:"dhv2-task-actions",children:q==="selected"?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"dhv2-primary",disabled:N==="confirm_workday",onClick:()=>{R("working"),f.size>0&&!es&&ku()},children:N==="confirm_workday"?"执行中...":"确认执行"}),c.jsx("button",{type:"button",className:"dhv2-secondary-action",onClick:()=>{R("standby"),L("已取消首页执行态展示;如需停止后端执行,请进入任务中心处理。")},children:"取消执行"})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"dhv2-primary",onClick:()=>{Z("selected"),L("已确认当前任务选择,可切换到已选任务执行。")},children:"确认选择"}),c.jsx("button",{type:"button",className:"dhv2-secondary-action",onClick:()=>vt(!0),children:"任务清单"})]})}),ri&&ri.total>0&&c.jsxs("div",{className:"de-route-summary-strip","aria-label":"入口路由和治理审计摘要",children:[c.jsxs("span",{children:[c.jsx("em",{children:"入口路由"}),c.jsx("strong",{children:ri.total})]}),c.jsxs("span",{children:[c.jsx("em",{children:"治理审计"}),c.jsx("strong",{children:ri.governance_mapped_count??ri.mapped_count})]}),(ri.governance_blocked_count??0)>0&&c.jsxs("span",{className:"is-warning",children:[c.jsx("em",{children:"治理拦截"}),c.jsx("strong",{children:ri.governance_blocked_count})]}),c.jsxs("small",{children:[gr?`${gr.route_kind} / ${gr.intent_kind} · ${gr.status_label}`:"暂无路由决策",ri.policy_source?` · 策略${ri.policy_source==="remote"?"远端":"本地"}`:""]}),c.jsx("button",{type:"button",onClick:()=>e({tab:"interventions",interventionKind:"route_intervention"}),children:"打开介入台"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"policy-center"}),children:"打开策略中心"})]})]})}),c.jsxs("main",{className:"dhv2-center","aria-label":"数字员工工作现场",children:[c.jsxs("section",{className:"dhv2-work-panel",children:[c.jsxs("nav",{className:"dhv2-work-tabs","aria-label":"数字员工状态",children:[c.jsx("button",{type:"button",className:Q==="standby"?"active":"",onClick:()=>R("standby"),children:"待命中"}),c.jsx("button",{type:"button",className:Q==="working"?"active":"",onClick:()=>R("working"),children:"工作中"})]}),c.jsxs("div",{className:`dhv2-stage dhv2-stage--${be} ${Q==="working"?"is-working":"is-standby"}`,children:[c.jsx("img",{className:`dhv2-stage-image dhv2-stage-image--${be}`,src:rI[be],alt:"","aria-hidden":"true"},be),c.jsx("div",{ref:mr,className:`dhv2-action-map ${Ie.width>0?"is-ready":""}`,"aria-label":"数字员工正在处理的业务模块",children:jl.map(j=>{const Y=Ps.find(je=>je.id===j)??Ps[0],oe=EI(Y.id),fe=Y.id===be,de=fe&&wl&&Y.id===Sa;return c.jsxs("button",{ref:je=>Do(Y.id,je),type:"button",className:`dhv2-action-card dhv2-action-card--${Y.id} ${fe?"is-active":""} ${de?"is-running":""}`,"aria-current":fe?"step":void 0,"aria-pressed":fe,onClick:()=>{R("working"),Ee(Y.id)},onPointerEnter:()=>as(Y.id,!0),onPointerMove:op,onPointerLeave:()=>as(Y.id,!1),onFocus:()=>as(Y.id,!0),onBlur:()=>as(Y.id,!1),children:[c.jsx("i",{children:c.jsx(oe,{size:22,"aria-hidden":"true"})}),c.jsxs("div",{children:[fe&&c.jsx("span",{children:"当前正在执行"}),c.jsx("strong",{children:fe?yu:Y.label}),c.jsx("em",{children:fe?rp:Y.detail})]}),de&&c.jsxs("svg",{className:"dhv2-action-edge-loader",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:[c.jsx("rect",{className:"dhv2-action-edge-loader__track",x:"1",y:"1",width:"98",height:"98",rx:"5",ry:"5",pathLength:"100"}),c.jsx("rect",{className:"dhv2-action-edge-loader__pulse dhv2-action-edge-loader__pulse--primary",x:"1",y:"1",width:"98",height:"98",rx:"5",ry:"5",pathLength:"100"}),c.jsx("rect",{className:"dhv2-action-edge-loader__pulse dhv2-action-edge-loader__pulse--secondary",x:"1",y:"1",width:"98",height:"98",rx:"5",ry:"5",pathLength:"100"})]})]},Y.id)})})]})]}),c.jsxs("section",{className:"dhv2-run-panel","aria-label":"今日任务明细",children:[c.jsxs("header",{children:[c.jsxs("div",{children:[c.jsx("h2",{children:"今日任务明细"}),c.jsx("p",{children:"可重复执行的任务按次数累计,运行明细展示最新动态日志。"})]}),c.jsx("button",{type:"button",onClick:$o,children:"运行明细"})]}),c.jsxs("div",{className:"dhv2-run-table",children:[c.jsxs("div",{className:"dhv2-run-head","aria-hidden":"true",children:[c.jsx("span",{children:"任务名称"}),c.jsx("span",{children:"任务总数"}),c.jsx("span",{children:"运行成效"}),c.jsx("span",{children:"运行明细"})]}),Ii.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无已选任务,确认任务后这里会显示真实执行明细。"}):Ii.map(j=>{const Y=AI(j.id);return c.jsxs("div",{className:`dhv2-run-row ${j.active?"is-active":""} ${j.streaming?"is-streaming":""} dhv2-run-row--${j.tone}`,children:[c.jsxs("span",{className:"dhv2-run-name",children:[c.jsx("i",{children:c.jsx(Y,{size:20,"aria-hidden":"true"})}),c.jsx("strong",{children:j.title})]}),c.jsx("span",{className:"dhv2-run-total",children:c.jsx("strong",{children:c.jsx(In,{value:j.total,unit:"次"})})}),c.jsxs("span",{className:"dhv2-run-effect",children:[c.jsxs("strong",{children:[c.jsx(In,{value:j.success}),"/",c.jsx(In,{value:j.failure})]}),c.jsx("small",{children:"成功/失败"})]}),c.jsxs("span",{className:"dhv2-run-log",tabIndex:0,onMouseEnter:oe=>vu(j,oe.currentTarget),onMouseLeave:()=>ae(null),onFocus:oe=>vu(j,oe.currentTarget),onBlur:()=>ae(null),children:[j.streaming&&c.jsxs("i",{className:"dhv2-run-live-dots","aria-hidden":"true",children:[c.jsx("b",{}),c.jsx("b",{}),c.jsx("b",{})]}),c.jsx(GI,{text:j.log,active:j.streaming})]})]},`${j.id}-${j.logKey}`)})]})]})]}),c.jsxs("aside",{className:"dhv2-right","aria-label":"今日执行、工作日报、AI 沟通",children:[c.jsxs("section",{className:"dhv2-panel dhv2-today",children:[c.jsxs("header",{className:"dhv2-panel-head",children:[c.jsx("h2",{children:"今日执行"}),c.jsx("button",{type:"button","aria-label":"刷新今日执行",children:c.jsx(Xx,{size:16,"aria-hidden":"true"})})]}),c.jsxs("div",{className:"dhv2-metrics",children:[c.jsxs("header",{className:"dhv2-metrics-title",children:[c.jsx("span",{children:"业务类型"}),c.jsx("strong",{children:c.jsx(In,{value:Wn.filter(j=>j.value>0).length,unit:"类"})})]}),Wn.map(j=>c.jsxs("div",{className:`dhv2-metric dhv2-metric--${j.id}`,title:`${j.label}:${j.value}${j.unit}任务,执行 ${j.total} 次,成功 ${j.success} 次,失败 ${j.failure} 次`,children:[c.jsx("span",{children:j.label}),c.jsx("strong",{children:c.jsx(In,{value:j.value,unit:j.unit})})]},j.id))]}),c.jsxs("div",{className:"dhv2-chart",children:[c.jsxs("header",{children:[c.jsx("strong",{children:"操作类型执行情况"}),c.jsx("span",{children:"成功 / 失败次数"})]}),c.jsx("div",{children:xi.length===0?c.jsx("span",{className:"de-empty-text",children:"暂无执行统计"}):xi.map(j=>c.jsxs("span",{className:`dhv2-bar dhv2-bar--${j.id}`,children:[c.jsxs("span",{className:"dhv2-bar-pair","aria-hidden":"true",children:[c.jsx("i",{style:{height:`${Math.max(j.success/So*100,10)}%`}}),c.jsx("i",{className:"is-failure",style:{height:`${Math.max(j.failure/So*100,8)}%`}})]}),c.jsxs("strong",{children:[c.jsx(In,{value:j.success}),"/",c.jsx(In,{value:j.failure})]}),c.jsx("em",{children:j.label})]},j.id))})]})]}),Jn&&c.jsxs("section",{className:"dhv2-panel de-diagnostic-summary-strip","aria-label":"诊断审计和成本摘要",children:[c.jsxs("header",{className:"dhv2-panel-head",children:[c.jsx("h2",{children:"诊断审计"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"ops-workbench",opsKind:(Fn==null?void 0:Fn.source)==="audit"?"audit":"diagnostic"}),children:"打开处置台"})]}),c.jsxs("div",{className:"dhv2-ai-stats",children:[c.jsxs("div",{className:`dhv2-ai-stat ${xo>0?"is-warning":""}`,children:[c.jsx("span",{children:"诊断异常"}),c.jsx("strong",{children:c.jsx(In,{value:xo})})]}),c.jsxs("div",{className:`dhv2-ai-stat ${xa>0?"is-warning":""}`,children:[c.jsx("span",{children:"审计风险"}),c.jsx("strong",{children:c.jsx(In,{value:xa})})]}),c.jsxs("div",{className:"dhv2-ai-stat",children:[c.jsx("span",{children:"Token"}),c.jsx("strong",{children:UI(Jn.cost.total_tokens)})]}),c.jsxs("div",{className:"dhv2-ai-stat",children:[c.jsx("span",{children:"估算成本"}),c.jsx("strong",{children:HI(Jn.cost.estimated_cost_usd)})]})]}),c.jsx("p",{className:"de-empty-text",style:{margin:"10px 0 0"},children:Fn?`${Fn.category} · ${Fn.message}`:"诊断、审计和成本投影正常"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"ops-workbench",opsKind:(Fn==null?void 0:Fn.source)==="audit"?"audit":"diagnostic"}),children:"打开处置台"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"notification-workbench",notificationKind:"all"}),children:"打开通知运营"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"scheduler-workbench"}),children:"打开调度运营"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"skill-audit"}),children:"打开技能审计"})]}),c.jsxs("section",{className:"dhv2-panel dhv2-report",children:[c.jsxs("header",{className:"dhv2-panel-head",children:[c.jsx("h2",{children:"工作日报"}),c.jsx("span",{className:(Me==null?void 0:Me.status)==="ready"?"is-ready":"is-pending",children:(Me==null?void 0:Me.status)==="ready"?"已生成":"待生成"})]}),c.jsx("div",{className:"dhv2-report-modes",role:"tablist","aria-label":"报告类型",children:sI.map(j=>c.jsx("button",{type:"button",className:kt===j.id?"active":"",onClick:()=>wn(j.id),children:j.label},j.id))}),c.jsx("div",{className:"dhv2-report-time",children:kt==="custom"?c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["开始时间",c.jsx("input",{type:"date",value:pt,onChange:j=>Zn(j.target.value||t)})]}),c.jsxs("label",{children:["结束时间",c.jsx("input",{type:"date",value:Bt,onChange:j=>yl(j.target.value||t)})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["生成时间",c.jsx("input",{type:"time",value:fn,onChange:j=>rn(j.target.value||"18:00")})]}),c.jsx("button",{type:"button",disabled:N==="update_report_schedule",onClick:()=>{up()},children:"设置时间"})]})}),c.jsxs("div",{className:"dhv2-report-actions",children:[c.jsx("button",{type:"button",className:"dhv2-primary",disabled:N==="generate_daily_report",onClick:()=>{dp()},children:N==="generate_daily_report"?"生成中...":kt==="custom"?"生成自定义报告":"生成工作报告"}),c.jsx("button",{type:"button",disabled:!mu,onClick:()=>He(!0),children:"预览日报"}),c.jsx("button",{type:"button",disabled:!(Me!=null&&Me.pdf_available)||N==="download_report_pdf",onClick:()=>{Su()},children:"打开PDF"}),c.jsx("button",{type:"button",disabled:!(Me!=null&&Me.pdf_available)||N==="open_report_folder",onClick:rs,children:"打开文件夹"}),c.jsx("button",{type:"button",onClick:()=>e({tab:"daily-report-workbench"}),children:"打开日报运营"})]})]}),c.jsxs("section",{className:"dhv2-panel dhv2-ai",children:[c.jsxs("header",{className:"dhv2-panel-head",children:[c.jsx("h2",{children:"AI 沟通"}),c.jsx("button",{type:"button",onClick:zo,children:"展开"})]}),c.jsxs("div",{className:"dhv2-ai-body","aria-label":"AI 沟通统计",children:[c.jsxs("div",{className:"dhv2-ai-stats",children:[c.jsxs("div",{className:"dhv2-ai-stat",children:[c.jsx("span",{children:"与本人"}),c.jsx("strong",{children:c.jsx(In,{value:jo})})]}),c.jsxs("div",{className:"dhv2-ai-stat",children:[c.jsx("span",{children:"与同事"}),c.jsx("strong",{children:c.jsx(In,{value:Co})})]}),c.jsxs("div",{className:"dhv2-ai-stat",children:[c.jsx("span",{children:"总交互"}),c.jsx("strong",{children:c.jsx(In,{value:xl})})]})]}),c.jsx("div",{className:"dhv2-ai-channels",children:zi.channelMetrics.map(j=>c.jsxs("div",{className:`dhv2-ai-channel dhv2-ai-channel--${j.id}`,title:`${j.label}:${j.value} 次`,children:[c.jsxs("span",{children:[j.label,j.id==="phone"&&c.jsx("small",{children:zi.phoneTypeMetrics.map(Y=>`${Y.label} ${Y.value}`).join(" / ")})]}),c.jsx("i",{style:{width:`${Math.max(j.value/ip*100,j.value>0?16:4)}%`}}),c.jsx("b",{children:c.jsx(In,{value:j.value})})]},j.id))})]}),c.jsxs("div",{className:"dhv2-ai-feed",children:[c.jsxs("div",{className:"dhv2-ai-message",children:[c.jsx("img",{src:JL,alt:""}),c.jsx("p",{children:Pa})]}),c.jsx("div",{className:"dhv2-ai-message dhv2-ai-message--user",children:c.jsx("p",{children:tn?`待确认:${tn.title}`:"可查看运行明细,或补充材料调整当前执行单。"})})]}),c.jsxs("button",{type:"button",className:"dhv2-ai-input",onClick:zo,children:[c.jsx("span",{children:"输入补充说明或问题..."}),c.jsx(Xx,{size:16,"aria-hidden":"true"})]})]})]})]})})}),U&&c.jsxs("div",{className:"dhv2-task-hover-panel",style:{left:U.left,top:U.top},role:"tooltip",children:[c.jsx("strong",{children:U.title}),c.jsxs("dl",{children:[c.jsxs("div",{children:[c.jsx("dt",{children:"面向对象"}),c.jsx("dd",{children:U.audience})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"任务描述"}),c.jsx("dd",{children:U.description})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"任务周期"}),c.jsx("dd",{children:U.schedule})]})]})]}),G&&c.jsxs("div",{className:"dhv2-run-log-hover-panel",style:{left:G.left,top:G.top},role:"tooltip",children:[c.jsx("strong",{children:G.title}),c.jsxs("dl",{children:[c.jsxs("div",{children:[c.jsx("dt",{children:"时间"}),c.jsx("dd",{children:G.time})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"状态"}),c.jsx("dd",{children:G.status})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"详情"}),c.jsx("dd",{children:G.detail})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"原始信息"}),c.jsx("dd",{children:G.raw})]})]})]}),it&&c.jsx(Aa,{variant:"drawer",size:"drawer",title:"AI / 执行单会话",description:Ha,className:"dhv2-plan-chat-overlay",surfaceClassName:"dhv2-plan-chat-drawer",bodyClassName:"dhv2-plan-chat-body dhv2-plan-chat-body--embedded",onClose:()=>bt(!1),headerActions:c.jsxs("div",{className:"dhv2-plan-chat-head-actions",children:[c.jsxs("span",{className:"dhv2-plan-chat-status",children:[c.jsx(Jx,{size:13,"aria-hidden":"true"}),c.jsx("span",{children:ts})]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",title:"查看运行明细",onClick:$o,children:[c.jsx(lo,{size:14,"aria-hidden":"true"}),c.jsx("span",{children:"运行明细"})]}),c.jsxs("button",{type:"button",className:"de-btn-primary de-btn-sm",title:"进入执行单",onClick:()=>St?Cu(St):vt(!0),children:[c.jsx(b_,{size:14,"aria-hidden":"true"}),c.jsx("span",{children:"进入执行单"})]})]}),children:gu?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dhv2-plan-chat-context-stack",children:[c.jsxs("div",{className:"dhv2-plan-chat-context-strip",children:[c.jsx("span",{children:"当前进展"}),c.jsx("p",{children:Pa})]}),tn&&c.jsx(pM,{decision:tn,busyAction:N,compact:!0,className:"dhv2-plan-chat-approval",onResolve:(j,Y)=>{ju(j,Y)},onViewContext:j=>e({tab:"missions",date:t,missionId:h0(j),taskId:j.task_id||void 0})})]}),c.jsx("div",{className:"dhv2-planb-chat-embed",children:c.jsx(QL,{plan:gu,onBack:()=>bt(!1),mode:"conversation",contextText:No})})]}):c.jsx("p",{className:"de-empty-text",children:"请先选择或执行一项任务,生成执行单后再进入 AI 沟通。"})}),ze&&Me&&c.jsxs(Aa,{title:Me.title||"数字员工日报",eyebrow:"日报预览",description:`${ap} 生成时间 ${Me.report_schedule_time},来源:${Me.generated_by==="ai"?"AI 生成":"未生成"}`,size:"document",className:"dhv2-report-preview-overlay",surfaceClassName:"de-report-preview-modal",bodyClassName:"dhv2-report-preview-body",onClose:()=>He(!1),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>He(!1),children:"关闭"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!Me.pdf_available||N==="download_report_pdf",onClick:()=>{Su()},children:"打开PDF"}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!Me.pdf_available||N==="open_report_folder",onClick:rs,children:[c.jsx(I1,{size:14,"aria-hidden":"true"}),N==="open_report_folder"?"打开中...":"打开文件夹"]})]}),children:[c.jsxs("div",{className:"de-report-preview-summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"任务总数"}),c.jsx("strong",{children:c.jsx(In,{value:la})})]}),c.jsxs("div",{children:[c.jsx("span",{children:"执行次数"}),c.jsx("strong",{children:c.jsx(In,{value:To})})]}),c.jsxs("div",{children:[c.jsx("span",{children:"成功次数"}),c.jsx("strong",{children:c.jsx(In,{value:Eo})})]}),c.jsxs("div",{children:[c.jsx("span",{children:"失败次数"}),c.jsx("strong",{children:c.jsx(In,{value:kl})})]})]}),c.jsx("div",{className:"de-report-preview-content",children:ka.length===0?c.jsx("p",{className:"de-empty-text",children:"当前日报暂无可预览文字。"}):ka.map((j,Y)=>c.jsx("p",{children:j},`${Y}-${j}`))})]}),le&&c.jsx(Aa,{title:"特性设置",eyebrow:"数字员工资料",description:"维护数字员工在首页展示的姓名、单位、岗位和工作模式。",size:"small",surfaceClassName:"de-profile-settings-modal",bodyClassName:"dhv2-profile-settings-body",onClose:()=>ge(!1),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>ge(!1),children:"取消"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:N==="update_profile",onClick:()=>{cp()},children:N==="update_profile"?"保存中...":"保存设置"})]}),children:c.jsxs("div",{className:"de-profile-settings-grid",children:[c.jsxs("label",{children:[c.jsx("span",{children:"姓名"}),c.jsx("input",{value:Pe.name,onChange:j=>Gt(Y=>({...Y,name:j.target.value}))})]}),c.jsxs("label",{children:[c.jsx("span",{children:"单位"}),c.jsx("input",{value:Pe.company,onChange:j=>Gt(Y=>({...Y,company:j.target.value}))})]}),c.jsxs("label",{children:[c.jsx("span",{children:"岗位"}),c.jsx("input",{value:Pe.position,onChange:j=>Gt(Y=>({...Y,position:j.target.value}))})]}),c.jsxs("div",{className:"de-profile-status-toggle",children:[c.jsx("span",{children:"工作模式"}),c.jsxs("div",{children:[c.jsx("button",{type:"button",className:Pe.currentStatus==="working"?"active":"",onClick:()=>Gt(j=>({...j,currentStatus:"working"})),children:"工作中"}),c.jsx("button",{type:"button",className:Pe.currentStatus==="resting"?"active":"",onClick:()=>Gt(j=>({...j,currentStatus:"resting"})),children:"休息中"})]})]})]})}),J&&c.jsxs(Aa,{title:"执行记录详情",eyebrow:"当前记录",description:"这条记录已被锁定,滚动不会把它刷掉。",size:"small",surfaceClassName:"de-event-detail-modal",bodyClassName:"dhv2-event-detail-body",onClose:Cl,actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:Cl,children:"关闭"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",onClick:()=>Eu(J),children:"打开任务中心详情"})]}),children:[c.jsxs("div",{className:"de-event-detail-grid",children:[c.jsxs("div",{children:[c.jsx("span",{children:"业务"}),c.jsx("strong",{children:J.plan_title})]}),c.jsxs("div",{children:[c.jsx("span",{children:"操作"}),c.jsx("strong",{children:J.task_title})]}),c.jsxs("div",{children:[c.jsx("span",{children:"状态"}),c.jsx("strong",{children:c0(J)})]}),c.jsxs("div",{children:[c.jsx("span",{children:"计划时间"}),c.jsx("strong",{children:hj(J)})]}),c.jsxs("div",{children:[c.jsx("span",{children:"执行时间"}),c.jsx("strong",{children:Mf(J)})]}),c.jsxs("div",{children:[c.jsx("span",{children:"数据来源"}),c.jsx("strong",{children:Oi})]})]}),c.jsxs("div",{className:"de-event-detail-result",children:[c.jsx("span",{children:"操作结果"}),c.jsx("p",{children:Br(J)})]})]}),z&&c.jsxs(Aa,{title:"运行明细",eyebrow:"全部执行记录",description:`当前日期共 ${Nn.length} 条记录,本窗口展示最新 ${Math.min(Ba.length,l0)} 条。`,size:"wide",surfaceClassName:"de-event-history-modal",bodyClassName:"dhv2-event-history-body",onClose:bp,children:[c.jsx("div",{className:"de-event-history-toolbar",children:eI.map(j=>c.jsx("button",{type:"button",className:`de-filter-chip ${_e===j.id?"active":""}`,onClick:()=>we(j.id),children:j.label},j.id))}),c.jsx("div",{className:"de-event-history-list",children:Ba.length===0?c.jsx("p",{className:"de-empty-text",children:"当前筛选下没有执行记录。"}):vo.map(j=>c.jsxs("button",{type:"button",className:`de-event-history-row de-live-feed-row--${j.status_tone||"info"}`,onClick:()=>{$(j),M(!1),ie(!0)},children:[c.jsxs("span",{children:[c.jsx("em",{children:"业务"}),c.jsx("strong",{children:j.plan_title})]}),c.jsxs("span",{children:[c.jsx("em",{children:"操作"}),c.jsx("strong",{children:j.task_title})]}),c.jsxs("span",{children:[c.jsx("em",{children:"状态"}),c.jsx("strong",{children:c0(j)})]}),c.jsxs("span",{children:[c.jsx("em",{children:"操作结果"}),c.jsx("strong",{children:Br(j)}),c.jsx("small",{children:u0(j)})]})]},j.id))})]}),wt&&c.jsx(Aa,{title:"定时任务",eyebrow:"调度设置",description:"定时会把任务注册到后端调度链路,每天按设置时间自动派发。",size:"medium",className:"de-plan-action-overlay",surfaceClassName:"de-plan-action-modal",bodyClassName:"dhv2-plan-action-body",onClose:()=>at(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>at(null),children:"取消"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:N===`schedule:${wt.id}`,onClick:()=>{gp(wt)},children:N===`schedule:${wt.id}`?"注册中...":"确认定时"})]}),children:c.jsxs("div",{className:"de-plan-action-body",children:[c.jsxs("div",{className:"de-event-detail-result",children:[c.jsx("span",{children:"任务"}),c.jsx("p",{children:wt.title})]}),c.jsxs("label",{className:"de-plan-action-field",children:[c.jsx("span",{children:"每日定时时间"}),c.jsx("input",{type:"time",value:It,onChange:j=>Oa(j.target.value||"09:00")})]}),c.jsxs("div",{className:"de-event-detail-grid de-plan-action-grid",children:[c.jsxs("div",{children:[c.jsx("span",{children:"调度注册"}),c.jsx("strong",{children:o0(It)})]}),c.jsxs("div",{children:[c.jsx("span",{children:"步骤数"}),c.jsxs("strong",{children:[wt.stepCount," 步"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"调用能力"}),c.jsxs("strong",{children:[wt.taskCount," 项"]})]})]}),c.jsx("div",{className:"de-schedule-result de-schedule-result--success",children:"这里不是本地假定时;提交后如果后端调度链路不可用,会直接显示真实失败原因。"})]})}),qe&&c.jsx(Aa,{title:"执行任务",eyebrow:"立即派发",description:"确认后立即创建并派发任务步骤,不需要先进入任务中心设置。",size:"medium",className:"de-plan-action-overlay",surfaceClassName:"de-plan-action-modal",bodyClassName:"dhv2-plan-action-body",onClose:()=>xt(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>xt(null),children:"取消"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:N===`execute:${qe.id}`||!Fs(qe),onClick:()=>{yp(qe)},children:N===`execute:${qe.id}`?"触发中...":"确认执行"})]}),children:c.jsxs("div",{className:"de-plan-action-body",children:[c.jsxs("div",{className:"de-event-detail-result",children:[c.jsx("span",{children:"任务"}),c.jsx("p",{children:qe.title})]}),c.jsxs("div",{className:"de-event-detail-grid de-plan-action-grid",children:[c.jsxs("div",{children:[c.jsx("span",{children:"执行状态"}),c.jsx("strong",{children:qe.statusLabel})]}),c.jsxs("div",{children:[c.jsx("span",{children:"步骤数"}),c.jsxs("strong",{children:[qe.stepCount," 步"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"调用能力"}),c.jsxs("strong",{children:[qe.taskCount," 项"]})]})]}),c.jsx("div",{className:`de-schedule-result ${Fs(qe)?"de-schedule-result--success":"de-schedule-result--pending"}`,children:Fs(qe)?"确认后立即调用后端派发接口,按任务步骤进入真实执行链路。":Gd(qe)})]})}),lt&&c.jsxs(Aa,{title:"执行流程",eyebrow:"PlanTemplate 步骤",description:`${lt.title} 的执行单会按这些步骤运行,当前步骤在流程图上高亮。`,size:"wide",className:"de-plan-flow-overlay",surfaceClassName:"de-plan-flow-modal",bodyClassName:"dhv2-plan-flow-body",onClose:()=>ia(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>ia(null),children:"关闭"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",onClick:()=>Cu(lt),children:"打开任务中心详情"})]}),children:[c.jsxs("div",{className:"de-plan-flow-head",children:[c.jsxs("div",{children:[c.jsx("span",{children:"执行单"}),c.jsx("strong",{children:lt.title}),c.jsx("p",{children:(aa==null?void 0:aa.business_summary)??lt.summary})]}),c.jsxs("div",{children:[c.jsx("span",{children:"当前步骤"}),c.jsx("strong",{children:(Gn==null?void 0:Gn.title)??"等待步骤事件"}),c.jsx("p",{children:Ua?Br(Ua):lt.resultText})]}),c.jsxs("div",{children:[c.jsx("span",{children:"状态"}),c.jsx("strong",{children:(aa==null?void 0:aa.latest_status_label)??lt.statusLabel}),c.jsx("p",{children:lt.scheduleText})]})]}),c.jsx("div",{className:"de-plan-flow-map","aria-label":`${lt.title} 执行流程图`,children:vl.map((j,Y)=>c.jsxs("div",{className:`de-plan-flow-step is-${j.status}`,children:[c.jsx("span",{className:"de-plan-flow-node",children:j.status==="done"?c.jsx(VE,{size:18,"aria-hidden":"true"}):j.status==="active"?c.jsx(Jx,{size:18,"aria-hidden":"true"}):c.jsx("span",{children:Y+1})}),c.jsxs("div",{className:"de-plan-flow-card",children:[c.jsxs("em",{children:["步骤 ",Y+1]}),c.jsx("strong",{children:j.title}),c.jsx("p",{children:j.meta}),j.status==="active"&&c.jsx(VI,{value:68,label:`${j.title}正在执行`})]}),Y<vl.length-1&&c.jsx("span",{className:`de-plan-flow-connector is-${j.status}`})]},j.id))}),c.jsx("div",{className:"de-plan-flow-foot",children:c.jsx("span",{children:"流程图来自当前任务模板的步骤数和能力列表;真实执行时,完成、当前、待执行状态由 Plan / Step / Event 推进。"})})]}),La&&ns&&c.jsxs(Aa,{title:"开始今天的任务",eyebrow:"开工确认",description:"像值班员早上交接一样,先确认日期和执行内容,再让数字员工开始接单、外呼、汇总和汇报。",size:"large",className:"de-workday-guide-overlay",surfaceClassName:"de-task-manager-modal de-workday-guide-modal",bodyClassName:"dhv2-workday-guide-shell-body",onClose:Tu,children:[c.jsx("div",{className:"de-workday-guide-steps","aria-label":"开工引导步骤",children:oI.map((j,Y)=>c.jsxs("div",{className:"de-workday-guide-step",children:[c.jsx("span",{children:Y+1}),c.jsx("strong",{children:j.title}),c.jsx("p",{children:j.body})]},j.title))}),c.jsxs("div",{className:"de-workday-guide-body",children:[c.jsxs("section",{className:"de-task-manager-column de-workday-guide-column",children:[c.jsxs("div",{className:"de-task-manager-section-head",children:[c.jsxs("div",{children:[c.jsx("strong",{children:"选择今天要执行的任务"}),c.jsxs("span",{children:[jt.length," 项已选,",xn.length," 项总任务,",Ia.length," 项待选择"]})]}),c.jsx("span",{className:`de-badge ${Ao}`,children:Oi})]}),c.jsx("div",{className:"de-workday-guide-duty-list",children:x?c.jsx("div",{className:"de-loading-skeleton",style:{height:220}}):vn.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无任务模板,首页不再展示硬编码任务。请先维护 PlanTemplate。"}):vn.map(j=>ss(j,"guide"))})]}),c.jsxs("aside",{className:"de-workday-guide-side",children:[c.jsxs("div",{className:"de-workday-guide-summary",children:[c.jsx("span",{children:"日期"}),c.jsx("strong",{children:t}),c.jsx("p",{children:yr})]}),c.jsxs("div",{className:"de-workday-guide-summary",children:[c.jsx("span",{children:"确认后会发生什么"}),c.jsx("strong",{children:"右侧进入执行滚动"}),c.jsx("p",{children:"首页会展示当前动作、下一步、操作状态和操作结果;需要人工决策时会在右侧停下来提示。"})]}),(B||se||(a==null?void 0:a.demo_reason))&&c.jsx("div",{className:`de-schedule-result ${B?"de-schedule-result--error":"de-schedule-result--success"}`,children:B||(se?"已调整任务勾选,点击确认后生效。":a==null?void 0:a.demo_reason)}),c.jsxs("div",{className:"de-workday-guide-actions",children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:Tu,children:"稍后设置"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:N==="confirm_workday"||x,onClick:()=>{ku()},children:N==="confirm_workday"?"确认中...":"确认并开始任务"})]})]})]})]}),Lt&&c.jsx(Aa,{title:"任务清单",eyebrow:"执行规则",description:"像员工早上确认工作一样,勾选今天要执行的内容,必要时进入详情或处理待决策事项。",size:"large",surfaceClassName:"de-task-manager-modal",bodyClassName:"dhv2-task-manager-shell-body",onClose:()=>vt(!1),children:c.jsxs("div",{className:"de-task-manager-modal-body",children:[c.jsxs("section",{className:"de-task-manager-column de-task-manager-column--duties",children:[c.jsx("div",{className:"de-task-manager-section-head",children:c.jsxs("div",{children:[c.jsx("strong",{children:"可选任务清单"}),c.jsxs("span",{children:[jt.length," 项已选,",xn.length," 项总任务,",Ia.length," 项待选择"]})]})}),c.jsx("div",{className:"de-task-manager-duty-list",children:x?c.jsx("div",{className:"de-loading-skeleton",style:{height:180}}):vn.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无任务模板,首页不会显示硬编码任务。请先维护 PlanTemplate。"}):vn.map(j=>ss(j,"manager"))})]}),c.jsxs("aside",{className:"de-task-manager-column de-task-manager-column--actions de-task-manager-column--preview",children:[c.jsx("div",{className:"de-task-manager-section-head",children:c.jsxs("div",{children:[c.jsx("strong",{children:"任务说明"}),c.jsx("span",{children:"鼠标移入左侧任务,查看工作内容和协同方式"})]})}),c.jsxs("div",{className:"de-task-manager-preview-panel",children:[An?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"de-task-manager-preview-title",children:[c.jsx("span",{children:f.has(An.id)?"已选任务":"可选任务"}),c.jsx("strong",{children:An.title}),c.jsx("em",{children:An.scheduleText||"未配置任务周期"})]}),c.jsxs("section",{className:"de-task-manager-brief-card",children:[c.jsx("span",{children:"工作任务描述"}),c.jsx("p",{children:An.summary||"暂无任务描述。"})]}),c.jsxs("section",{className:"de-task-manager-brief-card",children:[c.jsx("span",{children:"工作协同 / 外部协同情况"}),c.jsx("p",{children:RI(An)})]}),c.jsxs("dl",{className:"de-task-manager-preview-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"面向对象"}),c.jsx("dd",{children:g0(An)})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"执行规模"}),c.jsx("dd",{children:An.resultText||`${An.stepCount} 个步骤`})]})]})]}):c.jsx("p",{className:"de-empty-text",children:"暂无任务模板,右侧将在任务加载后展示说明。"}),c.jsxs("section",{className:"de-task-manager-decision-summary",children:[c.jsxs("header",{children:[c.jsx("strong",{children:"待解决事项"}),c.jsx("span",{children:va.length>0?`${va.length} 项需要人处理`:"暂无阻塞事项"}),c.jsx("button",{type:"button",disabled:x||N==="pull_approval_updates",onClick:()=>{fp()},title:"从管理端拉取审批更新",children:N==="pull_approval_updates"?"拉取中...":"审批更新"})]}),((a==null?void 0:a.decisions)??[]).length===0?c.jsx("p",{children:"没有需要你确认的事项。"}):c.jsx("div",{className:"de-task-manager-decision-compact-list",children:((a==null?void 0:a.decisions)??[]).slice(0,3).map(j=>{var fe,de;const Y=Ic(j),oe=(fe=j.conflict)==null?void 0:fe.active;return c.jsxs("article",{className:"de-task-manager-decision-compact-card",children:[c.jsxs("div",{children:[c.jsx("strong",{children:j.title}),c.jsx("span",{children:j.status_label})]}),oe&&c.jsx("span",{className:"de-badge de-badge-danger",children:"跨端冲突"}),c.jsx("p",{children:j.scenario}),oe&&c.jsxs("p",{children:["冲突保护:本地审批事实不会被静默覆盖,远端状态 ",((de=j.conflict)==null?void 0:de.remote_status)||"未知",",请保留本地、采纳管理端或标记已复核。"]}),c.jsxs("div",{className:"de-task-manager-decision-compact-actions",children:[j.actions.slice(0,2).map(je=>c.jsx("button",{type:"button",disabled:!!oe||N===`${Y}:${je.id}`||!m0(j.status),onClick:()=>{ju(j,je.id)},children:N===`${Y}:${je.id}`?"处理中...":je.label},je.id)),oe&&[["keep_local","保留本地"],["accept_remote","采纳管理端"],["mark_reviewed","标记已复核"]].map(([je,Se])=>{const Ae=`${Y}:conflict:${je}`;return c.jsx("button",{type:"button",disabled:N===Ae,onClick:()=>{pp(j,je)},children:N===Ae?"记录中...":Se},je)}),c.jsxs("button",{type:"button",onClick:()=>e({tab:"missions",date:t,missionId:h0(j),taskId:j.task_id||void 0}),children:[c.jsx(b_,{size:13,"aria-hidden":"true"}),c.jsx("span",{children:"上下文"})]})]})]},Y)})})]})]})]})]})})]})}function yi({children:e,className:t="",style:n}){return c.jsx("div",{className:`de-card ${t}`,style:n,children:e})}function Mi({title:e,children:t}){return c.jsxs("div",{className:"de-card-title-bar",children:[c.jsx("span",{className:"de-card-title-bar-text",children:e}),t]})}const KI={info:"de-badge-info",success:"de-badge-success",warning:"de-badge-warning",danger:"de-badge-danger"};function G_({variant:e,label:t}){return c.jsx("span",{className:`de-badge ${KI[e]}`,children:t})}function V_(e){return Array.isArray(e)?e:[]}function Kd(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ut(e,t=""){return typeof e=="string"?e:typeof e=="number"?String(e):t}function yo(e){return/[\u4e00-\u9fff]/.test(e)}const y0={queued:"排队中",ready:"就绪",idle:"待执行",pending:"待处理",pending_authorization:"待授权",waiting_input:"待输入",draft:"草稿",reviewing:"审核中",approved:"已批准",preparing:"准备中",running:"执行中",active:"运行中",blocked:"已阻塞",succeeded:"已完成",success:"成功",finished:"已完成",complete:"已完成",completed:"已完成",failed:"失败",error:"错误",cancelled:"已取消",canceled:"已取消",aborted:"已终止",rejected:"已拒绝",deferred:"已暂缓",dispatched:"已下发",scheduled:"已设置定时",enabled:"已启用",disabled:"已停用",paused:"已暂停",unknown:"未知"},b0={plan:"计划",task:"任务",task_running:"处理中",task_done:"任务完成",run:"执行开始",run_done:"执行完成",skill_tool:"技能调用",artifact:"产物",task_summary:"结果",entered_session:"会话",start:"目标",RunStarted:"开始调用",RequestDispatched:"请求已发出",ResponseReceived:"收到返回",RunSkipped:"本次跳过",RunCompleted:"执行完成",waiting_for_authorization:"等待授权",pending_authorization:"等待授权",authorization_approved:"授权通过",authorization_rejected:"授权拒绝",authorization_deferred:"稍后处理",failed:"执行失败",completed:"执行完成"};function ni(e,t="未知"){const n=ut(e).trim();if(!n)return t;const a=y0[n]??y0[n.toLowerCase()];return a||(yo(n)?n:t)}function QI(e){const t=ut(e).trim();return t?b0[t]??b0[t.toLowerCase()]??(yo(t)?t:"事件"):"事件"}function yj(e,t="暂无事件内容"){const n=ut(e).trim();if(!n)return t;if(yo(n))return n;const a=ni(n,"");if(a)return a;const r=n.match(/^(Succeeded|Failed|Running|Completed)\s*\(attempt\s*#(\d+)\)$/i);return r?`${ni(r[1])}(第 ${r[2]} 次)`:/request failed/i.test(n)?"请求失败":/backend unavailable/i.test(n)?"后端服务不可达":/not found/i.test(n)?"未找到对应资源":t}function $c(e,t="未命名内容"){const n=ut(e).trim();if(!n||/unnamed/i.test(n))return t;if(yo(n))return n;const a=ni(n,"");if(a)return a;const r=bj(n);return r||n}function Y_(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function K_(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function XI(e,t){const n=ut(e).trim().toLowerCase();return t.length===0?n||"pending":t.some(a=>K_(a.status))?"failed":t.some(a=>["running","active","leased"].includes(a.status.toLowerCase()))?"running":t.some(a=>["queued","ready","pending"].includes(a.status.toLowerCase()))?"queued":t.every(a=>Y_(a.status))?"succeeded":n||"pending"}function ZI(e,t){const n=ut(e,"unknown").trim().toLowerCase();return Y_(n)||K_(n)?n:t.some(a=>K_(a.status))?"failed":t.some(a=>["running","active","queued","leased"].includes(a.status.toLowerCase()))?"running":t.length>0&&t.every(a=>Y_(a.status))?"succeeded":n||"unknown"}function v0(e){return e?e.map(t=>{const n=ut(t.plan_id),r=V_(t.steps).map(u=>{const p=V_(u.tasks).map(m=>({id:ut(m.task_id),title:$c(m.title,"子任务"),description:ut(m.description),status:ut(m.status,"pending"),assignedSkillId:m.assigned_skill_id?ut(m.assigned_skill_id):null,startedAt:m.started_at?ut(m.started_at):null,finishedAt:m.finished_at?ut(m.finished_at):null}));return{id:ut(u.step_id),title:$c(u.title,"任务步骤"),description:ut(u.description),status:XI(u.status,p),preferredSkills:Array.isArray(u.preferred_skills)?u.preferred_skills:[],tasks:p}}),s=[];for(const u of r)for(const f of u.tasks)s.push(f.id);return{id:n,title:$c(t.title,"未命名任务"),objective:$c(t.objective||t.description,"暂无任务说明"),status:ZI(t.status,r),createdAt:t.created_at?ut(t.created_at):null,updatedAt:t.updated_at?ut(t.updated_at):null,steps:r,sourceIds:{planId:n||void 0,taskIds:s}}}):[]}const e_={"decision-analyzer":"决策分析","git-log-collector":"Git 日志采集","number-generator":"数据生成","office-export-xlsx":"Excel 导出","task-tracker":"任务跟踪","weekly-report-writer":"周报撰写","zhihu-hotlist-detail":"知乎热榜明细","zhihu-hotlist":"知乎热榜","tq-lineloss-report":"台区线损报表","archive-workorder-grid-push-monitor":"归档工单推送监控","available-balance-below-zero-monitor":"可用余额监控","command-center-fee-control-monitor":"费用管控监控","sgcc-todo-crawler":"SGCC 待办爬取","appointment-workorder-monitor":"约时工单监控","fault-location-monitor":"故障定位监控","fudian-failure-monitor":"复电失败监控","important-service-expiry-monitor":"服务到期预警","by-95598-customer-satisfaction-report":"95598 满意率日报","by-daily-report-statistics":"日报统计","by-fire-fault-monthly-report":"火警故障月报","by-risk-control-next-day-plan-report":"风控次日计划","by-risk-control-week-plan-report":"风控周计划","by-supervision-workorder-detail-report":"督办工单明细","age-file-encryption":"文件加解密","anonymous-file-upload":"匿名文件上传","browser-automation-agent":"浏览器自动化","bulk-github-star":"批量仓库标星","changelog-generator":"更新日志生成","code-reviewer":"代码审查","commit-automation":"自动提交","crypto-trading-signal":"交易信号分析","csv-to-json":"CSV 转 JSON","data-analysis":"数据分析","deep-research":"深度调研","dependency-updater":"依赖更新","deploy-automation":"自动部署","dns-lookup":"DNS 查询","document-generator":"文档生成","email-automation":"邮件自动化","file-converter":"文件格式转换","git-history-analyzer":"Git 历史分析","github-issue-manager":"Issue 管理","image-optimizer":"图片优化","json-schema-validator":"JSON Schema 校验","log-analyzer":"日志分析","markdown-to-pdf":"Markdown 转 PDF","meeting-summarizer":"会议纪要","news-aggregator":"新闻聚合","pdf-extractor":"PDF 提取","performance-profiler":"性能分析","pr-review-bot":"PR 审查","release-notes-generator":"发布说明生成","screenshot-automation":"截图自动化","search-engine-scraper":"搜索引擎抓取","sentiment-analysis":"情感分析","shell-command-runner":"命令执行","slack-notification":"Slack 通知","spreadsheet-generator":"电子表格生成","text-summarizer":"文本摘要","torrent-search":"资源搜索","translate-text":"文本翻译","web-scraper":"网页抓取","website-monitor":"网站监控","whitepaper-analyzer":"白皮书分析","xml-to-json":"XML 转 JSON"};function bj(e){if(e_[e])return e_[e];for(const[t,n]of Object.entries(e_))if(e.includes(t)||t.includes(e))return n;return null}function x0(e,t){const n=bj(e);return n||(yo(t)?t:"自动化技能")}const k0={"decision-analyzer":"数字化","git-log-collector":"数字化","number-generator":"数字化","office-export-xlsx":"办公","task-tracker":"办公","weekly-report-writer":"报表","zhihu-hotlist-detail":"数字化","zhihu-hotlist":"数字化","tq-lineloss-report":"报表","archive-workorder-grid-push-monitor":"监控巡检","available-balance-below-zero-monitor":"监控巡检","command-center-fee-control-monitor":"监控巡检","sgcc-todo-crawler":"监控巡检","appointment-workorder-monitor":"监控巡检","fault-location-monitor":"监控巡检","fudian-failure-monitor":"监控巡检","important-service-expiry-monitor":"监控巡检","by-95598-customer-satisfaction-report":"报表","by-daily-report-statistics":"报表","by-fire-fault-monthly-report":"报表","by-risk-control-next-day-plan-report":"报表","by-risk-control-week-plan-report":"报表","by-supervision-workorder-detail-report":"报表","age-file-encryption":"数字化","anonymous-file-upload":"通信","browser-automation-agent":"数字化","bulk-github-star":"发展","changelog-generator":"发展","chat-logger":"通信","check-crypto-address-balance":"财务","city-distance":"发展","city-tourism-website-builder":"营销","crawl-websites-at-scale":"数字化","csv-data-summarizer":"财务","d3js-data-visualization":"数字化","database-query-and-export":"数字化","file-tracker":"综合","free-geocoding-and-maps":"发展","free-translation-api":"综合","free-weather-data":"综合","generate-asset-price-chart":"财务","generate-qr-code-natively":"数字化","get-crypto-price":"财务","git-worktree-cli":"发展","github-stats":"发展","html-to-markdown":"数字化","image-compressor":"综合","json-to-csv":"数字化","llm-council":"数字化","markdown-table-generator":"综合","multi-format-converter":"综合","npm-package-info":"发展","pdf-generator":"综合","random-number-generator":"综合","readability-score":"综合","rss-feed-reader":"通信","sql-formatter":"数字化","text-diff":"综合","torrent-search":"通信","unit-converter":"综合","url-shortener":"通信","youtube-transcript":"通信","zip-extractor":"综合"};function S0(e){return k0[e]?k0[e]:"综合"}function JI(e){return e==="core"||e==="standard"||e==="specialized"||e==="experimental"?e:"standard"}function WI(e,t,n){const a=ut(t).trim();return a&&yo(a)?a:e.includes("monitor")?`${n}能力,用于按排班自动巡检并提示异常。`:e.includes("report")?`${n}能力,用于自动生成和整理业务报表。`:`${n}能力,可由数字员工按需执行或定时处理。`}function e5(e){return e?e.map(t=>{const n=ut(t.skill_id,ut(t.id)),a=Kd(t.governance);return{id:n,name:x0(n,ut(t.name,n)),version:t.version?ut(t.version):null,enabled:!!t.enabled,description:WI(n,t.description,x0(n,ut(t.name,n))),category:t.category?ut(t.category,S0(n)):S0(n),capabilityLevel:JI(t.capability_level??t.capabilityLevel),source:"skill-api",serverId:t.server_id?ut(t.server_id):null,transport:t.transport?ut(t.transport):null,running:typeof t.running=="boolean"?t.running:null,toolCount:w0(t.tool_count),tools:t_(t.tools),allowTools:t_(t.allow_tools??(a==null?void 0:a.server_allow_tools)??(a==null?void 0:a.global_allow_tools)),denyTools:t_(t.deny_tools??(a==null?void 0:a.server_deny_tools)??(a==null?void 0:a.global_deny_tools)),governancePolicy:t5(t.governance_policy??(a==null?void 0:a.effective_policy)),policySource:n5(t.policy_source),remotePolicy:Kd(t.remote_policy),localPolicy:Kd(t.local_policy),recentCalls:V_(t.recent_calls).map(r=>{const s=Kd(r)??{};return{eventId:ut(s.event_id,ut(s.id)),message:ut(s.message),status:s.status?ut(s.status):null,occurredAt:ut(s.occurred_at,ut(s.occurredAt)),toolName:s.tool_name?ut(s.tool_name):null,projectId:s.project_id?ut(s.project_id):null}}).filter(r=>r.eventId||r.message),callCount:w0(t.call_count)??0,lastCalledAt:t.last_called_at?ut(t.last_called_at):null}}):[]}function t_(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim()):[]}function w0(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:null}return null}function t5(e){return e==="allow"||e==="deny"||e==="open"||e==="disabled"?e:null}function n5(e){return e==="remote"||e==="local"||e==="open"?e:null}function tp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function i5(e){switch(e){case"succeeded":case"completed":return"success";case"failed":case"error":return"danger";case"running":case"active":return"info";default:return"warning"}}function a5(e){return["draft","reviewing","approved"].includes(e.toLowerCase())}function l5(e){const t=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return t.includes("month")||t.includes("monthly")||t.includes("月")?"月度任务":t.includes("week")||t.includes("weekly")||t.includes("周")?"周任务":t.includes("临时")||t.includes("adhoc")||t.includes("hotlist")||t.includes("monitor")?"临时任务":"日常任务"}function Pr(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function vj(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function r5(e){const t=e.steps.length;if(t===0)return ni(e.status);const n=e.steps.filter(u=>Pr(u.status)).length,a=e.steps.filter(u=>vj(u.status)).length,r=e.steps.filter(u=>["running","active","queued","leased"].includes(u.status.toLowerCase())).length,s=[`已完成 ${n}/${t}`];return a>0&&s.push(`失败 ${a}`),r>0&&a===0&&s.push(`处理中 ${r}`),s.join(",")}function s5(e){const t=e.steps.find(r=>vj(r.status));if(t)return`执行失败:${t.title}`;const n=e.steps.find(r=>["running","active"].includes(r.status.toLowerCase()));if(n)return`正在处理:${n.title}`;const a=e.steps.find(r=>!Pr(r.status));return a?`准备处理:${a.title}`:Pr(e.status)?"本轮任务已完成,等待你查看结果":e.status.toLowerCase()==="failed"?"执行遇到异常,等待你检查后重新执行":"等待你委托数字员工开始处理"}function o5(e,t){const n=e.status.toLowerCase();return n==="failed"||n==="error"?"查看详情后重新执行本任务":["running","active"].includes(n)?"等待完成或查看过程":Pr(n)?"查看产物,必要时重新执行":t?"确认目标后点击委托执行":"查看详情确认当前状态"}function c5(e){const t=`${e.title} ${e.objective}`.toLowerCase();return t.includes("excel")||t.includes("xlsx")||t.includes("导出")||t.includes("报表")?"导出报表":t.includes("brief")||t.includes("简报")||t.includes("日程")?"工作简报":t.includes("snapshot")||t.includes("快照")||t.includes("热榜")?"结果快照":Pr(e.status)?"查看完成结果":"完成后生成"}function xj(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":[t.getFullYear(),String(t.getMonth()+1).padStart(2,"0"),String(t.getDate()).padStart(2,"0")].join("-")}function kj(){return xj(new Date().toISOString())}function u5(e){if(!e)return"时间未记录";const t=new Date(e);return Number.isNaN(t.getTime())?"时间未记录":t.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1})}function d5(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}function f5(e){const t=`${e.title} ${e.id}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);if(!t)return null;const n=Number(t[1]),a=Number(t[2]);return!Number.isInteger(n)||!Number.isInteger(a)||n>23||a>59?null:`${String(n).padStart(2,"0")}:${String(a).padStart(2,"0")}`}function p5(e){return e.steps.flatMap(t=>t.tasks.flatMap(n=>[n.startedAt,n.finishedAt])).filter(t=>!!t)}function m5(e,t){return p5(e).filter(a=>xj(a)===t).sort((a,r)=>r.localeCompare(a))[0]??null}function h5(e,t){const n=m5(e,t);if(n)return`实际执行 ${u5(n)}`;const a=t===kj()?"今日未执行":"当日未执行";return`计划执行 ${f5(e)||"待确认"};${a}`}function _5({mission:e,onSelect:t,onRun:n,onRestart:a,dateFilter:r,selected:s,focusLabel:u,running:f}){const p=a5(e.status),m=Pr(e.status)||e.steps.some(v=>Pr(v.status)),g=r||kj(),b=d5(e.updatedAt||e.createdAt);return c.jsxs("div",{id:`mission-card-${tp(e.id)}`,className:`de-mission-card ${s?"de-mission-card--selected":""}`,onClick:()=>t(e),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),t(e))},role:"button",tabIndex:0,children:[c.jsxs("div",{className:"de-mission-card-header",children:[c.jsx("span",{className:"de-mission-card-title",children:e.title}),c.jsxs("div",{className:"de-mission-card-badges",children:[u&&c.jsx("span",{className:"de-mission-card-focus-chip",children:u}),c.jsx(G_,{variant:i5(e.status),label:ni(e.status)})]})]}),e.objective&&c.jsxs("p",{className:"de-mission-card-desc",children:["业务目标:",e.objective]}),c.jsxs("div",{className:"de-mission-card-meta",children:[c.jsxs("span",{children:["周期:",l5(e)]}),c.jsxs("span",{children:["当前进度:",r5(e)]}),b&&c.jsxs("span",{children:["同步于 ",b]})]}),c.jsx("div",{className:"de-mission-card-meta",children:c.jsx("span",{children:s5(e)})}),c.jsxs("div",{className:"de-mission-card-meta",children:[c.jsxs("span",{children:["下一步:",o5(e,p)]}),c.jsxs("span",{children:["产物入口:",c5(e)]})]}),c.jsxs("div",{className:"de-mission-card-actions",children:[c.jsxs("span",{className:"de-mission-card-time",children:[h5(e,g),m?";重新执行可能覆盖本任务结果":""]}),c.jsx("button",{type:"button",className:"de-btn-restart",disabled:f,onClick:v=>{v.stopPropagation(),f||a==null||a(e)},title:m?"重新执行本任务,可能覆盖已有结果":"重新执行本任务",children:"重新执行本任务"}),c.jsx("button",{type:"button",className:"de-btn-run",disabled:!p||f,onClick:v=>{v.stopPropagation(),p&&!f&&(n==null||n(e))},children:f?"执行中...":p?"委托执行":ni(e.status)})]})]})}function mt(e,t){const n=new Date;return n.setHours(e,t,0,0),n.toISOString()}function Xt(e,t,n,a,r,s,u){return{id:`${e}-${t}-task`,title:n,status:a,assignedSkillId:r,startedAt:s,finishedAt:u}}function Ki(e,t,n,a,r,s){return{id:e,title:t,objective:n,status:a,createdAt:mt(8,0),updatedAt:r,steps:s,sourceIds:{planId:e,taskIds:s.flatMap(u=>u.tasks.map(f=>f.id))}}}const g5=[Ki("whitecollar-day","白领一天端到端验收","模拟业务人员一天内通过数字员工完成网页采集、客户回访、资料整理和日报输出。","active",mt(10,35),[{id:"contact",title:"读取供应商联系人",status:"completed",preferredSkills:["whitecollar-day-legacy-contact"],tasks:[Xt("whitecollar-day","contact","整理联系人名单","completed","whitecollar-day-legacy-contact",mt(8,30),mt(8,33))]},{id:"news",title:"读取行业动态",status:"completed",preferredSkills:["whitecollar-day-legacy-news"],tasks:[Xt("whitecollar-day","news","整理行业动态摘要","completed","whitecollar-day-legacy-news",mt(8,35),mt(8,41))]},{id:"form",title:"预填客户回访登记",status:"completed",preferredSkills:["whitecollar-day-legacy-form"],tasks:[Xt("whitecollar-day","form","填充回访登记表","completed","whitecollar-day-legacy-form",mt(8,45),mt(8,51))]},{id:"compare",title:"比对设备方案",status:"running",preferredSkills:["whitecollar-day-legacy-compare"],tasks:[Xt("whitecollar-day","compare","生成方案差异结论","running","whitecollar-day-legacy-compare",mt(10,28),null)]},{id:"todos",title:"读取待办系统",status:"pending",preferredSkills:["whitecollar-day-legacy-todos"],tasks:[Xt("whitecollar-day","todos","汇总个人待办","pending","whitecollar-day-legacy-todos",null,null)]},{id:"customers",title:"读取客户清单",status:"pending",preferredSkills:["whitecollar-day-legacy-customers"],tasks:[Xt("whitecollar-day","customers","提取重点客户","pending","whitecollar-day-legacy-customers",null,null)]},{id:"download",title:"识别最新资料下载链接",status:"pending",preferredSkills:["whitecollar-day-legacy-download"],tasks:[Xt("whitecollar-day","download","识别最新制度材料","pending","whitecollar-day-legacy-download",null,null)]},{id:"email",title:"生成客户跟进邮件",status:"pending",preferredSkills:["whitecollar-day-legacy-email"],tasks:[Xt("whitecollar-day","email","生成回访邮件草稿","pending","whitecollar-day-legacy-email",null,null)]},{id:"daily-report",title:"生成工作日报",status:"pending",preferredSkills:["whitecollar-day-legacy-daily-report"],tasks:[Xt("whitecollar-day","daily-report","生成工作日报","pending","whitecollar-day-legacy-daily-report",null,null)]},{id:"tomorrow-plan",title:"生成明日计划",status:"pending",preferredSkills:["whitecollar-day-legacy-tomorrow-plan"],tasks:[Xt("whitecollar-day","tomorrow-plan","整理明日计划","pending","whitecollar-day-legacy-tomorrow-plan",null,null)]}]),Ki("whitecollar-day-0830-browser-portal-check","白领一天 08:30 工作台巡检","巡检工作台首页、待办数量和关键入口状态。","completed",mt(8,34),[{id:"browser-portal-check",title:"浏览器工作台巡检",status:"completed",preferredSkills:["whitecollar-day-browser-portal-check"],tasks:[Xt("whitecollar-day-0830-browser-portal-check","browser-portal-check","检查门户首页与入口","completed","whitecollar-day-browser-portal-check",mt(8,30),mt(8,34))]}]),Ki("whitecollar-day-0900-browser-inbox-triage","白领一天 09:00 收件箱分拣","识别高优先级通知并形成今日待办。","completed",mt(9,6),[{id:"browser-inbox-triage",title:"浏览器收件箱分拣",status:"completed",preferredSkills:["whitecollar-day-browser-inbox-triage"],tasks:[Xt("whitecollar-day-0900-browser-inbox-triage","browser-inbox-triage","分拣通知与邮件","completed","whitecollar-day-browser-inbox-triage",mt(9,0),mt(9,6))]}]),Ki("whitecollar-day-0930-calendar-brief","白领一天 09:30 日程简报","整理会议、回访与汇报节点,形成上午排程。","completed",mt(9,32),[{id:"calendar-brief",title:"生成日程简报",status:"completed",preferredSkills:["whitecollar-day-calendar-brief"],tasks:[Xt("whitecollar-day-0930-calendar-brief","calendar-brief","整理今日日程","completed","whitecollar-day-calendar-brief",mt(9,30),mt(9,32))]}]),Ki("whitecollar-day-1030-browser-crm-followup","白领一天 10:30 客户跟进","汇总重点客户情况,生成下一步回访建议。","running",mt(10,35),[{id:"browser-crm-followup",title:"浏览器客户跟进",status:"running",preferredSkills:["whitecollar-day-browser-crm-followup"],tasks:[Xt("whitecollar-day-1030-browser-crm-followup","browser-crm-followup","提取客户回访摘要","running","whitecollar-day-browser-crm-followup",mt(10,30),null)]}]),Ki("whitecollar-day-1130-browser-expense-approval","白领一天 11:30 费用审批核对","检查待审批单据并输出异常说明。","approved",mt(11,20),[{id:"browser-expense-approval",title:"浏览器费用审批核对",status:"pending",preferredSkills:["whitecollar-day-browser-expense-approval"],tasks:[Xt("whitecollar-day-1130-browser-expense-approval","browser-expense-approval","核对费用审批单","pending","whitecollar-day-browser-expense-approval",null,null)]}]),Ki("whitecollar-day-1330-sales-snapshot","白领一天 13:30 经营快照","汇总客户、项目和经营看板,形成午后快照。","draft",mt(13,20),[{id:"sales-snapshot",title:"生成经营快照",status:"pending",preferredSkills:["whitecollar-day-sales-snapshot"],tasks:[Xt("whitecollar-day-1330-sales-snapshot","sales-snapshot","整理经营快照","pending","whitecollar-day-sales-snapshot",null,null)]}]),Ki("whitecollar-day-1430-report-export","白领一天 14:30 报表导出","导出领导汇报所需的简版统计报表。","draft",mt(14,10),[{id:"report-export",title:"导出汇报报表",status:"pending",preferredSkills:["whitecollar-day-report-export"],tasks:[Xt("whitecollar-day-1430-report-export","report-export","导出统计报表","pending","whitecollar-day-report-export",null,null)]}]),Ki("whitecollar-day-1530-browser-knowledge-check","白领一天 15:30 知识库核查","核查制度、模板与常见问题资料是否最新。","draft",mt(15,15),[{id:"browser-knowledge-check",title:"浏览器知识库核查",status:"pending",preferredSkills:["whitecollar-day-browser-knowledge-check"],tasks:[Xt("whitecollar-day-1530-browser-knowledge-check","browser-knowledge-check","核查知识库资料","pending","whitecollar-day-browser-knowledge-check",null,null)]}]),Ki("whitecollar-day-1630-task-board-sync","白领一天 16:30 任务看板同步","把今日处理结果同步到看板和协同清单。","draft",mt(16,10),[{id:"task-board-sync",title:"同步任务看板",status:"pending",preferredSkills:["whitecollar-day-task-board-sync"],tasks:[Xt("whitecollar-day-1630-task-board-sync","task-board-sync","同步任务状态","pending","whitecollar-day-task-board-sync",null,null)]}]),Ki("whitecollar-day-1730-browser-day-close","白领一天 17:30 日终收口","汇总今日成果、风险和明日重点,形成日终总结。","draft",mt(17,10),[{id:"task-board-sync",title:"同步任务看板",status:"pending",preferredSkills:["whitecollar-day-task-board-sync"],tasks:[Xt("whitecollar-day-1730-browser-day-close","task-board-sync","同步看板结果","pending","whitecollar-day-task-board-sync",null,null)]},{id:"browser-day-close",title:"浏览器日终收口",status:"pending",preferredSkills:["whitecollar-day-browser-day-close"],tasks:[Xt("whitecollar-day-1730-browser-day-close","browser-day-close","整理日终收口","pending","whitecollar-day-browser-day-close",null,null)]}]),Ki("zhihu-hotlist-monitor","知乎热榜采集","通过计划模板调用知乎热榜采集技能,导出表格文件并生成当天热点摘要。","approved",mt(10,12),[{id:"collect-zhihu",title:"采集知乎热榜",status:"pending",preferredSkills:["zhihu-hotlist"],tasks:[Xt("zhihu-hotlist-monitor","collect-zhihu","采集知乎热榜","pending","zhihu-hotlist",null,null)]},{id:"export-xlsx",title:"导出表格文件",status:"pending",preferredSkills:["office-export-xlsx"],tasks:[Xt("zhihu-hotlist-monitor","export-xlsx","导出热榜表格","pending","office-export-xlsx",null,null)]}])];function y5(e){return{...e,steps:e.steps.map(t=>({...t,preferredSkills:[...t.preferredSkills],tasks:t.tasks.map(n=>({...n}))})),sourceIds:{planId:e.sourceIds.planId,taskIds:[...e.sourceIds.taskIds]}}}function eo(){return g5.map(y5)}function b5(e){return e.flatMap(t=>t.steps.flatMap(n=>n.tasks.map(a=>({task_id:a.id,title:a.title,status:a.status,plan_id:t.id,step_id:n.id,assigned_skill_id:a.assignedSkillId||"",description:`${t.title} · ${n.title}`,created_at:t.createdAt||mt(8,0),updated_at:t.updatedAt||t.createdAt||mt(8,0),started_at:a.startedAt,finished_at:a.finishedAt}))))}function v5(e){return e.filter(t=>["completed","running"].includes(t.status)).map((t,n)=>({run_id:`demo-run-${n+1}`,task_id:t.task_id,plan_id:t.plan_id,attempt_no:1,lifecycle:t.status==="running"?"Running":"Succeeded",created_at:t.started_at||t.created_at,completed_at:t.finished_at}))}function x5(e){const t=e.steps.find(a=>a.status==="running")||e.steps.find(a=>a.status==="pending")||e.steps[0],n=[{event_id:`${e.id}-event-1`,kind:"entered_session",occurred_at:e.createdAt||mt(8,0),message:`已接收场景:${e.title}`},{event_id:`${e.id}-event-2`,kind:"start",occurred_at:e.updatedAt||e.createdAt||mt(8,0),message:`当前目标:${e.objective}`}];return t&&n.push({event_id:`${e.id}-event-3`,kind:e.status==="completed"?"completed":e.status==="approved"||e.status==="draft"?"pending_authorization":"RunStarted",occurred_at:e.updatedAt||e.createdAt||mt(8,0),message:`${t.title}`}),e.status==="completed"&&n.push({event_id:`${e.id}-event-4`,kind:"RunCompleted",occurred_at:e.updatedAt||e.createdAt||mt(8,0),message:"已完成本场景执行并回写结果。"}),n}function n_(e){const t=e.steps.filter(r=>r.status==="completed").length,n=e.steps.find(r=>r.status==="running"),a=e.status==="completed"?`当前已完成全部 ${e.steps.length} 个步骤,结果已整理完毕。`:n?`当前正在处理“${n.title}”,已完成 ${t} 个步骤。`:"当前场景已准备就绪,可直接发起执行。";return[{role:"user",content:`请执行场景:${e.title}`},{role:"assistant",content:`已接收。业务目标:${e.objective}`},{role:"assistant",content:a}]}function i_(e,t){return e.map(n=>n.id!==t?n:{...n,status:"running",updatedAt:new Date().toISOString(),steps:n.steps.map((a,r)=>({...a,status:r===0?"running":a.status==="completed"?"completed":"pending",tasks:a.tasks.map(s=>({...s,status:r===0?"running":s.status==="completed"?"completed":"pending",startedAt:r===0?new Date().toISOString():s.startedAt,finishedAt:r===0?null:s.finishedAt}))}))})}function a_(e,t){return e.map(n=>n.id!==t?n:{...n,status:"completed",updatedAt:new Date().toISOString(),steps:n.steps.map(a=>({...a,status:"completed",tasks:a.tasks.map(r=>({...r,status:"completed",startedAt:r.startedAt||new Date().toISOString(),finishedAt:new Date().toISOString()}))}))})}function j0(e){switch(e){case"succeeded":case"completed":case"Succeeded":return"success";case"failed":return"danger";case"Failed":return"danger";case"running":case"active":case"Running":return"info";default:return"warning"}}function ol(e){return e?new Date(e).toLocaleString("zh-CN",{hour12:!1}):"未记录"}function C0(e){const t=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return t.includes("month")||t.includes("monthly")||t.includes("月")?"月度任务":t.includes("week")||t.includes("weekly")||t.includes("周")?"周任务":t.includes("临时")||t.includes("adhoc")||t.includes("hotlist")||t.includes("monitor")?"临时任务":"日常任务"}function k5(e){return["succeeded","success","finished","complete","completed"].includes(e.toLowerCase())}function Hc(e){return["failed","error","cancelled","canceled","aborted","rejected","deadletter"].includes(e.toLowerCase())}function T0(e){const t=e.steps.length;if(t===0)return ni(e.status);const n=e.steps.filter(u=>k5(u.status)).length,a=e.steps.filter(u=>Hc(u.status)).length,r=e.steps.filter(u=>["running","active","queued","leased"].includes(u.status.toLowerCase())).length,s=[`已完成 ${n}/${t}`];return a>0&&s.push(`失败 ${a}`),r>0&&a===0&&s.push(`处理中 ${r}`),s.join(",")}function E0(e){return e.replace(/^启动计划:/,"接收委托:").replace(/^准备步骤:/,"准备工作:").replace(/^创建任务:/,"安排工作:").replace(/^任务失败:/,"工作失败:").replace(/^开始处理:/,"开始处理:").replace(/^完成任务:/,"完成工作:").replace(/^调用技能:/,"数字员工处理:").replace(/^执行开始:/,"开始执行:").replace(/^执行完成:/,"执行完成:").replace(/^执行失败:/,"执行失败:").replace(/,将使用[^,。]+/,"").replace(/,分配给[^,。]+/,"")}function of(e){return/失败|failed|error|timeout|unavailable/i.test(e)}function A0(e,t=""){return of(t)?"失败":e==="artifact"?"产物":e==="task_summary"?"结果":e==="task_running"||e==="run"?"处理中":e==="task_done"||e==="run_done"?"完成":"过程"}function S5(e){return e==="user"?"用户":e==="assistant"?"数字员工":e==="system"?"系统":"消息"}function l_(e){return $c(e||"",e||"自动化技能")}function w5(e,t,n){const a=t==="true"?"成功":"失败";return e.includes("zhihu-hotlist")&&e.includes("extract_hotlist")?`调用技能:知乎热榜采集,结果:${a},耗时 ${n}ms`:e.includes("office-export-xlsx")&&e.includes("export_xlsx")?`调用技能:Excel 导出,结果:${a},耗时 ${n}ms`:`调用技能:${e},结果:${a},耗时 ${n}ms`}function _i(e){return typeof e=="string"?e:""}function $f(e){return e.occurred_at||""}function N0(e){return e.filter(t=>!!t).sort((t,n)=>t.localeCompare(n))[0]||null}function j5(e){var n;const t=new Map;for(const a of e){const r=((n=a.message.split(",结果:")[0])==null?void 0:n.split(",状态:")[0])||a.message,s=t.get(r);(!s||$f(a).localeCompare($f(s))>0)&&t.set(r,a)}return Array.from(t.values())}function C5(e){const t=new Map;for(const n of e)for(const a of n.approvals||[]){const r=_i(a.approval_id)||`approval-${n.run_id}`;t.set(r,{id:r,status:_i(a.status)||"requested",note:_i(a.note)||"等待人工审批",requestedAt:_i(a.requested_at)||null,decidedAt:_i(a.decided_at)||null,decidedBy:_i(a.decided_by)||null,runId:_i(a.run_id)||n.run_id,taskId:_i(a.task_id)||n.task_id||null,planId:_i(a.plan_id)||n.plan_id||null,targetKind:_i(a.target_kind)||"task",targetId:_i(a.target_id)||n.task_id||n.run_id})}return Array.from(t.values()).sort((n,a)=>(a.requestedAt||"").localeCompare(n.requestedAt||""))}function T5(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function R0(e){return e.replace(/\\\\/g,"\\")}function E5(e,t,n,a,r){const s=[],u=(p,m,g,b)=>{g.trim()&&s.push({event_id:b,kind:p,occurred_at:m??null,message:g})},f=(p,m,g,b)=>{let v=!1;try{const A=T5(JSON.parse(p));if(A){const x=typeof A.label=="string"?A.label.trim():"",T=A.value;x&&T!==void 0&&T!==null&&u("task_summary",m,`${x}:${String(T)}`,`metric-${g}-${b}`);const N=typeof A.output_path=="string"?A.output_path.trim():"";N&&(v=!0,u("artifact",m,`产物生成:${R0(N)}`,`artifact-${g}-${b}`))}}catch{}const k=p.match(/"row_count"\s*:\s*(\d+)/);k!=null&&k[1]&&u("task_summary",m,`数据处理完成:共 ${k[1]} 条记录`,`rows-${g}-${b}`);const C=p.match(/"output_path"\s*:\s*"([^"]+\.(?:xlsx|xls|csv|json|html|pdf|png|jpg|jpeg|txt))"/i),D=C==null?void 0:C[1];D&&!v&&u("artifact",m,`产物生成:${R0(D)}`,`artifact-regex-${g}-${b}`)};if(u("plan",e.createdAt||e.updatedAt,`启动计划:${e.title},目标:${e.objective}`,`plan-${e.id}`),t.length===0)for(const p of e.steps){const m=p.preferredSkills.map(l_).join("、")||"自动化技能";u("task",e.updatedAt||e.createdAt,`准备步骤:${p.title},将使用 ${m}`,`step-${p.id}`)}for(const p of t){const m=l_(p.assigned_skill_id),g=n.filter(k=>k.task_id===p.task_id),b=N0(g.map(k=>k.created_at)),v=N0([p.created_at,p.started_at,b]);if(u("task",v,`创建任务:${p.title||"子任务"},分配给 ${m}`,`task-create-${p.task_id}`),p.started_at&&u("task_running",p.started_at,`开始处理:${p.title||"子任务"}`,`task-start-${p.task_id}`),p.finished_at){const k=Hc(p.status)?"任务失败":"完成任务",C=Hc(p.status)&&p.error_message?`,原因:${p.error_message}`:"";u("task_done",p.finished_at,`${k}:${p.title||"子任务"},状态:${ni(p.status)}${C}`,`task-finish-${p.task_id}`)}}for(const p of n){const m=t.find(k=>k.task_id===p.task_id),g=(m==null?void 0:m.title)||"任务执行",b=l_(p.skill_id||(m==null?void 0:m.assigned_skill_id));if(a.some(k=>(k.content||"").includes(`[Task ${p.task_id}] tool_call`))||u("skill_tool",p.created_at,`调用技能:${b},处理:${g}`,`run-skill-${p.run_id}`),u("run",p.created_at,`执行开始:${g},第 ${p.attempt_no||1} 次`,`run-start-${p.run_id}`),p.completed_at){const k=Hc(p.lifecycle)?"执行失败":"执行完成";u("run_done",p.completed_at,`${k}:${g},结果:${ni(p.lifecycle)}`,`run-done-${p.run_id}`)}for(const[k,C]of(p.events||[]).entries())f(_i(C.message),C.occurred_at||p.completed_at||p.created_at,`run-${p.run_id}-${C.event_id||k}`,p.skill_id||(m==null?void 0:m.assigned_skill_id)||"run");for(const[k,C]of(p.artifacts||[]).entries()){const D=_i(C.uri),A=_i(C.name)||D;(D||A)&&u("artifact",p.completed_at||p.created_at,`产物生成:${A}${D&&D!==A?`(${D})`:""}`,`run-artifact-${p.run_id}-${k}`)}}for(const p of a){const m=p.content||"",g=m.match(/\[Task ([^\]]+)\] tool_call name=([^\s]+) success=(true|false) elapsed_ms=(\d+) args=(.*?) output=(.*)$/s);if(g){const v=g[1]||"",k=g[2]||"",C=g[3]||"false",D=g[4]||"0",A=g[6]||"";u("skill_tool",p.created_at,w5(k,C,D),`tool-${v}-${p.created_at}-${k}`),f(A,p.created_at,`message-${p.created_at}`,k);continue}const b=m.match(/共采集到\s*\**\s*(\d+)\s*条/);if(b!=null&&b[1]){u("task_summary",p.created_at,`采集完成:获得 ${b[1]} 条知乎热榜数据`,`summary-hotlist-${p.created_at}`);continue}m.includes("[Task ")&&m.includes("Excel")&&u("task_summary",p.created_at,"导出完成:Excel 文件已生成",`summary-excel-${p.created_at}`)}if(s.length<=1)for(const p of r||[])u(p.kind,p.occurred_at,yj(p.message,p.message),p.event_id);return s.sort((p,m)=>(p.occurred_at||"").localeCompare(m.occurred_at||"")).slice(-40)}function A5({mission:e,onClose:t}){const[n,a]=w.useState([]),[r,s]=w.useState([]),[u,f]=w.useState(null),[p,m]=w.useState(!0),[g,b]=w.useState([]),[v,k]=w.useState(!1),[C,D]=w.useState(!1),[A,x]=w.useState(!1),[T,N]=w.useState(null),F=e.sourceIds.planId||e.id;w.useEffect(()=>{let R=!1;const U=()=>{m(!0),Promise.allSettled([WD(F),eM(F),R_(F)]).then(([G,ae,ie])=>{var $;if(R)return;const z=eo().find(_e=>_e.id===F),M=z?b5([z]):[],J=M.length>0?v5(M):[];G.status==="fulfilled"?(a(G.value.tasks&&G.value.tasks.length>0?G.value.tasks:M),s(G.value.runs&&G.value.runs.length>0?G.value.runs:J)):(a(M),s(J)),ae.status==="fulfilled"&&(($=ae.value)!=null&&$.events)&&ae.value.events.length>0?f(ae.value):f(z?{events:x5(z)}:null),ie.status==="fulfilled"&&ie.value.messages.length>0?b(ie.value.messages):b(z?n_(z):[])}).finally(()=>{R||m(!1)})};U();const O=window.setInterval(U,3e3);return()=>{R=!0,window.clearInterval(O)}},[F]),w.useEffect(()=>{b([]),k(!1),D(!1),N(null)},[F]);const L=async()=>{if(!A){k(!0),x(!0),N(null);try{const R=await R_(F);if(R.messages&&R.messages.length>0)b(R.messages);else{const U=eo().find(O=>O.id===F);b(U?n_(U):[])}}catch(R){const U=eo().find(O=>O.id===F);U?(b(n_(U)),N(null)):(b([]),N(R instanceof Error?R.message:"读取会话失败"))}finally{x(!1)}}},B=w.useMemo(()=>{const R=new Map;for(const U of r){const O=R.get(U.task_id)||[];O.push(U),R.set(U.task_id,O)}for(const U of R.values())U.sort((O,G)=>(G.created_at||"").localeCompare(O.created_at||""));return R},[r]),P=w.useMemo(()=>E5(e,n,r,g,u==null?void 0:u.events),[u==null?void 0:u.events,e,r,g,n]),K=w.useMemo(()=>P.filter(R=>R.kind!=="skill_tool").slice(-12),[P]),se=w.useMemo(()=>C5(r),[r]),I=w.useMemo(()=>{const R=P.filter(ae=>["artifact","task_summary"].includes(ae.kind)),U=P.filter(ae=>ae.kind==="task_done"),O=j5(P.filter(ae=>ae.kind==="run_done")),G=U.length>0?U:O;return[...R,...G].sort((ae,ie)=>$f(ae).localeCompare($f(ie))).slice(-6)},[P]),q=w.useMemo(()=>P.reduce((R,U)=>U.occurred_at&&(!R||U.occurred_at.localeCompare(R)>0)?U.occurred_at:R,null),[P]),Z=e.updatedAt||q,Q=()=>{const R=!C;D(R),R&&!v&&L()};return c.jsxs("div",{className:"de-drawer",role:"dialog","aria-label":e.title,children:[c.jsxs("div",{className:"de-drawer-head",children:[c.jsxs("div",{className:"de-drawer-title-group",children:[c.jsx("span",{className:"de-drawer-eyebrow",children:"委托详情"}),c.jsx("h3",{children:e.title})]}),c.jsx("button",{className:"de-btn-secondary",onClick:t,"aria-label":"关闭",children:"✕"})]}),c.jsxs("div",{className:"de-drawer-status-line",children:[c.jsx(G_,{variant:j0(e.status),label:ni(e.status)}),c.jsx("span",{className:"de-drawer-meta",children:C0(e)}),c.jsx("span",{className:"de-drawer-meta",children:T0(e)})]}),c.jsxs("div",{className:"de-drawer-timeline",children:[c.jsxs("section",{className:"de-detail-section",children:[c.jsx("div",{className:"de-detail-section-head",children:c.jsx("h4",{children:"委托概览"})}),c.jsxs("div",{className:"de-detail-kv",children:[c.jsx("span",{children:"业务目标"}),c.jsx("strong",{children:e.objective||"未填写"}),c.jsx("span",{children:"周期"}),c.jsx("strong",{children:C0(e)}),c.jsx("span",{children:"当前进度"}),c.jsx("strong",{children:T0(e)}),c.jsx("span",{children:"启动时间"}),c.jsx("strong",{children:ol(e.createdAt)}),c.jsx("span",{children:"状态"}),c.jsx("strong",{children:ni(e.status)}),c.jsx("span",{children:"更新时间"}),c.jsx("strong",{children:ol(Z)})]})]}),se.length>0?c.jsxs("section",{className:"de-detail-section",children:[c.jsxs("div",{className:"de-detail-section-head",children:[c.jsx("h4",{children:"审批状态"}),c.jsxs("span",{className:"de-chain-plan-id",children:[se.length," 项执行期审批"]})]}),c.jsx("div",{className:"de-event-list",children:se.map(R=>c.jsxs("div",{className:"de-event-row",children:[c.jsx("strong",{children:ni(R.status)}),c.jsxs("span",{children:[R.note," ",R.taskId?`Task ${R.taskId}`:`Target ${R.targetKind}:${R.targetId}`,R.runId?` / Run ${R.runId}`:"",R.decidedBy?` / ${R.decidedBy}`:""]}),c.jsx("time",{children:ol(R.decidedAt||R.requestedAt)})]},`approval-${R.id}`))})]}):null,c.jsxs("section",{className:"de-detail-section de-execution-chain",children:[c.jsxs("div",{className:"de-detail-section-head",children:[c.jsx("h4",{children:"业务过程"}),c.jsxs("span",{className:"de-chain-plan-id",children:["最近更新:",ol(Z||e.createdAt)]})]}),p&&K.length===0?c.jsx("p",{className:"de-empty-text",children:"正在读取业务过程..."}):K.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无业务过程。重新执行本任务后会显示处理进展。"}):c.jsx("div",{className:"de-chain-list",children:K.map(R=>c.jsxs("div",{className:`de-chain-row de-chain-row--${R.kind} ${of(R.message)?"de-chain-row--danger":""}`,children:[c.jsx("strong",{children:A0(R.kind,R.message)}),c.jsx("span",{children:E0(R.message)}),c.jsx("time",{children:ol(R.occurred_at)})]},`chain-${R.event_id}`))})]}),c.jsxs("section",{className:"de-detail-section",children:[c.jsx("h4",{children:"结果与产物"}),I.length>0?c.jsx("div",{className:"de-event-list",children:[...I].reverse().map(R=>c.jsxs("div",{className:`de-event-row ${of(R.message)?"de-event-row--danger":""}`,children:[c.jsx("strong",{children:A0(R.kind,R.message)}),c.jsx("span",{children:E0(R.message)}),c.jsx("time",{children:ol(R.occurred_at)})]},`result-${R.event_id}`))}):c.jsx("p",{className:"de-empty-text",children:"任务完成后,这里会显示结果摘要和产物入口。"})]}),c.jsxs("section",{className:"de-detail-section",children:[c.jsx("h4",{children:"步骤进展"}),p?c.jsx("p",{className:"de-empty-text",children:"正在读取执行情况..."}):null,e.steps.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无步骤进展"}):e.steps.map((R,U)=>c.jsxs("div",{className:"de-step-node",children:[c.jsx("div",{className:`de-step-dot de-step-dot--${R.status}`}),U<e.steps.length-1&&c.jsx("div",{className:"de-step-line"}),c.jsxs("div",{className:"de-step-content",children:[c.jsx("strong",{children:R.title}),c.jsx("span",{children:ni(R.status)})]})]},R.id))]}),c.jsxs("section",{className:"de-detail-section",children:[c.jsxs("div",{className:"de-detail-section-head",children:[c.jsx("h4",{children:"高级详情"}),c.jsx("button",{className:"de-btn-secondary de-btn-sm",onClick:Q,disabled:A,children:C?"收起":"展开"})]}),C?c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"de-detail-section",children:[c.jsxs("div",{className:"de-detail-section-head",children:[c.jsx("h4",{children:"技术链路"}),c.jsx("span",{className:"de-chain-plan-id",children:"仅用于排障"})]}),P.length>0?c.jsx("div",{className:"de-event-list",children:P.slice(-20).reverse().map(R=>c.jsxs("div",{className:`de-event-row ${of(R.message)?"de-event-row--danger":""}`,children:[c.jsx("strong",{children:QI(R.kind)}),c.jsx("span",{children:R.message}),c.jsx("time",{children:ol(R.occurred_at)})]},R.event_id))}):c.jsx("p",{className:"de-empty-text",children:"暂无事件日志"})]}),c.jsxs("section",{className:"de-detail-section",children:[c.jsxs("div",{className:"de-detail-section-head",children:[c.jsx("h4",{children:"会话记录"}),c.jsx("button",{className:"de-btn-secondary de-btn-sm",onClick:L,disabled:A,children:"刷新"})]}),T?c.jsxs("p",{className:"de-empty-text",children:["会话读取失败:",T]}):A?c.jsx("p",{className:"de-empty-text",children:"正在读取会话..."}):g.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无会话消息。"}):c.jsx("div",{className:"de-session-message-list",children:g.map((R,U)=>c.jsxs("div",{className:`de-session-message de-session-message--${R.role==="user"?"user":"agent"}`,children:[c.jsx("div",{className:"de-session-message-role",children:S5(R.role)}),c.jsx("p",{children:yj(R.content,R.content)})]},`${R.role}-${U}`))})]}),c.jsxs("section",{className:"de-detail-section",children:[c.jsx("h4",{children:"任务与执行记录"}),n.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无原始任务记录"}):n.map(R=>{const U=B.get(R.task_id)||[],O=U[0];return c.jsxs("div",{className:"de-task-run-card",children:[c.jsxs("div",{className:"de-task-run-head",children:[c.jsx("span",{children:R.title||"子任务"}),c.jsx(G_,{variant:j0(R.status),label:ni(R.status)})]}),c.jsxs("div",{className:"de-task-run-meta",children:[c.jsxs("span",{children:["skill_id:",R.assigned_skill_id||"未分配"]}),c.jsxs("span",{children:["开始:",ol(R.started_at)]}),c.jsxs("span",{children:["结束:",ol(R.finished_at)]})]}),c.jsxs("div",{className:"de-task-run-meta",children:[c.jsxs("span",{children:["task_id:",R.task_id]}),c.jsxs("span",{children:["执行记录:",U.length," 次"]}),O?c.jsxs("span",{children:["最近结果:",ni(O.lifecycle)]}):null]}),Hc(R.status)&&R.error_message?c.jsxs("div",{className:"de-task-run-error",children:[c.jsx("strong",{children:"失败原因:"}),R.error_message]}):null]},R.task_id)})]})]}):c.jsx("p",{className:"de-empty-text",children:"默认隐藏排障信息;需要排障时可展开。"})]})]})]})}const cf=["whitecollar-day","whitecollar-day-0830-browser-portal-check","whitecollar-day-0900-browser-inbox-triage","whitecollar-day-0930-calendar-brief","whitecollar-day-1030-browser-crm-followup","whitecollar-day-1130-browser-expense-approval","whitecollar-day-1330-sales-snapshot","whitecollar-day-1430-report-export","whitecollar-day-1530-browser-knowledge-check","whitecollar-day-1630-task-board-sync","whitecollar-day-1730-browser-day-close","zhihu-hotlist-monitor"],N5=[{key:"all",label:"全部委托"},{key:"daily",label:"日常任务"},{key:"weekly",label:"周任务"},{key:"monthly",label:"月度任务"},{key:"adhoc",label:"临时任务"}];function Q_(e){const t=typeof e.updated_at=="string"?e.updated_at:typeof e.created_at=="string"?e.created_at:"",n=t?new Date(t).getTime():0;return Number.isFinite(n)?n:0}function lr(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":[t.getFullYear(),String(t.getMonth()+1).padStart(2,"0"),String(t.getDate()).padStart(2,"0")].join("-")}function Lr(){return lr(new Date().toISOString())}function D0(e,t){const n=e?new Date(`${e}T12:00:00`):new Date;return Number.isNaN(n.getTime())?Lr():(n.setDate(n.getDate()+t),lr(n.toISOString()))}function ny(e){const t=`${e.title} ${e.id}`.match(/(?:^|\D)(\d{1,2})[::](\d{2})(?:\D|$)/);if(!t)return null;const n=Number(t[1]),a=Number(t[2]);return!Number.isInteger(n)||!Number.isInteger(a)||n>23||a>59?null:{text:`${String(n).padStart(2,"0")}:${String(a).padStart(2,"0")}`,minutes:n*60+a}}function np(e){return e.steps.flatMap(t=>t.tasks.flatMap(n=>[n.startedAt,n.finishedAt])).filter(t=>!!t)}function R5(e,t){return np(e).map(lr).filter(Boolean).includes(t)||ny(e)?!0:[e.updatedAt,e.createdAt].map(lr).includes(t)}function D5(e){return ny(e)&&`${e.title}`.trim().toLowerCase()||e.id}function M5(e,t){return np(e).some(n=>lr(n)===t)}function M0(e,t){const n=M5(e,t)?1e4:0,a=cf.includes(e.id)?1e3:0,r=[e.updatedAt,e.createdAt].map(lr).includes(t)?100:0;return n+a+r+Q_({updated_at:e.updatedAt||"",created_at:e.createdAt||""})/1e13}function $5(e,t){const n=new Map;for(const a of e){const r=D5(a),s=n.get(r);(!s||M0(a,t)>M0(s,t))&&n.set(r,a)}return Array.from(n.values())}function $0(e,t){const n=ny(e);if(n)return n.minutes;const a=np(e).filter(r=>lr(r)===t).sort();if(a[0]){const r=new Date(a[0]);return r.getHours()*60+r.getMinutes()}return 1440}function z0(e,t){const n=np(e).filter(a=>lr(a)===t).map(a=>new Date(a).getTime()).filter(Number.isFinite);return n.length>0?Math.max(...n):0}function z5(e){const t=[e.status,...e.steps.map(n=>n.status),...e.steps.flatMap(n=>n.tasks.map(a=>a.status))].map(n=>n.toLowerCase());return t.some(n=>["running","active","leased"].includes(n))?5:t.some(n=>["queued","ready","pending"].includes(n))?4:t.some(n=>["failed","error"].includes(n))?3:t.some(n=>["succeeded","success","completed","complete","finished"].includes(n))?2:1}function O5(e){const t=`${e.id} ${e.title} ${e.objective}`.toLowerCase();return t.includes("month")||t.includes("monthly")||t.includes("月")?"monthly":t.includes("week")||t.includes("weekly")||t.includes("周")?"weekly":t.includes("临时")||t.includes("adhoc")||t.includes("hotlist")||t.includes("monitor")?"adhoc":"daily"}async function Sj(e,t,n={}){const a=Date.now(),r=await Tf({command_kind:e,context_refs:t,payload:{source:"digital-mission-center",...n},correlation_id:`mission-${e}-${a}`,idempotency_key:`mission-${e}-${Object.values(t).join("-")||"new"}-${a}`});if(!r.accepted)throw new Error(r.message||`command 未被接受:${r.command_id||e}`);return r}async function da(e,t,n={}){return Sj(t,{plan_id:e},n)}async function O0(e){const t=e.sourceIds.planId;if(!t)return null;const n=e.status.toLowerCase();if(n==="draft")await da(t,"submit_plan",{requested_action:"mission_dispatch"}),await da(t,"approve_plan",{requested_action:"mission_dispatch"});else if(n==="reviewing")await da(t,"approve_plan",{requested_action:"mission_dispatch"});else if(!["approved","active","running"].includes(n))return await da(t,"amend_plan",{requested_action:"reopen_for_execution",summary:"数字员工任务中心请求重新执行任务"}),null;return await da(t,"activate_plan",{requested_action:"mission_dispatch"}),t}function L5(e){const t=e.steps.map((n,a)=>{const r=new Set;n.preferredSkills.forEach(u=>{u.trim()&&r.add(u)}),n.tasks.forEach(u=>{var f;(f=u.assignedSkillId)!=null&&f.trim()&&r.add(u.assignedSkillId)});const s=[n.description,...n.tasks.map(u=>u.description),n.title,e.objective,e.title].find(u=>typeof u=="string"&&u.trim());return{title:n.title||`${e.title} 第 ${a+1} 步`,description:s||n.title||e.objective||e.title,skills:Array.from(r),depends_on:a===0?[]:[`step-${a}`]}}).filter(n=>n.skills.length>0);if(t.length===0)throw new Error("当前任务没有可复用的 skill,不能创建真实重新执行计划。");return t}function wj(e){return`${e.replace(/(\s*重新执行)+$/u,"").trim()||e} 重新执行`}async function I5(e){var r,s;const t=await Sj("create_plan",{session_id:"digital-mission-center",plan_id:e.sourceIds.planId||e.id},{requested_action:"mission_restart",title:wj(e.title),description:e.objective||e.title,steps:L5(e),original_plan_id:e.sourceIds.planId||e.id}),n=typeof((r=t.result)==null?void 0:r.plan_id)=="string"?t.result.plan_id:"";if(!n)throw new Error("重新执行计划已提交,但后端没有返回 plan_id。");const a=typeof((s=t.result)==null?void 0:s.status)=="string"?t.result.status.toLowerCase():"";return a==="draft"?(await da(n,"submit_plan",{requested_action:"mission_restart"}),await da(n,"approve_plan",{requested_action:"mission_restart"}),await da(n,"activate_plan",{requested_action:"mission_restart"})):a==="reviewing"?(await da(n,"approve_plan",{requested_action:"mission_restart"}),await da(n,"activate_plan",{requested_action:"mission_restart"})):a==="approved"&&await da(n,"activate_plan",{requested_action:"mission_restart"}),n}function B5({focusMissionId:e,focusTaskId:t,focusDate:n}){const a=n||Lr(),[r,s]=w.useState([]),[u,f]=w.useState(null),[p,m]=w.useState(!0),[g,b]=w.useState(!1),[v,k]=w.useState("all"),[C,D]=w.useState(()=>a),[A,x]=w.useState(!1),[T,N]=w.useState(null),[F,L]=w.useState(!1),[B,P]=w.useState(!1),[K,se]=w.useState(null),[I,q]=w.useState(null),[Z,Q]=w.useState(null),R=w.useRef(null),U=w.useRef(!1);w.useEffect(()=>(U.current=!0,()=>{U.current=!1}),[]);const O=w.useCallback(async()=>{m(!0),b(!1);try{const ue=await JD();if(!U.current)return[];const me=new Map,Xe=Ue=>{const ft=typeof Ue.plan_id=="string"?Ue.plan_id:"";ft&&!me.has(ft)&&me.set(ft,Ue)};(Array.isArray(ue)?ue:[]).forEach(Xe);const it=cf.filter(Ue=>!me.has(Ue));if(it.length>0){const Ue=await Promise.allSettled(it.map(async ft=>({id:ft,plans:await dk(ft,20)})));for(const ft of Ue)if(ft.status==="fulfilled"){const wt=ft.value.plans.find(at=>at.plan_id===ft.value.id);wt&&Xe(wt)}}const bt=cf.map(Ue=>me.get(Ue)).filter(Ue=>!!Ue),vt=[...[...me.entries()].filter(([Ue])=>!cf.includes(Ue)).map(([,Ue])=>Ue).sort((Ue,ft)=>Q_(ft)-Q_(Ue)),...bt];if(vt.length>0){const Ue=new Set(vt.map(at=>typeof at.plan_id=="string"?at.plan_id:"")),ft=eo().filter(at=>!Ue.has(at.id)).map(at=>({plan_id:at.id,title:at.title,objective:at.objective,status:at.status,created_at:at.createdAt||new Date().toISOString(),updated_at:at.updatedAt||at.createdAt||new Date().toISOString(),steps:at.steps.map(qe=>({step_id:qe.id,title:qe.title,description:qe.description,status:qe.status,preferred_skills:qe.preferredSkills,tasks:qe.tasks.map(xt=>({task_id:xt.id,title:xt.title,description:xt.description,status:xt.status,assigned_skill_id:xt.assignedSkillId,started_at:xt.startedAt,finished_at:xt.finishedAt}))}))})),wt=v0([...vt,...ft]);return P(!1),s(wt),wt}else{const Ue=eo();return P(!0),s(Ue),Ue}}catch(ue){if(!U.current)return[];console.error("[MissionCenter] fetch failed:",ue);const me=eo();return P(!0),s(me),b(!1),me}finally{U.current&&m(!1)}},[]);w.useEffect(()=>{O()},[O]),w.useEffect(()=>{D(n||Lr()),x(!1)},[n]);const G=w.useCallback(ue=>{f(ue),q(ue.id),window.setTimeout(()=>{var me;(me=R.current)==null||me.scrollIntoView({block:"start",inline:"nearest",behavior:"smooth"})},40)},[]),ae=w.useCallback(ue=>{G(ue),Q({kind:"selected",missionId:ue.id,title:ue.title,planId:ue.sourceIds.planId})},[G]);w.useEffect(()=>{if(!e&&!t)return;const ue=r.find(me=>me.id===e||me.sourceIds.planId===e||(t?me.sourceIds.taskIds.includes(t):!1));ue&&(k("all"),ae(ue),window.setTimeout(()=>{var me;(me=document.getElementById(`mission-card-${tp(ue.id)}`))==null||me.scrollIntoView({block:"center",behavior:"smooth"})},80))},[e,t,r,ae]);const ie=w.useCallback(async ue=>{if(N(ue.id),b(!1),se(null),B||!ue.sourceIds.planId){s(me=>i_(me,ue.id)),f(me=>(me==null?void 0:me.id)!==ue.id?me:i_([me],ue.id)[0]??me),window.setTimeout(()=>{U.current&&(s(me=>a_(me,ue.id)),f(me=>(me==null?void 0:me.id)!==ue.id?me:a_([me],ue.id)[0]??me),N(null))},1200);return}try{const me=await O0(ue),Xe=await O();if(k("all"),me){const it=Xe.find(bt=>bt.id===me||bt.sourceIds.planId===me);if(it)G(it),Q({kind:"dispatched",missionId:it.id,title:it.title,planId:me});else{const bt=await dk(me,5),Lt=v0(bt).find(vt=>vt.id===me);Lt?(G(Lt),Q({kind:"dispatched",missionId:Lt.id,title:Lt.title,planId:me})):f(null)}}else f(it=>(it==null?void 0:it.id)===ue.id?null:it)}catch(me){console.error("[MissionCenter] dispatch failed:",me),b(!1),se(me instanceof Error?me.message:"任务委托失败")}finally{N(null)}},[B,O,G]),z=w.useCallback(async ue=>{if(N(ue.id),b(!1),se(null),B||!ue.sourceIds.planId){await ie(ue);return}try{const me=await I5(ue),Xe=await O();k("all");const it=Xe.find(bt=>bt.id===me||bt.sourceIds.planId===me);it?(G(it),Q({kind:"created",missionId:it.id,title:it.title,planId:me})):(q(me),Q({kind:"created",missionId:me,title:wj(ue.title),planId:me}))}catch(me){console.error("[MissionCenter] restart failed:",me),b(!1),se(me instanceof Error?me.message:"重新执行失败")}finally{N(null)}},[B,O,G,ie]),M=C||Lr(),J=$5(A?r:r.filter(ue=>R5(ue,M)),M),$=J.filter(ue=>ue.sourceIds.planId&&["draft","reviewing","approved"].includes(ue.status.toLowerCase())),_e=w.useCallback(async()=>{if($.length!==0){if(L(!0),b(!1),B){let ue=0;for(const me of $.slice(0,4))window.setTimeout(()=>{U.current&&(N(me.id),s(Xe=>i_(Xe,me.id)))},ue),ue+=400,window.setTimeout(()=>{U.current&&s(Xe=>a_(Xe,me.id))},ue+900);window.setTimeout(()=>{U.current&&(N(null),L(!1))},ue+1200);return}try{for(const ue of $)N(ue.id),await O0(ue);await O(),f(null)}catch(ue){console.error("[MissionCenter] batch dispatch failed:",ue),b(!1),se(ue instanceof Error?ue.message:"批量委托失败")}finally{N(null),L(!1)}}},[B,O,$]),be=(v==="all"?J:J.filter(ue=>O5(ue)===v)).map((ue,me)=>({mission:ue,index:me})).sort((ue,me)=>{const Xe=it=>z5(it)*100+(it.id===I?20:0)+(it.id===(u==null?void 0:u.id)?10:0);return Xe(me.mission)-Xe(ue.mission)||z0(me.mission,M)-z0(ue.mission,M)||$0(ue.mission,M)-$0(me.mission,M)||ue.index-me.index}).map(({mission:ue})=>ue),Ee=(Z==null?void 0:Z.kind)==="created"?"刚创建重新执行任务":(Z==null?void 0:Z.kind)==="dispatched"?"刚委托执行任务":"当前查看任务",Ie=ue=>ue.id!==I?null:(Z==null?void 0:Z.missionId)===ue.id&&Z.kind==="created"?"刚创建":(Z==null?void 0:Z.missionId)===ue.id&&Z.kind==="dispatched"?"刚委托":"当前查看";return c.jsx("div",{className:"de-mission-center-page",children:c.jsxs("div",{className:"de-mission-center-layout",children:[c.jsx("div",{className:"de-mc-list",children:c.jsxs(yi,{children:[c.jsxs(Mi,{title:"任务委托",children:[c.jsx("button",{onClick:_e,className:"de-btn-primary de-btn-sm",disabled:F||$.length===0,children:F?"委托中...":`委托可执行任务(${$.length})`}),c.jsx("button",{onClick:O,className:"de-btn-secondary de-btn-sm",children:Zc("console.action.refresh")})]}),c.jsxs("div",{className:"de-card-body",children:[B&&c.jsx("div",{className:"de-schedule-result de-schedule-result--success",style:{marginBottom:12},children:"当前展示为客户演示场景。真实任务未加载时,页面会自动使用“一天工作流”示例数据。"}),K&&c.jsx("div",{className:"de-schedule-result de-schedule-result--error",style:{marginBottom:12},children:K}),Z&&c.jsxs("div",{className:"de-mission-focus-notice",children:[c.jsx("strong",{children:Ee}),c.jsx("span",{children:Z.title}),Z.planId&&c.jsx("code",{children:Z.planId})]}),c.jsxs("div",{className:"de-date-filter-row",children:[c.jsxs("label",{className:"de-date-filter-field",children:[c.jsx("span",{children:"选择日期"}),c.jsx("input",{type:"date",value:M,onChange:ue=>{x(!1),D(ue.target.value||Lr())}})]}),c.jsxs("div",{className:"de-date-filter-actions","aria-label":"日期切换",children:[c.jsx("button",{type:"button",className:"de-filter-chip",onClick:()=>{x(!1),D(D0(M,-1))},children:"前一天"}),c.jsx("button",{type:"button",className:"de-filter-chip active",onClick:()=>{x(!1),D(Lr())},children:"今天"}),c.jsx("button",{type:"button",className:"de-filter-chip",onClick:()=>{x(!1),D(D0(M,1))},children:"后一天"})]}),c.jsx("span",{className:"de-date-filter-summary",children:A?`全部 ${J.length} 项任务`:`${J.length} 项任务`})]}),c.jsx("div",{className:"de-filter-row",children:N5.map(ue=>c.jsx("button",{className:`de-filter-chip ${v===ue.key?"active":""}`,onClick:()=>k(ue.key),children:ue.label},ue.key))}),p?c.jsx("div",{className:"de-loading-skeleton",style:{height:300}}):g?c.jsx("p",{className:"de-empty-text",children:Zc("console.state.backendDown")}):be.length===0?c.jsxs("div",{className:"de-mission-empty-panel",children:[c.jsx("strong",{children:"当前日期暂无任务"}),c.jsx("p",{children:"这个日期没有匹配到任务记录,演示时可以切回演示日期,或临时查看全部任务。"}),c.jsxs("div",{className:"de-mission-empty-actions",children:[c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",onClick:()=>{x(!0),k("all")},children:"查看全部任务"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>{x(!1),D(n||Lr())},children:"返回演示日期"})]})]}):c.jsx("div",{className:"de-mc-card-list",children:be.map(ue=>c.jsx(_5,{mission:ue,selected:(u==null?void 0:u.id)===ue.id,focusLabel:Ie(ue),dateFilter:M,running:T===ue.id,onSelect:ae,onRun:ie,onRestart:z},ue.id))})]})]})}),c.jsx("div",{className:"de-mc-detail",ref:R,children:u?c.jsx(A5,{mission:u,onClose:()=>f(null)}):c.jsx(yi,{children:c.jsx("div",{className:"de-card-body",children:c.jsxs("div",{className:"de-mission-empty-panel de-mission-empty-panel--detail",children:[c.jsx("strong",{children:"选择一个任务后,右侧会显示执行步骤、运行记录和交付结果。"}),c.jsx("p",{children:"后天演示建议先从左侧选择“自动外呼现场人员”或“接收约时工单”,让领导看到数字员工不是静态页面,而是在按流程接活、执行、反馈。"})]})})})})]})})}const q5=[{value:"all",label:"全部任务"},{value:"daily",label:"日常任务"},{value:"weekly",label:"周任务"},{value:"monthly",label:"月度任务"},{value:"adhoc",label:"临时任务"}],U5={daily:"日常",weekly:"周",monthly:"月度",adhoc:"临时"},H5={allow:"白名单",deny:"黑名单",open:"开放",disabled:"停用"};function jj(e){const t=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/weekly|week|周/.test(t)?"weekly":/monthly|month|月报|月度/.test(t)?"monthly":/monitor|crawler|巡检|监控|待办|日程|日报|日终|收件箱|工作台|客户跟进/.test(t)?"daily":"adhoc"}function r_(e){const t=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return e.capabilityLevel==="specialized"||e.capabilityLevel==="experimental"||/加密|深度|分析|自动化|部署|代码|审查|调研|批量|converter|crypto|github|deploy|review|research/.test(t)}function P5(e){const t=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/日报|周报|报表|待办|日程|巡检|客户|知识库|经营|费用|收件箱|工作台/.test(t)}function F5(e){const t=e.name,n=`${e.id} ${e.name} ${e.description} ${e.category}`.toLowerCase();return/report|报表|日报|周报|月报|汇报/.test(n)?`自动整理${t}材料,减少手工汇总和重复填报。`:/monitor|巡检|监控|预警/.test(n)?`按约定频率完成${t},及时提示异常和遗漏。`:/todo|待办|task|看板|日程/.test(n)?`帮你梳理${t},把后续处理事项集中呈现。`:/客户|crm|回访|满意/.test(n)?"汇总客户相关信息,形成可直接跟进的处理建议。":/知识|文档|制度|模板/.test(n)?"查找和核对资料内容,减少人工翻找和版本确认。":e.description}function G5(e,t,n){return e.enabled?"已学习":e.enabled?n?"需确认后学习":t?"建议学习":"可学习":"暂不使用"}function V5(e){var n,a;const t=[];return e.serverId&&t.push(e.serverId),e.running!==null&&e.running!==void 0&&t.push(e.running?"运行中":"未运行"),e.policySource==="remote"&&t.push("远端策略"),e.remotePolicy&&e.remotePolicy.enabled===!1&&t.push("管理端禁用"),e.governancePolicy&&t.push(H5[e.governancePolicy]),typeof e.toolCount=="number"&&t.push(`${e.toolCount} 工具`),(n=e.allowTools)!=null&&n.length&&t.push(`allow ${e.allowTools.length}`),(a=e.denyTools)!=null&&a.length&&t.push(`deny ${e.denyTools.length}`),t.slice(0,5)}function Y5(e){var a;const t=(a=e.recentCalls)==null?void 0:a[0];return t?`${t.toolName?`${t.toolName} · `:""}${t.message||t.status||"最近调用"}`:typeof e.callCount=="number"&&e.callCount>0?`${e.callCount} 次调用`:null}function K5({skill:e,recommended:t=!1,advanced:n=!1,selected:a=!1,updating:r=!1,onSelect:s,onToggle:u,onAudit:f}){const p=jj(e),m=G5(e,t,n),g=V5(e),b=Y5(e);return c.jsxs("div",{id:`skill-card-${tp(e.id)}`,className:`de-skill-card ${a?"de-skill-card--selected":""}`,role:"button",tabIndex:0,onClick:()=>s==null?void 0:s(e),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),s==null||s(e))},children:[c.jsxs("div",{className:"de-skill-card-head",children:[c.jsx("span",{className:"de-skill-name",children:e.name}),c.jsx("span",{className:`de-skill-status ${e.enabled?"enabled":"disabled"}`,children:m})]}),c.jsx("p",{className:"de-skill-desc",children:F5(e)}),g.length>0&&c.jsx("div",{className:"de-skill-meta-row",children:g.map(v=>c.jsx("span",{className:"de-skill-meta-chip",children:v},v))}),b&&c.jsxs("p",{className:"de-skill-recent",children:["最近:",b]}),c.jsxs("div",{className:"de-skill-card-foot",children:[c.jsxs("span",{className:"de-skill-version",children:["适用任务:",U5[p]]}),c.jsx("button",{className:`de-skill-btn ${e.enabled?"de-skill-btn--danger":""}`,disabled:r,title:e.enabled?"暂时停用此技能,后续路由不会选择它。":"恢复使用此技能。",onClick:v=>{v.stopPropagation(),r||u==null||u(e)},children:r?"处理中...":e.enabled?"暂不使用":"恢复使用"}),c.jsx("button",{className:"de-skill-btn",title:"查看该技能的调用审计。",onClick:v=>{v.stopPropagation(),f==null||f(e)},children:"技能审计"})]})]})}function Q5({focusSkillId:e,onNavigate:t}){const[n,a]=w.useState([]),[r,s]=w.useState(!0),[u,f]=w.useState(!1),[p,m]=w.useState(""),[g,b]=w.useState("all"),[v,k]=w.useState(e??null),[C,D]=w.useState(null),[A,x]=w.useState(!1),[T,N]=w.useState(null),[F,L]=w.useState(null),B=w.useRef(!1);w.useEffect(()=>(B.current=!0,()=>{B.current=!1}),[]);const P=w.useCallback(async()=>{s(!0),f(!1);try{const M=await tM();if(!B.current)return;a(Array.isArray(M)?e5(M):[])}catch(M){if(!B.current)return;console.error("[SkillLibrary] fetch failed:",M),a([]),f(!0)}finally{B.current&&s(!1)}},[]);w.useEffect(()=>{P()},[P]),w.useEffect(()=>{e&&(k(e),b("all"),m(""),window.setTimeout(()=>{var M;(M=document.getElementById(`skill-card-${tp(e)}`))==null||M.scrollIntoView({block:"center",behavior:"smooth"})},80))},[e,n.length]);const K=w.useCallback(async M=>{const J=!M.enabled;D(M.id),N(null),L(null);try{const $=await nM(M.id,J);if(!$.ok)throw new Error($.error||"技能状态变更失败");a(_e=>_e.map(we=>we.id===M.id?{...we,enabled:J}:we)),k(M.id)}catch($){N($ instanceof Error?$.message:"技能状态变更失败")}finally{D(null)}},[]),se=w.useCallback(async()=>{x(!0),N(null),L(null);try{const M=await ew();if(!M.ok)throw new Error(M.error||"技能策略拉取失败");await P(),L(M.skipped?"技能策略无需重复拉取。":"技能策略已更新。")}catch(M){N(M instanceof Error?M.message:"技能策略拉取失败")}finally{x(!1)}},[P]),I=n.filter(M=>g==="all"||jj(M)===g).filter(M=>p?[M.name,M.description,M.category,M.serverId,...M.tools??[],...M.allowTools??[],...M.denyTools??[]].filter(Boolean).join(" ").includes(p):!0),q=I.filter(r_),Z=new Set(q.map(M=>M.id)),Q=I.filter(M=>M.enabled&&!Z.has(M.id)),R=I.filter(M=>!M.enabled&&P5(M)&&!r_(M)),U=I.filter(M=>!M.enabled&&!r_(M)),O=(R.length>0?R:U).slice(0,4),G=new Set(O.map(M=>M.id)),ae=U.filter(M=>!G.has(M.id)),ie=[{key:"recommended",title:"推荐学习",hint:"优先补齐高频工作能力,适合让数字员工尽快接手重复事务。",skills:O,emptyText:"暂无推荐学习项。"},{key:"learnable",title:"可学习技能",hint:"可纳入数字员工日常工作的业务能力,学习入口待接入后启用。",skills:ae,emptyText:"当前没有可学习技能。"},{key:"learned",title:"已学技能",hint:"数字员工已经掌握并可被业务场景调用的能力。",skills:Q,emptyText:"当前还没有已学习技能。"},{key:"advanced",title:"高级技能",hint:"适合有明确边界或需要确认后再交给数字员工处理的能力。",skills:q,emptyText:"暂无高级技能。"}],z=M=>c.jsxs("section",{style:{display:"grid",gap:10},children:[c.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[c.jsxs("div",{children:[c.jsx("h3",{style:{margin:0,fontSize:16,color:"var(--de-text-primary)"},children:M.title}),c.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--de-text-muted)"},children:M.hint})]}),c.jsxs("span",{className:"de-capability-badge de-capability-standard",children:[M.skills.length," 项"]})]}),M.skills.length===0?c.jsx("p",{className:"de-empty-text",style:{margin:0},children:M.emptyText}):c.jsx("div",{className:"de-skill-grid",children:M.skills.map(J=>c.jsx(K5,{skill:J,recommended:M.key==="recommended",advanced:M.key==="advanced",selected:v===J.id,updating:C===J.id,onSelect:$=>k($.id),onToggle:K,onAudit:$=>t==null?void 0:t({tab:"skill-audit",auditSkillId:$.id})},`${M.key}-${J.id}`))})]},M.key);return c.jsx("div",{style:{padding:"14px 18px"},children:c.jsxs(yi,{children:[c.jsxs(Mi,{title:"学习技能",children:[c.jsx("button",{onClick:se,disabled:A,className:"de-btn-secondary de-btn-sm",children:A?"拉取中...":"拉取策略"}),c.jsx("button",{onClick:P,className:"de-btn-secondary de-btn-sm",children:"刷新"})]}),c.jsxs("div",{className:"de-card-body",children:[T&&c.jsx("div",{className:"de-schedule-result de-schedule-result--error",style:{marginBottom:12},children:T}),F&&c.jsx("div",{className:"de-schedule-result",style:{marginBottom:12},children:F}),c.jsxs("div",{className:"de-skill-toolbar",children:[c.jsx("input",{type:"text",className:"de-input",placeholder:"搜索业务能力...",value:p,onChange:M=>m(M.target.value)}),c.jsx("div",{className:"de-filter-row",children:q5.map(M=>c.jsx("button",{className:`de-filter-chip ${g===M.value?"active":""}`,onClick:()=>b(M.value),children:M.label},M.value))})]}),r?c.jsx("div",{className:"de-loading-skeleton",style:{height:300}}):u?c.jsx("p",{className:"de-empty-text",children:"技能目录暂不可用,请检查 qimingclaw bridge 或稍后刷新。"}):I.length===0&&n.length>0?c.jsx("p",{className:"de-empty-text",children:"无匹配技能,请调整搜索或筛选条件"}):I.length===0?c.jsx("p",{className:"de-empty-text",children:"暂无可展示的学习技能。"}):c.jsx("div",{style:{display:"grid",gap:18},children:ie.map(z)})]})]})})}const X5={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(260px, 1fr))",gap:12},Qd={border:"1px solid var(--de-glass-border-lighter)",borderRadius:10,padding:"12px 14px",background:"linear-gradient(180deg, rgba(244,250,255,0.82), rgba(235,246,255,0.58))"};function Z5(){const e=new Date;return[e.getFullYear(),String(e.getMonth()+1).padStart(2,"0"),String(e.getDate()).padStart(2,"0")].join("-")}function J5(e){return(e==null?void 0:e.status)==="ready"?"已生成":(e==null?void 0:e.status)==="generating"?"生成中":(e==null?void 0:e.status)==="failed"?"生成失败":"待生成"}function W5(e){return(e==null?void 0:e.status)==="ready"?"de-report-badge--ready":"de-report-badge--waiting"}function eB(e){return e?e.generated_by==="ai"?`AI 已生成日报${e.model?`:${e.model}`:""}`:"AI 不可用时已使用规则兜底生成日报":"AI 将基于当天任务和运行明细生成日报"}function tB(e){if(!e)return[];const t=e.duties.filter(n=>n.selected).map(n=>n.id);return t.length>0?t:e.duties.filter(n=>n.implemented).map(n=>n.id)}function Cj(e){if(!e)return"暂未生成";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function nB(e,t){const n=new Blob([t],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(n),r=document.createElement("a");r.href=a,r.download=e,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)}function L0(e,t,n){const a=new Blob([t],{type:n}),r=URL.createObjectURL(a),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),s.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}function iB(e){const t=window.atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}function s_(e){return`qimingclaw-digital-report-${e}.txt`}function aB(e,t,n,a,r){return[t.title||`${e} 数字员工日报`,`日期:${e}`,`生成时间:${Cj(t.generated_at)}`,`生成来源:${t.generated_by==="ai"?"AI":"qimingclaw adapter"}`,"","## 摘要",t.summary||"暂无摘要。","","## 指标",`任务总数:${t.totals.task_count}`,`执行次数:${t.totals.execution_count}`,`成功次数:${t.totals.success_count}`,`失败次数:${t.totals.failure_count}`,`运行中:${t.totals.running_count??0}`,"","## 任务汇总",...n.length>0?n.map(s=>`- ${s.title}:${s.latest_status_label},执行 ${s.total_count} 次,成功 ${s.success_count},失败 ${s.failure_count}。${s.ai_summary||s.business_summary||""}`):["暂无任务汇总。"],"","## 运行明细",...a.length>0?a.map(s=>`- ${s.time||"--:--"} ${s.task_name} / ${s.step_name||s.operation_name||"任务执行"}:${s.status_label},${s.business_detail}`):["暂无运行明细。"],"","## 产物来源",...r.length>0?r.map(s=>`- ${s.name}:${s.source_label||s.source_type||"未知来源"}${s.uri?`,${s.uri}`:""}`):["暂无产物来源。"],"","## 详情",...(t.detail_lines??[]).length>0?t.detail_lines:["暂无详情。"]].join(`
|
||
`)}function lB({sections:e}){return e.length===0?c.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"今天还没有可汇总的任务。"}):c.jsx("div",{className:"de-task-summary-grid","aria-label":"日报任务汇总",children:e.map(t=>c.jsxs("div",{className:`de-task-summary-card de-live-feed-row--${t.latest_status_tone||"info"}`,children:[c.jsx("span",{className:"de-task-summary-title",children:t.title}),c.jsx("span",{className:"de-badge de-badge-info",children:t.latest_status_label}),c.jsxs("strong",{children:["执行次数 ",t.total_count]}),c.jsxs("small",{children:["成功次数 ",t.success_count," · 失败次数 ",t.failure_count]}),c.jsx("em",{children:t.ai_summary||t.business_summary})]},t.id))})}function rB({details:e}){return e.length===0?c.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"任务执行后,这里会展示时间、任务、步骤和执行情况。"}):c.jsxs("div",{className:"de-run-detail-list de-run-detail-list-scroll","aria-label":"日报运行明细",children:[c.jsxs("div",{className:"de-run-detail-row de-run-detail-row--head",children:[c.jsx("span",{children:"时间"}),c.jsx("span",{children:"任务名称"}),c.jsx("span",{children:"步骤名称"}),c.jsx("span",{children:"执行状态"}),c.jsx("span",{children:"执行情况"})]}),e.map(t=>c.jsxs("div",{className:`de-run-detail-row de-live-feed-row--${t.status_tone||"info"}`,children:[c.jsx("span",{children:t.time||"--:--"}),c.jsx("strong",{children:t.task_name}),c.jsx("em",{children:t.step_name||t.operation_name||"任务执行"}),c.jsx("i",{className:"de-badge de-badge-info",children:t.status_label}),c.jsx("span",{children:t.business_detail})]},t.id))]})}function sB({artifacts:e}){var D,A;const[t,n]=w.useState(null),[a,r]=w.useState(null),[s,u]=w.useState(null),[f,p]=w.useState(null);if(e.length===0)return c.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"运行产物出现后,这里会展示文件、输出和来源记录。"});const m=(x,T)=>({...x,retention_status:String((T==null?void 0:T.retention_status)||x.retention_status||"unmanaged"),retention_until:String((T==null?void 0:T.retention_until)||x.retention_until||"")||null,last_retention_action:String((T==null?void 0:T.last_retention_action)||x.last_retention_action||"")||null,cleanup_status:String((T==null?void 0:T.cleanup_status)||x.cleanup_status||"")||null,deleted_at:String((T==null?void 0:T.deleted_at)||x.deleted_at||"")||null,cleanup_reason:String((T==null?void 0:T.cleanup_reason)||x.cleanup_reason||"")||null,cleanup_event_id:String((T==null?void 0:T.cleanup_event_id)||x.cleanup_event_id||"")||null,access:(T==null?void 0:T.access)||x.access}),g=async(x,T)=>{if(!x.id||t)return;const N=`${x.id}:${T}`;n(N),r(null);try{const F=await lw(x.id,T);if(!(F!=null&&F.ok)){r((F==null?void 0:F.error)||"产物访问被拒绝");return}if(T==="preview"){const L=F.preview||{};u({title:String(L.name||x.name||"产物预览"),text:String(L.text||`${L.mime||x.kind||"artifact"} · ${L.size??"unknown"}`)})}else r(T==="download"?"已打开产物":"已打开位置")}catch(F){r(F instanceof Error?F.message:"产物访问失败")}finally{n(null)}},b=async x=>{if(!(!x.id||t)){n(`${x.id}:detail`),r(null);try{const[T,N]=await Promise.all([Bd(x.id),qd(x.id)]);p({artifact:m(x,T),item:T,versions:N})}catch(T){r(T instanceof Error?T.message:"读取产物详情失败")}finally{n(null)}}},v=async x=>{const T=f==null?void 0:f.artifact;if(!(!(T!=null&&T.id)||t)){n(`${T.id}:${x}`),r(null);try{const N=await aM(T.id,x,{reason:"digital_employee_artifact_governance"});if(!(N!=null&&N.ok)){r((N==null?void 0:N.error)||"保留策略写入失败");return}const[F,L]=await Promise.all([Bd(T.id),qd(T.id)]);p({artifact:m(T,F),item:F,versions:L}),r("保留策略已记录")}catch(N){r(N instanceof Error?N.message:"保留策略写入失败")}finally{n(null)}}},k=async()=>{const x=f==null?void 0:f.artifact;if(!(!(x!=null&&x.id)||t)){n(`${x.id}:cleanup`),r(null);try{const T=await lM(x.id,{reason:"digital_employee_artifact_cleanup",retention_status:x.retention_status||null,last_retention_action:x.last_retention_action||null});if(!(T!=null&&T.ok)){r((T==null?void 0:T.error)||"清理文件失败");return}const[N,F]=await Promise.all([Bd(x.id),qd(x.id)]);p({artifact:m(x,N),item:N,versions:F}),r("清理已记录")}catch(T){r(T instanceof Error?T.message:"清理文件失败")}finally{n(null)}}},C=async()=>{if(t)return;const x=e.map(T=>T.id).filter(Boolean);if(x.length!==0){n("artifact-batch:mark_expire"),r(null);try{const T=await sw(x,"mark_expire",{reason:"digital_employee_daily_report_batch_retention"});if(!(T!=null&&T.ok)){r((T==null?void 0:T.error)||"批量标记到期失败");return}if(f!=null&&f.artifact.id){const[N,F]=await Promise.all([Bd(f.artifact.id),qd(f.artifact.id)]);p({artifact:m(f.artifact,N),item:N,versions:F})}r(`批量标记到期已记录:${T.recorded??0}/${T.total??x.length}`)}catch(T){r(T instanceof Error?T.message:"批量标记到期失败")}finally{n(null)}}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"de-artifact-retention-actions",children:c.jsx("button",{type:"button",className:"de-btn-secondary",disabled:t!==null,onClick:()=>{C()},children:"批量标记到期"})}),c.jsx("div",{className:"de-artifact-source-list","aria-label":"日报产物来源",children:e.map(x=>{var L,B,P,K;const T=!!((L=x.access)!=null&&L.previewable),N=!!((B=x.access)!=null&&B.downloadable),F=!!((P=x.access)!=null&&P.openable);return c.jsxs("div",{className:"de-artifact-source-row",children:[c.jsx("strong",{children:x.name}),c.jsx("span",{children:x.source_label||x.source_type||"未知来源"}),c.jsxs("div",{className:"de-artifact-source-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",disabled:!T||t!==null,onClick:()=>g(x,"preview"),title:"预览","aria-label":"预览",children:c.jsx(O1,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:!N||t!==null,onClick:()=>g(x,"download"),title:"下载","aria-label":"下载",children:c.jsx(y_,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:!F||t!==null,onClick:()=>g(x,"open_location"),title:"位置","aria-label":"位置",children:c.jsx(I1,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:t!==null,onClick:()=>b(x),title:"版本","aria-label":"版本",children:c.jsx(ZE,{size:15})})]}),c.jsxs("div",{className:"de-artifact-source-meta",children:[c.jsx("span",{children:x.version||"local-v1"}),c.jsx("span",{children:x.retention_status||"unmanaged"}),x.cleanup_status?c.jsx("span",{children:x.cleanup_status}):null,x.delivery_status?c.jsx("span",{children:x.delivery_status}):null,(K=x.access)!=null&&K.last_access_status?c.jsx("span",{children:x.access.last_access_status}):null]}),x.uri?c.jsx("code",{children:x.uri}):c.jsx("em",{children:x.kind||"artifact"})]},x.id)})}),a?c.jsx("p",{className:"de-inline-notice",children:a}):null,s?c.jsxs("div",{className:"de-artifact-preview",children:[c.jsxs("div",{children:[c.jsx("strong",{children:s.title}),c.jsx("button",{type:"button",className:"de-btn-secondary",onClick:()=>u(null),children:"关闭"})]}),c.jsx("pre",{children:s.text})]}):null,f?c.jsxs("div",{className:"de-artifact-preview",children:[c.jsxs("div",{children:[c.jsx("strong",{children:f.artifact.name}),c.jsx("button",{type:"button",className:"de-btn-secondary",onClick:()=>p(null),children:"关闭"})]}),c.jsxs("div",{className:"de-artifact-source-meta",children:[c.jsx("span",{children:f.artifact.retention_status||"unmanaged"}),f.artifact.cleanup_status?c.jsx("span",{children:f.artifact.cleanup_status}):null,f.artifact.deleted_at?c.jsx("span",{children:f.artifact.deleted_at}):null]}),c.jsxs("div",{className:"de-artifact-retention-actions",children:[c.jsx("button",{type:"button",className:"de-btn-secondary",disabled:t!==null,onClick:()=>v("mark_keep"),children:"保留"}),c.jsx("button",{type:"button",className:"de-btn-secondary",disabled:t!==null,onClick:()=>v("mark_expire"),children:"到期"}),c.jsx("button",{type:"button",className:"de-btn-secondary",disabled:t!==null,onClick:()=>v("mark_review"),children:"复核"}),c.jsx("button",{type:"button",className:"de-btn-secondary",disabled:t!==null,onClick:()=>v("clear_retention"),children:"清除"}),c.jsxs("button",{type:"button",className:"de-btn-secondary",disabled:t!==null||f.artifact.cleanup_status==="deleted"||!(f.artifact.retention_status==="expired"||f.artifact.last_retention_action==="mark_expire")||!((D=f.artifact.access)!=null&&D.downloadable||(A=f.artifact.access)!=null&&A.openable),onClick:()=>{k()},children:[c.jsx(U1,{size:14})," 清理文件"]})]}),c.jsx("div",{className:"de-artifact-version-list",children:(f.versions.length>0?f.versions:[f.item]).filter(Boolean).map(x=>{var T;return c.jsxs("div",{children:[c.jsx("strong",{children:String(x.version||"local-v1")}),c.jsx("span",{children:String(((T=x.delivery_summary)==null?void 0:T.delivery_status)||x.source_label||"未记录")}),c.jsx("em",{children:String(x.created_at||"")})]},String(x.artifact_id||x.version_key||x.created_at))})})]}):null]})}function oB({focusSection:e}){const t=w.useMemo(()=>Z5(),[]),[n,a]=w.useState(null),[r,s]=w.useState("18:00"),[u,f]=w.useState(!0),[p,m]=w.useState(null),[g,b]=w.useState(null),v=w.useRef(!1),k=(n==null?void 0:n.source)==="live",C=k?(n==null?void 0:n.daily_report)??null:null,D=k?(C==null?void 0:C.task_sections)??(n==null?void 0:n.execution_summaries)??[]:[],A=k?(n==null?void 0:n.run_details)??[]:[],x=k?(C==null?void 0:C.artifact_sources)??[]:[],T=k?null:(n==null?void 0:n.demo_reason)??"当前没有真实运行投影,日报区域暂不展示兜底数据。",N=(C==null?void 0:C.totals)??{task_count:D.length,execution_count:D.reduce((I,q)=>I+q.total_count,0),success_count:D.reduce((I,q)=>I+q.success_count,0),failure_count:D.reduce((I,q)=>I+q.failure_count,0),running_count:D.reduce((I,q)=>I+q.running_count,0)},F=w.useCallback(async()=>{var I;f(!0),b(null);try{const q=await rf(t);if(!v.current)return;a(q),s(q.source==="live"&&((I=q.daily_report)==null?void 0:I.report_schedule_time)||"18:00")}catch(q){if(!v.current)return;b(q instanceof Error?q.message:"日报数据加载失败")}finally{v.current&&f(!1)}},[t]);w.useEffect(()=>(v.current=!0,F(),()=>{v.current=!1}),[F]),w.useEffect(()=>{!e||u||window.setTimeout(()=>{var I;(I=document.getElementById(`report-section-${e}`))==null||I.scrollIntoView({block:"center",behavior:"smooth"})},80)},[e,u]);const L=w.useCallback(async()=>{var I;m("update_report_schedule"),b(null);try{const q=await Ws({action:"update_report_schedule",date:t,report_schedule_time:r});if(!v.current)return;a(q),s(q.source==="live"&&((I=q.daily_report)==null?void 0:I.report_schedule_time)||r),b("日报生成时间已更新。")}catch(q){if(!v.current)return;b(q instanceof Error?q.message:"日报生成时间设置失败")}finally{v.current&&m(null)}},[r,t]),B=w.useCallback(async()=>{var I;m("generate_daily_report"),b(null);try{const q=await Ws({action:"generate_daily_report",date:t,duty_ids:k?tB(n):[],report_schedule_time:r});if(!v.current)return;a(q),s(q.source==="live"&&((I=q.daily_report)==null?void 0:I.report_schedule_time)||r),b("日报已生成,可下载本地文本。")}catch(q){if(!v.current)return;b(q instanceof Error?q.message:"日报生成失败")}finally{v.current&&m(null)}},[k,n,r,t]),P=w.useCallback(()=>{!C||C.status!=="ready"||nB(C.download_filename||s_(t),C.text_content||aB(t,C,D,A,x))},[x,C,A,D,t]),K=w.useCallback(async I=>{if(!C||C.status!=="ready")return;const q=I==="html"?C.html_artifact_id:C.pdf_artifact_id;if(q){m(I==="html"?"download_html":"download_pdf"),b(null);try{const Z=await lw(q,"download");if(!(Z!=null&&Z.ok)){b((Z==null?void 0:Z.error)||"日报导出失败");return}const Q=Z.preview||{};if(I==="html")L0(C.html_filename||s_(t).replace(/\.txt$/,".html"),String(Q.text||C.html_content||""),"text/html;charset=utf-8"),b("HTML 日报已导出。");else{const R=String(Q.base64||"");if(!R){b("PDF 日报内容不可用");return}L0(C.pdf_filename||s_(t).replace(/\.txt$/,".pdf"),iB(R),"application/pdf"),b("PDF 日报已导出。")}}catch(Z){if(!v.current)return;b(Z instanceof Error?Z.message:"日报导出失败")}finally{v.current&&m(null)}}},[C,t]),se=w.useCallback(async I=>{if(!(C!=null&&C.report_id))return;m({send:"send_report",confirm:"confirm_report",request_approval:"request_approval"}[I]),b(null);try{const Z=await rw({reportId:C.report_id,action:I,status:I==="send"?"sent":I==="confirm"?"confirmed":"pending",actor:I==="confirm"?"management":"digital_employee_operator",endpoint:"management-console"});if(!(Z!=null&&Z.eventId)&&!(Z!=null&&Z.event_id)){b("日报交付记录未写入");return}b(I==="send"?"日报发送记录已写入。":I==="confirm"?"管理端确认回执已写入。":"日报发送审批已创建。"),await F()}catch(Z){if(!v.current)return;b(Z instanceof Error?Z.message:"日报交付记录失败")}finally{v.current&&m(null)}},[F,C==null?void 0:C.report_id]);return c.jsx("div",{style:{padding:"14px 18px"},children:c.jsxs(yi,{children:[c.jsx(Mi,{title:"日报生成",children:c.jsx("span",{className:"de-card-meta-text",children:t})}),c.jsx("div",{className:"de-card-body",children:u?c.jsx("div",{className:"de-loading-skeleton",style:{height:420}}):c.jsxs(c.Fragment,{children:[c.jsxs("section",{id:"report-section-today",className:"de-report-summary",style:{marginBottom:12},children:[c.jsxs("div",{className:"de-report-summary-head",children:[c.jsxs("div",{className:"de-report-summary-title-row",children:[c.jsx("h3",{children:(C==null?void 0:C.title)||"数字员工日报"}),c.jsx("p",{children:eB(C)})]}),c.jsx("span",{className:`de-report-badge ${W5(C)}`,children:J5(C)})]}),c.jsxs("div",{className:"de-report-summary-body",children:[c.jsxs("div",{className:"de-report-schedule-row",children:[c.jsxs("label",{children:[c.jsx("span",{children:"生成时间"}),c.jsx("input",{type:"time",value:r,onChange:I=>s(I.target.value||"18:00")})]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p==="update_report_schedule",onClick:()=>{L()},children:"设置时间"}),c.jsx("button",{type:"button",className:"de-btn-primary de-btn-sm",disabled:p==="generate_daily_report",onClick:()=>{B()},children:p==="generate_daily_report"?"生成中...":"生成日报"}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm de-report-download-btn",disabled:!(C!=null&&C.pdf_available),onClick:P,title:C!=null&&C.pdf_available?"下载本地日报文本":"生成日报后可下载本地日报",children:[c.jsx(y_,{size:14,"aria-hidden":"true"}),"下载日报"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!(C!=null&&C.html_artifact_id)||p==="download_html",onClick:()=>{K("html")},title:"导出 HTML 日报",children:[c.jsx(L1,{size:14,"aria-hidden":"true"}),"导出 HTML"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!(C!=null&&C.pdf_artifact_id)||p==="download_pdf",onClick:()=>{K("pdf")},title:"导出 PDF 日报",children:[c.jsx(y_,{size:14,"aria-hidden":"true"}),"导出 PDF"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!(C!=null&&C.report_id)||p==="send_report",onClick:()=>{se("send")},title:"记录日报发送",children:[c.jsx(hg,{size:14,"aria-hidden":"true"}),"记录发送"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!(C!=null&&C.report_id)||p==="confirm_report",onClick:()=>{se("confirm")},title:"写入管理端确认",children:[c.jsx(mg,{size:14,"aria-hidden":"true"}),"确认回执"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!(C!=null&&C.report_id)||p==="request_approval",onClick:()=>{se("request_approval")},title:"发起日报审批",children:[c.jsx(_g,{size:14,"aria-hidden":"true"}),"发起审批"]})]}),c.jsxs("div",{className:"de-report-metrics",children:[c.jsxs("div",{className:"de-report-metric",children:[c.jsx("span",{children:"任务总数"}),c.jsx("strong",{children:N.task_count})]}),c.jsxs("div",{className:"de-report-metric",children:[c.jsx("span",{children:"执行次数"}),c.jsx("strong",{children:N.execution_count})]}),c.jsxs("div",{className:"de-report-metric",children:[c.jsx("span",{children:"成功次数"}),c.jsx("strong",{children:N.success_count})]}),c.jsxs("div",{className:"de-report-metric",children:[c.jsx("span",{children:"失败次数"}),c.jsx("strong",{children:N.failure_count})]})]}),c.jsxs("div",{className:"de-report-meta",children:[c.jsx("p",{children:(C==null?void 0:C.summary)||"点击生成日报后,AI 会基于当天所有任务写出总分结构日报。"}),T?c.jsx("p",{children:T}):null,c.jsxs("p",{children:["计划生成时间:",r,";最近生成:",Cj(C==null?void 0:C.generated_at)]}),g?c.jsx("p",{children:g}):null]})]})]}),c.jsxs("div",{style:X5,children:[c.jsxs("section",{id:"report-section-tasks",style:Qd,children:[c.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"任务汇总"}),c.jsx(lB,{sections:D})]}),c.jsxs("section",{id:"report-section-details",style:Qd,children:[c.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"运行明细"}),c.jsx(rB,{details:A})]}),c.jsxs("section",{id:"report-section-artifacts",style:Qd,children:[c.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"产物来源"}),c.jsx(sB,{artifacts:x})]}),c.jsxs("section",{id:"report-section-summary",style:Qd,children:[c.jsx("h3",{className:"de-settings-heading",style:{marginTop:0},children:"日报内容"}),((C==null?void 0:C.detail_lines)??[]).length===0?c.jsx("p",{className:"de-empty-text",style:{padding:"18px 0 6px"},children:"生成日报后会展示 AI 整理后的分项说明。"}):c.jsx("div",{className:"de-report-meta",children:((C==null?void 0:C.detail_lines)??[]).map(I=>c.jsx("p",{children:I},I))})]})]})]})})]})})}const Tj=[{id:"plans",label:"计划"},{id:"tasks",label:"任务"},{id:"runs",label:"运行"},{id:"events",label:"事件"},{id:"artifacts",label:"产物"},{id:"artifact-groups",label:"产物聚合"},{id:"approvals",label:"审批"}],cB={padding:"14px 18px"},uB={display:"grid",gridTemplateColumns:"minmax(180px, 1fr) repeat(4, minmax(120px, 160px)) auto",gap:8,alignItems:"end",marginBottom:12},dB={display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(280px, 360px)",gap:12,alignItems:"start"},fB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},pB={width:"100%",minWidth:840,borderCollapse:"collapse"},I0={border:"1px solid var(--de-glass-border-lighter)",borderRadius:8,background:"rgba(255,255,255,0.72)",overflow:"hidden"},mB={padding:18,color:"var(--de-text-muted)",fontSize:13},B0={entity:"",status:"",syncStatus:"",updatedFrom:"",updatedTo:"",pageSize:20};function q0(e){return Tj.some(t=>t.id===e)?e:"plans"}function Zt(e,t="-"){return e==null||e===""?t:String(e)}function fa(e){return Zt(e.entity_id||e.plan_id||e.task_id||e.run_id||e.event_id||e.artifact_id||e.approval_id,"unknown")}function Ej(e){return Zt(e.title||e.summary||e.kind||fa(e),"未命名业务对象")}function X_(e){return Zt(e.updated_at||e.occurred_at||e.finished_at||e.started_at||e.created_at)}function hB(e,t){return t==="plans"?`任务 ${Zt(e.task_count,"0")} / 运行 ${Zt(e.run_count,"0")}`:t==="runs"?Zt(e.last_event_message||e.duration_ms,"无最近事件"):t==="events"?Zt(e.kind,"event"):t==="artifacts"?Zt(e.cleanup_status||e.deleted_at||e.uri||e.kind,"artifact"):t==="artifact-groups"?`产物 ${Zt(e.artifact_count,"0")} / 设备 ${Zt(e.device_count,"0")} / 版本 ${Zt(e.version_count,"0")}`:t==="approvals"?Zt(e.approval_conflict_resolution||e.approval_conflict_resolved_at||e.decision||e.approval_conflict_reason||e.kind,"approval"):Zt(e.assigned_skill_id||e.operation||e.kind)}function Xd(e){return Array.isArray(e.artifact_ids)?e.artifact_ids.map(String).filter(Boolean):e.artifact_id?[String(e.artifact_id)]:[]}function _B(e,t){return{entity_id:e.entity.trim()||null,status:e.status.trim()||null,sync_status:e.syncStatus.trim()||null,updated_from:e.updatedFrom||null,updated_to:e.updatedTo||null,page_no:t,page_size:e.pageSize}}function gB(e){const t=String(e||"").toLowerCase();return["failed","error","rejected","conflict"].some(n=>t.includes(n))?"de-badge de-badge-danger":["pending","running","syncing","ready"].some(n=>t.includes(n))?"de-badge de-badge-warning":"de-badge de-badge-info"}function yB(e){return e.notification_id||e.entity_type==="notification"?{label:"打开通知运营",search:`?tab=notification-workbench&entity=${encodeURIComponent(fa(e))}`}:e.report_id||e.entity_type==="daily_report"?{label:"打开日报运营",search:`?tab=daily-report-workbench&entity=${encodeURIComponent(fa(e))}`}:e.service_id||e.audit_id||e.entity_type==="managed_service"||e.entity_type==="audit"?{label:"打开处置台",search:`?tab=ops-workbench&entity=${encodeURIComponent(fa(e))}`}:null}function bB({row:e,onClose:t}){if(!e)return c.jsx("aside",{style:I0,children:c.jsx("div",{style:mB,children:"选择一行业务对象查看详情。"})});const n=e.business_view||e.payload?{business_view:e.business_view??null,payload:e.payload??null}:null,a=yB(e);return c.jsxs("aside",{style:I0,"aria-label":"业务视图详情",children:[c.jsxs("div",{className:"de-artifact-preview",children:[c.jsxs("div",{children:[c.jsx("strong",{children:Ej(e)}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:t,title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:[`实体:${fa(e)}`,`状态:${Zt(e.status)}`,`同步:${Zt(e.sync_status)}`,`Plan:${Zt(e.plan_id)}`,`Task:${Zt(e.task_id)}`,`Run:${Zt(e.run_id)}`,`时间:${X_(e)}`,e.sync_record_url?`Sync Record:${e.sync_record_url}`:"",e.summary?`摘要:${e.summary}`:""].filter(Boolean).join(`
|
||
`)}),a?c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",onClick:()=>{window.location.search=a.search},children:a.label}):null]}),n?c.jsxs("details",{className:"de-business-json",open:!0,children:[c.jsx("summary",{children:"JSON 详情"}),c.jsx("pre",{children:JSON.stringify(n,null,2)})]}):null]})}function vB({initialKind:e,focusEntityId:t}){const[n,a]=w.useState(()=>q0(e)),[r,s]=w.useState({...B0,entity:t||""}),[u,f]=w.useState(1),[p,m]=w.useState([]),[g,b]=w.useState(0),[v,k]=w.useState(null),[C,D]=w.useState(null),[A,x]=w.useState([]),[T,N]=w.useState(!1),[F,L]=w.useState(null),[B,P]=w.useState(null);w.useEffect(()=>{a(q0(e))},[e]),w.useEffect(()=>{t&&s(R=>({...R,entity:t}))},[t]);const K=w.useCallback(async()=>{N(!0),L(null);try{const R=await FD(n,_B(r,u));m(R.items??[]),b(R.total??0),k(R.source??null),x(U=>U.filter(O=>(R.items??[]).some(G=>Xd(G).includes(O)))),D(U=>U?(R.items??[]).find(O=>fa(O)===fa(U))??null:null)}catch(R){m([]),b(0),L(R instanceof Error?R.message:"业务视图加载失败")}finally{N(!1)}},[r,n,u]);w.useEffect(()=>{K()},[K]);const se=w.useMemo(()=>Math.max(1,Math.ceil(g/r.pageSize)),[r.pageSize,g]),I=n==="artifacts"||n==="artifact-groups",q=(R,U)=>{s(O=>({...O,[R]:U})),f(1)},Z=R=>{const U=Xd(R);x(O=>U.length>0&&U.every(ae=>O.includes(ae))?O.filter(ae=>!U.includes(ae)):Array.from(new Set([...O,...U])))},Q=async R=>{if(!(A.length===0||T)){N(!0),P(null),L(null);try{const U=await sw(A,R,{reason:"digital_employee_artifact_batch_governance"});if(!(U!=null&&U.ok)){P((U==null?void 0:U.error)||"批量保留策略写入失败");return}P(`批量保留策略已记录:${U.recorded??0}/${U.total??A.length}`),x([]),await K()}catch(U){L(U instanceof Error?U.message:"批量保留策略写入失败")}finally{N(!1)}}};return c.jsx("div",{style:cB,children:c.jsxs(yi,{children:[c.jsx(Mi,{title:"业务视图",children:c.jsx("span",{className:"de-card-meta-text",children:v||"qimingclaw 本地业务查询"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsx("div",{className:"de-segmented-tabs",role:"tablist","aria-label":"业务视图类型",children:Tj.map(R=>c.jsx("button",{type:"button",className:R.id===n?"active":"",onClick:()=>{a(R.id),f(1),D(null)},children:R.label},R.id))}),c.jsxs("div",{style:uB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"关键词 / 实体 ID"}),c.jsx("input",{value:r.entity,onChange:R=>q("entity",R.target.value),placeholder:"plan / task / artifact"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:r.status,onChange:R=>q("status",R.target.value),placeholder:"pending"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"同步状态"}),c.jsx("input",{value:r.syncStatus,onChange:R=>q("syncStatus",R.target.value),placeholder:"synced"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"起始时间"}),c.jsx("input",{type:"date",value:r.updatedFrom,onChange:R=>q("updatedFrom",R.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"结束时间"}),c.jsx("input",{type:"date",value:r.updatedTo,onChange:R=>q("updatedTo",R.target.value)})]}),c.jsxs("div",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{K()},title:"搜索","aria-label":"搜索",children:c.jsx(fl,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{s(B0),f(1)},title:"重置","aria-label":"重置",children:c.jsx(ml,{size:15})})]})]}),I?c.jsxs("div",{className:"de-business-actions","aria-label":"批量保留治理",children:[c.jsxs("span",{className:"de-card-meta-text",children:["已选择 ",A.length," 个产物"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:A.length===0||T,onClick:()=>{Q("mark_keep")},children:[c.jsx(q1,{size:14})," 批量保留"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:A.length===0||T,onClick:()=>{Q("mark_expire")},children:"批量标记到期"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:A.length===0||T,onClick:()=>{Q("mark_review")},children:"批量复核"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:A.length===0||T,onClick:()=>x([]),children:"清空选择"})]}):null,B?c.jsx("p",{className:"de-inline-notice",children:B}):null,F?c.jsx("p",{className:"de-inline-notice",children:F}):null,c.jsxs("div",{style:dB,className:"de-business-layout",children:[c.jsx("section",{style:fB,"aria-label":"业务视图列表",children:c.jsxs("table",{style:pB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[I?c.jsx("th",{children:"选择"}):null,c.jsx("th",{children:"标题 / 实体"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"关联"}),c.jsx("th",{children:"扩展字段"}),c.jsx("th",{children:"同步"}),c.jsx("th",{children:"更新时间"}),c.jsx("th",{children:"详情"})]})}),c.jsx("tbody",{children:p.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:I?8:7,children:T?"加载中...":"暂无业务对象"})}):p.map(R=>c.jsxs("tr",{className:C&&fa(C)===fa(R)?"active":"",children:[I?c.jsx("td",{children:c.jsx("input",{type:"checkbox",checked:Xd(R).length>0&&Xd(R).every(U=>A.includes(U)),onChange:()=>Z(R),"aria-label":"选择产物"})}):null,c.jsxs("td",{children:[c.jsx("strong",{children:Ej(R)}),c.jsx("code",{children:fa(R)})]}),c.jsx("td",{children:c.jsx("span",{className:gB(R.status),children:Zt(R.status)})}),c.jsxs("td",{children:[c.jsx("span",{children:Zt(R.plan_id)}),c.jsx("span",{children:Zt(R.task_id)}),c.jsx("span",{children:Zt(R.run_id)})]}),c.jsx("td",{children:hB(R,n)}),c.jsx("td",{children:Zt(R.sync_status)}),c.jsx("td",{children:X_(R)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(R),title:"详情","aria-label":"详情",children:c.jsx(O1,{size:15})})})]},`${n}:${fa(R)}:${X_(R)}`))})]})}),c.jsx(bB,{row:C,onClose:()=>D(null)})]}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",g," 条"]}),c.jsxs("label",{children:[c.jsx("span",{children:"每页"}),c.jsxs("select",{value:r.pageSize,onChange:R=>q("pageSize",Number(R.target.value)||20),children:[c.jsx("option",{value:10,children:"10"}),c.jsx("option",{value:20,children:"20"}),c.jsx("option",{value:50,children:"50"})]})]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:u<=1,onClick:()=>f(R=>Math.max(1,R-1)),children:"上一页"}),c.jsxs("span",{children:[u," / ",se]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:u>=se,onClick:()=>f(R=>Math.min(se,R+1)),children:"下一页"})]})]})]})})}const Aj=[{id:"all",label:"全部"},{id:"approval_conflict",label:"审批冲突"},{id:"route_intervention",label:"路由干预"},{id:"risk_approval",label:"风险审批"},{id:"action_notification",label:"待处理通知"}],xB={padding:"14px 18px"},kB={display:"grid",gridTemplateColumns:"minmax(180px, 1fr) repeat(3, minmax(120px, 160px)) auto",gap:8,alignItems:"end",marginBottom:12},SB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},wB={width:"100%",minWidth:980,borderCollapse:"collapse"},U0={entity:"",status:"",priority:"",pageSize:20};function H0(e){return Aj.some(t=>t.id===e)&&e||"all"}function Ir(e,t="-"){return e==null||e===""?t:String(e)}function jB(e){return Ir(e.updated_at||e.occurred_at)}function CB(e){const t=String(e||"").toLowerCase();return["failed","rejected","blocked","error"].some(n=>t.includes(n))?"de-badge de-badge-danger":["pending","open","required","warn"].some(n=>t.includes(n))?"de-badge de-badge-warning":"de-badge de-badge-info"}function TB(e){return e.kind==="approval_conflict"&&e.approval_id?String(e.approval_id):null}function EB(e){return e.kind==="route_intervention"&&e.route_decision_id?String(e.route_decision_id):null}function AB({initialKind:e,focusEntityId:t}){const[n,a]=w.useState(()=>H0(e)),[r,s]=w.useState({...U0,entity:t||""}),[u,f]=w.useState(1),[p,m]=w.useState([]),[g,b]=w.useState(0),[v,k]=w.useState(null),[C,D]=w.useState([]),[A,x]=w.useState(null),[T,N]=w.useState(!1),[F,L]=w.useState(null),[B,P]=w.useState(null);w.useEffect(()=>a(H0(e)),[e]),w.useEffect(()=>{t&&s(G=>({...G,entity:t}))},[t]);const K=w.useCallback(async()=>{N(!0),P(null);try{const G=await ND({kind:n,entity_id:r.entity.trim()||null,status:r.status.trim()||null,priority:r.priority.trim()||null,page_no:u,page_size:r.pageSize});m(G.items??[]),b(G.total??0),k(G.source??null),D(ae=>ae.filter(ie=>(G.items??[]).some(z=>z.intervention_id===ie)))}catch(G){m([]),b(0),P(G instanceof Error?G.message:"介入台加载失败")}finally{N(!1)}},[r,n,u]);w.useEffect(()=>{K()},[K]);const se=w.useMemo(()=>p.filter(G=>C.includes(G.intervention_id)),[p,C]),I=w.useMemo(()=>se.map(TB).filter(G=>!!G),[se]),q=w.useMemo(()=>se.map(EB).filter(G=>!!G),[se]),Z=w.useMemo(()=>Math.max(1,Math.ceil(g/r.pageSize)),[r.pageSize,g]),Q=(G,ae)=>{s(ie=>({...ie,[G]:ae})),f(1)},R=G=>{D(ae=>ae.includes(G.intervention_id)?ae.filter(ie=>ie!==G.intervention_id):[...ae,G.intervention_id])},U=async G=>{var ae;if(!(I.length===0||T)){N(!0),L(null),P(null);try{const ie=await sM(I,G,{actor:"digital_employee_operator"});if(!ie.ok)throw new Error(ie.error||((ae=ie.reason_codes)==null?void 0:ae.join(", "))||"批量审批冲突处理失败");L(`批量审批冲突已记录:${ie.recorded}/${ie.total}`),D([]),await K()}catch(ie){P(ie instanceof Error?ie.message:"批量审批冲突处理失败")}finally{N(!1)}}},O=async G=>{var ae;if(!(q.length===0||T)){N(!0),L(null),P(null);try{const ie=await AD(q,{decision:G,actor:"digital_employee_operator"});if(!ie.ok)throw new Error(ie.error||((ae=ie.reason_codes)==null?void 0:ae.join(", "))||"批量路由干预处理失败");L(`批量路由干预已记录:${ie.recorded}/${ie.total}`),D([]),await K()}catch(ie){P(ie instanceof Error?ie.message:"批量路由干预处理失败")}finally{N(!1)}}};return c.jsxs("div",{style:xB,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"介入台",children:c.jsx("span",{className:"de-card-meta-text",children:v||"qimingclaw 人工介入运营台"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsx("div",{className:"de-segmented-tabs",role:"tablist","aria-label":"介入类型",children:Aj.map(G=>c.jsx("button",{type:"button",className:G.id===n?"active":"",onClick:()=>{a(G.id),f(1),D([])},children:G.label},G.id))}),c.jsxs("div",{style:kB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"实体 ID"}),c.jsx("input",{value:r.entity,onChange:G=>Q("entity",G.target.value),placeholder:"approval / route / task"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:r.status,onChange:G=>Q("status",G.target.value),placeholder:"open"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"优先级"}),c.jsx("input",{value:r.priority,onChange:G=>Q("priority",G.target.value),placeholder:"high"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"每页"}),c.jsxs("select",{value:r.pageSize,onChange:G=>Q("pageSize",Number(G.target.value)||20),children:[c.jsx("option",{value:10,children:"10"}),c.jsx("option",{value:20,children:"20"}),c.jsx("option",{value:50,children:"50"})]})]}),c.jsxs("div",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{K()},title:"搜索","aria-label":"搜索",children:c.jsx(fl,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{s(U0),f(1)},title:"重置","aria-label":"重置",children:c.jsx(ml,{size:15})})]})]}),c.jsxs("div",{className:"de-business-actions","aria-label":"批量介入动作",children:[c.jsxs("span",{className:"de-card-meta-text",children:["已选择 ",C.length," 项"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:I.length===0||T,onClick:()=>{U("keep_local")},children:[c.jsx(q1,{size:14})," 批量保留本地"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:I.length===0||T,onClick:()=>{U("mark_reviewed")},children:"批量标记复核"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:q.length===0||T,onClick:()=>{O("mark_reviewed")},children:"批量标记已看"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:q.length===0||T,onClick:()=>{O("dismiss")},children:"批量忽略"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:C.length===0||T,onClick:()=>D([]),children:"清空选择"})]}),F?c.jsx("p",{className:"de-inline-notice",children:F}):null,B?c.jsx("p",{className:"de-inline-notice",children:B}):null,c.jsx("section",{style:SB,"aria-label":"介入台列表",children:c.jsxs("table",{style:wB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"选择"}),c.jsx("th",{children:"类型 / 标题"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"优先级"}),c.jsx("th",{children:"关联"}),c.jsx("th",{children:"原因"}),c.jsx("th",{children:"最近时间"}),c.jsx("th",{children:"操作"})]})}),c.jsx("tbody",{children:p.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:8,children:T?"加载中...":"暂无介入事项"})}):p.map(G=>c.jsxs("tr",{className:C.includes(G.intervention_id)?"active":"",children:[c.jsx("td",{children:c.jsx("input",{type:"checkbox",checked:C.includes(G.intervention_id),onChange:()=>R(G),"aria-label":"选择介入事项"})}),c.jsxs("td",{children:[c.jsx("strong",{children:G.title}),c.jsx("code",{children:G.intervention_id})]}),c.jsx("td",{children:c.jsx("span",{className:CB(G.status),children:Ir(G.status)})}),c.jsx("td",{children:Ir(G.priority)}),c.jsxs("td",{children:[c.jsx("span",{children:Ir(G.plan_id)}),c.jsx("span",{children:Ir(G.task_id)}),c.jsx("span",{children:Ir(G.run_id)})]}),c.jsx("td",{children:Ir(G.reason||G.summary)}),c.jsx("td",{children:jB(G)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>x(G),title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})})})]},G.intervention_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",g," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:u<=1,onClick:()=>f(G=>Math.max(1,G-1)),children:"上一页"}),c.jsxs("span",{children:[u," / ",Z]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:u>=Z,onClick:()=>f(G=>Math.min(Z,G+1)),children:"下一页"})]})]})]}),A?c.jsxs("div",{className:"de-artifact-preview","aria-label":"介入详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:A.title}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>x(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(A,null,2)})]}):null]})}const NB={padding:"14px 18px"},RB={display:"grid",gridTemplateColumns:"minmax(180px, 1fr) repeat(3, minmax(120px, 160px)) auto",gap:8,alignItems:"end",marginBottom:12},DB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},MB={width:"100%",minWidth:980,borderCollapse:"collapse"},P0={query:"",category:"",status:"",pageSize:20};function Gs(e,t="-"){return e==null||e===""?t:String(e)}function $B(e){const t=String(e||"").toLowerCase();return["archived","deleted","failed"].some(n=>t.includes(n))?"de-badge de-badge-danger":["review","pending"].some(n=>t.includes(n))?"de-badge de-badge-warning":"de-badge de-badge-info"}function zB({initialQuery:e,focusEntityId:t}){const[n,a]=w.useState({...P0,query:e||""}),[r,s]=w.useState(1),[u,f]=w.useState([]),[p,m]=w.useState(0),[g,b]=w.useState(null),[v,k]=w.useState([]),[C,D]=w.useState(null),[A,x]=w.useState(!1),[T,N]=w.useState(null),[F,L]=w.useState(null);w.useEffect(()=>{e&&a(q=>({...q,query:e}))},[e]);const B=w.useCallback(async()=>{x(!0),L(null);try{const q=await RD({q:n.query.trim()||null,category:n.category.trim()||null,status:n.status.trim()||null,entity_id:t||null,page_no:r,page_size:n.pageSize});f(q.items??[]),m(q.total??0),b(q.source??null),k(Z=>Z.filter(Q=>(q.items??[]).some(R=>R.memory_id===Q)))}catch(q){f([]),m(0),L(q instanceof Error?q.message:"记忆治理加载失败")}finally{x(!1)}},[n,t,r]);w.useEffect(()=>{B()},[B]);const P=w.useMemo(()=>Math.max(1,Math.ceil(p/n.pageSize)),[n.pageSize,p]),K=(q,Z)=>{a(Q=>({...Q,[q]:Z})),s(1)},se=q=>{k(Z=>Z.includes(q.memory_id)?Z.filter(Q=>Q!==q.memory_id):[...Z,q.memory_id])},I=async q=>{var Z;if(!(v.length===0||A)){x(!0),N(null),L(null);try{const Q=await DD(v,q,{actor:"digital_employee_operator"});if(!Q.ok)throw new Error(Q.error||((Z=Q.reason_codes)==null?void 0:Z.join(", "))||"记忆治理操作失败");N(`记忆治理已记录:${Q.recorded}/${Q.total}`),k([]),await B()}catch(Q){L(Q instanceof Error?Q.message:"记忆治理操作失败")}finally{x(!1)}}};return c.jsxs("div",{style:NB,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"记忆治理",children:c.jsx("span",{className:"de-card-meta-text",children:g||"qimingclaw 长期记忆治理"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:RB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"关键词"}),c.jsx("input",{value:n.query,onChange:q=>K("query",q.target.value),placeholder:"key / content"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"分类"}),c.jsx("input",{value:n.category,onChange:q=>K("category",q.target.value),placeholder:"fact"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:n.status,onChange:q=>K("status",q.target.value),placeholder:"active"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"每页"}),c.jsxs("select",{value:n.pageSize,onChange:q=>K("pageSize",Number(q.target.value)||20),children:[c.jsx("option",{value:10,children:"10"}),c.jsx("option",{value:20,children:"20"}),c.jsx("option",{value:50,children:"50"})]})]}),c.jsxs("div",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{B()},title:"搜索","aria-label":"搜索",children:c.jsx(fl,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{a(P0),s(1)},title:"重置","aria-label":"重置",children:c.jsx(ml,{size:15})})]})]}),c.jsxs("div",{className:"de-business-actions","aria-label":"记忆批量治理",children:[c.jsxs("span",{className:"de-card-meta-text",children:["已选择 ",v.length," 条"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:v.length===0||A,onClick:()=>{I("archive")},children:[c.jsx(PE,{size:14})," 批量归档"]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:v.length===0||A,onClick:()=>{I("restore")},children:[c.jsx(WE,{size:14})," 批量恢复"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:v.length===0||A,onClick:()=>{I("mark_reviewed")},children:"批量复核"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:v.length===0||A,onClick:()=>k([]),children:"清空选择"})]}),T?c.jsx("p",{className:"de-inline-notice",children:T}):null,F?c.jsx("p",{className:"de-inline-notice",children:F}):null,c.jsx("section",{style:DB,"aria-label":"记忆治理列表",children:c.jsxs("table",{style:MB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"选择"}),c.jsx("th",{children:"Key / 内容"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"分类"}),c.jsx("th",{children:"重复候选"}),c.jsx("th",{children:"同步"}),c.jsx("th",{children:"更新时间"}),c.jsx("th",{children:"详情"})]})}),c.jsx("tbody",{children:u.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:8,children:A?"加载中...":"暂无记忆"})}):u.map(q=>c.jsxs("tr",{className:v.includes(q.memory_id)?"active":"",children:[c.jsx("td",{children:c.jsx("input",{type:"checkbox",checked:v.includes(q.memory_id),onChange:()=>se(q),"aria-label":"选择记忆"})}),c.jsxs("td",{children:[c.jsx("strong",{children:Gs(q.key)}),c.jsx("code",{children:Gs(q.content_preview)})]}),c.jsx("td",{children:c.jsx("span",{className:$B(q.governance_status),children:Gs(q.governance_status)})}),c.jsx("td",{children:Gs(q.category)}),c.jsx("td",{children:q.merge_candidate_count>0?`重复候选 ${q.merge_candidate_count}`:"-"}),c.jsx("td",{children:Gs(q.sync_status)}),c.jsx("td",{children:Gs(q.updated_at)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(q),title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})})})]},q.memory_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",p," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r<=1,onClick:()=>s(q=>Math.max(1,q-1)),children:"上一页"}),c.jsxs("span",{children:[r," / ",P]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r>=P,onClick:()=>s(q=>Math.min(P,q+1)),children:"下一页"})]})]})]}),C?c.jsxs("div",{className:"de-artifact-preview","aria-label":"记忆详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:C.key}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(C,null,2)})]}):null]})}const OB={padding:"14px 18px"},LB={display:"grid",gridTemplateColumns:"repeat(6, minmax(120px, 1fr)) auto",gap:8,alignItems:"end",marginBottom:12},IB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},BB={width:"100%",minWidth:1040,borderCollapse:"collapse"},F0={skillId:"",toolName:"",serverId:"",decision:"",category:"",status:"",pageSize:20};function cl(e,t="-"){return e==null||e===""?t:String(e)}function qB(e){const t=String(e||"").toLowerCase();return t.includes("allow")||t.includes("accepted")?"允许":t.includes("reject")||t.includes("deny")||t.includes("blocked")?"拒绝":t.includes("observe")?"观察":cl(e,"观察")}function G0(e){const t=String(e||"").toLowerCase();return/reject|deny|blocked|failed|error/.test(t)?"de-badge de-badge-danger":/warn|review|pending|timeout/.test(t)?"de-badge de-badge-warning":"de-badge de-badge-info"}function UB(e){const t=typeof e=="number"?e:Number(e);return!Number.isFinite(t)||t<=0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}function HB({focusSkillId:e}){const[t,n]=w.useState({...F0,skillId:e||""}),[a,r]=w.useState(1),[s,u]=w.useState([]),[f,p]=w.useState(0),[m,g]=w.useState(null),[b,v]=w.useState(null),[k,C]=w.useState(!1),[D,A]=w.useState(null);w.useEffect(()=>{e&&n(L=>({...L,skillId:e}))},[e]);const x=w.useCallback(async()=>{C(!0),A(null);try{const L=await MD({skill_id:t.skillId.trim()||null,tool_name:t.toolName.trim()||null,server_id:t.serverId.trim()||null,decision:t.decision.trim()||null,category:t.category.trim()||null,status:t.status.trim()||null,page_no:a,page_size:t.pageSize});u(L.items??[]),p(L.total??0),g(L.source??null)}catch(L){u([]),p(0),A(L instanceof Error?L.message:"技能审计加载失败")}finally{C(!1)}},[t,a]);w.useEffect(()=>{x()},[x]);const T=w.useMemo(()=>Math.max(1,Math.ceil(f/t.pageSize)),[t.pageSize,f]),N=(L,B)=>{n(P=>({...P,[L]:B})),r(1)},F=()=>{n({...F0,skillId:e||""}),r(1)};return c.jsxs("div",{style:OB,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"技能审计",children:c.jsx("span",{className:"de-card-meta-text",children:m||"技能调用、工具、sandbox 与 token/cost 审计"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:LB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"Skill"}),c.jsx("input",{value:t.skillId,onChange:L=>N("skillId",L.target.value),placeholder:"skill id"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"Tool"}),c.jsx("input",{value:t.toolName,onChange:L=>N("toolName",L.target.value),placeholder:"tool name"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"Server"}),c.jsx("input",{value:t.serverId,onChange:L=>N("serverId",L.target.value),placeholder:"server id"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"决策"}),c.jsx("input",{value:t.decision,onChange:L=>N("decision",L.target.value),placeholder:"允许 / 拒绝 / 观察"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"分类"}),c.jsx("input",{value:t.category,onChange:L=>N("category",L.target.value),placeholder:"tool_call_audit"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:t.status,onChange:L=>N("status",L.target.value),placeholder:"status"})]}),c.jsxs("div",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{x()},title:"筛选","aria-label":"筛选",children:c.jsx(XE,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:F,title:"重置","aria-label":"重置",children:c.jsx(ml,{size:15})})]})]}),c.jsxs("div",{className:"de-business-actions","aria-label":"技能审计筛选",children:[c.jsxs("span",{className:"de-card-meta-text",children:["共 ",f," 条"]}),c.jsxs("label",{children:[c.jsx("span",{children:"每页"}),c.jsxs("select",{value:t.pageSize,onChange:L=>N("pageSize",Number(L.target.value)||20),children:[c.jsx("option",{value:10,children:"10"}),c.jsx("option",{value:20,children:"20"}),c.jsx("option",{value:50,children:"50"})]})]})]}),D?c.jsx("p",{className:"de-inline-notice",children:D}):null,c.jsx("section",{style:IB,"aria-label":"技能审计列表",children:c.jsxs("table",{style:BB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"审计"}),c.jsx("th",{children:"决策"}),c.jsx("th",{children:"Skill / Tool"}),c.jsx("th",{children:"Server"}),c.jsx("th",{children:"风险"}),c.jsx("th",{children:"Token / 成本"}),c.jsx("th",{children:"时间"}),c.jsx("th",{children:"详情"})]})}),c.jsx("tbody",{children:s.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:8,children:k?"加载中...":"暂无技能审计记录"})}):s.map(L=>c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx("strong",{children:cl(L.category)}),c.jsx("code",{children:cl(L.audit_id)})]}),c.jsx("td",{children:c.jsx("span",{className:G0(L.decision||L.status),children:qB(L.decision||L.status)})}),c.jsxs("td",{children:[c.jsx("strong",{children:cl(L.skill_id)}),c.jsx("code",{children:cl(L.tool_name)})]}),c.jsx("td",{children:cl(L.server_id)}),c.jsx("td",{children:c.jsx("span",{className:G0(L.risk_level||L.status),children:cl(L.risk_level||L.status)})}),c.jsxs("td",{children:[cl(L.total_tokens,"0")," / ",UB(L.estimated_cost_usd)]}),c.jsx("td",{children:cl(L.occurred_at||L.updated_at)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>v(L),title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})})})]},L.audit_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:[a," / ",T]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:a<=1,onClick:()=>r(L=>Math.max(1,L-1)),children:"上一页"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:a>=T,onClick:()=>r(L=>Math.min(T,L+1)),children:"下一页"})]})]})]}),b?c.jsxs("div",{className:"de-artifact-preview","aria-label":"技能审计详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:b.category}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>v(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(b,null,2)})]}):null]})}const PB={padding:"14px 18px"},FB={display:"grid",gridTemplateColumns:"repeat(4, minmax(130px, 1fr)) auto",gap:8,alignItems:"end",marginBottom:12},GB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},VB={width:"100%",minWidth:980,borderCollapse:"collapse"},YB={kind:"all",status:"",priority:"",entityId:"",pageSize:20};function Zd(e,t="-"){return e==null||e===""?t:String(e)}function KB(e){const t=String(e||"").toLowerCase();return/error|failed|stopped|degraded/.test(t)?"de-badge de-badge-danger":/warn|pending|review/.test(t)?"de-badge de-badge-warning":"de-badge de-badge-info"}function QB({initialKind:e,focusEntityId:t}){const[n,a]=w.useState({...YB,kind:e||"all",entityId:t||""}),[r,s]=w.useState(1),[u,f]=w.useState([]),[p,m]=w.useState([]),[g,b]=w.useState(0),[v,k]=w.useState(null),[C,D]=w.useState(null),[A,x]=w.useState(!1),[T,N]=w.useState(null),[F,L]=w.useState(null),B=w.useCallback(async()=>{x(!0),L(null);try{const q=await $D({kind:n.kind==="all"?null:n.kind,status:n.status||null,priority:n.priority||null,entity_id:n.entityId||null,page_no:r,page_size:n.pageSize});f(q.items??[]),b(q.total??0),k(q.source??null),m(Z=>Z.filter(Q=>(q.items??[]).some(R=>R.ops_id===Q)))}catch(q){f([]),b(0),L(q instanceof Error?q.message:"处置台加载失败")}finally{x(!1)}},[n,r]);w.useEffect(()=>{B()},[B]);const P=w.useMemo(()=>Math.max(1,Math.ceil(g/n.pageSize)),[n.pageSize,g]),K=(q,Z)=>{a(Q=>({...Q,[q]:Z})),s(1)},se=q=>{m(Z=>Z.includes(q.ops_id)?Z.filter(Q=>Q!==q.ops_id):[...Z,q.ops_id])},I=async q=>{var Z;if(!(p.length===0||A)){x(!0),N(null),L(null);try{const Q=await zD(p,q,{actor:"digital_employee_operator"});if(!Q.ok)throw new Error(Q.error||((Z=Q.reason_codes)==null?void 0:Z.join(", "))||"处置动作失败");N(`处置台已记录:${Q.recorded}/${Q.total}`),m([]),await B()}catch(Q){L(Q instanceof Error?Q.message:"处置动作失败")}finally{x(!1)}}};return c.jsxs("div",{style:PB,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"处置台",children:c.jsx("span",{className:"de-card-meta-text",children:v||"诊断、服务、同步和策略处置"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:FB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"类型"}),c.jsxs("select",{value:n.kind,onChange:q=>K("kind",q.target.value),children:[c.jsx("option",{value:"all",children:"全部"}),c.jsx("option",{value:"diagnostic",children:"诊断"}),c.jsx("option",{value:"service",children:"服务"}),c.jsx("option",{value:"sync",children:"同步"}),c.jsx("option",{value:"policy",children:"策略"}),c.jsx("option",{value:"audit",children:"审计"})]})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:n.status,onChange:q=>K("status",q.target.value),placeholder:"error"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"优先级"}),c.jsx("input",{value:n.priority,onChange:q=>K("priority",q.target.value),placeholder:"warn"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"实体"}),c.jsx("input",{value:n.entityId,onChange:q=>K("entityId",q.target.value),placeholder:"service / policy"})]}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{B()},title:"刷新","aria-label":"刷新",children:c.jsx(ml,{size:15})})]}),c.jsxs("div",{className:"de-business-actions","aria-label":"处置台批量动作",children:[c.jsxs("span",{className:"de-card-meta-text",children:["已选择 ",p.length," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||A,onClick:()=>{I("mark_reviewed")},children:"批量标记已看"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||A,onClick:()=>{I("dismiss")},children:"批量忽略"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||A,onClick:()=>{I("retry_policy_pull")},children:"策略重拉"}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||A,onClick:()=>{I("safe_restart_service")},children:[c.jsx(_g,{size:14})," 安全重启"]})]}),T?c.jsx("p",{className:"de-inline-notice",children:T}):null,F?c.jsx("p",{className:"de-inline-notice",children:F}):null,c.jsx("section",{style:GB,"aria-label":"处置事项列表",children:c.jsxs("table",{style:VB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"选择"}),c.jsx("th",{children:"事项"}),c.jsx("th",{children:"类型"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"建议"}),c.jsx("th",{children:"时间"}),c.jsx("th",{children:"详情"})]})}),c.jsx("tbody",{children:u.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:7,children:A?"加载中...":"暂无处置事项"})}):u.map(q=>c.jsxs("tr",{className:p.includes(q.ops_id)?"active":"",children:[c.jsx("td",{children:c.jsx("input",{type:"checkbox",checked:p.includes(q.ops_id),onChange:()=>se(q),"aria-label":"选择处置事项"})}),c.jsxs("td",{children:[c.jsx("strong",{children:q.title}),c.jsx("code",{children:q.ops_id})]}),c.jsx("td",{children:Zd(q.kind)}),c.jsx("td",{children:c.jsx("span",{className:KB(q.status||q.priority),children:Zd(q.status)})}),c.jsx("td",{children:Zd(q.recommended_action)}),c.jsx("td",{children:Zd(q.updated_at||q.occurred_at)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(q),title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})})})]},q.ops_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",g," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r<=1,onClick:()=>s(q=>Math.max(1,q-1)),children:"上一页"}),c.jsxs("span",{children:[r," / ",P]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r>=P,onClick:()=>s(q=>Math.min(P,q+1)),children:"下一页"})]})]})]}),C?c.jsxs("div",{className:"de-artifact-preview","aria-label":"处置详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:C.title}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(C,null,2)})]}):null]})}const XB={padding:"14px 18px"},ZB={display:"grid",gridTemplateColumns:"repeat(4, minmax(130px, 1fr)) auto",gap:8,alignItems:"end",marginBottom:12},JB={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},WB={width:"100%",minWidth:980,borderCollapse:"collapse"},e6={kind:"all",status:"",level:"",entityId:"",pageSize:20};function Jd(e,t="-"){return e==null||e===""?t:String(e)}function V0(e){const t=String(e||"").toLowerCase();return/error|failed/.test(t)?"de-badge de-badge-danger":/warn|action|unread/.test(t)?"de-badge de-badge-warning":"de-badge de-badge-info"}function t6({initialKind:e,focusEntityId:t}){const[n,a]=w.useState({...e6,kind:e||"all",entityId:t||""}),[r,s]=w.useState(1),[u,f]=w.useState([]),[p,m]=w.useState([]),[g,b]=w.useState(0),[v,k]=w.useState(null),[C,D]=w.useState(null),[A,x]=w.useState(""),[T,N]=w.useState(!1),[F,L]=w.useState(null),[B,P]=w.useState(null),K=w.useCallback(async()=>{N(!0),P(null);try{const R=await OD({kind:n.kind==="all"?null:n.kind,status:n.status||null,level:n.level||null,entity_id:n.entityId||null,page_no:r,page_size:n.pageSize});f(R.items??[]),b(R.total??0),k(R.source??null),m(U=>U.filter(O=>(R.items??[]).some(G=>G.notification_id===O)))}catch(R){f([]),b(0),P(R instanceof Error?R.message:"通知运营加载失败")}finally{N(!1)}},[n,r]);w.useEffect(()=>{K()},[K]);const se=w.useMemo(()=>Math.max(1,Math.ceil(g/n.pageSize)),[n.pageSize,g]),I=(R,U)=>{a(O=>({...O,[R]:U})),s(1)},q=R=>{m(U=>U.includes(R.notification_id)?U.filter(O=>O!==R.notification_id):[...U,R.notification_id])},Z=async R=>{var U;if(!((R==="mark_read"||R==="dismiss")&&p.length===0)){N(!0),L(null),P(null);try{const O=await LD(p,R,{actor:"digital_employee_operator"});if(!O.ok)throw new Error(O.error||((U=O.reason_codes)==null?void 0:U.join(", "))||"通知运营操作失败");L(R==="open_desktop_settings"?"已请求打开系统设置。":`通知运营已记录:${O.recorded}/${O.total}`),R!=="open_desktop_settings"&&m([]),await K()}catch(O){P(O instanceof Error?O.message:"通知运营操作失败")}finally{N(!1)}}},Q=async()=>{if(!(!(C!=null&&C.notification_id)||!A.trim())){N(!0);try{await GD(C.notification_id,A.trim()),L("回复已记录。"),x(""),await K()}catch(R){P(R instanceof Error?R.message:"回复失败")}finally{N(!1)}}};return c.jsxs("div",{style:XB,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"通知运营",children:c.jsx("span",{className:"de-card-meta-text",children:v||"Inbox 运营视图"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:ZB,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"类型"}),c.jsx("input",{value:n.kind,onChange:R=>I("kind",R.target.value||"all"),placeholder:"all / need_input"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:n.status,onChange:R=>I("status",R.target.value),placeholder:"unread"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"等级"}),c.jsx("input",{value:n.level,onChange:R=>I("level",R.target.value),placeholder:"action"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"实体"}),c.jsx("input",{value:n.entityId,onChange:R=>I("entityId",R.target.value),placeholder:"notification id"})]}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{K()},title:"刷新","aria-label":"刷新",children:c.jsx(ml,{size:15})})]}),c.jsxs("div",{className:"de-business-actions","aria-label":"通知批量动作",children:[c.jsxs("span",{className:"de-card-meta-text",children:["已选择 ",p.length," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||T,onClick:()=>{Z("mark_read")},children:"批量已读"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:p.length===0||T,onClick:()=>{Z("dismiss")},children:"批量忽略"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:T,onClick:()=>{Z("pull_updates")},children:"拉取通知"}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:T,onClick:()=>{Z("open_desktop_settings")},children:[c.jsx(eA,{size:14})," 打开系统设置"]})]}),F?c.jsx("p",{className:"de-inline-notice",children:F}):null,B?c.jsx("p",{className:"de-inline-notice",children:B}):null,c.jsx("section",{style:JB,"aria-label":"通知运营列表",children:c.jsxs("table",{style:WB,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"选择"}),c.jsx("th",{children:"通知"}),c.jsx("th",{children:"类型"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"等级"}),c.jsx("th",{children:"时间"}),c.jsx("th",{children:"详情"})]})}),c.jsx("tbody",{children:u.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:7,children:T?"加载中...":"暂无通知"})}):u.map(R=>c.jsxs("tr",{className:p.includes(R.notification_id)?"active":"",children:[c.jsx("td",{children:c.jsx("input",{type:"checkbox",checked:p.includes(R.notification_id),onChange:()=>q(R),"aria-label":"选择通知"})}),c.jsxs("td",{children:[c.jsx("strong",{children:R.title}),c.jsx("code",{children:R.notification_id})]}),c.jsx("td",{children:Jd(R.kind)}),c.jsx("td",{children:c.jsx("span",{className:V0(R.status),children:Jd(R.status)})}),c.jsx("td",{children:c.jsx("span",{className:V0(R.priority),children:Jd(R.priority)})}),c.jsx("td",{children:Jd(R.updated_at||R.occurred_at)}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{D(R),x("")},title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})})})]},R.notification_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",g," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r<=1,onClick:()=>s(R=>Math.max(1,R-1)),children:"上一页"}),c.jsxs("span",{children:[r," / ",se]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r>=se,onClick:()=>s(R=>Math.min(se,R+1)),children:"下一页"})]})]})]}),C?c.jsxs("div",{className:"de-artifact-preview","aria-label":"通知详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:C.title}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>D(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(C,null,2)}),c.jsx("textarea",{value:A,onChange:R=>x(R.target.value),placeholder:"回复单条通知"}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:!A.trim()||T,onClick:()=>{Q()},children:"回复"})]}):null]})}const n6={padding:"14px 18px"},i6={display:"grid",gridTemplateColumns:"repeat(4, minmax(130px, 1fr)) auto",gap:8,alignItems:"end",marginBottom:12},a6={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},l6={width:"100%",minWidth:1020,borderCollapse:"collapse"},r6={date:"",status:"",entityId:"",pageSize:20};function Nc(e,t="-"){return e==null||e===""?t:String(e)}function s6(e){const t=String(e||"").toLowerCase();return/failed|error|pending/.test(t)?"de-badge de-badge-warning":(/confirmed|sent|requested|ready/.test(t),"de-badge de-badge-info")}function o6({focusEntityId:e}){const[t,n]=w.useState({...r6,entityId:e||""}),[a,r]=w.useState(1),[s,u]=w.useState([]),[f,p]=w.useState(0),[m,g]=w.useState(null),[b,v]=w.useState(null),[k,C]=w.useState(!1),[D,A]=w.useState(null),[x,T]=w.useState(null),N=w.useCallback(async()=>{C(!0),T(null);try{const K=await ID({date:t.date||null,status:t.status||null,entity_id:t.entityId||null,page_no:a,page_size:t.pageSize});u(K.items??[]),p(K.total??0),g(K.source??null)}catch(K){u([]),p(0),T(K instanceof Error?K.message:"日报运营加载失败")}finally{C(!1)}},[t,a]);w.useEffect(()=>{N()},[N]);const F=w.useMemo(()=>Math.max(1,Math.ceil(f/t.pageSize)),[t.pageSize,f]),L=(K,se)=>{n(I=>({...I,[K]:se})),r(1)},B=async K=>{C(!0),A(null),T(null);try{await Ws({action:"generate_daily_report",date:(K==null?void 0:K.date)||t.date||void 0,duty_ids:[]}),A("日报已生成。"),await N()}catch(se){T(se instanceof Error?se.message:"生成日报失败")}finally{C(!1)}},P=async(K,se)=>{C(!0),A(null),T(null);try{await rw({reportId:K.report_id,action:se,status:se==="send"?"sent":se==="confirm"?"confirmed":"approval_requested",actor:"digital_employee_operator",message:"daily_report_workbench_action_recorded"}),A(se==="send"?"发送记录已写入。":se==="confirm"?"确认回执已记录。":"请求审批已记录。"),await N()}catch(I){T(I instanceof Error?I.message:"日报动作失败")}finally{C(!1)}};return c.jsxs("div",{style:n6,children:[c.jsxs(yi,{children:[c.jsx(Mi,{title:"日报运营",children:c.jsx("span",{className:"de-card-meta-text",children:m||"日报交付运营视图"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:i6,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"日期"}),c.jsx("input",{type:"date",value:t.date,onChange:K=>L("date",K.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"状态"}),c.jsx("input",{value:t.status,onChange:K=>L("status",K.target.value),placeholder:"ready"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"实体"}),c.jsx("input",{value:t.entityId,onChange:K=>L("entityId",K.target.value),placeholder:"report id"})]}),c.jsxs("label",{children:[c.jsx("span",{children:"每页"}),c.jsxs("select",{value:t.pageSize,onChange:K=>L("pageSize",Number(K.target.value)||20),children:[c.jsx("option",{value:10,children:"10"}),c.jsx("option",{value:20,children:"20"}),c.jsx("option",{value:50,children:"50"})]})]}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>{N()},title:"刷新","aria-label":"刷新",children:c.jsx(ml,{size:15})})]}),c.jsx("div",{className:"de-business-actions","aria-label":"日报运营动作",children:c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:k,onClick:()=>{B()},children:"生成日报"})}),D?c.jsx("p",{className:"de-inline-notice",children:D}):null,x?c.jsx("p",{className:"de-inline-notice",children:x}):null,c.jsx("section",{style:a6,"aria-label":"日报运营列表",children:c.jsxs("table",{style:l6,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"日报"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"发送"}),c.jsx("th",{children:"确认"}),c.jsx("th",{children:"审批"}),c.jsx("th",{children:"产物"}),c.jsx("th",{children:"操作"})]})}),c.jsx("tbody",{children:s.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:7,children:k?"加载中...":"暂无日报记录"})}):s.map(K=>c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx("strong",{children:K.title}),c.jsxs("code",{children:[K.date," · ",K.report_id]})]}),c.jsx("td",{children:c.jsx("span",{className:s6(K.status),children:Nc(K.status)})}),c.jsx("td",{children:Nc(K.delivery_status)}),c.jsx("td",{children:Nc(K.confirmation_status)}),c.jsx("td",{children:Nc(K.approval_status)}),c.jsx("td",{children:Nc(K.artifact_count,"0")}),c.jsxs("td",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>v(K),title:"详情","aria-label":"详情",children:c.jsx(fl,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:k,onClick:()=>{P(K,"send")},title:"记录发送","aria-label":"记录发送",children:c.jsx(hg,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:k,onClick:()=>{P(K,"confirm")},title:"确认回执","aria-label":"确认回执",children:c.jsx(mg,{size:15})}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:k,onClick:()=>{P(K,"request_approval")},title:"请求审批","aria-label":"请求审批",children:c.jsx(_g,{size:15})})]})]},K.report_id))})]})}),c.jsxs("div",{className:"de-business-pagination",children:[c.jsxs("span",{children:["共 ",f," 条"]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:a<=1,onClick:()=>r(K=>Math.max(1,K-1)),children:"上一页"}),c.jsxs("span",{children:[a," / ",F]}),c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:a>=F,onClick:()=>r(K=>Math.min(F,K+1)),children:"下一页"})]})]})]}),b?c.jsxs("div",{className:"de-artifact-preview","aria-label":"日报运营详情",children:[c.jsxs("div",{children:[c.jsx("strong",{children:b.title}),c.jsx("button",{type:"button",className:"de-icon-btn",onClick:()=>v(null),title:"关闭","aria-label":"关闭",children:c.jsx(Gr,{size:15})})]}),c.jsx("pre",{children:JSON.stringify(b,null,2)})]}):null]})}const c6={padding:"14px 18px"},u6={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:12},o_={border:"1px solid var(--de-glass-border-lighter)",borderRadius:8,padding:12,display:"grid",gap:10};function c_(e,t="-"){return e==null||e===""?t:String(e)}function d6(e){const t=String(e||"").toLowerCase();return/error|failed|disabled/.test(t)?"de-badge de-badge-danger":/pull|pending|remote/.test(t)?"de-badge de-badge-warning":"de-badge de-badge-info"}function f6(){const[e,t]=w.useState([]),[n,a]=w.useState(null),[r,s]=w.useState(null),[u,f]=w.useState(!1),[p,m]=w.useState(null),[g,b]=w.useState(null),v=w.useCallback(async()=>{f(!0),b(null);try{const x=await UD();t(x.items??[]),a(x.plan_step_dispatch_policy),s(x.risk_approval_policy)}catch(x){t([]),b(x instanceof Error?x.message:"策略中心加载失败")}finally{f(!1)}},[]);w.useEffect(()=>{v()},[v]);const k=async()=>{f(!0),m(null),b(null);try{const x=await HD();if(!x.ok)throw new Error(x.items.map(T=>T.error).filter(Boolean).join(", ")||"批量拉取策略失败");m(`批量拉取策略完成:${x.pulled}/${x.total}`),await v()}catch(x){b(x instanceof Error?x.message:"批量拉取策略失败")}finally{f(!1)}},C=async x=>{if(!n)return;const T=await qD(x);a(T),m("派发策略已保存。"),await v()},D=async x=>{if(!r)return;const T=await iw(x);s(T),m("风险审批策略已保存。"),await v()},A=(x,T)=>{D({[x]:T.split(",").map(N=>N.trim()).filter(Boolean)})};return c.jsx("div",{style:c6,children:c.jsxs(yi,{children:[c.jsxs(Mi,{title:"策略中心",children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:u,onClick:()=>{k()},children:"批量拉取策略"}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:u,onClick:()=>{v()},title:"刷新","aria-label":"刷新",children:c.jsx(ml,{size:15})})]}),c.jsxs("div",{className:"de-card-body",children:[p?c.jsx("p",{className:"de-inline-notice",children:p}):null,g?c.jsx("p",{className:"de-inline-notice",children:g}):null,c.jsx("div",{style:u6,children:e.map(x=>c.jsxs("section",{style:o_,children:[c.jsx("strong",{children:x.title}),c.jsx("span",{className:d6(x.status),children:x.status}),c.jsx("small",{children:c_(x.summary)}),c.jsxs("small",{children:["source: ",c_(x.source)," · pulled: ",c_(x.last_pulled_at)]}),x.last_pull_error?c.jsx("small",{children:x.last_pull_error}):null]},x.policy_id))}),n?c.jsxs("section",{style:o_,children:[c.jsx("h3",{className:"de-settings-heading",children:"派发策略"}),c.jsxs("label",{children:[c.jsx("span",{children:"enabled"}),c.jsxs("select",{value:n.enabled?"true":"false",onChange:x=>{C({enabled:x.target.value==="true"})},children:[c.jsx("option",{value:"true",children:"true"}),c.jsx("option",{value:"false",children:"false"})]})]}),c.jsxs("label",{children:[c.jsx("span",{children:"max_per_sweep"}),c.jsx("input",{type:"number",min:1,max:10,value:n.max_per_sweep,onChange:x=>{C({max_per_sweep:Number(x.target.value)||1})}})]}),c.jsxs("label",{children:[c.jsx("span",{children:"auto_dispatch_ready_steps"}),c.jsxs("select",{value:n.auto_dispatch_ready_steps?"true":"false",onChange:x=>{C({auto_dispatch_ready_steps:x.target.value==="true"})},children:[c.jsx("option",{value:"true",children:"true"}),c.jsx("option",{value:"false",children:"false"})]})]})]}):null,r?c.jsxs("section",{style:o_,children:[c.jsx("h3",{className:"de-settings-heading",children:"风险审批策略"}),c.jsxs("label",{children:[c.jsx("span",{children:"enabled"}),c.jsxs("select",{value:r.enabled?"true":"false",onChange:x=>{D({enabled:x.target.value==="true"})},children:[c.jsx("option",{value:"true",children:"true"}),c.jsx("option",{value:"false",children:"false"})]})]}),c.jsxs("label",{children:[c.jsx("span",{children:"approval_required_risk_levels"}),c.jsx("input",{value:r.approval_required_risk_levels.join(","),onChange:x=>A("approval_required_risk_levels",x.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"approval_required_actions"}),c.jsx("input",{value:r.approval_required_actions.join(","),onChange:x=>A("approval_required_actions",x.target.value)})]}),c.jsxs("label",{children:[c.jsx("span",{children:"auto_reject_actions"}),c.jsx("input",{value:r.auto_reject_actions.join(","),onChange:x=>A("auto_reject_actions",x.target.value)})]})]}):null]})]})})}const p6={padding:"14px 18px"},m6={overflow:"auto",border:"1px solid var(--de-glass-border-lighter)",borderRadius:8},h6={width:"100%",minWidth:980,borderCollapse:"collapse"},_6={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:10,marginBottom:12};function Rc(e,t="-"){return e==null||e===""?t:String(e)}function g6(e){const t=String(e||"").toLowerCase();return/failed|error|deleted/.test(t)?"de-badge de-badge-danger":/paused|pending|skipped/.test(t)?"de-badge de-badge-warning":"de-badge de-badge-info"}function y6(){const[e,t]=w.useState([]),[n,a]=w.useState({enabled:!1,catch_up_on_startup:!1,max_run_history:20}),[r,s]=w.useState(!1),[u,f]=w.useState(null),[p,m]=w.useState(null),g=w.useCallback(async()=>{s(!0),m(null);try{const A=await ED();t(A.items??[]),a(A.settings)}catch(A){t([]),m(A instanceof Error?A.message:"调度运营加载失败")}finally{s(!1)}},[]);w.useEffect(()=>{g()},[g]);const b=w.useMemo(()=>e.filter(A=>A.enabled).length,[e]),v=async A=>{s(!0);try{const x=await TD(A);a(x),f("调度设置已保存。"),await g()}catch(x){m(x instanceof Error?x.message:"调度设置保存失败")}finally{s(!1)}},k=async()=>{s(!0),f(null),m(null);try{const A=await iM();f(`立即检查调度完成:activated ${A.activated??0},skipped ${A.skipped??0}`),await g()}catch(A){m(A instanceof Error?A.message:"立即检查调度失败")}finally{s(!1)}},C=async A=>{s(!0);try{await wD(A.schedule_id,{enabled:!A.enabled}),f(A.enabled?"调度已暂停。":"调度已启用。"),await g()}catch(x){m(x instanceof Error?x.message:"调度启停失败")}finally{s(!1)}},D=async A=>{s(!0);try{await SD(A.schedule_id),f("调度已删除。"),await g()}catch(x){m(x instanceof Error?x.message:"删除调度失败")}finally{s(!1)}};return c.jsx("div",{style:p6,children:c.jsxs(yi,{children:[c.jsxs(Mi,{title:"调度运营",children:[c.jsxs("span",{className:"de-card-meta-text",children:["启用 ",b,"/",e.length]}),c.jsxs("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r,onClick:()=>{k()},children:[c.jsx(JE,{size:14})," 立即检查调度"]}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:r,onClick:()=>{g()},title:"刷新","aria-label":"刷新",children:c.jsx(ml,{size:15})})]}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("div",{style:_6,className:"de-business-toolbar",children:[c.jsxs("label",{children:[c.jsx("span",{children:"enabled"}),c.jsxs("select",{value:n.enabled?"true":"false",onChange:A=>{v({enabled:A.target.value==="true"})},children:[c.jsx("option",{value:"true",children:"true"}),c.jsx("option",{value:"false",children:"false"})]})]}),c.jsxs("label",{children:[c.jsx("span",{children:"catch_up_on_startup"}),c.jsxs("select",{value:n.catch_up_on_startup?"true":"false",onChange:A=>{v({catch_up_on_startup:A.target.value==="true"})},children:[c.jsx("option",{value:"true",children:"true"}),c.jsx("option",{value:"false",children:"false"})]})]}),c.jsxs("label",{children:[c.jsx("span",{children:"max_run_history"}),c.jsx("input",{type:"number",min:1,max:500,value:n.max_run_history,onChange:A=>{v({max_run_history:Number(A.target.value)||20})}})]})]}),u?c.jsx("p",{className:"de-inline-notice",children:u}):null,p?c.jsx("p",{className:"de-inline-notice",children:p}):null,c.jsx("section",{style:m6,"aria-label":"调度运营列表",children:c.jsxs("table",{style:h6,className:"de-business-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"任务"}),c.jsx("th",{children:"状态"}),c.jsx("th",{children:"Cron"}),c.jsx("th",{children:"下次"}),c.jsx("th",{children:"最近运行"}),c.jsx("th",{children:"最近结果"}),c.jsx("th",{children:"操作"})]})}),c.jsx("tbody",{children:e.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:7,children:r?"加载中...":"暂无调度任务"})}):e.map(A=>c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx("strong",{children:A.name}),c.jsx("code",{children:A.schedule_id})]}),c.jsx("td",{children:c.jsx("span",{className:g6(A.status),children:Rc(A.status)})}),c.jsx("td",{children:Rc(A.cron_expr)}),c.jsx("td",{children:Rc(A.next_run)}),c.jsx("td",{children:Rc(A.last_run)}),c.jsx("td",{children:Rc(A.last_status||A.latest_run_error)}),c.jsxs("td",{className:"de-business-actions",children:[c.jsx("button",{type:"button",className:"de-btn-secondary de-btn-sm",disabled:r,onClick:()=>{C(A)},children:A.enabled?"暂停":"启用"}),c.jsx("button",{type:"button",className:"de-icon-btn",disabled:r,onClick:()=>{D(A)},title:"删除","aria-label":"删除",children:c.jsx(U1,{size:15})})]})]},A.schedule_id))})]})})]})]})})}function b6(){return{selectedDutyIdsByDate:{},confirmedDates:{},reportScheduleTime:"18:00",reportGeneratedAtByDate:{},decisionResultsByDate:{},profile:{name:"飞天数字员工",company:"qimingclaw 客户端",position:"客户端任务执行员",currentStatus:"working"}}}async function v6(){var e,t,n;try{return await((n=(t=(e=window.QimingClawBridge)==null?void 0:e.digital)==null?void 0:t.getUiState)==null?void 0:n.call(t))??null}catch{return null}}async function x6(e,t={}){var a,r;const n=(a=window.QimingClawBridge)==null?void 0:a.digital;if(!(n!=null&&n.saveUiState))return null;try{const s=await((r=n.getUiState)==null?void 0:r.call(n).catch(()=>null))??null,u={...b6(),...s??{},...e};return await n.saveUiState({state:u,...t})}catch{return null}}const k6=["sales","engineering","hr","finance","executive"],Z_="qimingclaw:digital-role-preferences",J_="sgrobot-role-preferences",Pc={workStart:"09:00",workEnd:"18:00",notification:"system",reportTime:"17:30",avatarStyle:"professional",reminderLevel:"important"},S6={compact:"紧凑",balanced:"均衡",presentation:"汇报"},w6=[{id:"medium",label:"中风险"},{id:"high",label:"高风险"},{id:"critical",label:"严重风险"}],Y0=[{id:"governance.run_schedule_now",label:"立即运行调度"},{id:"plan_step.dispatch_ready_steps",label:"派发 Ready 步骤"},{id:"managed_service.restart.fileServer",label:"重启文件服务"},{id:"artifact.access.open_location",label:"打开产物位置"}],K0={enabled:!0,approval_required_risk_levels:["high","critical"],approval_required_actions:[],auto_reject_actions:[],updated_at:null,source:"local",remote_updated_at:null,last_pulled_at:null,last_pull_error:null},Q0={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12},Na={display:"flex",flexDirection:"column",gap:6,border:"1px solid var(--de-glass-border-lighter)",borderRadius:10,padding:"12px 14px",background:"linear-gradient(180deg, rgba(244,250,255,0.82), rgba(235,246,255,0.58))"},Or={minHeight:34,borderRadius:8,border:"1px solid var(--de-glass-border-light)",background:"rgba(255,255,255,0.72)",color:"var(--de-text-primary)",padding:"0 10px"};function j6(){try{const e=localStorage.getItem(Z_)??localStorage.getItem(J_);return e?{...Pc,...JSON.parse(e)}:Pc}catch{return Pc}}function C6(e){return!e||typeof e!="object"||Array.isArray(e)?Pc:{...Pc,...e}}function T6(){const{role:e,profile:t,setRole:n}=QT(),[a,r]=w.useState(j6),[s,u]=w.useState(K0),[f,p]=w.useState(!1),m=w.useRef(null);w.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),w.useEffect(()=>{let x=!1;return v6().then(T=>{if(x||!(T!=null&&T.rolePreferences))return;const N=C6(T.rolePreferences);r(N);try{localStorage.setItem(Z_,JSON.stringify(N)),localStorage.removeItem(J_)}catch{}}),()=>{x=!0}},[]),w.useEffect(()=>{let x=!1;return nw().then(T=>{x||u(T)}).catch(()=>{x||u(K0)}),()=>{x=!0}},[]);const g=()=>{p(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>p(!1),2e3)},b=x=>{r(x);try{localStorage.setItem(Z_,JSON.stringify(x)),localStorage.removeItem(J_)}catch{}x6({rolePreferences:x},{action:"update_role_preferences",metadata:{preferences:x}}),g()},v=(x,T)=>{b({...a,[x]:T})},k=x=>{n(x),g()},C=x=>{const T={...s,...x};u(T),iw(x).then(N=>u(N)).catch(()=>u(s)),g()},D=x=>{const T=new Set(s.approval_required_risk_levels);T.has(x)?T.delete(x):T.add(x),C({approval_required_risk_levels:Array.from(T)})},A=(x,T)=>{const N=new Set(s[x]);N.has(T)?N.delete(T):N.add(T),C({[x]:Array.from(N)})};return c.jsx("div",{style:{padding:"14px 18px"},children:c.jsxs(yi,{children:[c.jsx(Mi,{title:"角色偏好",children:f&&c.jsx("span",{className:"de-card-meta-text",children:"已保存"})}),c.jsxs("div",{className:"de-card-body",children:[c.jsxs("section",{className:"de-settings-section",children:[c.jsx("h3",{className:"de-settings-heading",children:"数字员工角色"}),c.jsx("p",{className:"de-settings-desc",children:"选择日常协作身份,数字员工会按你的岗位重点调整提醒和汇总口径。"}),c.jsx("div",{className:"de-role-grid",children:k6.map(x=>c.jsxs("button",{className:`de-role-card ${e===x?"active":""}`,onClick:()=>k(x),children:[c.jsx("span",{className:"de-role-label",children:Zc(ff[x].labelKey)}),c.jsxs("span",{className:"de-role-density",children:[S6[ff[x].density]??"均衡","视图"]})]},x))})]}),c.jsxs("section",{className:"de-settings-section",children:[c.jsx("h3",{className:"de-settings-heading",children:"工作偏好"}),c.jsxs("div",{style:Q0,children:[c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"工作开始时间"}),c.jsx("input",{style:Or,type:"time",value:a.workStart,onChange:x=>v("workStart",x.target.value)})]}),c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"工作结束时间"}),c.jsx("input",{style:Or,type:"time",value:a.workEnd,onChange:x=>v("workEnd",x.target.value)})]}),c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"默认日报时间"}),c.jsx("input",{style:Or,type:"time",value:a.reportTime,onChange:x=>v("reportTime",x.target.value)})]}),c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"通知方式"}),c.jsxs("select",{style:Or,value:a.notification,onChange:x=>v("notification",x.target.value),children:[c.jsx("option",{value:"system",children:"系统通知"}),c.jsx("option",{value:"email",children:"邮件提醒"}),c.jsx("option",{value:"silent",children:"只在页面显示"})]})]}),c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"数字员工形象偏好"}),c.jsxs("select",{style:Or,value:a.avatarStyle,onChange:x=>v("avatarStyle",x.target.value),children:[c.jsx("option",{value:"professional",children:"专业稳重"}),c.jsx("option",{value:"friendly",children:"亲和协作"}),c.jsx("option",{value:"concise",children:"简洁高效"})]})]}),c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"任务提醒偏好"}),c.jsxs("select",{style:Or,value:a.reminderLevel,onChange:x=>v("reminderLevel",x.target.value),children:[c.jsx("option",{value:"important",children:"只提醒重要事项"}),c.jsx("option",{value:"all",children:"所有进展都提醒"}),c.jsx("option",{value:"quiet",children:"尽量少打扰"})]})]})]})]}),c.jsxs("section",{className:"de-settings-section",children:[c.jsx("h3",{className:"de-settings-heading",children:"风险审批策略"}),c.jsx("p",{className:"de-settings-desc",children:"调整客户端高风险动作在执行前是否需要人工审批,或直接拒绝;更完整的派发、路由和技能策略可在策略中心统一查看。"}),c.jsxs("div",{style:Q0,children:[c.jsxs("label",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"启用策略"}),c.jsxs("select",{style:Or,value:s.enabled?"enabled":"disabled",onChange:x=>C({enabled:x.target.value==="enabled"}),children:[c.jsx("option",{value:"enabled",children:"启用"}),c.jsx("option",{value:"disabled",children:"关闭"})]})]}),c.jsxs("div",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"按风险等级审批"}),w6.map(x=>c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("input",{type:"checkbox",checked:s.approval_required_risk_levels.includes(x.id),onChange:()=>D(x.id)}),c.jsx("span",{children:x.label})]},x.id))]}),c.jsxs("div",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"指定动作需审批"}),Y0.map(x=>c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("input",{type:"checkbox",checked:s.approval_required_actions.includes(x.id),onChange:()=>A("approval_required_actions",x.id)}),c.jsx("span",{children:x.label})]},x.id))]}),c.jsxs("div",{style:Na,children:[c.jsx("span",{className:"de-role-label",children:"指定动作直接拒绝"}),Y0.map(x=>c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("input",{type:"checkbox",checked:s.auto_reject_actions.includes(x.id),onChange:()=>A("auto_reject_actions",x.id)}),c.jsx("span",{children:x.label})]},x.id))]})]})]}),c.jsxs("details",{className:"de-settings-section",style:{marginBottom:0},children:[c.jsx("summary",{className:"de-settings-heading",style:{cursor:"pointer"},children:"高级技术设置"}),c.jsxs("p",{className:"de-settings-desc",children:["默认隐藏,仅供技术人员排查使用。当前角色刷新阈值:",Math.round(t.staleDataThresholdMs/1e3)," 秒。"]})]})]})]})})}const E6=["home","missions","skills","reports","business","interventions","memory-governance","skill-audit","ops-workbench","notification-workbench","daily-report-workbench","policy-center","scheduler-workbench","settings"];function Nj(e){return!!(e&&E6.includes(e))}function A6(e){const t=e.split("/").filter(Boolean),n=t.length>0?t[t.length-1]:null;return Nj(n)?n:null}function X0(e,t){const n=new URLSearchParams(t),a=n.get("tab");return{tab:Nj(a)?a:A6(e)??"home",date:n.get("date"),missionId:n.get("mission"),taskId:n.get("task"),skillId:n.get("skill"),reportSection:n.get("section"),businessKind:n.get("kind"),interventionKind:n.get("kind"),memoryQuery:n.get("q"),auditSkillId:n.get("skill_id"),opsKind:n.get("kind"),notificationKind:n.get("kind"),entityId:n.get("entity")}}function N6({target:e,onNavigate:t}){switch(e.tab){case"home":return c.jsx(YI,{onNavigate:t});case"missions":return c.jsx(B5,{focusMissionId:e.missionId,focusTaskId:e.taskId,focusDate:e.date});case"skills":return c.jsx(Q5,{focusSkillId:e.skillId,onNavigate:t});case"reports":return c.jsx(oB,{focusSection:e.reportSection});case"business":return c.jsx(vB,{initialKind:e.businessKind,focusEntityId:e.entityId});case"interventions":return c.jsx(AB,{initialKind:e.interventionKind,focusEntityId:e.entityId});case"memory-governance":return c.jsx(zB,{initialQuery:e.memoryQuery,focusEntityId:e.entityId});case"skill-audit":return c.jsx(HB,{focusSkillId:e.auditSkillId||e.skillId});case"ops-workbench":return c.jsx(QB,{initialKind:e.opsKind,focusEntityId:e.entityId});case"notification-workbench":return c.jsx(t6,{initialKind:e.notificationKind,focusEntityId:e.entityId});case"daily-report-workbench":return c.jsx(o6,{focusEntityId:e.entityId});case"policy-center":return c.jsx(f6,{});case"scheduler-workbench":return c.jsx(y6,{});case"settings":return c.jsx(T6,{})}}function R6(){const e=_a(),t=ig(),[n,a]=w.useState(()=>X0(e.pathname,e.search));w.useEffect(()=>{a(X0(e.pathname,e.search))},[e.pathname,e.search]);const r=w.useCallback(s=>{a(s);const u=new URLSearchParams;s.tab!=="home"&&u.set("tab",s.tab),s.date&&u.set("date",s.date),s.missionId&&u.set("mission",s.missionId),s.taskId&&u.set("task",s.taskId),s.skillId&&u.set("skill",s.skillId),s.reportSection&&u.set("section",s.reportSection),s.businessKind&&u.set("kind",s.businessKind),s.interventionKind&&u.set("kind",s.interventionKind),s.memoryQuery&&u.set("q",s.memoryQuery),s.auditSkillId&&u.set("skill_id",s.auditSkillId),s.opsKind&&u.set("kind",s.opsKind),s.notificationKind&&u.set("kind",s.notificationKind),s.entityId&&u.set("entity",s.entityId),t({pathname:e.pathname,search:u.toString()?`?${u.toString()}`:""},{replace:!1})},[e.pathname,t]);return c.jsx(KT,{children:c.jsx("div",{className:"de-shell de-shell--embedded",children:c.jsx("div",{className:"de-shell-body",children:c.jsx(N6,{target:n,onNavigate:r})})})})}function D6(){return c.jsx(LT,{children:c.jsxs(pT,{children:[c.jsx(d_,{path:"/digital/*",element:c.jsx(R6,{})}),c.jsx(d_,{path:"*",element:c.jsx(dT,{to:"/digital",replace:!0})})]})})}m2.createRoot(document.getElementById("root")).render(c.jsx(s2.StrictMode,{children:c.jsx(D6,{})}));
|