hob-bot 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,230 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/math-zZ4JA8eM.js","assets/math-C-EwFotM.css"])))=>i.map(i=>d[i]);
2
- var jj=Object.defineProperty;var kj=(l,i,c)=>i in l?jj(l,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[i]=c;var Xe=(l,i,c)=>kj(l,typeof i!="symbol"?i+"":i,c);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function c(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=c(d);fetch(d.href,f)}})();var ld={exports:{}},ui={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Kg;function Nj(){if(Kg)return ui;Kg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(u,d,f){var g=null;if(f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:l,type:u,key:g,ref:d!==void 0?d:null,props:f}}return ui.Fragment=i,ui.jsx=c,ui.jsxs=c,ui}var Jg;function Sj(){return Jg||(Jg=1,ld.exports=Nj()),ld.exports}var s=Sj(),ad={exports:{}},oi={},sd={exports:{}},id={};/**
11
- * @license React
12
- * scheduler.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var Ig;function wj(){return Ig||(Ig=1,(function(l){function i(F,fe){var oe=F.length;F.push(fe);e:for(;0<oe;){var De=oe-1>>>1,je=F[De];if(0<d(je,fe))F[De]=fe,F[oe]=je,oe=De;else break e}}function c(F){return F.length===0?null:F[0]}function u(F){if(F.length===0)return null;var fe=F[0],oe=F.pop();if(oe!==fe){F[0]=oe;e:for(var De=0,je=F.length,zt=je>>>1;De<zt;){var Gt=2*(De+1)-1,Xt=F[Gt],A=Gt+1,Q=F[A];if(0>d(Xt,oe))A<je&&0>d(Q,Xt)?(F[De]=Q,F[A]=oe,De=A):(F[De]=Xt,F[Gt]=oe,De=Gt);else if(A<je&&0>d(Q,oe))F[De]=Q,F[A]=oe,De=A;else break e}}return fe}function d(F,fe){var oe=F.sortIndex-fe.sortIndex;return oe!==0?oe:F.id-fe.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var g=Date,p=g.now();l.unstable_now=function(){return g.now()-p}}var h=[],v=[],b=1,k=null,S=3,E=!1,y=!1,x=!1,N=!1,z=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function P(F){for(var fe=c(v);fe!==null;){if(fe.callback===null)u(v);else if(fe.startTime<=F)u(v),fe.sortIndex=fe.expirationTime,i(h,fe);else break;fe=c(v)}}function te(F){if(x=!1,P(F),!y)if(c(h)!==null)y=!0,V||(V=!0,Pe());else{var fe=c(v);fe!==null&&Re(te,fe.startTime-F)}}var V=!1,$=-1,L=5,ue=-1;function Se(){return N?!0:!(l.unstable_now()-ue<L)}function Le(){if(N=!1,V){var F=l.unstable_now();ue=F;var fe=!0;try{e:{y=!1,x&&(x=!1,O($),$=-1),E=!0;var oe=S;try{t:{for(P(F),k=c(h);k!==null&&!(k.expirationTime>F&&Se());){var De=k.callback;if(typeof De=="function"){k.callback=null,S=k.priorityLevel;var je=De(k.expirationTime<=F);if(F=l.unstable_now(),typeof je=="function"){k.callback=je,P(F),fe=!0;break t}k===c(h)&&u(h),P(F)}else u(h);k=c(h)}if(k!==null)fe=!0;else{var zt=c(v);zt!==null&&Re(te,zt.startTime-F),fe=!1}}break e}finally{k=null,S=oe,E=!1}fe=void 0}}finally{fe?Pe():V=!1}}}var Pe;if(typeof X=="function")Pe=function(){X(Le)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,Ve=de.port2;de.port1.onmessage=Le,Pe=function(){Ve.postMessage(null)}}else Pe=function(){z(Le,0)};function Re(F,fe){$=z(function(){F(l.unstable_now())},fe)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(F){F.callback=null},l.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},l.unstable_getCurrentPriorityLevel=function(){return S},l.unstable_next=function(F){switch(S){case 1:case 2:case 3:var fe=3;break;default:fe=S}var oe=S;S=fe;try{return F()}finally{S=oe}},l.unstable_requestPaint=function(){N=!0},l.unstable_runWithPriority=function(F,fe){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var oe=S;S=F;try{return fe()}finally{S=oe}},l.unstable_scheduleCallback=function(F,fe,oe){var De=l.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?De+oe:De):oe=De,F){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=oe+je,F={id:b++,callback:fe,priorityLevel:F,startTime:oe,expirationTime:je,sortIndex:-1},oe>De?(F.sortIndex=oe,i(v,F),c(h)===null&&F===c(v)&&(x?(O($),$=-1):x=!0,Re(te,oe-De))):(F.sortIndex=je,i(h,F),y||E||(y=!0,V||(V=!0,Pe()))),F},l.unstable_shouldYield=Se,l.unstable_wrapCallback=function(F){var fe=S;return function(){var oe=S;S=fe;try{return F.apply(this,arguments)}finally{S=oe}}}})(id)),id}var Fg;function Tj(){return Fg||(Fg=1,sd.exports=wj()),sd.exports}var rd={exports:{}},ve={};/**
19
- * @license React
20
- * react.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var Wg;function Ej(){if(Wg)return ve;Wg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),E=Symbol.iterator;function y(A){return A===null||typeof A!="object"?null:(A=E&&A[E]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,z={};function O(A,Q,K){this.props=A,this.context=Q,this.refs=z,this.updater=K||x}O.prototype.isReactComponent={},O.prototype.setState=function(A,Q){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,Q,"setState")},O.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function X(){}X.prototype=O.prototype;function P(A,Q,K){this.props=A,this.context=Q,this.refs=z,this.updater=K||x}var te=P.prototype=new X;te.constructor=P,N(te,O.prototype),te.isPureReactComponent=!0;var V=Array.isArray;function $(){}var L={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function Se(A,Q,K){var ee=K.ref;return{$$typeof:l,type:A,key:Q,ref:ee!==void 0?ee:null,props:K}}function Le(A,Q){return Se(A.type,Q,A.props)}function Pe(A){return typeof A=="object"&&A!==null&&A.$$typeof===l}function de(A){var Q={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(K){return Q[K]})}var Ve=/\/+/g;function Re(A,Q){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):Q.toString(36)}function F(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then($,$):(A.status="pending",A.then(function(Q){A.status==="pending"&&(A.status="fulfilled",A.value=Q)},function(Q){A.status==="pending"&&(A.status="rejected",A.reason=Q)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function fe(A,Q,K,ee,ge){var ze=typeof A;(ze==="undefined"||ze==="boolean")&&(A=null);var Oe=!1;if(A===null)Oe=!0;else switch(ze){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(A.$$typeof){case l:case i:Oe=!0;break;case b:return Oe=A._init,fe(Oe(A._payload),Q,K,ee,ge)}}if(Oe)return ge=ge(A),Oe=ee===""?"."+Re(A,0):ee,V(ge)?(K="",Oe!=null&&(K=Oe.replace(Ve,"$&/")+"/"),fe(ge,Q,K,"",function(ie){return ie})):ge!=null&&(Pe(ge)&&(ge=Le(ge,K+(ge.key==null||A&&A.key===ge.key?"":(""+ge.key).replace(Ve,"$&/")+"/")+Oe)),Q.push(ge)),1;Oe=0;var U=ee===""?".":ee+":";if(V(A))for(var I=0;I<A.length;I++)ee=A[I],ze=U+Re(ee,I),Oe+=fe(ee,Q,K,ze,ge);else if(I=y(A),typeof I=="function")for(A=I.call(A),I=0;!(ee=A.next()).done;)ee=ee.value,ze=U+Re(ee,I++),Oe+=fe(ee,Q,K,ze,ge);else if(ze==="object"){if(typeof A.then=="function")return fe(F(A),Q,K,ee,ge);throw Q=String(A),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function oe(A,Q,K){if(A==null)return A;var ee=[],ge=0;return fe(A,ee,"","",function(ze){return Q.call(K,ze,ge++)}),ee}function De(A){if(A._status===-1){var Q=A._result,K=Q();K.then(function(ee){(A._status===0||A._status===-1)&&(A._status=1,A._result=ee,K.status===void 0&&(K.status="fulfilled",K.value=ee))},function(ee){(A._status===0||A._status===-1)&&(A._status=2,A._result=ee,K.status===void 0&&(K.status="rejected",K.reason=ee))}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var je=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function zt(A){var Q=L.T,K={};K.types=Q!==null?Q.types:null,L.T=K;try{var ee=A(),ge=L.S;ge!==null&&ge(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then($,je)}catch(ze){je(ze)}finally{Q!==null&&K.types!==null&&(Q.types=K.types),L.T=Q}}function Gt(A){var Q=L.T;if(Q!==null){var K=Q.types;K===null?Q.types=[A]:K.indexOf(A)===-1&&K.push(A)}else zt(Gt.bind(null,A))}var Xt={map:oe,forEach:function(A,Q,K){oe(A,function(){Q.apply(this,arguments)},K)},count:function(A){var Q=0;return oe(A,function(){Q++}),Q},toArray:function(A){return oe(A,function(Q){return Q})||[]},only:function(A){if(!Pe(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ve.Activity=k,ve.Children=Xt,ve.Component=O,ve.Fragment=c,ve.Profiler=d,ve.PureComponent=P,ve.StrictMode=u,ve.Suspense=h,ve.ViewTransition=S,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ve.__COMPILER_RUNTIME={__proto__:null,c:function(A){return L.H.useMemoCache(A)}},ve.addTransitionType=Gt,ve.cache=function(A){return function(){return A.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(A,Q,K){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ee=N({},A.props),ge=A.key;if(Q!=null)for(ze in Q.key!==void 0&&(ge=""+Q.key),Q)!ue.call(Q,ze)||ze==="key"||ze==="__self"||ze==="__source"||ze==="ref"&&Q.ref===void 0||(ee[ze]=Q[ze]);var ze=arguments.length-2;if(ze===1)ee.children=K;else if(1<ze){for(var Oe=Array(ze),U=0;U<ze;U++)Oe[U]=arguments[U+2];ee.children=Oe}return Se(A.type,ge,ee)},ve.createContext=function(A){return A={$$typeof:g,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:f,_context:A},A},ve.createElement=function(A,Q,K){var ee,ge={},ze=null;if(Q!=null)for(ee in Q.key!==void 0&&(ze=""+Q.key),Q)ue.call(Q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ge[ee]=Q[ee]);var Oe=arguments.length-2;if(Oe===1)ge.children=K;else if(1<Oe){for(var U=Array(Oe),I=0;I<Oe;I++)U[I]=arguments[I+2];ge.children=U}if(A&&A.defaultProps)for(ee in Oe=A.defaultProps,Oe)ge[ee]===void 0&&(ge[ee]=Oe[ee]);return Se(A,ze,ge)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(A){return{$$typeof:p,render:A}},ve.isValidElement=Pe,ve.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:De}},ve.memo=function(A,Q){return{$$typeof:v,type:A,compare:Q===void 0?null:Q}},ve.startTransition=zt,ve.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ve.use=function(A){return L.H.use(A)},ve.useActionState=function(A,Q,K){return L.H.useActionState(A,Q,K)},ve.useCallback=function(A,Q){return L.H.useCallback(A,Q)},ve.useContext=function(A){return L.H.useContext(A)},ve.useDebugValue=function(){},ve.useDeferredValue=function(A,Q){return L.H.useDeferredValue(A,Q)},ve.useEffect=function(A,Q){return L.H.useEffect(A,Q)},ve.useEffectEvent=function(A){return L.H.useEffectEvent(A)},ve.useId=function(){return L.H.useId()},ve.useImperativeHandle=function(A,Q,K){return L.H.useImperativeHandle(A,Q,K)},ve.useInsertionEffect=function(A,Q){return L.H.useInsertionEffect(A,Q)},ve.useLayoutEffect=function(A,Q){return L.H.useLayoutEffect(A,Q)},ve.useMemo=function(A,Q){return L.H.useMemo(A,Q)},ve.useOptimistic=function(A,Q){return L.H.useOptimistic(A,Q)},ve.useReducer=function(A,Q,K){return L.H.useReducer(A,Q,K)},ve.useRef=function(A){return L.H.useRef(A)},ve.useState=function(A){return L.H.useState(A)},ve.useSyncExternalStore=function(A,Q,K){return L.H.useSyncExternalStore(A,Q,K)},ve.useTransition=function(){return L.H.useTransition()},ve.version="19.3.1",ve}var Pg;function Gd(){return Pg||(Pg=1,rd.exports=Ej()),rd.exports}var cd={exports:{}},wt={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var ev;function Cj(){if(ev)return wt;ev=1;var l=Gd();function i(b){var k="https://react.dev/errors/"+b;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)k+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+b+"; visit "+k+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(i(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),g=Symbol.for("react.optimistic_key");function p(b,k,S){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:E===g?g:""+E,children:b,containerInfo:k,implementation:S}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,k){if(b==="font")return"";if(typeof k=="string")return k==="use-credentials"?k:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,wt.browser=function(b){return{$$typeof:f,_reason:b}},wt.createPortal=function(b,k){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!k||k.nodeType!==1&&k.nodeType!==9&&k.nodeType!==11)throw Error(i(299));return p(b,k,null,S)},wt.flushSync=function(b){var k=h.T,S=u.p;try{if(h.T=null,u.p=2,b)return b()}finally{h.T=k,u.p=S,u.d.f()}},wt.preconnect=function(b,k){typeof b=="string"&&(k?(k=k.crossOrigin,k=typeof k=="string"?k==="use-credentials"?k:"":void 0):k=null,u.d.C(b,k))},wt.prefetchDNS=function(b){typeof b=="string"&&u.d.D(b)},wt.preinit=function(b,k){if(typeof b=="string"&&k&&typeof k.as=="string"){var S=k.as,E=v(S,k.crossOrigin),y=typeof k.integrity=="string"?k.integrity:void 0,x=typeof k.fetchPriority=="string"?k.fetchPriority:void 0;S==="style"?u.d.S(b,typeof k.precedence=="string"?k.precedence:void 0,{crossOrigin:E,integrity:y,fetchPriority:x}):S==="script"&&u.d.X(b,{crossOrigin:E,integrity:y,fetchPriority:x,nonce:typeof k.nonce=="string"?k.nonce:void 0})}},wt.preinitModule=function(b,k){if(typeof b=="string")if(typeof k=="object"&&k!==null){if(k.as==null||k.as==="script"){var S=v(k.as,k.crossOrigin);u.d.M(b,{crossOrigin:S,integrity:typeof k.integrity=="string"?k.integrity:void 0,nonce:typeof k.nonce=="string"?k.nonce:void 0,fetchPriority:typeof k.fetchPriority=="string"?k.fetchPriority:void 0})}}else k==null&&u.d.M(b)},wt.preload=function(b,k){if(typeof b=="string"&&typeof k=="object"&&k!==null&&typeof k.as=="string"){var S=k.as,E=v(S,k.crossOrigin);u.d.L(b,S,{crossOrigin:E,integrity:typeof k.integrity=="string"?k.integrity:void 0,nonce:typeof k.nonce=="string"?k.nonce:void 0,type:typeof k.type=="string"?k.type:void 0,fetchPriority:typeof k.fetchPriority=="string"?k.fetchPriority:void 0,referrerPolicy:typeof k.referrerPolicy=="string"?k.referrerPolicy:void 0,imageSrcSet:typeof k.imageSrcSet=="string"?k.imageSrcSet:void 0,imageSizes:typeof k.imageSizes=="string"?k.imageSizes:void 0,media:typeof k.media=="string"?k.media:void 0})}},wt.preloadModule=function(b,k){if(typeof b=="string")if(k){var S=v(k.as,k.crossOrigin);u.d.m(b,{as:typeof k.as=="string"&&k.as!=="script"?k.as:void 0,crossOrigin:S,integrity:typeof k.integrity=="string"?k.integrity:void 0,nonce:typeof k.nonce=="string"?k.nonce:void 0,fetchPriority:typeof k.fetchPriority=="string"?k.fetchPriority:void 0})}else u.d.m(b)},wt.requestFormReset=function(b){u.d.r(b)},wt.unstable_batchedUpdates=function(b,k){return b(k)},wt.useFormState=function(b,k,S){return h.H.useFormState(b,k,S)},wt.useFormStatus=function(){return h.H.useHostTransitionStatus()},wt.version="19.3.1",wt}var tv;function ax(){if(tv)return cd.exports;tv=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),cd.exports=Cj(),cd.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var nv;function zj(){if(nv)return oi;nv=1;var l=Tj(),i=Gd(),c=ax();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(f(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var o=r.alternate;if(o===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return h(r),e;if(o===a)return h(r),t;o=o.sibling}throw Error(u(188))}if(n.return!==a.return)n=r,a=o;else{for(var m=!1,j=r.child;j;){if(j===n){m=!0,n=r,a=o;break}if(j===a){m=!0,a=r,n=o;break}j=j.sibling}if(!m){for(j=o.child;j;){if(j===n){m=!0,n=o,a=r;break}if(j===a){m=!0,a=o,n=r;break}j=j.sibling}if(!m)throw Error(u(189))}}if(n.alternate!==a)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}function k(e,t,n,a,r,o){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,r,o)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&k(e.child,t,n,a,r,o))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function E(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function y(e){var t=[null,null],n=S(e);return n===null||x(t,e,n.child,{foundSelf:!1}),t}function x(e,t,n,a){for(;n!==null;){if(n===t)a.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(a.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&x(e,t,n.child,a))return!0;n=n.sibling}return!1}function N(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(u(559))}}var z=null,O=null;function X(e,t,n){return e===n?!0:e===t?(z=e,!0):!1}function P(e,t,n){return e===n?(O=e,!1):e===t?(O!==null&&(z=e),!0):!1}function te(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function V(e,t,n){for(var a=0,r=e;r;r=n(r))a++;r=0;for(var o=t;o;o=n(o))r++;for(;0<a-r;)e=n(e),a--;for(;0<r-a;)t=n(t),r--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var $=Object.assign,L=Symbol.for("react.element"),ue=Symbol.for("react.transitional.element"),Se=Symbol.for("react.portal"),Le=Symbol.for("react.fragment"),Pe=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),Ve=Symbol.for("react.consumer"),Re=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),De=Symbol.for("react.memo"),je=Symbol.for("react.lazy"),zt=Symbol.for("react.activity"),Gt=Symbol.for("react.legacy_hidden"),Xt=Symbol.for("react.memo_cache_sentinel"),A=Symbol.for("react.view_transition"),Q=Symbol.for("react.recoverable"),K=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function ze(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Le:return"Fragment";case de:return"Profiler";case Pe:return"StrictMode";case fe:return"Suspense";case oe:return"SuspenseList";case zt:return"Activity";case A:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Se:return"Portal";case Re:return e.displayName||"Context";case Ve:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case De:return t=e.displayName||null,t!==null?t:ze(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return ze(e(t))}catch{}}return null}var Oe=Array.isArray,U=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},xt=[],Tt=-1;function ft(e){return{current:e}}function et(e){0>Tt||(e.current=xt[Tt],xt[Tt]=null,Tt--)}function Je(e,t){Tt++,xt[Tt]=e.current,e.current=t}var Nn=ft(null),ps=ft(null),nl=ft(null),Ni=ft(null);function Si(e,t){switch(Je(nl,t),Je(ps,e),Je(Nn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lg(t),e=ag(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}et(Nn),Je(Nn,e)}function ha(){et(Nn),et(ps),et(nl)}function kc(e){var t=e.memoizedState;t!==null&&(es._currentValue=t.memoizedState,Je(Ni,e)),t=Nn.current;var n=ag(t,e.type);t!==n&&(Je(ps,e),Je(Nn,n))}function wi(e){ps.current===e&&(et(Nn),et(ps)),Ni.current===e&&(et(Ni),es._currentValue=ie)}var Nc,Sf;function ll(e){if(Nc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Nc=t&&t[1]||"",Sf=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Nc+e+Sf}var Sc=!1;function wc(e,t){if(!e||Sc)return"";Sc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(W){var _=W}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(W){_=W}Y=!1;try{var H=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Y=!0,new e}finally{Y&&(H!==void 0?Object.defineProperty(e.prototype,"props",H):delete e.prototype.props)}}}else{try{throw Error()}catch(W){_=W}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(W){if(W&&_&&typeof W.stack=="string")return[W.stack,_.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),m=o[0],j=o[1];if(m&&j){var T=m.split(`
45
- `),R=j.split(`
46
- `);for(r=a=0;a<T.length&&!T[a].includes("DetermineComponentFrameRoot");)a++;for(;r<R.length&&!R[r].includes("DetermineComponentFrameRoot");)r++;if(a===T.length||r===R.length)for(a=T.length-1,r=R.length-1;1<=a&&0<=r&&T[a]!==R[r];)r--;for(;1<=a&&0<=r;a--,r--)if(T[a]!==R[r]){if(a!==1||r!==1)do if(a--,r--,0>r||T[a]!==R[r]){var B=`
47
- `+T[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=r);break}}}finally{Sc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ll(n):""}function wb(e,t){switch(e.tag){case 26:case 27:case 5:return ll(e.type);case 16:return ll("Lazy");case 13:return e.child!==t&&t!==null?ll("Suspense Fallback"):ll("Suspense");case 19:return ll("SuspenseList");case 0:case 15:return wc(e.type,!1);case 11:return wc(e.type.render,!1);case 1:return wc(e.type,!0);case 31:return ll("Activity");case 30:return ll("ViewTransition");default:return""}}function wf(e){try{var t="",n=null;do t+=wb(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
48
- Error generating stack: `+a.message+`
49
- `+a.stack}}var Tc=Object.prototype.hasOwnProperty,Ec=l.unstable_scheduleCallback,Cc=l.unstable_cancelCallback,Tb=l.unstable_shouldYield,Eb=l.unstable_requestPaint,Qt=l.unstable_now,Cb=l.unstable_getCurrentPriorityLevel,Tf=l.unstable_ImmediatePriority,Ef=l.unstable_UserBlockingPriority,Ti=l.unstable_NormalPriority,zb=l.unstable_LowPriority,Cf=l.unstable_IdlePriority,Ab=l.log,Ob=l.unstable_setDisableYieldValue,gs=null,Vt=null;function al(e){if(typeof Ab=="function"&&Ob(e),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(gs,e)}catch{}}var Zt=Math.clz32?Math.clz32:Rb,_b=Math.log,Mb=Math.LN2;function Rb(e){return e>>>=0,e===0?32:31-(_b(e)/Mb|0)|0}var Ei=256,Ci=262144,zi=4194304;function Ml(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ai(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var j=a&134217727;return j!==0?(a=j&~o,a!==0?r=Ml(a):(m&=j,m!==0?r=Ml(m):n||(n=j&~e,n!==0&&(r=Ml(n))))):(j=a&~o,j!==0?r=Ml(j):m!==0?r=Ml(m):n||(n=a&~e,n!==0&&(r=Ml(n)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:r}function vs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zf(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-Zt(n),r=1<<a;t|=e[a],n&=~r}return t}function Db(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Af(){var e=zi;return zi<<=1,(zi&62914560)===0&&(zi=4194304),e}function zc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ub(e,t,n,a,r,o){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,T=e.expirationTimes,R=e.hiddenUpdates;for(n=m&~n;0<n;){var B=31-Zt(n),Y=1<<B;j[B]=0,T[B]=-1;var _=R[B];if(_!==null)for(R[B]=null,B=0;B<_.length;B++){var H=_[B];H!==null&&(H.lane&=-536870913)}n&=~Y}a!==0&&Of(e,a,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(m&~t))}function Of(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Zt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function _f(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Zt(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function Mf(e,t){var n=t&-t;return n=(n&42)!==0?1:Ac(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ac(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rf(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:qg(e.type))}function Df(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Bn=Math.random().toString(36).slice(2),bt="__reactFiber$"+Bn,Ut="__reactProps$"+Bn,ma="__reactContainer$"+Bn,Uf="__reactEvents$"+Bn,Hb="__reactListeners$"+Bn,Bb="__reactHandles$"+Bn,Hf="__reactResources$"+Bn,bs="__reactMarker$"+Bn,Oi="__reactLoad$"+Bn;function _i(e){delete e[bt],delete e[Ut],delete e[Hb],delete e[Bb]}function Rl(e){var t;if(t=e[bt])return t;for(var n=e.parentNode;n;){if(t=n[ma]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=jg(e);e!==null;){if(n=e[bt])return n;e=jg(e)}return t}e=n,n=e.parentNode}return null}function pa(e){if(e=e[bt]||e[ma]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ys(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ga(e){var t=e[Hf];return t||(t=e[Hf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[bs]=!0}function Bf(e){e[Oi]=void 0}var Lf=new Set,$f={};function Dl(e,t){va(e,t),va(e+"Capture",t)}function va(e,t){for($f[e]=t,e=0;e<t.length;e++)Lf.add(t[e])}var Lb=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]*$"),qf={},Yf={};function $b(e){return Tc.call(Yf,e)?!0:Tc.call(qf,e)?!1:Lb.test(e)?Yf[e]=!0:(qf[e]=!0,!1)}var Me=!1;function Gf(){var e=Me;return Me=!1,e}function Mi(e,t,n){if($b(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Ri(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Ln(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,a)}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qb(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _c(e){if(!e._valueTracker){var t=Xf(e)?"checked":"value";e._valueTracker=qb(e,t,""+e[t])}}function Qf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Xf(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var Yb=/[\n"\\]/g;function an(e){return e.replace(Yb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mc(e,t,n,a,r,o,m,j){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Rc(e,Kt(e.value)):Rc(e,Kt(t)):n!=null?Rc(e,Kt(n)):a!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Kt(j):e.removeAttribute("name")}function Vf(e,t,n,a,r,o,m,j){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){_c(e);return}n=n!=null?""+Kt(n):"",t=t!=null?""+Kt(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=j?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),_c(e)}function Rc(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function xa(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Kt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Zf(e,t,n){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Kt(n):""}function Kf(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(u(92));if(Oe(a)){if(1<a.length)throw Error(u(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Kt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),_c(e)}function ba(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gb=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 Jf(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Gb.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function If(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",Me=!0);for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&(Jf(e,r,a),Me=!0)}else for(var o in t)t.hasOwnProperty(o)&&Jf(e,o,t[o])}function Dc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xb=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"],["maskType","mask-type"],["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"]]),Qb=/^[\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 Di(e){return Qb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sn(){}var Uc=null;function Hc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ya=null,ja=null;function Ff(e){var t=pa(e);if(t&&(e=t.stateNode)){var n=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mc(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+an(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[Ut]||null;if(!r)throw Error(u(90));Mc(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Qf(a)}break e;case"textarea":Zf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&xa(e,!!n.multiple,t,!1)}}}var Bc=!1;function Wf(e,t,n){if(Bc)return e(t,n);Bc=!0;try{var a=e(t);return a}finally{if(Bc=!1,(ya!==null||ja!==null)&&(Dr(),ya&&(t=ya,e=ja,ja=ya=null,Ff(t),e)))for(t=0;t<e.length;t++)Ff(e[t])}}function js(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ut]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var $n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lc=!1;if($n)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){Lc=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{Lc=!1}var sl=null,$c=null,Ui=null;function Pf(){if(Ui)return Ui;var e,t=$c,n=t.length,a,r="value"in sl?sl.value:sl.textContent,o=r.length;for(e=0;e<n&&t[e]===r[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===r[o-a];a++);return Ui=r.slice(e,1<a?1-a:void 0)}function Hi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Bi(){return!0}function eh(){return!1}function At(e){function t(n,a,r,o,m){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(o):o[j]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Bi:eh,this.isPropagationStopped=eh,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Bi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bi)},persist:function(){},isPersistent:Bi}),t}var il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Li=At(il),Ns=$({},il,{view:0,detail:0}),Vb=At(Ns),qc,Yc,Ss,$i=$({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ss&&(Ss&&e.type==="mousemove"?(qc=e.screenX-Ss.screenX,Yc=e.screenY-Ss.screenY):Yc=qc=0,Ss=e),qc)},movementY:function(e){return"movementY"in e?e.movementY:Yc}}),th=At($i),Zb=$({},$i,{dataTransfer:0}),Kb=At(Zb),Jb=$({},Ns,{relatedTarget:0}),Gc=At(Jb),Ib=$({},il,{animationName:0,elapsedTime:0,pseudoElement:0}),Fb=At(Ib),Wb=$({},il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pb=At(Wb),ey=$({},il,{data:0}),nh=At(ey),ty={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ny={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"},ly={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ay(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ly[e])?!!t[e]:!1}function Xc(){return ay}var sy=$({},Ns,{key:function(e){if(e.key){var t=ty[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ny[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xc,charCode:function(e){return e.type==="keypress"?Hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),iy=At(sy),ry=$({},$i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lh=At(ry),cy=$({},il,{submitter:0}),uy=At(cy),oy=$({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xc}),dy=At(oy),fy=$({},il,{propertyName:0,elapsedTime:0,pseudoElement:0}),hy=At(fy),my=$({},$i,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),py=At(my),gy=$({},il,{newState:0,oldState:0,source:0}),vy=At(gy),xy=[9,13,27,32],Qc=$n&&"CompositionEvent"in window,ws=null;$n&&"documentMode"in document&&(ws=document.documentMode);var by=$n&&"TextEvent"in window&&!ws,ah=$n&&(!Qc||ws&&8<ws&&11>=ws),sh=" ",ih=!1;function rh(e,t){switch(e){case"keyup":return xy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ka=!1;function yy(e,t){switch(e){case"compositionend":return ch(t);case"keypress":return t.which!==32?null:(ih=!0,sh);case"textInput":return e=t.data,e===sh&&ih?null:e;default:return null}}function jy(e,t){if(ka)return e==="compositionend"||!Qc&&rh(e,t)?(e=Pf(),Ui=$c=sl=null,ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ah&&t.locale!=="ko"?null:t.data;default:return null}}var ky={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 uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ky[e.type]:t==="textarea"}function oh(e,t,n,a){ya?ja?ja.push(a):ja=[a]:ya=a,t=qr(t,"onChange"),0<t.length&&(n=new Li("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ts=null,Es=null;function Ny(e){Fp(e,0)}function qi(e){var t=ys(e);if(Qf(t))return e}function dh(e,t){if(e==="change")return t}var fh=!1;if($n){var Vc;if($n){var Zc="oninput"in document;if(!Zc){var hh=document.createElement("div");hh.setAttribute("oninput","return;"),Zc=typeof hh.oninput=="function"}Vc=Zc}else Vc=!1;fh=Vc&&(!document.documentMode||9<document.documentMode)}function mh(){Ts&&(Ts.detachEvent("onpropertychange",ph),Es=Ts=null)}function ph(e){if(e.propertyName==="value"&&qi(Es)){var t=[];oh(t,Es,e,Hc(e)),Wf(Ny,t)}}function Sy(e,t,n){e==="focusin"?(mh(),Ts=t,Es=n,Ts.attachEvent("onpropertychange",ph)):e==="focusout"&&mh()}function wy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(Es)}function Ty(e,t){if(e==="click")return qi(t)}function Ey(e,t){if(e==="input"||e==="change")return qi(t)}function Cy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:Cy;function Cs(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Tc.call(t,r)||!Jt(e[r],t[r]))return!1}return!0}function Kc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vh(e,t){var n=gh(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gh(n)}}function xh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kc(e.document)}return t}function Jc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var zy=$n&&"documentMode"in document&&11>=document.documentMode,Na=null,Ic=null,zs=null,Fc=!1;function yh(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fc||Na==null||Na!==Kc(a)||(a=Na,"selectionStart"in a&&Jc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),zs&&Cs(zs,a)||(zs=a,a=qr(Ic,"onSelect"),0<a.length&&(t=new Li("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Na)))}function Ul(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sa={animationend:Ul("Animation","AnimationEnd"),animationiteration:Ul("Animation","AnimationIteration"),animationstart:Ul("Animation","AnimationStart"),transitionrun:Ul("Transition","TransitionRun"),transitionstart:Ul("Transition","TransitionStart"),transitioncancel:Ul("Transition","TransitionCancel"),transitionend:Ul("Transition","TransitionEnd")},Wc={},jh={};$n&&(jh=document.createElement("div").style,"AnimationEvent"in window||(delete Sa.animationend.animation,delete Sa.animationiteration.animation,delete Sa.animationstart.animation),"TransitionEvent"in window||delete Sa.transitionend.transition);function Hl(e){if(Wc[e])return Wc[e];if(!Sa[e])return e;var t=Sa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jh)return Wc[e]=t[n];return e}var kh=Hl("animationend"),Nh=Hl("animationiteration"),Sh=Hl("animationstart"),Ay=Hl("transitionrun"),Oy=Hl("transitionstart"),_y=Hl("transitioncancel"),wh=Hl("transitionend"),Th=new Map,Pc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Pc.push("scrollEnd");function gn(e,t){Th.set(e,t),Dl(t,[e])}var My=0;function qn(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=yn.identifierPrefix;var n=My++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Eh(e){if(e==null||typeof e=="string")return e;var t=null,n=Xa;if(n!==null)for(var a=0;a<n.length;a++){var r=e[n[a]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Yn(e,t){return e=Eh(e),t=Eh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Yi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},sn=[],wa=0,eu=0;function Gi(){for(var e=wa,t=eu=wa=0;t<e;){var n=sn[t];sn[t++]=null;var a=sn[t];sn[t++]=null;var r=sn[t];sn[t++]=null;var o=sn[t];if(sn[t++]=null,a!==null&&r!==null){var m=a.pending;m===null?r.next=r:(r.next=m.next,m.next=r),a.pending=r}o!==0&&Ch(n,r,o)}}function Xi(e,t,n,a){sn[wa++]=e,sn[wa++]=t,sn[wa++]=n,sn[wa++]=a,eu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function tu(e,t,n,a){return Xi(e,t,n,a),Qi(e)}function Bl(e,t){return Xi(e,null,null,t),Qi(e)}function Ch(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,r&&t!==null&&(r=31-Zt(n),e=o.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),o):null}function Qi(e){if(50<Fs)throw Fs=0,Rr=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ta={};function Ry(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,n,a){return new Ry(e,t,n,a)}function nu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gn(e,t){var n=e.alternate;return n===null?(n=Ht(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function zh(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vi(e,t,n,a,r,o){var m=0;if(a=e,typeof a=="function")nu(a)&&(m=1);else if(typeof a=="string")m=cj(e,n,Nn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case zt:return e=Ht(31,n,t,r),e.elementType=zt,e.lanes=o,e;case Le:return Ll(n.children,r,o,t);case Pe:m=8,r|=24;break;case de:return e=Ht(12,n,t,r|2),e.elementType=de,e.lanes=o,e;case fe:return e=Ht(13,n,t,r),e.elementType=fe,e.lanes=o,e;case oe:return e=Ht(19,n,t,r),e.elementType=oe,e.lanes=o,e;case Gt:case A:return e=r|32,e=Ht(30,n,t,e),e.elementType=A,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Re:m=10;break e;case Ve:m=9;break e;case F:m=11;break e;case De:m=14;break e;case je:m=16,a=null;break e}m=29,n=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Ht(m,n,t,r),t.elementType=e,t.type=a,t.lanes=o,t}function Ll(e,t,n,a){return e=Ht(7,e,a,t),e.lanes=n,e}function lu(e,t,n){return e=Ht(6,e,null,t),e.lanes=n,e}function Ah(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function au(e,t,n){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Oh=new WeakMap;function rn(e,t){if(typeof e=="object"&&e!==null){var n=Oh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:wf(t)},Oh.set(e,t),t)}return{value:e,source:t,stack:wf(t)}}var Ea=[],Ca=0,Zi=null,As=0,cn=[],un=0,rl=null,wn=1,Tn="";function Xn(e,t){Ea[Ca++]=As,Ea[Ca++]=Zi,Zi=e,As=t}function _h(e,t,n){cn[un++]=wn,cn[un++]=Tn,cn[un++]=rl,rl=e;var a=wn;e=Tn;var r=32-Zt(a)-1;a&=~(1<<r),n+=1;var o=32-Zt(t)+r;if(30<o){var m=r-r%5;o=(a&(1<<m)-1).toString(32),a>>=m,r-=m,wn=1<<32-Zt(t)+r|n<<r|a,Tn=o+e}else wn=1<<o|n<<r|a,Tn=e}function Ki(e){e.return!==null&&(Xn(e,1),_h(e,1,0))}function su(e){for(;e===Zi;)Zi=Ea[--Ca],Ea[Ca]=null,As=Ea[--Ca],Ea[Ca]=null;for(;e===rl;)rl=cn[--un],cn[un]=null,Tn=cn[--un],cn[un]=null,wn=cn[--un],cn[un]=null}function Mh(e,t){cn[un++]=wn,cn[un++]=Tn,cn[un++]=rl,wn=t.id,Tn=t.overflow,rl=e}var mt=null,Ie=null,ke=!1,cl=null,on=!1,iu=Error(u(519));function ul(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Os(rn(t,e)),iu}function Rh(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[bt]=e,t[Ut]=a,n){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(n=0;n<Ps.length;n++)Te(Ps[n],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),Vf(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),Kf(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||tg(t.textContent,n)?(a.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),a.onScroll!=null&&Te("scroll",t),a.onScrollEnd!=null&&Te("scrollend",t),a.onClick!=null&&(t.onclick=Sn),t=!0):t=!1,t||ul(e,!0)}function Ji(e){for(mt=e.return;mt;)switch(mt.tag){case 5:case 31:case 13:on=!1;return;case 27:case 3:on=!0;return;default:mt=mt.return}}function za(e){if(e!==mt)return!1;if(!ke)return Ji(e),ke=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ho(e.type,e.memoizedProps)),n=!n),n&&Ie&&ul(e),Ji(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=yg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=yg(e)}else t===27?(t=Ie,wl(e.type)?(e=Vo,Vo=null,Ie=e):Ie=t):Ie=mt?fn(e.stateNode.nextSibling):null;return!0}function $l(){Ie=mt=null,ke=!1}function ru(){var e=cl;return e!==null&&($t===null?$t=e:$t.push.apply($t,e),cl=null),e}function Os(e){cl===null?cl=[e]:cl.push(e)}var cu=ft(null),ql=null,Qn=null;function ol(e,t,n){Je(cu,t._currentValue),t._currentValue=n}function Vn(e){e._currentValue=cu.current,et(cu)}function Ii(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function uu(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var m=r.child;o=o.firstContext;e:for(;o!==null;){var j=o;o=r;for(var T=0;T<t.length;T++)if(j.context===t[T]){o.lanes|=n,j=o.alternate,j!==null&&(j.lanes|=n),Ii(o.return,n,e),a||(m=null);break e}o=j.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(u(341));m.lanes|=n,o=m.alternate,o!==null&&(o.lanes|=n),Ii(m,n,e),m=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,m=r.alternate,m!==null&&(m.lanes|=n),Ii(r.return,n,e),m=r.child,m=m!==null?m.sibling:null):m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function Yl(e,t,n,a){e=null;for(var r=t,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(u(387));if(m=m.memoizedProps,m!==null){var j=r.type;Jt(r.pendingProps.value,m.value)||(e!==null?e.push(j):e=[j])}}else if(r===Ni.current){if(m=r.alternate,m===null)throw Error(u(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(es):e=[es])}r=r.return}return e!==null&&uu(t,e,n,a),t.flags|=262144,e!==null}function Fi(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gl(e){ql=e,Qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return Dh(ql,e)}function Wi(e,t){return ql===null&&Gl(e),Dh(e,t)}function Dh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Qn===null){if(e===null)throw Error(u(308));Qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qn=Qn.next=t;return n}var Dy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Uy=l.unstable_scheduleCallback,Hy=l.unstable_NormalPriority,it={$$typeof:Re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ou(){return{controller:new Dy,data:new Map,refCount:0}}function _s(e){e.refCount--,e.refCount===0&&Uy(Hy,function(){e.controller.abort()})}function Uh(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];n.indexOf(a)===-1&&n.push(a)}}}var Ms=null;function By(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Rs=null,du=0,Xl=0,Aa=null;function Ly(e,t){if(Rs===null){var n=Rs=[];du=0,Xl=Co(),Aa={status:"pending",value:void 0,then:function(a){n.push(a)}}}return du++,t.then(Hh,Hh),t}function Hh(){if(--du===0&&(Ms=null,Rs!==null)){Aa!==null&&(Aa.status="fulfilled");var e=Rs;Rs=null,Xl=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $y(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var Bh=U.S;U.S=function(e,t){if(Ap=Qt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ly(e,t),Ms!==null)for(var n=Ka;n!==null;)Uh(n,Ms),n=n.next;if(n=e.types,n!==null){for(var a=Ka;a!==null;)Uh(a,n),a=a.next;if(Xl!==0){a=Ms,a===null&&(a=Ms=[]);for(var r=0;r<n.length;r++){var o=n[r];a.indexOf(o)===-1&&a.push(o)}}}Bh!==null&&Bh(e,t)};var Ql=ft(null);function fu(){var e=Ql.current;return e!==null?e:Ze.pooledCache}function Pi(e,t){t===null?Je(Ql,Ql.current):Je(Ql,t.pool)}function Lh(){var e=fu();return e===null?null:{parent:it._currentValue,pool:e}}var Oa=Error(u(460)),hu=Error(u(474)),er=Error(u(542)),tr={then:function(){}};function $h(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Sn,Sn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gh(e),e===void 0&&!("reason"in t)?Error(u(600)):e;default:if(typeof t.status=="string")t.then(Sn,Sn);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gh(e),e}throw Zl=t,Oa}}function Vl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zl=n,Oa):n}}var Zl=null;function Yh(){if(Zl===null)throw Error(u(459));var e=Zl;return Zl=null,e}function Gh(e){if(e===Oa||e===er)throw Error(u(483))}var _a=null,Ds=0;function nr(e){var t=Ds;return Ds+=1,_a===null&&(_a=[]),qh(_a,e,t)}function dl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function lr(e,t){throw t.$$typeof===L?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Xh(e){function t(M,C){if(e){var D=M.deletions;D===null?(M.deletions=[C],M.flags|=16):D.push(C)}}function n(M,C){if(!e)return null;for(;C!==null;)t(M,C),C=C.sibling;return null}function a(M){for(var C=new Map;M!==null;)M.key===null?C.set(M.index,M):C.set(M.key,M),M=M.sibling;return C}function r(M,C){return M=Gn(M,C),M.index=0,M.sibling=null,M}function o(M,C,D){return M.index=D,e?(D=M.alternate,D!==null?(D=D.index,D<C?(M.flags|=2,C):D):(M.flags|=134217730,C)):(M.flags|=1048576,C)}function m(M){return e&&M.alternate===null&&(M.flags|=134217730),M}function j(M,C,D,q){return C===null||C.tag!==6?(C=lu(D,M.mode,q),C.return=M,C):(C=r(C,D),C.return=M,C)}function T(M,C,D,q){var ne=D.type;return ne===Le?(M=B(M,C,D.props.children,q,D.key),dl(M,D),M):C!==null&&(C.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===je&&Vl(ne)===C.type)?(C=r(C,D.props),dl(C,D),C.return=M,C):(C=Vi(D.type,D.key,D.props,null,M.mode,q),dl(C,D),C.return=M,C)}function R(M,C,D,q){return C===null||C.tag!==4||C.stateNode.containerInfo!==D.containerInfo||C.stateNode.implementation!==D.implementation?(C=au(D,M.mode,q),C.return=M,C):(C=r(C,D.children||[]),C.return=M,C)}function B(M,C,D,q,ne){return C===null||C.tag!==7?(C=Ll(D,M.mode,q,ne),C.return=M,C):(C=r(C,D),C.return=M,C)}function Y(M,C,D){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=lu(""+C,M.mode,D),C.return=M,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ue:return D=Vi(C.type,C.key,C.props,null,M.mode,D),dl(D,C),D.return=M,D;case Se:return C=au(C,M.mode,D),C.return=M,C;case je:return C=Vl(C),Y(M,C,D)}if(Oe(C)||ee(C))return C=Ll(C,M.mode,D,null),C.return=M,C;if(typeof C.then=="function")return Y(M,nr(C),D);if(C.$$typeof===Re)return Y(M,Wi(M,C),D);lr(M,C)}return null}function _(M,C,D,q){var ne=C!==null?C.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return ne!==null?null:j(M,C,""+D,q);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case ue:return D.key===ne?T(M,C,D,q):null;case Se:return D.key===ne?R(M,C,D,q):null;case je:return D=Vl(D),_(M,C,D,q)}if(Oe(D)||ee(D))return ne!==null?null:B(M,C,D,q,null);if(typeof D.then=="function")return _(M,C,nr(D),q);if(D.$$typeof===Re)return _(M,C,Wi(M,D),q);lr(M,D)}return null}function H(M,C,D,q,ne){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return M=M.get(D)||null,j(C,M,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case ue:return M=M.get(q.key===null?D:q.key)||null,T(C,M,q,ne);case Se:return M=M.get(q.key===null?D:q.key)||null,R(C,M,q,ne);case je:return q=Vl(q),H(M,C,D,q,ne)}if(Oe(q)||ee(q))return M=M.get(D)||null,B(C,M,q,ne,null);if(typeof q.then=="function")return H(M,C,D,nr(q),ne);if(q.$$typeof===Re)return H(M,C,D,Wi(C,q),ne);lr(C,q)}return null}function W(M,C,D,q){for(var ne=null,Ce=null,ce=C,pe=C=0,ut=null;ce!==null&&pe<D.length;pe++){ce.index>pe?(ut=ce,ce=null):ut=ce.sibling;var _e=_(M,ce,D[pe],q);if(_e===null){ce===null&&(ce=ut);break}e&&ce&&_e.alternate===null&&t(M,ce),C=o(_e,C,pe),Ce===null?ne=_e:Ce.sibling=_e,Ce=_e,ce=ut}if(pe===D.length)return n(M,ce),ke&&Xn(M,pe),ne;if(ce===null){for(;pe<D.length;pe++)ce=Y(M,D[pe],q),ce!==null&&(C=o(ce,C,pe),Ce===null?ne=ce:Ce.sibling=ce,Ce=ce);return ke&&Xn(M,pe),ne}for(ce=a(ce);pe<D.length;pe++)ut=H(ce,M,pe,D[pe],q),ut!==null&&(e&&(_e=ut.alternate,_e!==null&&ce.delete(_e.key===null?pe:_e.key)),C=o(ut,C,pe),Ce===null?ne=ut:Ce.sibling=ut,Ce=ut);return e&&ce.forEach(function(Al){return t(M,Al)}),ke&&Xn(M,pe),ne}function ae(M,C,D,q){if(D==null)throw Error(u(151));for(var ne=null,Ce=null,ce=C,pe=C=0,ut=null,_e=D.next();ce!==null&&!_e.done;pe++,_e=D.next()){ce.index>pe?(ut=ce,ce=null):ut=ce.sibling;var Al=_(M,ce,_e.value,q);if(Al===null){ce===null&&(ce=ut);break}e&&ce&&Al.alternate===null&&t(M,ce),C=o(Al,C,pe),Ce===null?ne=Al:Ce.sibling=Al,Ce=Al,ce=ut}if(_e.done)return n(M,ce),ke&&Xn(M,pe),ne;if(ce===null){for(;!_e.done;pe++,_e=D.next())_e=Y(M,_e.value,q),_e!==null&&(C=o(_e,C,pe),Ce===null?ne=_e:Ce.sibling=_e,Ce=_e);return ke&&Xn(M,pe),ne}for(ce=a(ce);!_e.done;pe++,_e=D.next())_e=H(ce,M,pe,_e.value,q),_e!==null&&(e&&(ut=_e.alternate,ut!==null&&ce.delete(ut.key===null?pe:ut.key)),C=o(_e,C,pe),Ce===null?ne=_e:Ce.sibling=_e,Ce=_e);return e&&ce.forEach(function(yj){return t(M,yj)}),ke&&Xn(M,pe),ne}function ye(M,C,D,q){if(typeof D=="object"&&D!==null&&D.type===Le&&D.key===null&&D.props.ref===void 0&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case ue:e:{for(var ne=D.key;C!==null;){if(C.key===ne){if(ne=D.type,ne===Le){if(C.tag===7){n(M,C.sibling),q=r(C,D.props.children),dl(q,D),q.return=M,M=q;break e}}else if(C.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===je&&Vl(ne)===C.type){n(M,C.sibling),q=r(C,D.props),dl(q,D),q.return=M,M=q;break e}n(M,C);break}else t(M,C);C=C.sibling}D.type===Le?(q=Ll(D.props.children,M.mode,q,D.key),dl(q,D),q.return=M,M=q):(q=Vi(D.type,D.key,D.props,null,M.mode,q),dl(q,D),q.return=M,M=q)}return m(M);case Se:e:{for(ne=D.key;C!==null;){if(C.key===ne)if(C.tag===4&&C.stateNode.containerInfo===D.containerInfo&&C.stateNode.implementation===D.implementation){n(M,C.sibling),q=r(C,D.children||[]),q.return=M,M=q;break e}else{n(M,C);break}else t(M,C);C=C.sibling}q=au(D,M.mode,q),q.return=M,M=q}return m(M);case je:return D=Vl(D),ye(M,C,D,q)}if(Oe(D))return W(M,C,D,q);if(ee(D)){if(ne=ee(D),typeof ne!="function")throw Error(u(150));return D=ne.call(D),ae(M,C,D,q)}if(typeof D.then=="function")return ye(M,C,nr(D),q);if(D.$$typeof===Re)return ye(M,C,Wi(M,D),q);lr(M,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,C!==null&&C.tag===6?(n(M,C.sibling),q=r(C,D),q.return=M,M=q):(n(M,C),q=lu(D,M.mode,q),q.return=M,M=q),m(M)):n(M,C)}return function(M,C,D,q){try{Ds=0;var ne=ye(M,C,D,q);return _a=null,ne}catch(ce){if(ce===Oa||ce===er)throw ce;var Ce=Ht(29,ce,null,M.mode);return Ce.lanes=q,Ce.return=M,Ce}finally{}}}var Kl=Xh(!0),Qh=Xh(!1),fl=!1;function mu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function hl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ml(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ue&2)!==0){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Qi(e),Ch(e,null,n),t}return Xi(e,a,t,n),Qi(e)}function Us(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,_f(e,n)}}function gu(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?r=o=m:o=o.next=m,n=n.next}while(n!==null);o===null?r=o=t:o=o.next=t}else r=o=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vu=!1;function Hs(){if(vu){var e=Aa;if(e!==null)throw e}}function Bs(e,t,n,a){vu=!1;var r=e.updateQueue;fl=!1;var o=r.firstBaseUpdate,m=r.lastBaseUpdate,j=r.shared.pending;if(j!==null){r.shared.pending=null;var T=j,R=T.next;T.next=null,m===null?o=R:m.next=R,m=T;var B=e.alternate;B!==null&&(B=B.updateQueue,j=B.lastBaseUpdate,j!==m&&(j===null?B.firstBaseUpdate=R:j.next=R,B.lastBaseUpdate=T))}if(o!==null){var Y=r.baseState;m=0,B=R=T=null,j=o;do{var _=j.lane&-536870913,H=_!==j.lane;if(H?(Ee&_)===_:(a&_)===_){_!==0&&_===Xl&&(vu=!0),B!==null&&(B=B.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var W=e,ae=j;_=t;var ye=n;switch(ae.tag){case 1:if(W=ae.payload,typeof W=="function"){Y=W.call(ye,Y,_);break e}Y=W;break e;case 3:W.flags=W.flags&-65537|128;case 0:if(W=ae.payload,_=typeof W=="function"?W.call(ye,Y,_):W,_==null)break e;Y=$({},Y,_);break e;case 2:fl=!0}}_=j.callback,_!==null&&(e.flags|=64,H&&(e.flags|=8192),H=r.callbacks,H===null?r.callbacks=[_]:H.push(_))}else H={lane:_,tag:j.tag,payload:j.payload,callback:j.callback,next:null},B===null?(R=B=H,T=Y):B=B.next=H,m|=_;if(j=j.next,j===null){if(j=r.shared.pending,j===null)break;H=j,j=H.next,H.next=null,r.lastBaseUpdate=H,r.shared.pending=null}}while(!0);B===null&&(T=Y),r.baseState=T,r.firstBaseUpdate=R,r.lastBaseUpdate=B,o===null&&(r.shared.lanes=0),jl|=m,e.lanes=m,e.memoizedState=Y}}function Vh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Zh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Vh(n[e],t)}var pl=ft(null),ar=ft(0);function Kh(e,t){e=Fn,Je(ar,e),Je(pl,t),Fn=e|t.baseLanes}function xu(){Je(ar,Fn),Je(pl,pl.current)}function bu(){Fn=ar.current,et(pl),et(ar)}var jt=ft(null),Et=null;function gl(e){var t=e.alternate;Je(kt,kt.current&1),Je(jt,e),Et===null&&(t===null||pl.current!==null||t.memoizedState!==null)&&(Et=e)}function yu(e){Je(kt,kt.current),Je(jt,e),Et===null&&(Et=e)}function Jh(e){e.tag===22?(Je(kt,kt.current),Je(jt,e),Et===null&&(Et=e)):vl()}function vl(){Je(kt,kt.current),Je(jt,jt.current)}function It(e){et(jt),Et===e&&(Et=null),et(kt)}var kt=ft(0);function Ls(e,t){Je(jt,jt.current),Je(kt,t)}function ju(e){et(kt),et(jt),Et===e&&(Et=null)}function sr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xo(n)||Qo(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zn=0,be=null,Ge=null,rt=null,ir=!1,Ma=!1,Jl=!1,rr=0,$s=0,Ra=null,qy=0;function lt(){throw Error(u(321))}function ku(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jt(e[n],t[n]))return!1;return!0}function Nu(e,t,n,a,r,o){return Zn=o,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?_m:Mm,Jl=!1,o=n(a,r),Jl=!1,Ma&&(o=Fh(t,n,a,r)),Ih(e),o}function Ih(e){U.H=mr;var t=Ge!==null&&Ge.next!==null;if(Zn=0,rt=Ge=be=null,ir=!1,$s=0,Ra=null,t)throw Error(u(300));e===null||ct||(e=e.dependencies,e!==null&&Fi(e)&&(ct=!0))}function Fh(e,t,n,a){be=e;var r=0;do{if(Ma&&(Ra=null),$s=0,Ma=!1,25<=r)throw Error(u(301));if(r+=1,rt=Ge=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=Jy,o=t(n,a)}while(Ma);return o}function Yy(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?qs(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(be.flags|=1024),t}function Su(){var e=rr!==0;return rr=0,e}function wu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Tu(e){if(ir){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ir=!1}Zn=0,rt=Ge=be=null,Ma=!1,$s=rr=0,Ra=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?be.memoizedState=rt=e:rt=rt.next=e,rt}function st(){if(Ge===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=rt===null?be.memoizedState:rt.next;if(t!==null)rt=t,Ge=e;else{if(e===null)throw be.alternate===null?Error(u(467)):Error(u(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},rt===null?be.memoizedState=rt=e:rt=rt.next=e}return rt}function cr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qs(e){var t=$s;return $s+=1,Ra===null&&(Ra=[]),e=qh(Ra,e,t),t=be,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?_m:Mm),e}function ur(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return qs(e);if(e.$$typeof===Q)return;if(e.$$typeof===Re)return yt(e)}throw Error(u(438,String(e)))}function Eu(e){var t=null,n=be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=be.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=cr(),be.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=Xt;return t.index++,n}function Kn(e,t){return typeof t=="function"?t(e):t}function or(e){var t=st();return Cu(t,Ge,e)}function Cu(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var r=e.baseQueue,o=a.pending;if(o!==null){if(r!==null){var m=r.next;r.next=o.next,o.next=m}t.baseQueue=r=o,a.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var j=m=null,T=null,R=t,B=!1;do{var Y=R.lane&-536870913;if(Y!==R.lane?(Ee&Y)===Y:(Zn&Y)===Y){var _=R.revertLane;if(_===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),Y===Xl&&(B=!0);else if((Zn&_)===_){R=R.next,_===Xl&&(B=!0);continue}else Y={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(j=T=Y,m=o):T=T.next=Y,be.lanes|=_,jl|=_;Y=R.action,Jl&&n(o,Y),o=R.hasEagerState?R.eagerState:n(o,Y)}else _={lane:Y,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(j=T=_,m=o):T=T.next=_,be.lanes|=Y,jl|=Y;R=R.next}while(R!==null&&R!==t);if(T===null?m=o:T.next=j,!Jt(o,e.memoizedState)&&(ct=!0,B&&(n=Aa,n!==null)))throw n;e.memoizedState=o,e.baseState=m,e.baseQueue=T,a.lastRenderedState=o}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function zu(e){var t=st(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,o=t.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do o=e(o,m.action),m=m.next;while(m!==r);Jt(o,t.memoizedState)||(ct=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function Wh(e,t,n){var a=be,r=st(),o=ke;if(o){if(n===void 0)throw Error(u(407));n=n()}else n=t();var m=!Jt((Ge||r).memoizedState,n);if(m&&(r.memoizedState=n,ct=!0),r=r.queue,_u(tm.bind(null,a,r,e),[e]),e=r.getSnapshot!==t||m||rt!==null&&(rt.memoizedState.tag&1)!==0,Da(e?9:8,{destroy:void 0},em.bind(null,a,r,n,t),null),e){if(a.flags|=2048,Ze===null)throw Error(u(349));o||(Zn&127)!==0||Ph(a,t,n)}return n}function Ph(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t=cr(),be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function em(e,t,n,a){t.value=n,t.getSnapshot=a,nm(t)&&lm(e)}function tm(e,t,n){return n(function(){nm(t)&&lm(e)})}function nm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jt(e,n)}catch{return!0}}function lm(e){var t=Bl(e,2);t!==null&&qt(t,e,2)}function Au(e){var t=Ot();if(typeof e=="function"){var n=e;if(e=n(),Jl){al(!0);try{n()}finally{al(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},t}function am(e,t,n,a){return e.baseState=n,Cu(e,Ge,typeof a=="function"?a:Kn)}function Gy(e,t,n,a,r){if(hr(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){o.listeners.push(m)}};U.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,sm(t,o)):(o.next=n.next,t.pending=n.next=o)}}function sm(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var o=U.T,m={};m.types=o!==null?o.types:null,U.T=m;try{var j=n(r,a),T=U.S;T!==null&&T(m,j),im(e,t,j)}catch(R){Ou(e,t,R)}finally{o!==null&&m.types!==null&&(o.types=m.types),U.T=o}}else try{o=n(r,a),im(e,t,o)}catch(R){Ou(e,t,R)}}function im(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){rm(e,t,a)},function(a){return Ou(e,t,a)}):rm(e,t,n)}function rm(e,t,n){t.status="fulfilled",t.value=n,cm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sm(e,n)))}function Ou(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,cm(t),t=t.next;while(t!==a)}e.action=null}function cm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function um(e,t){return t}function om(e,t){if(ke){var n=Ze.formState;if(n!==null){e:{var a=be;if(ke){if(Ie){t:{for(var r=Ie,o=on;r.nodeType!==8;){if(!o){r=null;break t}if(r=fn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ie=fn(r.nextSibling),a=r.data==="F!";break e}}ul(a)}a=!1}a&&(t=n[0])}}return n=Ot(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:um,lastRenderedState:t},n.queue=a,n=zm.bind(null,be,a),a.dispatch=n,a=Au(!1),o=Hu.bind(null,be,!1,a.queue),a=Ot(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=Gy.bind(null,be,r,o,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function dm(e){var t=st();return fm(t,Ge,e)}function fm(e,t,n){if(t=Cu(e,t,um)[0],e=or(Kn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=qs(t)}catch(m){throw m===Oa?er:m}else a=t;t=st();var r=t.queue,o=r.dispatch;return n!==t.memoizedState&&(be.flags|=2048,Da(9,{destroy:void 0},Xy.bind(null,r,n),null)),[a,o,e]}function Xy(e,t){e.action=t}function hm(e){var t=st(),n=Ge;if(n!==null)return fm(t,n,e);st(),t=t.memoizedState,n=st();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Da(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=be.updateQueue,t===null&&(t=cr(),be.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function mm(){return st().memoizedState}function dr(e,t,n,a){var r=Ot();be.flags|=e,r.memoizedState=Da(1|t,{destroy:void 0},n,a===void 0?null:a)}function fr(e,t,n,a){var r=st();a=a===void 0?null:a;var o=r.memoizedState.inst;Ge!==null&&a!==null&&ku(a,Ge.memoizedState.deps)?r.memoizedState=Da(t,o,n,a):(be.flags|=e,r.memoizedState=Da(1|t,o,n,a))}function pm(e,t){dr(8390656,8,e,t)}function _u(e,t){fr(2048,8,e,t)}function Qy(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=cr(),be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gm(e){var t=st().memoizedState;return Qy({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function vm(e,t){return fr(4,2,e,t)}function xm(e,t){return fr(4,4,e,t)}function bm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ym(e,t,n){n=n!=null?n.concat([e]):null,fr(4,4,bm.bind(null,t,e),n)}function Mu(){}function jm(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&ku(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function km(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&ku(t,a[1]))return a[0];if(a=e(),Jl){al(!0);try{e()}finally{al(!1)}}return n.memoizedState=[a,t],a}function Ru(e,t,n){return n===void 0||(Zn&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=_p(),be.lanes|=e,jl|=e,n)}function Nm(e,t,n,a){return Jt(n,t)?n:pl.current!==null?(e=Ru(e,n,a),Jt(e,t)||(ct=!0),e):(Zn&106)===0||(Zn&1073741824)!==0&&(Ee&261930)===0?(ct=!0,e.memoizedState=n):(e=_p(),be.lanes|=e,jl|=e,t)}function Sm(e,t,n,a,r){var o=I.p;I.p=o!==0&&8>o?o:8;var m=U.T,j={};j.types=m!==null?m.types:null,U.T=j,Hu(e,!1,t,n);try{var T=r(),R=U.S;if(R!==null&&R(j,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=$y(T,a);Ys(e,t,B,en(e))}else Ys(e,t,a,en(e))}catch(Y){Ys(e,t,{then:function(){},status:"rejected",reason:Y},en())}finally{I.p=o,m!==null&&j.types!==null&&(m.types=j.types),U.T=m}}function Vy(){}function Du(e,t,n,a){if(e.tag!==5)throw Error(u(476));var r=wm(e).queue;Sm(e,r,t,ie,n===null?Vy:function(){return Tm(e),n(a)})}function wm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Tm(e){var t=wm(e);t.next===null&&(t=e.alternate.memoizedState),Ys(e,t.next.queue,{},en())}function Uu(){return yt(es)}function Em(){return st().memoizedState}function Cm(){return st().memoizedState}function Zy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=en();e=hl(n);var a=ml(t,e,n);a!==null&&(qt(a,t,n),Us(a,t,n)),t={cache:ou()},e.payload=t;return}t=t.return}}function Ky(e,t,n){var a=en();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hr(e)?Am(t,n):(n=tu(e,t,n,a),n!==null&&(qt(n,e,a),Om(n,t,a)))}function zm(e,t,n){var a=en();Ys(e,t,n,a)}function Ys(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hr(e))Am(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,j=o(m,n);if(r.hasEagerState=!0,r.eagerState=j,Jt(j,m))return Xi(e,t,r,0),Ze===null&&Gi(),!1}catch{}finally{}if(n=tu(e,t,r,a),n!==null)return qt(n,e,a),Om(n,t,a),!0}return!1}function Hu(e,t,n,a){if(a={lane:2,revertLane:Co(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hr(e)){if(t)throw Error(u(479))}else t=tu(e,n,a,2),t!==null&&qt(t,e,2)}function hr(e){var t=e.alternate;return e===be||t!==null&&t===be}function Am(e,t){Ma=ir=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Om(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,_f(e,n)}}var mr={readContext:yt,use:ur,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt,useEffectEvent:lt},_m={readContext:yt,use:ur,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:pm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,dr(4194308,4,bm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return dr(4194308,4,e,t)},useInsertionEffect:function(e,t){dr(4,2,e,t)},useMemo:function(e,t){var n=Ot();t=t===void 0?null:t;var a=e();if(Jl){al(!0);try{e()}finally{al(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Ot();if(n!==void 0){var r=n(t);if(Jl){al(!0);try{n(t)}finally{al(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=Ky.bind(null,be,e),[a.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Au(e);var t=e.queue,n=zm.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Mu,useDeferredValue:function(e,t){var n=Ot();return Ru(n,e,t)},useTransition:function(){var e=Au(!1);return e=Sm.bind(null,be,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=be,r=Ot();if(ke){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ze===null)throw Error(u(349));(Ee&127)!==0||Ph(a,t,n)}r.memoizedState=n;var o={value:n,getSnapshot:t};return r.queue=o,pm(tm.bind(null,a,o,e),[e]),a.flags|=2048,Da(9,{destroy:void 0},em.bind(null,a,o,n,t),null),n},useId:function(){var e=Ot(),t=Ze.identifierPrefix;if(ke){var n=Tn,a=wn;n=(a&~(1<<32-Zt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=rr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=qy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Uu,useFormState:om,useActionState:om,useOptimistic:function(e){var t=Ot();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Hu.bind(null,be,!0,n),n.dispatch=t,[e,t]},useMemoCache:Eu,useCacheRefresh:function(){return Ot().memoizedState=Zy.bind(null,be)},useEffectEvent:function(e){var t=Ot(),n={impl:e};return t.memoizedState=n,function(){if((Ue&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Mm={readContext:yt,use:ur,useCallback:jm,useContext:yt,useEffect:_u,useImperativeHandle:ym,useInsertionEffect:vm,useLayoutEffect:xm,useMemo:km,useReducer:or,useRef:mm,useState:function(){return or(Kn)},useDebugValue:Mu,useDeferredValue:function(e,t){var n=st();return Nm(n,Ge.memoizedState,e,t)},useTransition:function(){var e=or(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:qs(e),t]},useSyncExternalStore:Wh,useId:Em,useHostTransitionStatus:Uu,useFormState:dm,useActionState:dm,useOptimistic:function(e,t){var n=st();return am(n,Ge,e,t)},useMemoCache:Eu,useCacheRefresh:Cm,useEffectEvent:gm},Jy={readContext:yt,use:ur,useCallback:jm,useContext:yt,useEffect:_u,useImperativeHandle:ym,useInsertionEffect:vm,useLayoutEffect:xm,useMemo:km,useReducer:zu,useRef:mm,useState:function(){return zu(Kn)},useDebugValue:Mu,useDeferredValue:function(e,t){var n=st();return Ge===null?Ru(n,e,t):Nm(n,Ge.memoizedState,e,t)},useTransition:function(){var e=zu(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:qs(e),t]},useSyncExternalStore:Wh,useId:Em,useHostTransitionStatus:Uu,useFormState:hm,useActionState:hm,useOptimistic:function(e,t){var n=st();return Ge!==null?am(n,Ge,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Eu,useCacheRefresh:Cm,useEffectEvent:gm};function Bu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:$({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=en(),r=hl(a);r.payload=t,n!=null&&(r.callback=n),t=ml(e,r,a),t!==null&&(qt(t,e,a),Us(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=en(),r=hl(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=ml(e,r,a),t!==null&&(qt(t,e,a),Us(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=en(),a=hl(n);a.tag=2,t!=null&&(a.callback=t),t=ml(e,a,n),t!==null&&(qt(t,e,n),Us(t,e,n))}};function Rm(e,t,n,a,r,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,m):t.prototype&&t.prototype.isPureReactComponent?!Cs(n,a)||!Cs(r,o):!0}function Dm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Lu.enqueueReplaceState(t,t.state,null)}function Il(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=$({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function Um(e){Yi(e)}function Hm(e){console.error(e)}function Bm(e){Yi(e)}function pr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Lm(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function $u(e,t,n){return n=hl(n),n.tag=3,n.payload={element:null},n.callback=function(){pr(e,t)},n}function $m(e){return e=hl(e),e.tag=3,e}function qm(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var o=a.value;e.payload=function(){return r(o)},e.callback=function(){Lm(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Lm(t,n,a),typeof r!="function"&&(kl===null?kl=new Set([this]):kl.add(this));var j=a.stack;this.componentDidCatch(a.value,{componentStack:j!==null?j:""})})}function Iy(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Yl(t,n,r,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Et===null?Ur():n.alternate===null&&at===0&&(at=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===tr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),wo(e,a,r)),!1;case 22:return n.flags|=65536,a===tr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),wo(e,a,r)),!1}throw Error(u(435,n.tag))}return wo(e,a,r),Ur(),!1}if(ke)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==iu&&(e=Error(u(422),{cause:a}),Os(rn(e,n)))):(a!==iu&&(t=Error(u(423),{cause:a}),Os(rn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=rn(a,n),r=$u(e.stateNode,a,r),gu(e,r),at!==4&&(at=2)),!1;var o=Error(u(520),{cause:a});if(o=rn(o,n),Is===null?Is=[o]:Is.push(o),at!==4&&(at=2),t===null)return!0;a=rn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=$u(n.stateNode,a,e),gu(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(kl===null||!kl.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,r=$m(r),qm(r,e,n,a),gu(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var qu=Error(u(461)),ct=!1;function ot(e,t,n,a){t.child=e===null?Qh(t,null,n,a):Kl(t,e.child,n,a)}function Ym(e,t,n,a,r){n=n.render;var o=t.ref;if("ref"in a){var m={};for(var j in a)j!=="ref"&&(m[j]=a[j])}else m=a;return Gl(t),a=Nu(e,t,n,m,o,r),j=Su(),e!==null&&!ct?(wu(e,t,r),Jn(e,t,r)):(ke&&j&&Ki(t),t.flags|=1,ot(e,t,a,r),t.child)}function Gm(e,t,n,a,r){if(e===null){var o=n.type;return typeof o=="function"&&!nu(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,Xm(e,t,o,a,r)):(e=Vi(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Ju(e,r)){var m=o.memoizedProps;if(n=n.compare,n=n!==null?n:Cs,n(m,a)&&e.ref===t.ref)return Jn(e,t,r)}return t.flags|=1,e=Gn(o,a),e.ref=t.ref,e.return=t,t.child=e}function Xm(e,t,n,a,r){if(e!==null){var o=e.memoizedProps;if(Cs(o,a)&&e.ref===t.ref)if(ct=!1,t.pendingProps=a=o,Ju(e,r))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Jn(e,t,r)}return Yu(e,t,n,a,r)}function Qm(e,t,n,a){var r=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~o}else a=0,t.child=null;return Vm(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Pi(t,o!==null?o.cachePool:null),o!==null?Kh(t,o):xu(),Jh(t);else return a=t.lanes=536870912,Vm(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(Pi(t,o.cachePool),Kh(t,o),vl(),t.memoizedState=null):(e!==null&&Pi(t,null),xu(),vl());return ot(e,t,r,n),t.child}function Gs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vm(e,t,n,a,r){var o=fu();return o=o===null?null:{parent:it._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Pi(t,null),xu(),Jh(t),e!==null&&Yl(e,t,a,!0),t.childLanes=r,null}function gr(e,t){return t=vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zm(e,t,n){return Kl(t,e.child,null,n),e=gr(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function Fy(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=gr(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gs(null,e);if(yu(t),(e=Ie)?(e=bg(e,on),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Ah(e),n.return=t,t.child=n,mt=t,Ie=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return gr(t,a)}var o=e.memoizedState;if(o!==null){var m=o.dehydrated;if(yu(t),r)if(t.flags&256)t.flags&=-257,t=Zm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(ct||Yl(e,t,n,!1),r=(n&e.childLanes)!==0,ct||r){if(pl.current===null){if(a=Ze,a!==null&&(m=Mf(a,n),m!==0&&m!==o.retryLane))throw o.retryLane=m,Bl(e,m),qt(a,e,m),qu;Ur()}t=Zm(e,t,n)}else e=o.treeContext,Ie=fn(m.nextSibling),mt=t,ke=!0,cl=null,on=!1,e!==null&&Mh(t,e),t=gr(t,a),t.flags|=134221824;return t}return e=Gn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ua(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Yu(e,t,n,a,r){return Gl(t),n=Nu(e,t,n,a,void 0,r),a=Su(),e!==null&&!ct?(wu(e,t,r),Jn(e,t,r)):(ke&&a&&Ki(t),t.flags|=1,ot(e,t,n,r),t.child)}function Km(e,t,n,a,r,o){return Gl(t),t.updateQueue=null,n=Fh(t,a,n,r),Ih(e),a=Su(),e!==null&&!ct?(wu(e,t,o),Jn(e,t,o)):(ke&&a&&Ki(t),t.flags|=1,ot(e,t,n,o),t.child)}function Jm(e,t,n,a,r){if(Gl(t),t.stateNode===null){var o=Ta,m=n.contextType;typeof m=="object"&&m!==null&&(o=yt(m)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Lu,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},mu(t),m=n.contextType,o.context=typeof m=="object"&&m!==null?yt(m):Ta,o.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Bu(t,n,m,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(m=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),m!==o.state&&Lu.enqueueReplaceState(o,o.state,null),Bs(t,a,o,r),Hs(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var j=t.memoizedProps,T=Il(n,j);o.props=T;var R=o.context,B=n.contextType;m=Ta,typeof B=="object"&&B!==null&&(m=yt(B));var Y=n.getDerivedStateFromProps;B=typeof Y=="function"||typeof o.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,B||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(j||R!==m)&&Dm(t,o,a,m),fl=!1;var _=t.memoizedState;o.state=_,Bs(t,a,o,r),Hs(),R=t.memoizedState,j||_!==R||fl?(typeof Y=="function"&&(Bu(t,n,Y,a),R=t.memoizedState),(T=fl||Rm(t,n,T,a,_,R,m))?(B||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),o.props=a,o.state=R,o.context=m,a=T):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,pu(e,t),m=t.memoizedProps,B=Il(n,m),o.props=B,Y=t.pendingProps,_=o.context,R=n.contextType,T=Ta,typeof R=="object"&&R!==null&&(T=yt(R)),j=n.getDerivedStateFromProps,(R=typeof j=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m!==Y||_!==T)&&Dm(t,o,a,T),fl=!1,_=t.memoizedState,o.state=_,Bs(t,a,o,r),Hs();var H=t.memoizedState;m!==Y||_!==H||fl||e!==null&&e.dependencies!==null&&Fi(e.dependencies)?(typeof j=="function"&&(Bu(t,n,j,a),H=t.memoizedState),(B=fl||Rm(t,n,B,a,_,H,T)||e!==null&&e.dependencies!==null&&Fi(e.dependencies))?(R||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,H,T),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,H,T)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=H),o.props=a,o.state=H,o.context=T,a=B):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,Ua(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=Kl(t,e.child,null,r),t.child=Kl(t,null,n,r)):ot(e,t,n,r),t.memoizedState=o.state,e=t.child):e=Jn(e,t,r),e}function Im(e,t,n,a){return $l(),t.flags|=256,ot(e,t,n,a),t.child}var Gu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xu(e){return{baseLanes:e,cachePool:Lh()}}function Qu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Pt),e}function Fm(e,t,n){var a=t.pendingProps,r=!1,o=(t.flags&128)!==0,m;if((m=o)||(m=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(r?gl(t):vl(),(e=Ie)?(e=bg(e,on),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Ah(e),n.return=t,t.child=n,mt=t,Ie=null)):e=null,e===null)throw ul(t);return Qo(e)?t.lanes=32:t.lanes=536870912,null}return o=a.children,a=a.fallback,r?(vl(),r=t.mode,o=vr({mode:"hidden",children:o},r),a=Ll(a,r,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,a=t.child,a.memoizedState=Xu(n),a.childLanes=Qu(e,m,n),t.memoizedState=Gu,Gs(null,a)):(gl(t),Vu(t,o))}var j=e.memoizedState;if(j!==null){var T=j.dehydrated;if(T!==null)return Wy(e,t,o,m,a,T,j,n)}return r?(vl(),r=a.fallback,o=t.mode,j=e.child,T=j.sibling,a=Gn(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&1206910976,T!==null?r=Gn(T,r):(r=Ll(r,o,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,Gs(null,a),a=t.child,r=e.child.memoizedState,r===null?r=Xu(n):(o=r.cachePool,o!==null?(j=it._currentValue,o=o.parent!==j?{parent:j,pool:j}:o):o=Lh(),r={baseLanes:r.baseLanes|n,cachePool:o}),a.memoizedState=r,a.childLanes=Qu(e,m,n),t.memoizedState=Gu,Gs(e.child,a)):(gl(t),n=e.child,e=n.sibling,n=Gn(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Vu(e,t){return t=vr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vr(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function xr(e,t,n){return Kl(t,e.child,null,n),e=Vu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wy(e,t,n,a,r,o,m,j){if(n)return t.flags&256?(gl(t),t.flags&=-257,xr(e,t,j)):t.memoizedState!==null?(vl(),t.child=e.child,t.flags|=128,null):(vl(),o=r.fallback,m=t.mode,r=vr({mode:"visible",children:r.children},m),o=Ll(o,m,j,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,Kl(t,e.child,null,j),r=t.child,r.memoizedState=Xu(j),r.childLanes=Qu(e,a,j),t.memoizedState=Gu,Gs(null,r));if(gl(t),Qo(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var T=a.dgst;return a=T,a!==""&&(r=Error(u(419)),r.stack="",r.digest=a,Os({value:r,source:null,stack:null})),xr(e,t,j)}if(ct||Yl(e,t,j,!1),a=(j&e.childLanes)!==0,ct||a){if(pl.current!==null)return xr(e,t,j);if(a=Ze,a!==null&&(r=Mf(a,j),r!==0&&r!==m.retryLane))throw m.retryLane=r,Bl(e,r),qt(a,e,r),qu;return Xo(o)||Ur(),xr(e,t,j)}return Xo(o)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,Ie=fn(o.nextSibling),mt=t,ke=!0,cl=null,on=!1,e!==null&&Mh(t,e),t=Vu(t,r.children),t.flags|=134221824,t)}function Wm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ii(e.return,t,n)}function Pm(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&sr(n)===null&&(t=e),e=e.sibling}return t}function br(e,t,n,a,r,o){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:o}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=r,m.treeForkCount=o)}function Zu(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Ku(e,t,n){var a=t.pendingProps,r=a.revealOrder,o=a.tail;a=a.children;var m=kt.current;if(t.flags&128)return Ls(t,m),null;var j=(m&2)!==0;if(j?(m=m&1|2,t.flags|=128):m&=1,Ls(t,m),r==="backwards"&&e!==null?(Zu(e),ot(e,t,a,n),Zu(e)):ot(e,t,a,n),a=ke?As:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wm(e,n,t);else if(e.tag===19)Wm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":n=Pm(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,Zu(t)),br(t,!0,r,null,o,a);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&sr(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}br(t,!0,n,null,o,a);break;case"together":br(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=Pm(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),br(t,!1,r,n,o,a)}return t.child}function ep(e,t,n){var a=t.pendingProps;return ol(t,t.type,a.value),ot(e,t,a.children,n),t.child}function Jn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=Gn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ju(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fi(e)))}function Py(e,t,n){switch(t.tag){case 3:Si(t,t.stateNode.containerInfo),ol(t,it,e.memoizedState.cache),$l();break;case 27:case 5:kc(t);break;case 4:Si(t,t.stateNode.containerInfo);break;case 10:ol(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yu(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return gl(t),t.flags|=128,null;a=Yl(e,t,n,!1);var r=t.child.childLanes;return a||(n&r)!==0?Fm(e,t,n):(gl(t),e=Jn(e,t,n),e!==null?e.sibling:null)}gl(t);break;case 19:if(t.flags&128)return Ku(e,t,n);if(r=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(Yl(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return Ku(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ls(t,kt.current),a)break;return null;case 22:return t.lanes=0,Qm(e,t,n,t.pendingProps);case 24:ol(t,it,e.memoizedState.cache)}return Jn(e,t,n)}function tp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Ju(e,n)&&(t.flags&128)===0)return ct=!1,Py(e,t,n);ct=(e.flags&131072)!==0}else ct=!1,ke&&(t.flags&1048576)!==0&&_h(t,As,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Vl(t.elementType),t.type=e,typeof e=="function")nu(e)?(a=Il(e,a),t.tag=1,t=Jm(null,t,e,a,n)):(t.tag=0,t=Yu(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===F){t.tag=11,t=Ym(null,t,e,a,n);break e}else if(r===De){t.tag=14,t=Gm(null,t,e,a,n);break e}else if(r===Re){t.tag=10,t.type=e,t=ep(null,t,n);break e}}throw t=ze(e)||e,Error(u(306,t,""))}}return t;case 0:return Yu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=Il(a,t.pendingProps),Jm(e,t,a,r,n);case 3:e:{if(Si(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var o=t.memoizedState;r=o.element,pu(e,t),Bs(t,a,null,n);var m=t.memoizedState;if(a=m.cache,ol(t,it,a),a!==o.cache&&uu(t,[it],n,!0),Hs(),a=m.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Im(e,t,a,n);break e}else if(a!==r){r=rn(Error(u(424)),t),Os(r),t=Im(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ie=fn(e.firstChild),mt=t,ke=!0,cl=null,on=!0,n=Qh(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if($l(),a===r){t=Jn(e,t,n);break e}ot(e,t,a,n)}t=t.child}return t;case 26:return Ua(e,t),e===null?(n=Tg(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(t.stateNode=sg(t.type,t.pendingProps,nl.current,t)):t.memoizedState=Tg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return kc(t),e===null&&ke&&(a=t.stateNode=kg(t.type,t.pendingProps,nl.current),mt=t,on=!0,r=Ie,wl(t.type)?(Vo=r,Ie=fn(a.firstChild)):Ie=r),ot(e,t,t.pendingProps.children,n),Ua(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((r=a=Ie)&&(a=Z0(a,t.type,t.pendingProps,on),a!==null?(t.stateNode=a,mt=t,Ie=fn(a.firstChild),on=!1,r=!0):r=!1),r||ul(t)),kc(t),r=t.type,o=t.pendingProps,m=e!==null?e.memoizedProps:null,a=o.children,Ho(r,o)?a=null:m!==null&&Ho(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=Nu(e,t,Yy,null,null,n),es._currentValue=r),Ua(e,t),ot(e,t,a,n),t.child;case 6:return e===null&&ke&&((e=n=Ie)&&(n=K0(n,t.pendingProps,on),n!==null?(t.stateNode=n,mt=t,Ie=null,e=!0):e=!1),e||ul(t)),null;case 13:return Fm(e,t,n);case 4:return Si(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Kl(t,null,a,n):ot(e,t,a,n),t.child;case 11:return Ym(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Ua(e,t),ot(e,t,a,n),t.child;case 8:return ot(e,t,t.pendingProps.children,n),t.child;case 12:return ot(e,t,t.pendingProps.children,n),t.child;case 10:return ep(e,t,n);case 9:return r=t.type._context,a=t.pendingProps.children,Gl(t),r=yt(r),a=a(r),t.flags|=1,ot(e,t,a,n),t.child;case 14:return Gm(e,t,t.type,t.pendingProps,n);case 15:return Xm(e,t,t.type,t.pendingProps,n);case 19:return Ku(e,t,n);case 31:return Fy(e,t,n);case 22:return Qm(e,t,n,t.pendingProps);case 24:return Gl(t),a=yt(it),e===null?(r=fu(),r===null&&(r=Ze,o=ou(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=n),r=o),t.memoizedState={parent:a,cache:r},mu(t),ol(t,it,r)):((e.lanes&n)!==0&&(pu(e,t),Bs(t,null,null,n),Hs()),r=e.memoizedState,o=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ol(t,it,a)):(a=o.cache,ol(t,it,a),a!==r.cache&&uu(t,[it],n,!0))),ot(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:ke&&Ki(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Ua(e,t),ot(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function In(e){e.flags|=4}function Iu(e,t,n,a,r){var o;if((o=(e.mode&32)!==0)&&(o=n===null?Ag(t,a):Ag(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Up())e.flags|=8192;else throw Zl=tr,hu}else e.flags&=-16777217}function np(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Og(t))if(Up())e.flags|=8192;else throw Zl=tr,hu}function yr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Af():536870912,e.lanes|=t,qa|=t)}function Xs(e,t){if(!ke)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&1206910976,a|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function e0(e,t,n){var a=t.pendingProps;switch(su(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Vn(it),ha(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(za(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ru())),Fe(t),null;case 26:var r=t.type,o=t.memoizedState;return e===null?(In(t),o!==null?(Fe(t),np(t,o)):(Fe(t),Iu(t,r,null,a,n))):o?o!==e.memoizedState?(In(t),Fe(t),np(t,o)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&In(t),Fe(t),Iu(t,r,e,a,n)),null;case 27:if(wi(t),n=nl.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Fe(t),t.subtreeFlags&=-33554433,null}e=Nn.current,za(t)?Rh(t):(e=kg(r,a,n),t.stateNode=e,In(t))}return Fe(t),t.subtreeFlags&=-33554433,null;case 5:if(wi(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Fe(t),t.subtreeFlags&=-33554433,null}if(o=Nn.current,za(t))Rh(t);else{var m=ti(nl.current);switch(o){case 1:o=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=m.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?m.createElement(r,{is:a.is}):m.createElement(r)}}o[bt]=t,o[Ut]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(St(o,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&In(t)}}return Fe(t),t.subtreeFlags&=-33554433,Iu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=nl.current,za(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=mt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||tg(e.nodeValue,n)),e||ul(t,!0)}else e=ti(e).createTextNode(a),e[bt]=t,t.stateNode=e}return Fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=za(t),n!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[bt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else n=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Fe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=za(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[bt]=t}else $l(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),r=!1}else r=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yr(t,t.updateQueue),Fe(t),null);case 4:return ha(),e===null&&_o(t.stateNode.containerInfo),t.flags|=67108864,Fe(t),null;case 10:return Vn(t.type),Fe(t),null;case 19:if(ju(t),a=t.memoizedState,a===null)return Fe(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Xs(a,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=sr(e),o!==null){for(t.flags|=128,Xs(a,!1),e=o.updateQueue,t.updateQueue=e,yr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zh(n,e),n=n.sibling;return Ls(t,kt.current&1|2),ke&&Xn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Qt()>_r&&(t.flags|=128,r=!0,Xs(a,!1),t.lanes=4194304)}else{if(!r)if(e=sr(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,yr(t,e),Xs(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!o.alternate&&!ke)return Fe(t),null}else 2*Qt()-a.renderingStartTime>_r&&n!==536870912&&(t.flags|=128,r=!0,Xs(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Qt(),e.sibling=null,o=kt.current,o=r?o&1|2:o&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||ke?Ls(t,o):(n=o,Je(jt,t),Je(kt,n),Et===null&&(Et=t)),ke&&Xn(t,a.treeForkCount),e}return Fe(t),null;case 22:case 23:return It(t),bu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),n=t.updateQueue,n!==null&&yr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&et(Ql),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vn(it),Fe(t),null;case 25:return null;case 30:return t.flags|=33554432,Fe(t),null}throw Error(u(156,t.tag))}function t0(e,t){switch(su(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(it),ha(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return wi(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(u(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ju(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ha(),null;case 10:return Vn(t.type),null;case 22:case 23:return It(t),bu(),e!==null&&et(Ql),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vn(it),null;case 25:return null;default:return null}}function lp(e,t){switch(su(t),t.tag){case 3:Vn(it),ha();break;case 26:case 27:case 5:wi(t);break;case 4:ha();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:ju(t);break;case 10:Vn(t.type);break;case 22:case 23:It(t),bu(),e!==null&&et(Ql);break;case 24:Vn(it)}}function Qs(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var o=n.create,m=n.inst;a=o(),m.destroy=a}n=n.next}while(n!==r)}}catch(j){qe(t,t.return,j)}}function xl(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var o=r.next;a=o;do{if((a.tag&e)===e){var m=a.inst,j=m.destroy;if(j!==void 0){m.destroy=void 0,r=t;var T=n,R=j;try{R()}catch(B){qe(r,T,B)}}}a=a.next}while(a!==o)}}catch(B){qe(t,t.return,B)}}function ap(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Zh(t,n)}catch(a){qe(e,e.return,a)}}}function sp(e,t,n){n.props=Il(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){qe(e,t,a)}}function En(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var r=e.stateNode,o=qn(e.memoizedProps,r);(r.ref===null||r.ref.name!==o)&&(r.ref=fg(o)),a=r.ref;break;case 7:if(e.stateNode===null){var m=new tn(e);k(e.child,!1,Q0,m,void 0,void 0),e.stateNode=m}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(j){qe(e,t,j)}}function Nt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){qe(e,t,r)}else n.current=null}function jr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)xg(e.stateNode,t[n])}function ip(e){for(var t=e.return;t!==null&&(Wu(t)&&xg(e.stateNode,t.stateNode),!Fu(t));)t=t.return}function Vs(e){for(var t=e.return;t!==null&&(Wu(t)&&V0(e.stateNode,t.stateNode),!Fu(t));)t=t.return}function Fu(e){return e.tag===5||e.tag===3||e.tag===27}function Wu(e){return e&&e.tag===7&&e.stateNode!==null}function Pu(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){qe(e,e.return,r)}}function eo(e,t,n){try{var a=e.stateNode;E0(a,e.type,n,t),a[Ut]=t}catch(r){qe(e,e.return,r)}}function rp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wl(e.type)||e.tag===4}function to(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function no(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sn)),jr(e,a),Me=!0;else if(r!==4&&(r===27&&(jr(e,a),a=null,wl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(no(e,t,n,a),e=e.sibling;e!==null;)no(e,t,n,a),e=e.sibling}function kr(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),jr(e,a),Me=!0;else if(r!==4&&(r===27&&(jr(e,a),a=null,wl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(kr(e,t,n,a),e=e.sibling;e!==null;)kr(e,t,n,a),e=e.sibling}function cp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);St(t,a,n),t[bt]=e,t[Ut]=n}catch(o){qe(e,e.return,o)}}var Nr=!1,Ft=null;function up(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Nr=!0)}var Cn=null;function op(){var e=Cn;return Cn=null,e}var Bt=0;function Ha(e,t,n,a,r){return Bt=0,dp(e.child,t,n,a,r)}function dp(e,t,n,a,r){for(var o=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(a!==null){var j=$o(m);a.push(j),j.view&&(o=!0)}else o||$o(m).view&&(o=!0);Nr=!0,og(m,Bt===0?t:t+"_"+Bt,n),Bt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||dp(e.child,t,n,a,r)&&(o=!0));e=e.sibling}return o}function zn(e,t){for(;e!==null;)e.tag===5?dg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||zn(e.child,t)),e=e.sibling}function Sr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Sr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(u(544));var n=t.name;t=Yn(t.default,t.share),t!=="none"&&(Ha(e,n,t,null,!1)||zn(e.child,!1))}e=e.sibling}}function lo(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,r=qn(a,n),o=Yn(a.default,n.paired?a.share:a.enter);o!=="none"?Ha(e,r,o,null,!1)?(Sr(e),n.paired||t||Qa(e,a.onEnter)):zn(e.child,!1):Sr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)lo(e,t),e=e.sibling;else Sr(e)}function ao(e){if(Ft!==null&&Ft.size!==0){var t=Ft;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,a=n.name;if(a!=null&&a!=="auto"){var r=t.get(a);if(r!==void 0){var o=Yn(n.default,n.share);if(o!=="none"&&(Ha(e,a,o,null,!1)?(o=e.stateNode,r.paired=o,o.paired=r,Qa(e,n.onShare)):zn(e.child,!1)),t.delete(a),t.size===0)break}}}ao(e)}e=e.sibling}}}function so(e){if(e.tag===30){var t=e.memoizedProps,n=qn(t,e.stateNode),a=Ft!==null?Ft.get(n):void 0,r=Yn(t.default,a!==void 0?t.share:t.exit);r!=="none"&&(Ha(e,n,r,null,!1)?a!==void 0?(r=e.stateNode,a.paired=r,r.paired=a,Ft.delete(n),Qa(e,t.onShare)):Qa(e,t.onExit):zn(e.child,!1)),Ft!==null&&ao(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)so(e),e=e.sibling;else Ft!==null&&ao(e)}function fp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=qn(t,e.stateNode);t=Yn(t.default,t.update),e.flags&=-5,t!=="none"&&Ha(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&fp(e);e=e.sibling}}function io(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,zn(e.child,!1))}io(e)}e=e.sibling}}function wr(e){if(e.tag===30)e.stateNode.paired=null,zn(e.child,!1),io(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wr(e),e=e.sibling;else io(e)}function hp(e){for(e=e.child;e!==null;)e.tag===30?zn(e.child,!1):(e.subtreeFlags&33554432)!==0&&hp(e),e=e.sibling}function ro(e,t,n,a,r,o,m){for(var j=!1;t!==null;){if(t.tag===5){var T=t.stateNode;if(o!==null&&Bt<o.length){var R=o[Bt],B=$o(T);(R.view||B.view)&&(j=!0);var Y;if(Y=(e.flags&4)===0)if(B.clip)Y=!0;else{Y=R.rect;var _=B.rect;Y=Y.y!==_.y||Y.x!==_.x||Y.height!==_.height||Y.width!==_.width}Y&&(e.flags|=4),B.abs?B=!R.abs:(R=R.rect,B=B.rect,B=R.height!==B.height||R.width!==B.width),B&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&og(T,Bt===0?n:n+"_"+Bt,r),j&&(e.flags&4)!==0||(Cn===null&&(Cn=[]),Cn.push(T,Bt===0?a:a+"_"+Bt,t.memoizedProps)),Bt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:ro(e,t.child,n,a,r,o,m)&&(j=!0));t=t.sibling}return j}function mp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,r=qn(n,a),o=Yn(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,a=e;var j=e.child;Bt=0,r=ro(a,j,r,r,o,m,!1),(e.flags&4)!==0&&r&&Qa(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&mp(e);e=e.sibling}}var pt=!1,He=!1,An=!1,co=!1,pp=typeof WeakSet=="function"?WeakSet:Set,gt=null,On=!1,Zs=!1,Tr=!1,uo=!1;function n0(e,t,n){if(e=e.containerInfo,Do=ts,e=bh(e),Jc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var j=0,T=-1,R=-1,B=0,Y=0,_=e,H=null;t:for(;;){for(var W;_!==a||o!==0&&_.nodeType!==3||(T=j+o),_!==m||r!==0&&_.nodeType!==3||(R=j+r),_.nodeType===3&&(j+=_.nodeValue.length),(W=_.firstChild)!==null;)H=_,_=W;for(;;){if(_===e)break t;if(H===a&&++B===o&&(T=j),H===m&&++Y===r&&(R=j),(W=_.nextSibling)!==null)break;_=H,H=_.parentNode}_=W}a=T===-1||R===-1?null:{start:T,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Uo={focusedElem:e,selectionRange:a},ts=!1,n=(n&335544064)===n,gt=t,t=n?9270:1024;gt!==null;){if(e=gt,n&&(a=e.deletions,a!==null))for(o=0;o<a.length;o++)n&&so(a[o]);if(e.alternate===null&&(e.flags&2)!==0)n&&up(e),Er(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&so(a),Er(n);continue}else if(a!==null&&a.memoizedState!==null){n&&up(e),Er(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,gt=a):(n&&fp(e),Er(n))}}Ft=null}function Er(e){for(;gt!==null;){var t=gt,n=e,a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&a!==null){n=void 0,r=a.memoizedProps,a=a.memoizedState;var o=t.stateNode;try{var m=Il(t.type,r);n=o.getSnapshotBeforeUpdate(m,a),o.__reactInternalSnapshotBeforeUpdate=n}catch(j){qe(t,t.return,j)}}break;case 3:if((r&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)Go(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Go(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&a!==null&&(n=qn(a.memoizedProps,a.stateNode),r=t.memoizedProps,r=Yn(r.default,r.update),r!=="none"&&Ha(a,n,r,a.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(u(163))}if(a=t.sibling,a!==null){a.return=t.return,gt=a;break}gt=t.return}}function gp(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:_n(e,n),a&4&&Qs(5,n);break;case 1:if(_n(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){qe(n,n.return,m)}else{var r=Il(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){qe(n,n.return,m)}}a&64&&ap(n),a&512&&En(n,n.return);break;case 3:if(_n(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Zh(e,t)}catch(m){qe(n,n.return,m)}}break;case 27:t===null&&a&4&&cp(n);case 26:case 5:_n(e,n),t===null&&a&4&&Pu(n),a&512&&En(n,n.return);break;case 12:_n(e,n);break;case 31:_n(e,n),a&4&&yp(e,n);break;case 13:_n(e,n),a&4&&jp(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=m0.bind(null,n),J0(e,n))));break;case 22:if(a=n.memoizedState!==null||pt,!a){var o=t!==null&&t.memoizedState!==null||He;t=pt,r=He,pt=a,(He=o)&&!r?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),bn(e,n,a)):_n(e,n),pt=t,He=r}break;case 30:_n(e,n),a&512&&En(n,n.return);break;case 7:a&512&&En(n,n.return);default:_n(e,n)}}function oo(e,t){for(e=e.child;e!==null;)vp(e,t),e=e.sibling}function vp(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var a=n.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var r=e.stateNode,o=e.memoizedProps.style,m=o!=null&&o.hasOwnProperty("display")?o.display:null;r.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(T){qe(e,e.return,T)}fo(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Me=!0}catch(T){qe(e,e.return,T)}break;case 18:try{var j=e.stateNode;t?ug(j,!0):ug(e.stateNode,!1)}catch(T){qe(e,e.return,T)}break;case 22:case 23:e.memoizedState===null&&oo(e,t);break;default:oo(e,t)}}function fo(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:vp(n,a);break e;case 22:n.memoizedState===null&&fo(n,a);break e;default:fo(n,a)}}e=e.sibling}}function xp(e){var t=e.alternate;t!==null&&(e.alternate=null,xp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_i(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var We=null,Lt=!1;function vn(e,t,n){for(n=n.child;n!==null;)bp(e,t,n),n=n.sibling}function bp(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(gs,n)}catch{}switch(n.tag){case 26:He||Nt(n,t),vn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!He&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:He||Nt(n,t),Vs(n);var a=We,r=Lt;wl(n.type)&&(We=n.stateNode,Lt=!1),vn(e,t,n),Ng(n.stateNode,n.type,n.memoizedProps),We=a,Lt=r;break;case 5:He||Nt(n,t),Vs(n);case 6:if(n.tag===6&&Vs(n),a=We,r=Lt,We=null,vn(e,t,n),We=a,Lt=r,We!==null)if(Lt)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(n.stateNode),Me=!0}catch(o){qe(n,t,o)}else try{We.removeChild(n.stateNode),Me=!0}catch(o){qe(n,t,o)}break;case 18:We!==null&&(Lt?(e=We,cg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ns(e)):cg(We,n.stateNode));break;case 4:a=We,r=Lt,We=n.stateNode.containerInfo,Lt=!0,vn(e,t,n),We=a,Lt=r;break;case 0:case 11:case 14:case 15:xl(2,n,t),He||xl(4,n,t),vn(e,t,n);break;case 1:He||(Nt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&sp(n,t,a)),vn(e,t,n);break;case 21:vn(e,t,n);break;case 22:He=(a=He)||n.memoizedState!==null,vn(e,t,n),He=a;break;case 30:Nt(n,t),vn(e,t,n);break;case 7:He||Nt(n,t),vn(e,t,n);break;default:vn(e,t,n)}}function yp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ns(e)}catch(n){qe(t,t.return,n)}}}function jp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ns(e)}catch(n){qe(t,t.return,n)}}function l0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pp),t;default:throw Error(u(435,e.tag))}}function Cr(e,t){var n=l0(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=p0.bind(null,e,a);a.then(r,r)}})}function _t(e,t,n){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r],m=e,j=t,T=j;e:for(;T!==null;){switch(T.tag){case 27:if(wl(T.type)){We=T.stateNode,Lt=!1;break e}break;case 5:We=T.stateNode,Lt=!1;break e;case 3:case 4:We=T.stateNode.containerInfo,Lt=!0;break e}T=T.return}if(We===null)throw Error(u(160));bp(m,j,o),We=null,Lt=!1,m=o.alternate,m!==null&&(m.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kp(t,e,n),t=t.sibling}var xn=null;function kp(e,t,n){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var o=0;o<a.length;o++){var m=a[o];m.ref.impl=m.nextImpl}_t(t,e,n),Mt(e),r&4&&(xl(3,e,e.return),Qs(3,e),xl(5,e,e.return));break;case 1:_t(t,e,n),Mt(e),r&512&&(He||a===null||Nt(a,a.return)),r&64&&pt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=xn,_t(t,e,n),Mt(e),r&512&&(He||a===null||Nt(a,a.return)),r&4)if(r=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(pt)e.stateNode=sg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=o.ownerDocument||o;t:switch(t){case"title":a=r.getElementsByTagName("title")[0],(!a||a[bs]||a[bt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(t),r.head.insertBefore(a,r.querySelector("head > title"))),St(a,t,n),a[bt]=e,ht(a),t=a;break e;case"link":if(o=zg("link","href",r).get(t+(n.href||""))){for(m=0;m<o.length;m++)if(a=o[m],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(m,1);break t}}a=r.createElement(t),St(a,t,n),r.head.appendChild(a);break;case"meta":if(o=zg("meta","content",r).get(t+(n.content||""))){for(m=0;m<o.length;m++)if(a=o[m],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(m,1);break t}}a=r.createElement(t),St(a,t,n),r.head.appendChild(a);break;default:throw Error(u(468,t))}a[bt]=e,ht(a),t=a}e.stateNode=t}else pt||Io(o,e.type,e.stateNode);else e.stateNode=Cg(o,n,e.memoizedProps);else r!==n?(r===null?(t=a.stateNode,t===null||He||t.parentNode.removeChild(t)):r.count--,n===null?pt||Io(o,e.type,e.stateNode):Cg(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&eo(e,e.memoizedProps,a.memoizedProps);break;case 27:_t(t,e,n),Mt(e),r&512&&(He||a===null||Nt(a,a.return)),a!==null&&r&4&&eo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(o=An,An=!1,_t(t,e,n),An=o,Mt(e),r&512&&(He||a===null||Nt(a,a.return)),e.flags&32){t=e.stateNode;try{ba(t,""),Me=!0}catch(B){qe(e,e.return,B)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,eo(e,t,a!==null?a.memoizedProps:t)),r&1024&&(co=!0);break;case 6:if(_t(t,e,n),Mt(e),r&4){if(e.stateNode===null)throw Error(u(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Me=!0}catch(B){qe(e,e.return,B)}}break;case 3:if(Me=!1,Gr=null,o=xn,xn=ni(t.containerInfo),_t(t,e,n),xn=o,Mt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ns(t.containerInfo)}catch(B){qe(e,e.return,B)}co&&(co=!1,Np(e)),Me=!1;break;case 4:r=An,An=pt,a=Gf(),o=xn,xn=ni(e.stateNode.containerInfo),_t(t,e,n),Mt(e),xn=o,Me&&Zs&&(Tr=!0),Me=a,An=r;break;case 12:_t(t,e,n),Mt(e);break;case 31:_t(t,e,n),Mt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cr(e,t)));break;case 13:_t(t,e,n),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Or=Qt()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cr(e,t)));break;case 22:o=e.memoizedState!==null,m=a!==null&&a.memoizedState!==null;var j=pt,T=He,R=An;pt=j||o,An=R||o,He=T||m,_t(t,e,n),He=T,An=R,pt=j,Mt(e),r&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||a===null||m||pt||He||(t=m||He,n=pt,a=He,pt=o||pt,He=t,bl(e,2),pt=n,He=a),!o&&An||oo(e,o)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cr(e,n))));break;case 19:_t(t,e,n),Mt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cr(e,t)));break;case 30:r&512&&(He||a===null||Nt(a,a.return)),r=Gf(),o=Zs,m=(n&335544064)===n,j=e.memoizedProps,Zs=m&&Yn(j.default,j.update)!=="none",_t(t,e,n),Mt(e),m&&a!==null&&Me&&(e.flags|=4),Zs=o,Me=r;break;case 21:break;case 7:r&512&&(He||a===null||Nt(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:_t(t,e,n),Mt(e)}}function Mt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(rp(a)){n=a;break}a=a.return}a=null;for(var r=e.return;r!==null;){if(Wu(r)){var o=r.stateNode;a===null?a=[o]:a.push(o)}if(Fu(r))break;r=r.return}var m=a;if(n==null)throw Error(u(160));switch(n.tag){case 27:var j=n.stateNode,T=to(e);kr(e,T,j,m);break;case 5:var R=n.stateNode;n.flags&32&&(ba(R,""),n.flags&=-33);var B=to(e);kr(e,B,R,m);break;case 3:case 4:var Y=n.stateNode.containerInfo,_=to(e);no(e,_,Y,m);break;default:throw Error(u(161))}}catch(H){qe(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Np(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Np(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ts=!0,t.reset(),ts=!1),e=e.sibling}}function Ba(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Sp(t,e),t=t.sibling;else mp(t)}function Sp(e,t){var n=e.alternate;if(n===null)lo(e,!1);else switch(e.tag){case 3:if(uo=On=!1,op(),Ba(t,e),!On&&!Tr){if(e=Cn,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var r=e[a+1];dg(n,e[a+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),uo=!0}Cn=null;break;case 5:Ba(t,e);break;case 4:a=On,On=!1,Ba(t,e),On&&(Tr=!0),On=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?lo(e,!1):Ba(t,e));break;case 30:a=On,r=op(),On=!1,Ba(t,e),On&&(e.flags|=4);var o=e.memoizedProps,m=e.stateNode;t=qn(o,m),m=qn(n.memoizedProps,m);var j=Yn(o.default,o.update);j==="none"?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,Bt=0,t=ro(e,n,t,m,j,o,!0),Bt!==(o===null?0:o.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Qa(e,e.memoizedProps.onUpdate),Cn=r):r!==null&&(r.push.apply(r,Cn),Cn=r),On=(e.flags&32)!==0?!0:a;break;default:Ba(t,e)}}function _n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gp(e,t.alternate,t),t=t.sibling}function bl(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),bl(n,a);break;case 1:Nt(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&sp(n,n.return,r),bl(n,a);break;case 27:(a&2)!==0&&Ng(n.stateNode,n.type,n.memoizedProps);case 5:Nt(n,n.return),n.tag!==5&&n.tag!==27||Vs(n),bl(n,a);break;case 6:Vs(n);break;case 26:Nt(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||He||r.parentNode.removeChild(r),bl(n,a);break;case 22:n.memoizedState===null&&bl(n,a);break;case 30:Nt(n,n.return),bl(n,a);break;case 7:Nt(n,n.return);default:bl(n,a)}e=e.sibling}}function bn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,r=e,o=t,m=o.flags,j=(n&1)!==0;switch(o.tag){case 0:case 11:case 15:bn(r,o,n),Qs(4,o);break;case 1:if(bn(r,o,n),a=o,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(B){qe(a,a.return,B)}if(a=o,r=a.updateQueue,r!==null){var T=a.stateNode;try{var R=r.shared.hiddenCallbacks;if(R!==null)for(r.shared.hiddenCallbacks=null,r=0;r<R.length;r++)Vh(R[r],T)}catch(B){qe(a,a.return,B)}}j&&m&64&&ap(o),En(o,o.return);break;case 27:(n&2)!==0&&cp(o);case 5:o.tag!==5&&o.tag!==27||ip(o),bn(r,o,n),j&&a===null&&m&4&&Pu(o),En(o,o.return);break;case 6:ip(o);break;case 26:T=o.stateNode,o.memoizedState!==null||T===null||pt||Io(ni(T.ownerDocument),o.type,T),bn(r,o,n),j&&a===null&&m&4&&Pu(o),En(o,o.return);break;case 12:bn(r,o,n);break;case 31:bn(r,o,n),j&&m&4&&yp(r,o);break;case 13:bn(r,o,n),j&&m&4&&jp(r,o);break;case 22:o.memoizedState===null&&bn(r,o,n),En(o,o.return);break;case 30:bn(r,o,n),En(o,o.return);break;case 7:En(o,o.return);default:bn(r,o,n)}t=t.sibling}}function ho(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&_s(n))}function mo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_s(e))}function dn(e,t,n,a){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)wp(e,t,n,a),t=t.sibling;else r&&hp(t)}function wp(e,t,n,a){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&wr(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:dn(e,t,n,a),o&2048&&Qs(9,t);break;case 1:dn(e,t,n,a);break;case 3:dn(e,t,n,a),r&&uo&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),o&2048&&(o=null,t.alternate!==null&&(o=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==o&&(t.refCount++,o!=null&&_s(o)));break;case 12:if(o&2048){dn(e,t,n,a),o=t.stateNode;try{var m=t.memoizedProps,j=m.id,T=m.onPostCommit;typeof T=="function"&&T(j,t.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(R){qe(t,t.return,R)}}else dn(e,t,n,a);break;case 31:dn(e,t,n,a);break;case 13:dn(e,t,n,a);break;case 23:break;case 22:m=t.stateNode,j=t.alternate,t.memoizedState!==null?(r&&j!==null&&j.memoizedState===null&&wr(j),m._visibility&2?dn(e,t,n,a):Ks(e,t)):(r&&j!==null&&j.memoizedState!==null&&wr(t),m._visibility&2?dn(e,t,n,a):(m._visibility|=2,La(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),o&2048&&ho(j,t);break;case 24:dn(e,t,n,a),o&2048&&mo(t.alternate,t);break;case 30:r&&(o=t.alternate,o!==null&&(zn(o.child,!0),zn(t.child,!0))),dn(e,t,n,a);break;default:dn(e,t,n,a)}}function La(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,m=t,j=n,T=a,R=m.flags;switch(m.tag){case 0:case 11:case 15:La(o,m,j,T,r),Qs(8,m);break;case 23:break;case 22:var B=m.stateNode;m.memoizedState!==null?B._visibility&2?La(o,m,j,T,r):Ks(o,m):(B._visibility|=2,La(o,m,j,T,r)),r&&R&2048&&ho(m.alternate,m);break;case 24:La(o,m,j,T,r),r&&R&2048&&mo(m.alternate,m);break;default:La(o,m,j,T,r)}t=t.sibling}}function Ks(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Ks(n,a),r&2048&&ho(a.alternate,a);break;case 24:Ks(n,a),r&2048&&mo(a.alternate,a);break;default:Ks(n,a)}t=t.sibling}}var Fl=8192;function Wl(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Tp(e,t,n),e=e.sibling}function Tp(e,t,n){switch(e.tag){case 26:Wl(e,t,n),e.flags&Fl&&(e.memoizedState!==null?uj(n,xn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Mg(n,e)));break;case 5:Wl(e,t,n),e.flags&Fl&&(e=e.stateNode,(t&335544128)===t&&Mg(n,e));break;case 3:case 4:var a=xn;xn=ni(e.stateNode.containerInfo),Wl(e,t,n),xn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Fl,Fl=16777216,Wl(e,t,n),Fl=a):Wl(e,t,n));break;case 30:if((e.flags&Fl)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var r=e.stateNode;r.paired=null,Ft===null&&(Ft=new Map),Ft.set(a,r)}Wl(e,t,n);break;default:Wl(e,t,n)}}function Ep(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];gt=a,zp(a,e)}Ep(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cp(e),e=e.sibling}function Cp(e){switch(e.tag){case 0:case 11:case 15:Js(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Js(e);break;case 12:Js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zr(e)):Js(e);break;default:Js(e)}}function zr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];gt=a,zp(a,e)}Ep(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),zr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zr(t));break;default:zr(t)}e=e.sibling}}function zp(e,t){for(;gt!==null;){var n=gt;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:_s(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,gt=a;else e:for(n=e;gt!==null;){a=gt;var r=a.sibling,o=a.return;if(xp(a),a===n){gt=null;break e}if(r!==null){r.return=o,gt=r;break e}gt=o}}}var a0={getCacheForType:function(e){var t=yt(it),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return yt(it).controller.signal}},s0=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ze=null,we=null,Ee=0,$e=0,Wt=null,yl=!1,$a=!1,po=!1,Fn=0,at=0,jl=0,Pl=0,Ar=0,Pt=0,qa=0,Is=null,$t=null,go=!1,Or=0,Ap=0,_r=1/0,Mr=null,kl=null,tt=0,yn=null,ea=null,Mn=0,vo=0,xo=null,Op=null,Ya=null,Ga=null,Xa=null,Fs=0,Rr=null;function en(){return(Ue&2)!==0&&Ee!==0?Ee&-Ee:U.T!==null?Co():Rf()}function _p(){if(Pt===0)if((Ee&536870912)===0||ke){var e=Ci;Ci<<=1,(Ci&3932160)===0&&(Ci=262144),Pt=e}else Pt=536870912;return e=jt.current,e!==null&&(e.flags|=32),Pt}function Qa(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=fg(qn(e.memoizedProps,n))),Ga===null&&(Ga=[]),Ga.push(t.bind(null,a))}}function qt(e,t,n){(e===Ze&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(Va(e,0),Nl(e,Ee,Pt,!1)),xs(e,n),((Ue&2)===0||e!==Ze)&&(e===Ze&&((Ue&2)===0&&(Pl|=n),at===4&&Nl(e,Ee,Pt,!1)),Rn(e))}function Mp(e,t,n){if((Ue&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||vs(e,t),r=a?c0(e,t):yo(e,t,!0),o=a;do{if(r===0){$a&&!a&&Nl(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!i0(n)){r=yo(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var j=e;r=Is;var T=j.current.memoizedState.isDehydrated;if(T&&(Va(j,m).flags|=256),m=yo(j,m,!1),m!==2&&m!==6){if(po&&!T){j.errorRecoveryDisabledLanes|=o,Pl|=o,r=4;break e}o=$t,$t=r,o!==null&&($t===null?$t=o:$t.push.apply($t,o))}r=m}if(o=!1,r!==2)continue}}if(r===1){Va(e,0),Nl(e,t,0,!0);break}e:{switch(a=e,o=r,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Nl(a,t,Pt,!yl);break e;case 2:$t=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(r=Or+300-Qt(),10<r)){if(Nl(a,t,Pt,!yl),Ai(a,0,!0)!==0)break e;Mn=t,a.timeoutHandle=Lo(Rp.bind(null,a,n,$t,Mr,go,t,Pt,Pl,qa,yl,o,"Throttled",-0,0),r);break e}Rp(a,n,$t,Mr,go,t,Pt,Pl,qa,yl,o,null,-0,0)}}break}while(!0);Rn(e)}function Rp(e,t,n,a,r,o,m,j,T,R,B,Y,_,H){e.timeoutHandle=-1;var W=t.subtreeFlags,ae=(o&335544064)===o;if(Y=null,(ae||W&8192||(W&16785408)===16785408)&&(Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sn},Ft=null,Tp(t,o,Y),ae&&(W=Y,ae=e.containerInfo,ae=(ae.nodeType===9?ae:ae.ownerDocument).__reactViewTransition,ae!=null&&(W.count++,W.waitingForViewTransition=!0,W=si.bind(W),ae.finished.then(W,W))),W=(o&62914560)===o?Or-Qt():(o&4194048)===o?Ap-Qt():0,W=oj(Y,W),W!==null)){Mn=o,e.cancelPendingCommit=W(Yp.bind(null,e,t,o,n,a,r,m,j,T,R,B,Y,null,_,H)),Nl(e,o,m,!R);return}Yp(e,t,o,n,a,r,m,j,T,R,B,Y)}function i0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],o=r.getSnapshot;r=r.value;try{if(!Jt(o(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nl(e,t,n,a){t=zf(e,t),t&=~Ar,t&=~Pl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var o=31-Zt(r),m=1<<o;a[o]=-1,r&=~m}n!==0&&Of(e,n,t)}function Dr(){return(Ue&6)===0?(Ws(0),!1):!0}function bo(){if(we!==null){if($e===0)var e=we.return;else e=we,Qn=ql=null,Tu(e),_a=null,Ds=0,e=we;for(;e!==null;)lp(e.alternate,e),e=e.return;we=null}}function Va(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,A0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Mn=0,bo(),Ze=e,we=n=Gn(e.current,null),Ee=t,$e=0,Wt=null,yl=!1,$a=vs(e,t),po=!1,qa=Pt=Ar=Pl=jl=at=0,$t=Is=null,go=!1,Fn=zf(e,t),Gi(),n}function Dp(e,t){be=null,U.H=mr,t===Oa||t===er?(t=Yh(),$e=3):t===hu?(t=Yh(),$e=4):$e=t===qu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,we===null&&(at=1,pr(e,rn(t,e.current)))}function Up(){var e=jt.current;return e===null?!0:(Ee&4194048)===Ee?Et===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===Et:!1}function Hp(){var e=U.H;return U.H=mr,e===null?mr:e}function Bp(){var e=U.A;return U.A=a0,e}function Ur(){at=4,yl||(Ee&4194048)!==Ee&&jt.current!==null||($a=!0),(jl&134217727)===0&&(Pl&134217727)===0||Ze===null||Nl(Ze,Ee,Pt,!1)}function yo(e,t,n){var a=Ue;Ue|=2;var r=Hp(),o=Bp();(Ze!==e||Ee!==t)&&(Mr=null,Va(e,t)),t=!1;var m=at;e:do try{if($e!==0&&we!==null){var j=we,T=Wt;switch($e){case 8:bo(),m=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var R=$e;if($e=0,Wt=null,Za(e,j,T,R),n&&$a){m=0;break e}break;default:R=$e,$e=0,Wt=null,Za(e,j,T,R)}}r0(),m=at;break}catch(B){Dp(e,B)}while(!0);return t&&e.shellSuspendCounter++,Qn=ql=null,Ue=a,U.H=r,U.A=o,we===null&&(Ze=null,Ee=0,Gi()),m}function r0(){for(;we!==null;)Lp(we)}function c0(e,t){var n=Ue;Ue|=2;var a=Hp(),r=Bp();Ze!==e||Ee!==t?(Mr=null,_r=Qt()+500,Va(e,t)):$a=vs(e,t);e:do try{if($e!==0&&we!==null){t=we;var o=Wt;t:switch($e){case 1:$e=0,Wt=null,Za(e,t,o,1);break;case 2:case 9:if($h(o)){$e=0,Wt=null,$p(t);break}t=function(){$e!==2&&$e!==9||Ze!==e||($e=7),Rn(e)},o.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:$h(o)?($e=0,Wt=null,$p(t)):($e=0,Wt=null,Za(e,t,o,7));break;case 5:var m=null;switch(we.tag){case 26:m=we.memoizedState;case 5:case 27:var j=we;if(m?Og(m):j.stateNode.complete){$e=0,Wt=null;var T=j.sibling;if(T!==null)we=T;else{var R=j.return;R!==null?(we=R,Hr(R)):we=null}break t}}$e=0,Wt=null,Za(e,t,o,5);break;case 6:$e=0,Wt=null,Za(e,t,o,6);break;case 8:bo(),at=6;break e;default:throw Error(u(462))}}u0();break}catch(B){Dp(e,B)}while(!0);return Qn=ql=null,U.H=a,U.A=r,Ue=n,we!==null?0:(Ze=null,Ee=0,Gi(),at)}function u0(){for(;we!==null&&!Tb();)Lp(we)}function Lp(e){var t=tp(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,t===null?Hr(e):we=t}function $p(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Km(n,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=Km(n,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:Tu(t);var a=t;a===mt&&(ke?(Ji(a),a.tag===5&&a.stateNode!=null&&(Ie=a.stateNode)):(Ji(a),ke=!0));default:lp(n,t),t=we=zh(t,Fn),t=tp(n,t,Fn)}e.memoizedProps=e.pendingProps,t===null?Hr(e):we=t}function Za(e,t,n,a){Qn=ql=null,Tu(t),_a=null,Ds=0;var r=t.return;try{if(Iy(e,r,t,n,Ee)){at=1,pr(e,rn(n,e.current)),we=null;return}}catch(o){if(r!==null)throw we=r,o;at=1,pr(e,rn(n,e.current)),we=null;return}t.flags&32768?(ke||a===1?e=!0:$a||(Ee&536870912)!==0?e=!1:(yl=e=!0,(a===2||a===9||a===3||a===6)&&(a=jt.current,a!==null&&a.tag===13&&(a.flags|=16384))),qp(t,e)):Hr(t)}function Hr(e){var t=e;do{if((t.flags&32768)!==0){qp(t,yl);return}e=t.return;var n=e0(t.alternate,t,Fn);if(n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);at===0&&(at=5)}function qp(e,t){do{var n=t0(e.alternate,e);if(n!==null){n.flags&=32767,we=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=n}while(e!==null);at=6,we=null}function Yp(e,t,n,a,r,o,m,j,T,R,B,Y){e.cancelPendingCommit=null;do Br();while(tt!==0);if((Ue&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));e===Ze&&(we=Ze=null,Ee=0),ea=t,yn=e,Mn=n,xo=r,Op=a,o0(e,t,n,m,j,T,Y)}}function o0(e,t,n,a,r,o,m){var j=t.lanes|t.childLanes;if(vo=j,j|=eu,Ub(e,n,j,a,r,o),Ga=null,(n&335544064)===n?(Xa=By(e),a=10262):(Xa=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,g0(Ti,function(){return So(),null})):(e.callbackNode=null,e.callbackPriority=0),Nr=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null,r=I.p,I.p=2,o=Ue,Ue|=4;try{n0(e,t,n)}finally{Ue=o,I.p=r,U.T=a}}tt=1,Nr?Ya=U0(m,e.containerInfo,Xa,jo,ko,f0,No,So,d0):(jo(),ko(),No())}function d0(e){if(tt!==0){var t=yn.onRecoverableError;t(e,{componentStack:null})}}function f0(){tt===3&&(tt=0,Sp(ea,yn),tt=4)}function jo(){if(tt===1){tt=0;var e=yn,t=ea,n=Mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var r=I.p;I.p=2;var o=Ue;Ue|=4;try{Zs=Tr=!1,kp(t,e,n),n=Uo;var m=bh(e.containerInfo),j=n.focusedElem,T=n.selectionRange;if(m!==j&&j&&j.ownerDocument&&xh(j.ownerDocument.documentElement,j)){if(T!==null&&Jc(j)){var R=T.start,B=T.end;if(B===void 0&&(B=R),"selectionStart"in j)j.selectionStart=R,j.selectionEnd=Math.min(B,j.value.length);else{var Y=j.ownerDocument||document,_=Y&&Y.defaultView||window;if(_.getSelection){var H=_.getSelection(),W=j.textContent.length,ae=Math.min(T.start,W),ye=T.end===void 0?ae:Math.min(T.end,W);!H.extend&&ae>ye&&(m=ye,ye=ae,ae=m);var M=vh(j,ae),C=vh(j,ye);if(M&&C&&(H.rangeCount!==1||H.anchorNode!==M.node||H.anchorOffset!==M.offset||H.focusNode!==C.node||H.focusOffset!==C.offset)){var D=Y.createRange();D.setStart(M.node,M.offset),H.removeAllRanges(),ae>ye?(H.addRange(D),H.extend(C.node,C.offset)):(D.setEnd(C.node,C.offset),H.addRange(D))}}}}for(Y=[],H=j;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<Y.length;j++){var q=Y[j];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}ts=!!Do,Uo=Do=null}finally{Ue=o,I.p=r,U.T=a}}e.current=t,tt=2}}function ko(){if(tt===2){tt=0;var e=yn,t=ea,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var a=I.p;I.p=2;var r=Ue;Ue|=4;try{gp(e,t.alternate,t)}finally{Ue=r,I.p=a,U.T=n}}tt=3}}function No(){if(tt===4||tt===3){tt=0;var e=Ya;Ya=null,Eb();var t=yn,n=ea,a=Mn,r=Op,o=(a&335544064)===a?10262:10256;if((n.subtreeFlags&o)!==0||(n.flags&o)!==0?tt=5:(tt=0,ea=yn=null,Gp(t,t.pendingLanes)),o=t.pendingLanes,o===0&&(kl=null),Oc(a),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(gs,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=U.T,o=I.p,I.p=2,U.T=null;try{for(var m=t.onRecoverableError,j=0;j<r.length;j++){var T=r[j];m(T.value,{componentStack:T.stack})}}finally{U.T=n,I.p=o}}if(r=Ga,m=Xa,Xa=null,r!==null&&(Ga=null,m===null&&(m=[]),e!==null))for(T=0;T<r.length;T++)n=(0,r[T])(m),n!==void 0&&e.finished.finally(n);(Mn&3)!==0&&Br(),Rn(t),o=t.pendingLanes,(a&261930)!==0&&(o&42)!==0?t===Rr?Fs++:(Fs=0,Rr=t):(Fs=0,Rr=null),Ws(0)}}function Gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_s(t)))}function Br(){return Ya!==null&&(Ya.skipTransition(),Ya=null),jo(),ko(),No(),So()}function So(){if(tt!==5)return!1;var e=yn,t=vo;vo=0;var n=Oc(Mn),a=U.T,r=I.p;try{I.p=32>n?32:n,U.T=null,n=xo,xo=null;var o=yn,m=Mn;if(tt=0,ea=yn=null,Mn=0,(Ue&6)!==0)throw Error(u(331));var j=Ue;if(Ue|=4,Cp(o.current),wp(o,o.current,m,n),Ue=j,Ws(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(gs,o)}catch{}return!0}finally{I.p=r,U.T=a,Gp(e,t)}}function Xp(e,t,n){t=rn(n,t),t=$u(e.stateNode,t,2),e=ml(e,t,2),e!==null&&(xs(e,2),Rn(e))}function qe(e,t,n){if(e.tag===3)Xp(e,e,n);else for(;t!==null;){if(t.tag===3){Xp(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(kl===null||!kl.has(a))){e=rn(n,e),n=$m(2),a=ml(t,n,2),a!==null&&(qm(n,a,t,e),xs(a,2),Rn(a));break}}t=t.return}}function wo(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new s0;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(po=!0,r.add(n),e=h0.bind(null,e,t,n),t.then(e,e))}function h0(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ze===e&&(Ee&n)===n&&((at===4||at===3&&(Ee&62914560)===Ee&&300>Qt()-Or)&&(Ue&2)===0?Va(e,0):Ar|=n,qa===Ee&&(qa=0)),Rn(e)}function Qp(e,t){t===0&&(t=Af()),e=Bl(e,t),e!==null&&(xs(e,t),Rn(e))}function m0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qp(e,n)}function p0(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),Qp(e,n)}function g0(e,t){return Ec(e,t)}var Ka=null,Ja=null,To=!1,Lr=!1,Eo=!1,Sl=0;function Rn(e){e!==Ja&&e.next===null&&(Ja===null?Ka=Ja=e:Ja=Ja.next=e),Lr=!0,To||(To=!0,x0())}function Ws(e,t){if(!Eo&&Lr){Eo=!0;do for(var n=!1,a=Ka;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var o=0;else{var m=a.suspendedLanes,j=a.pingedLanes;o=(1<<31-Zt(42|e)+1)-1,o&=r&~(m&~j),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Jp(a,o))}else o=Ee,o=Ai(a,a===Ze?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||vs(a,o)||(n=!0,Jp(a,o));a=a.next}while(n);Eo=!1}}function v0(){Vp()}function Vp(){Lr=To=!1;var e=0;Sl!==0&&z0()&&(e=Sl);for(var t=Qt(),n=null,a=Ka;a!==null;){var r=a.next,o=Zp(a,t);o===0?(a.next=null,n===null?Ka=r:n.next=r,r===null&&(Ja=n)):(n=a,(e!==0||(o&3)!==0)&&(Lr=!0)),a=r}tt!==0&&tt!==5||Ws(e),Sl!==0&&(Sl=0)}function Zp(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var m=31-Zt(o),j=1<<m,T=r[m];T===-1?((j&n)===0||(j&a)!==0)&&(r[m]=Db(j,t)):T<=t&&(e.expiredLanes|=j),o&=~j}if(t=Ze,n=Ee,n=Ai(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Cc(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||vs(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Cc(a),Oc(n)){case 2:case 8:n=Ef;break;case 32:n=Ti;break;case 268435456:n=Cf;break;default:n=Ti}return a=Kp.bind(null,e),n=Ec(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Cc(a),e.callbackPriority=2,e.callbackNode=null,2}function Kp(e,t){if(tt!==0&&tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Br()&&e.callbackNode!==n)return null;var a=Ee;return a=Ai(e,e===Ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Mp(e,a,t),Zp(e,Qt()),e.callbackNode!=null&&e.callbackNode===n?Kp.bind(null,e):null)}function Jp(e,t){if(Br())return null;Mp(e,t,!0)}function x0(){O0(function(){(Ue&6)!==0?Ec(Tf,v0):Vp()})}function Co(){if(Sl===0){var e=Xl;e===0&&(e=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),Sl=e}return Sl}function Ip(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Di(e)}function b0(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var o=Ip((r[Ut]||null).action),m=a.submitter;m&&(t=(t=m[Ut]||null)?Ip(t.formAction):m.getAttribute("formAction"),t!==null&&(o=t,m=null));var j=new Li("action","action",null,a,r);e.push({event:j,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Sl!==0){var T=new FormData(r,m);Du(n,{pending:!0,data:T,method:r.method,action:o},null,T)}}else typeof o=="function"&&(j.preventDefault(),T=new FormData(r,m),Du(n,{pending:!0,data:T,method:r.method,action:o},o,T))},currentTarget:r}]})}}for(var zo=0;zo<Pc.length;zo++){var Ao=Pc[zo],y0=Ao.toLowerCase(),j0=Ao[0].toUpperCase()+Ao.slice(1);gn(y0,"on"+j0)}gn(kh,"onAnimationEnd"),gn(Nh,"onAnimationIteration"),gn(Sh,"onAnimationStart"),gn("dblclick","onDoubleClick"),gn("focusin","onFocus"),gn("focusout","onBlur"),gn(Ay,"onTransitionRun"),gn(Oy,"onTransitionStart"),gn(_y,"onTransitionCancel"),gn(wh,"onTransitionEnd"),va("onMouseEnter",["mouseout","mouseover"]),va("onMouseLeave",["mouseout","mouseover"]),va("onPointerEnter",["pointerout","pointerover"]),va("onPointerLeave",["pointerout","pointerover"]),Dl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ps="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(" "),k0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ps));function Fp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var m=a.length-1;0<=m;m--){var j=a[m],T=j.instance,R=j.currentTarget;if(j=j.listener,T!==o&&r.isPropagationStopped())break e;o=j,r.currentTarget=R;try{o(r)}catch(B){Yi(B)}r.currentTarget=null,o=T}else for(m=0;m<a.length;m++){if(j=a[m],T=j.instance,R=j.currentTarget,j=j.listener,T!==o&&r.isPropagationStopped())break e;o=j,r.currentTarget=R;try{o(r)}catch(B){Yi(B)}r.currentTarget=null,o=T}}}}function Te(e,t){var n=t[Uf];n===void 0&&(n=t[Uf]=new Set);var a=e+"__bubble";n.has(a)||(Wp(t,e,2,!1),n.add(a))}function Oo(e,t,n){var a=0;t&&(a|=4),Wp(n,e,a,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function _o(e){if(!e[$r]){e[$r]=!0,Lf.forEach(function(n){n!=="selectionchange"&&(k0.has(n)||Oo(n,!1,e),Oo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$r]||(t[$r]=!0,Oo("selectionchange",!1,t))}}function Wp(e,t,n,a){switch(qg(t)){case 2:var r=mj;break;case 8:r=pj;break;default:r=Wo}n=r.bind(null,t,n,e),r=void 0,!Lc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Mo(e,t,n,a,r){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var j=a.stateNode.containerInfo;if(j===r)break;if(m===4)for(m=a.return;m!==null;){var T=m.tag;if((T===3||T===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;j!==null;){if(m=Rl(j),m===null)return;if(T=m.tag,T===5||T===6||T===26||T===27){a=o=m;continue e}j=j.parentNode}}a=a.return}Wf(function(){var R=o,B=Hc(n),Y=[];e:{var _=Th.get(e);if(_!==void 0){var H=Li,W=e;switch(e){case"keypress":if(Hi(n)===0)break e;case"keydown":case"keyup":H=iy;break;case"focusin":W="focus",H=Gc;break;case"focusout":W="blur",H=Gc;break;case"beforeblur":case"afterblur":H=Gc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=th;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=Kb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=dy;break;case kh:case Nh:case Sh:H=Fb;break;case wh:H=hy;break;case"scroll":case"scrollend":H=Vb;break;case"wheel":H=py;break;case"copy":case"cut":case"paste":H=Pb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=lh;break;case"submit":H=uy;break;case"toggle":case"beforetoggle":H=vy}var ae=(t&4)!==0,ye=!ae&&(e==="scroll"||e==="scrollend"),M=ae?_!==null?_+"Capture":null:_;ae=[];for(var C=R,D;C!==null;){var q=C;if(D=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||D===null||M===null||(q=js(C,M),q!=null&&ae.push(ei(C,q,D))),ye)break;C=C.return}0<ae.length&&(_=new H(_,W,null,n,B),Y.push({event:_,listeners:ae}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",H&&n!==Uc&&(W=n.relatedTarget||n.fromElement)&&(Rl(W)||W[ma]))break e;(_||H)&&(W=B.window===B?B:(H=B.ownerDocument)?H.defaultView||H.parentWindow:window,_?(H=n.relatedTarget||n.toElement,_=R,H=H?Rl(H):null,H!==null&&(ye=f(H),ae=H.tag,H!==ye||ae!==5&&ae!==27&&ae!==6)&&(H=null)):(_=null,H=R),_!==H&&(ae=th,q="onMouseLeave",M="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ae=lh,q="onPointerLeave",M="onPointerEnter",C="pointer"),ye=_==null?W:ys(_),D=H==null?W:ys(H),W=new ae(q,C+"leave",_,n,B),W.target=ye,W.relatedTarget=D,q=null,Rl(B)===R&&(ae=new ae(M,C+"enter",H,n,B),ae.target=D,ae.relatedTarget=ye,q=ae),ye=q,ae=_&&H?V(_,H,N0):null,_!==null&&Pp(Y,W,_,ae,!1),H!==null&&ye!==null&&Pp(Y,ye,H,ae,!0)))}e:{if(_=R?ys(R):window,H=_.nodeName&&_.nodeName.toLowerCase(),H==="select"||H==="input"&&_.type==="file")var ne=dh;else if(uh(_))if(fh)ne=Ey;else{ne=wy;var Ce=Sy}else H=_.nodeName,!H||H.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?R&&Dc(R.elementType)&&(ne=dh):ne=Ty;if(ne&&(ne=ne(e,R))){oh(Y,ne,n,B);break e}Ce&&Ce(e,_,R)}switch(Ce=R?ys(R):window,e){case"focusin":(uh(Ce)||Ce.contentEditable==="true")&&(Na=Ce,Ic=R,zs=null);break;case"focusout":zs=Ic=Na=null;break;case"mousedown":Fc=!0;break;case"contextmenu":case"mouseup":case"dragend":Fc=!1,yh(Y,n,B);break;case"selectionchange":if(zy)break;case"keydown":case"keyup":yh(Y,n,B)}var ce;if(Qc)e:{switch(e){case"compositionstart":var pe="onCompositionStart";break e;case"compositionend":pe="onCompositionEnd";break e;case"compositionupdate":pe="onCompositionUpdate";break e}pe=void 0}else ka?rh(e,n)&&(pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(pe="onCompositionStart");pe&&(ah&&n.locale!=="ko"&&(ka||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&ka&&(ce=Pf()):(sl=B,$c="value"in sl?sl.value:sl.textContent,ka=!0)),Ce=qr(R,pe),0<Ce.length&&(pe=new nh(pe,e,null,n,B),Y.push({event:pe,listeners:Ce}),ce?pe.data=ce:(ce=ch(n),ce!==null&&(pe.data=ce)))),(ce=by?yy(e,n):jy(e,n))&&(pe=qr(R,"onBeforeInput"),0<pe.length&&(Ce=new nh("onBeforeInput","beforeinput",null,n,B),Y.push({event:Ce,listeners:pe}),Ce.data=ce)),b0(Y,e,R,n,B)}Fp(Y,t)})}function ei(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qr(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=js(e,n),r!=null&&a.unshift(ei(e,r,o)),r=js(e,t),r!=null&&a.push(ei(e,r,o))),e.tag===3)return a;e=e.return}return[]}function N0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pp(e,t,n,a,r){for(var o=t._reactName,m=[];n!==null&&n!==a;){var j=n,T=j.alternate,R=j.stateNode;if(j=j.tag,T!==null&&T===a)break;j!==5&&j!==26&&j!==27||R===null||(T=R,r?(R=js(n,o),R!=null&&m.unshift(ei(n,R,T))):r||(R=js(n,o),R!=null&&m.push(ei(n,R,T)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var S0=/\r\n?/g,w0=/\u0000|\uFFFD/g;function eg(e){return(typeof e=="string"?e:""+e).replace(S0,`
50
- `).replace(w0,"")}function tg(e,t){return t=eg(t),eg(e)===t}function Ye(e,t,n,a,r,o){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||ba(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&ba(e,""+a);else return;break;case"className":Ri(e,"class",a);break;case"tabIndex":Ri(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(e,n,a);break;case"style":If(e,a,o);return;case"data":if(t!=="object"){Ri(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Di(a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&Ye(e,t,"name",r.name,r,null),Ye(e,t,"formEncType",r.formEncType,r,null),Ye(e,t,"formMethod",r.formMethod,r,null),Ye(e,t,"formTarget",r.formTarget,r,null)):(Ye(e,t,"encType",r.encType,r,null),Ye(e,t,"method",r.method,r,null),Ye(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Di(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Sn);return;case"onScroll":a!=null&&Te("scroll",e);return;case"onScrollEnd":a!=null&&Te("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(u(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Di(a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Te("beforetoggle",e),Te("toggle",e),Mi(e,"popover",a);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Mi(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=Xb.get(n)||n,Mi(e,n,a);else return}Me=!0}function Ro(e,t,n,a,r,o){switch(n){case"style":If(e,a,o);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(u(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")ba(e,a);else if(typeof a=="number"||typeof a=="bigint")ba(e,""+a);else return;break;case"onScroll":a!=null&&Te("scroll",e);return;case"onScrollEnd":a!=null&&Te("scrollend",e);return;case"onClick":a!=null&&(e.onclick=Sn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!$f.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),o=n.slice(2,r?n.length-7:void 0),t=e[Ut]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(o,t,r),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,a,r);break e}Me=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Mi(e,n,a)}return}Me=!0}function St(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var a=!1,r=!1,o;for(o in n)if(n.hasOwnProperty(o)){var m=n[o];if(m!=null)switch(o){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ye(e,t,o,m,n,null)}}r&&Ye(e,t,"srcSet",n.srcSet,n,null),a&&Ye(e,t,"src",n.src,n,null);return;case"input":Te("invalid",e);var j=o=m=r=null,T=null,R=null;for(a in n)if(n.hasOwnProperty(a)){var B=n[a];if(B!=null)switch(a){case"name":r=B;break;case"type":m=B;break;case"checked":T=B;break;case"defaultChecked":R=B;break;case"value":o=B;break;case"defaultValue":j=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Ye(e,t,a,B,n,null)}}Vf(e,o,j,T,R,m,r,!1);return;case"select":Te("invalid",e),a=m=o=null;for(r in n)if(n.hasOwnProperty(r)&&(j=n[r],j!=null))switch(r){case"value":o=j;break;case"defaultValue":m=j;break;case"multiple":a=j;default:Ye(e,t,r,j,n,null)}t=o,n=m,e.multiple=!!a,t!=null?xa(e,!!a,t,!1):n!=null&&xa(e,!!a,n,!0);return;case"textarea":Te("invalid",e),o=r=a=null;for(m in n)if(n.hasOwnProperty(m)&&(j=n[m],j!=null))switch(m){case"value":a=j;break;case"defaultValue":r=j;break;case"children":o=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(u(91));break;default:Ye(e,t,m,j,n,null)}Kf(e,a,r,o);return;case"option":for(T in n)if(n.hasOwnProperty(T)&&(a=n[T],a!=null))switch(T){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ye(e,t,T,a,n,null)}return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(a=0;a<Ps.length;a++)Te(Ps[a],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ye(e,t,R,a,n,null)}return;default:if(Dc(t)){for(B in n)n.hasOwnProperty(B)&&(a=n[B],a!==void 0&&Ro(e,t,B,a,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(a=n[j],a!=null&&Ye(e,t,j,a,n,null))}var T0={};function E0(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,m=null,j=null,T=null,R=null,B=null;for(H in n){var Y=n[H];if(n.hasOwnProperty(H)&&Y!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":T=Y;default:a.hasOwnProperty(H)||Ye(e,t,H,null,a,Y)}}for(var _ in a){var H=a[_];if(Y=n[_],a.hasOwnProperty(_)&&(H!=null||Y!=null))switch(_){case"type":H!==Y&&(Me=!0),o=H;break;case"name":H!==Y&&(Me=!0),r=H;break;case"checked":H!==Y&&(Me=!0),R=H;break;case"defaultChecked":H!==Y&&(Me=!0),B=H;break;case"value":H!==Y&&(Me=!0),m=H;break;case"defaultValue":H!==Y&&(Me=!0),j=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:H!==Y&&Ye(e,t,_,H,a,Y)}}Mc(e,m,j,T,R,B,o,r);return;case"select":H=m=j=_=null;for(o in n)if(T=n[o],n.hasOwnProperty(o)&&T!=null)switch(o){case"value":break;case"multiple":H=T;default:a.hasOwnProperty(o)||Ye(e,t,o,null,a,T)}for(r in a)if(o=a[r],T=n[r],a.hasOwnProperty(r)&&(o!=null||T!=null))switch(r){case"value":o!==T&&(Me=!0),_=o;break;case"defaultValue":o!==T&&(Me=!0),j=o;break;case"multiple":o!==T&&(Me=!0),m=o;default:o!==T&&Ye(e,t,r,o,a,T)}t=j,n=m,a=H,_!=null?xa(e,!!n,_,!1):!!a!=!!n&&(t!=null?xa(e,!!n,t,!0):xa(e,!!n,n?[]:"",!1));return;case"textarea":H=_=null;for(j in n)if(r=n[j],n.hasOwnProperty(j)&&r!=null&&!a.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ye(e,t,j,null,a,r)}for(m in a)if(r=a[m],o=n[m],a.hasOwnProperty(m)&&(r!=null||o!=null))switch(m){case"value":r!==o&&(Me=!0),_=r;break;case"defaultValue":r!==o&&(Me=!0),H=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==o&&Ye(e,t,m,r,a,o)}Zf(e,_,H);return;case"option":for(var W in n)if(_=n[W],n.hasOwnProperty(W)&&_!=null&&!a.hasOwnProperty(W))switch(W){case"selected":e.selected=!1;break;default:Ye(e,t,W,null,a,_)}for(T in a)if(_=a[T],H=n[T],a.hasOwnProperty(T)&&_!==H&&(_!=null||H!=null))switch(T){case"selected":_!==H&&(Me=!0),e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:Ye(e,t,T,_,a,H)}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 ae in n)_=n[ae],n.hasOwnProperty(ae)&&_!=null&&!a.hasOwnProperty(ae)&&Ye(e,t,ae,null,a,_);for(R in a)if(_=a[R],H=n[R],a.hasOwnProperty(R)&&_!==H&&(_!=null||H!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(u(137,t));break;default:Ye(e,t,R,_,a,H)}return;default:if(Dc(t)){for(var ye in n)_=n[ye],n.hasOwnProperty(ye)&&_!==void 0&&!a.hasOwnProperty(ye)&&Ro(e,t,ye,void 0,a,_);for(B in a)_=a[B],H=n[B],!a.hasOwnProperty(B)||_===H||_===void 0&&H===void 0||Ro(e,t,B,_,a,H);return}}for(var M in n)_=n[M],n.hasOwnProperty(M)&&_!=null&&!a.hasOwnProperty(M)&&Ye(e,t,M,null,a,_);for(Y in a)_=a[Y],H=n[Y],!a.hasOwnProperty(Y)||_===H||_==null&&H==null||Ye(e,t,Y,_,a,H)}function ng(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],o=r.transferSize,m=r.initiatorType,j=r.duration;if(o&&j&&ng(m)){for(m=0,j=r.responseEnd,a+=1;a<n.length;a++){var T=n[a],R=T.startTime;if(R>j)break;var B=T.transferSize,Y=T.initiatorType;B&&ng(Y)&&(T=T.responseEnd,m+=B*(T<j?1:(j-R)/(T-R)))}if(--a,t+=8*(o+m)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Do=null,Uo=null;function ti(e){return e.nodeType===9?e:e.ownerDocument}function lg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ag(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function sg(e,t,n,a){return n=ti(n).createElement(e),n[bt]=a,n[Ut]=t,St(n,e,t),ht(n),n}function Ho(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bo=null;function z0(){var e=window.event;return e&&e.type==="popstate"?e===Bo?!1:(Bo=e,!0):(Bo=null,!1)}var Lo=typeof setTimeout=="function"?setTimeout:void 0,A0=typeof clearTimeout=="function"?clearTimeout:void 0,ig=typeof Promise=="function"?Promise:void 0,rg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Lo,O0=typeof queueMicrotask=="function"?queueMicrotask:typeof ig<"u"?function(e){return ig.resolve(null).then(e).catch(_0)}:Lo;function _0(e){setTimeout(function(){throw e})}function wl(e){return e==="head"}function cg(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),ns(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Zo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Zo(n);for(var o=n.firstChild;o;){var m=o.nextSibling,j=o.nodeName;o[bs]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=m}}else n==="body"&&Zo(e.ownerDocument.body);n=r}while(n);ns(t)}function ug(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function og(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var a=1;else for(var r=a=0;r<t.length;r++){var o=t[r];0<o.width&&0<o.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function dg(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function M0(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function $o(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return M0(t,n,e)}function R0(e){return e.documentElement.clientHeight}function D0(e){this.addEventListener("load",e),this.addEventListener("error",e)}function U0(e,t,n,a,r,o,m,j,T){var R=t.nodeType===9?t:t.ownerDocument;try{var B=R.startViewTransition({update:function(){var _=R.defaultView,H=_.navigation&&_.navigation.transition,W=R.fonts.status;a();var ae=[];if(W==="loaded"&&(R0(R),R.fonts.status==="loading"&&ae.push(R.fonts.ready)),W=ae.length,e!==null)for(var ye=e.suspenseyImages,M=0,C=0;C<ye.length;C++){var D=ye[C];if(!D.complete){var q=D.getBoundingClientRect();if(0<q.bottom&&0<q.right&&q.top<_.innerHeight&&q.left<_.innerWidth){if(M+=_g(D),M>Xr){ae.length=W;break}D=new Promise(D0.bind(D)),ae.push(D)}}}if(0<ae.length)return _=Promise.race([Promise.all(ae),new Promise(function(ne){return setTimeout(ne,500)})]).then(r,r),(H?Promise.allSettled([H.finished,_]):_).then(o,o);if(r(),H)return H.finished.then(o,o);o()},types:n});R.__reactViewTransition=B;var Y=[];return B.ready.then(function(){for(var _=R.documentElement.getAnimations({subtree:!0}),H=0;H<_.length;H++){var W=_[H],ae=W.effect,ye=ae.pseudoElement;if(ye!=null&&ye.startsWith("::view-transition")){Y.push(W),W=ae.getKeyframes();for(var M=ye=void 0,C=!0,D=0;D<W.length;D++){var q=W[D],ne=q.width;if(ye===void 0)ye=ne;else if(ye!==ne){C=!1;break}if(ne=q.height,M===void 0)M=ne;else if(M!==ne){C=!1;break}delete q.width,delete q.height,q.transform==="none"&&delete q.transform}C&&ye!==void 0&&M!==void 0&&(ae.setKeyframes(W),C=getComputedStyle(ae.target,ae.pseudoElement),C.width!==ye||C.height!==M)&&(C=W[0],C.width=ye,C.height=M,C=W[W.length-1],C.width=ye,C.height=M,ae.setKeyframes(W))}}m()},function(_){R.__reactViewTransition===B&&(R.__reactViewTransition=null);try{if(typeof _=="object"&&_!==null)switch(_.name){case"InvalidStateError":(_.message==="View transition was skipped because document visibility state is hidden."||_.message==="Skipping view transition because document visibility state has become hidden."||_.message==="Skipping view transition because viewport size changed."||_.message==="Transition was aborted because of invalid state")&&(_=null)}_!==null&&T(_)}finally{a(),r(),m()}}),B.finished.finally(function(){for(var _=0;_<Y.length;_++)Y[_].cancel();R.__reactViewTransition===B&&(R.__reactViewTransition=null),j()}),B}catch{return a(),r(),m(),null}}function ta(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ta.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:$({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ta.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],r=0;r<n.length;r++){var o=n[r].effect;o!==null&&o.target===e&&o.pseudoElement===t&&a.push(n[r])}return a},ta.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function fg(e){return{name:e,group:new ta("group",e),imagePair:new ta("image-pair",e),old:new ta("old",e),new:new ta("new",e)}}function tn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}tn.prototype.addEventListener=function(e,t,n){var a=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var o=this._eventListeners;if(mg(o,e,t,n)===-1){var m=this,j=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(j=function(T){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,T):t.handleEvent(T)}),a!==null&&(r=m.removeEventListener.bind(m,e,t,n),a.addEventListener("abort",r,{once:!0}),r=a.removeEventListener.bind(a,"abort",r)),a=Ia(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:j,cleanup:r}),k(this._fragmentFiber.child,!1,H0,e,j,a)}this._eventListeners=o}};function H0(e,t,n,a){return N(e).addEventListener(t,n,a),!1}tn.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=mg(a,e,t,n),t!==-1)){var r=a[t];n=r.attachedListener;var o=r.cleanup;r=Ia(r.optionsOrUseCapture),k(this._fragmentFiber.child,!1,B0,e,n,r),a.splice(t,1),o!==null&&o()}};function B0(e,t,n,a){return N(e).removeEventListener(t,n,a),!1}function Ia(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function hg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function mg(e,t,n,a){if(e.length===0)return-1;a=hg(a);for(var r=0;r<e.length;r++){var o=e[r];if(o.type===t&&o.listener===n&&hg(o.optionsOrUseCapture)===a)return r}return-1}tn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=N(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var o=n[r];a.addEventListener(o.type,o.attachedListener,Ia(o.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(r=0;r<n.length;r++)o=n[r],a.removeEventListener(o.type,o.attachedListener,Ia(o.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},tn.prototype.focus=function(e){k(this._fragmentFiber.child,!0,pg,e,void 0,void 0)};function pg(e,t){return e.tag===6?!1:(e=N(e),I0(e,t))}tn.prototype.focusLast=function(e){var t=[];k(this._fragmentFiber.child,!0,qo,t,void 0,void 0);for(var n=t.length-1;0<=n&&!pg(t[n],e);n--);};function qo(e,t){return t.push(e),!1}tn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=N(e),e=ti(e).activeElement,e!==null&&k(this._fragmentFiber.child,!1,L0,e,void 0,void 0))};function L0(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}tn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),k(this._fragmentFiber.child,!1,$0,e,void 0,void 0)};function $0(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}tn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),k(this._fragmentFiber.child,!1,q0,e,void 0,void 0);for(var n=t=0;n<jn.length;n++){var a=jn[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):jn[t++]=a}jn.length=t}};function q0(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var jn=[],Yo=!1;function Y0(e,t,n){jn.push({fragmentInstance:e,observer:t,instance:n}),Yo||(Yo=!0,F0(function(){Yo=!1;var a=jn;jn=[];for(var r=0;r<a.length;r++){var o=a[r];o.observer.unobserve(o.instance)}}))}tn.prototype.getClientRects=function(){var e=[];return k(this._fragmentFiber.child,!1,G0,e,void 0,void 0),e};function G0(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=N(e),t.push.apply(t,e.getClientRects());return!1}tn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},tn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];k(this._fragmentFiber.child,!1,qo,n,void 0,void 0);var a=N(t);if(n.length===0){if(n=a,E(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var r=a=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=y(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=N(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(n[0]),r=N(n[n.length-1]);var o=E(this._fragmentFiber)?t.parentElement:a;if(o==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),j=r.compareDocumentPosition(e),T=m&Node.DOCUMENT_POSITION_CONTAINED_BY||j&Node.DOCUMENT_POSITION_CONTAINED_BY;return j=a&&o&&m&Node.DOCUMENT_POSITION_FOLLOWING&&j&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||o&&r===e||T||j?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!o&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||X0(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function X0(e,t,n,a,r){var o=Rl(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;o!==null;){if(o.tag===7&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(o===null)return o=r.ownerDocument,r===o||r===o.documentElement||r===o.body;e:{for(o=t,t=S(t);o!==null;){if(!(o.tag!==5&&o.tag!==3&&o.tag!==27||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(t=V(n,o,te),t===null?t=!1:(k(t,!0,X,o,n),o=z,z=null,t=o!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!o)&&!(t=o===a)&&(t=V(a,o,te),t===null?t=!1:(k(t,!0,P,o,a),o=z,O=z=null,t=o!==null)),t):!1}function gg(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}tn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(u(566));var t=[];k(this._fragmentFiber.child,!1,qo,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=y(this._fragmentFiber);if(a=n?a[1]||a[0]||S(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=N(a),gg(e,n);return}if(a=N(a),a.nodeType!==9){if(a.nodeType===11){n="host"in a?a.host:null,n!==null&&n.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=n?t.length-1:0;a!==(n?-1:t.length);){var r=t[a];r.tag===6?(r=N(r),gg(r,n)):N(r).scrollIntoView(e),a+=n?-1:1}};function Q0(e,t){return e=N(e),vg(e,t),!1}function vg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function xg(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.addEventListener(r.type,r.attachedListener,Ia(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){for(var m=0,j=0;j<jn.length;j++){var T=jn[j];(T.fragmentInstance!==t||T.observer!==o||T.instance!==e)&&(jn[m++]=T)}jn.length=m,o.observe(e)}),vg(e,t))}function V0(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.removeEventListener(r.type,r.attachedListener,Ia(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){typeof o.rootMargin=="string"?Y0(t,o,e):o.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Go(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Go(n),_i(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Z0(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=fn(e.nextSibling),e===null)break}return null}function K0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=fn(e.nextSibling),e===null))return null;return e}function bg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=fn(e.nextSibling),e===null))return null;return e}function Xo(e){return e.data==="$?"||e.data==="$~"}function Qo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function J0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function fn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Vo=null;function yg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return fn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function jg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function I0(e,t){function n(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return a}function F0(e){rg(function(){rg(function(t){return e(t)})})}function kg(e,t,n){switch(t=ti(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ng(e,t,n){for(var a in n){var r=n[a];n.hasOwnProperty(a)&&r!=null&&Ye(e,t,a,null,T0,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Sn&&(e.onclick=null),_i(e)}function Zo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_i(e)}var hn=new Map,Sg=new Set;function ni(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Wn=I.d;I.d={f:W0,r:P0,D:ej,C:tj,L:nj,m:lj,X:sj,S:aj,M:ij};function W0(){var e=Wn.f(),t=Dr();return e||t}function P0(e){var t=pa(e);t!==null&&t.tag===5&&t.type==="form"?Tm(t):Wn.r(e)}var Fa=typeof document>"u"?null:document;function wg(e,t,n){var a=Fa;if(a&&typeof t=="string"&&t){var r=an(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Sg.has(r)||(Sg.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),St(t,"link",e),ht(t),a.head.appendChild(t)))}}function ej(e){Wn.D(e),wg("dns-prefetch",e,null)}function tj(e,t){Wn.C(e,t),wg("preconnect",e,t)}function nj(e,t,n){Wn.L(e,t,n);var a=Fa;if(a&&e&&t){var r='link[rel="preload"][as="'+an(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+an(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+an(n.imageSizes)+'"]')):r+='[href="'+an(e)+'"]';var o=r;switch(t){case"style":o=Wa(e);break;case"script":o=Pa(e)}if(!(hn.has(o)||(e=$({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),hn.set(o,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(li(o))||t==="script"&&a.querySelector(ai(o))))){var m=a.createElement("link");St(m,"link",e),t==="style"&&(m[Oi]=!0,m.onload=m.onerror=function(){Bf(m)}),ht(m),a.head.appendChild(m)}}}function lj(e,t){Wn.m(e,t);var n=Fa;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+an(a)+'"][href="'+an(e)+'"]',o=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Pa(e)}if(!hn.has(o)&&(e=$({rel:"modulepreload",href:e},t),hn.set(o,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ai(o)))return}a=n.createElement("link"),St(a,"link",e),ht(a),n.head.appendChild(a)}}}function aj(e,t,n){Wn.S(e,t,n);var a=Fa;if(a&&e){var r=ga(a).hoistableStyles,o=Wa(e);t=t||"default";var m=r.get(o);if(!m){var j={loading:0,preload:null};if(m=a.querySelector(li(o)))j.loading=5;else{e=$({rel:"stylesheet",href:e,"data-precedence":t},n),(n=hn.get(o))&&Ko(e,n);var T=m=a.createElement("link");ht(T),St(T,"link",e),T._p=new Promise(function(R,B){T.onload=R,T.onerror=B}),T.addEventListener("load",function(){j.loading|=1}),T.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Yr(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:j},r.set(o,m)}}}function sj(e,t){Wn.X(e,t);var n=Fa;if(n&&e){var a=ga(n).hoistableScripts,r=Pa(e),o=a.get(r);o||(o=n.querySelector(ai(r)),o||(e=$({src:e,async:!0},t),(t=hn.get(r))&&Jo(e,t),o=n.createElement("script"),ht(o),St(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(r,o))}}function ij(e,t){Wn.M(e,t);var n=Fa;if(n&&e){var a=ga(n).hoistableScripts,r=Pa(e),o=a.get(r);o||(o=n.querySelector(ai(r)),o||(e=$({src:e,async:!0,type:"module"},t),(t=hn.get(r))&&Jo(e,t),o=n.createElement("script"),ht(o),St(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(r,o))}}function Tg(e,t,n,a){var r=(r=nl.current)?ni(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Wa(n.href),t=ga(r).hoistableStyles,a=t.get(n),a||(a={type:"style",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wa(n.href);var o=ga(r).hoistableStyles,m=o.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,m),(o=r.querySelector(li(e)))?o._p||(m.instance=o,m.state.loading=5):(o=hn.get(e),o||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hn.set(e,o)),rj(r,e,o,m.state))),t&&a===null)throw Error(u(528,""));return m}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Pa(n),t=ga(r).hoistableScripts,a=t.get(n),a||(a={type:"script",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Wa(e){return'href="'+an(e)+'"'}function li(e){return'link[rel="stylesheet"]['+e+"]"}function Eg(e){return $({},e,{"data-precedence":e.precedence,precedence:null})}function rj(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Oi]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Oi]=!0,t.onload=t.onerror=Bf.bind(null,t),St(t,"link",n),ht(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function Pa(e){return'[src="'+an(e)+'"]'}function ai(e){return"script[async]"+e}function Cg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+an(n.href)+'"]');if(a)return t.instance=a,ht(a),a;var r=$({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ht(a),St(a,"style",r),Yr(a,n.precedence,e),t.instance=a;case"stylesheet":r=Wa(n.href);var o=e.querySelector(li(r));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;a=Eg(n),(r=hn.get(r))&&Ko(a,r),o=(e.ownerDocument||e).createElement("link"),ht(o);var m=o;return m._p=new Promise(function(j,T){m.onload=j,m.onerror=T}),St(o,"link",a),t.state.loading|=4,Yr(o,n.precedence,e),t.instance=o;case"script":return o=Pa(n.src),(r=e.querySelector(ai(o)))?(t.instance=r,ht(r),r):(a=n,(r=hn.get(o))&&(a=$({},n),Jo(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),ht(r),St(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Yr(a,n.precedence,e));return t.instance}function Yr(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,o=r,m=0;m<a.length;m++){var j=a[m];if(j.dataset.precedence===t)o=j;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ko(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Gr=null;function zg(e,t,n){if(Gr===null){var a=new Map,r=Gr=new Map;r.set(n,a)}else r=Gr,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var o=n[r];if(!(o[bs]||o[bt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var m=o.getAttribute(t)||"";m=e+m;var j=a.get(m);j?j.push(o):a.set(m,[o])}}return a}function Io(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function cj(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ag(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Og(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _g(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Mg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=_g(t),e.suspenseyImages.push(t)),e=dj.bind(e),t.decode().then(e,e))}function uj(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Wa(a.href),o=t.querySelector(li(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=si.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,ht(o);return}o=t.ownerDocument||t,a=Eg(a),(r=hn.get(r))&&Ko(a,r),o=o.createElement("link"),ht(o);var m=o;m._p=new Promise(function(j,T){m.onload=j,m.onerror=T}),St(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=si.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Xr=0;function oj(e,t){return e.stylesheets&&e.count===0&&Vr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Vr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Xr===0&&(Xr=62500*C0());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Xr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function Rg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Vr(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function si(){this.count--,Rg(this)}function dj(){this.imgCount--,Rg(this)}var Qr=null;function Vr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qr=new Map,t.forEach(fj,e),Qr=null,si.call(e))}function fj(e,t){if(!(t.state.loading&4)){var n=Qr.get(e);if(n)var a=n.get(null);else{n=new Map,Qr.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var m=r[o];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}r=t.instance,m=r.getAttribute("data-precedence"),o=n.get(m)||a,o===a&&n.set(null,r),n.set(m,r),this.count++,a=si.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var es={$$typeof:Re,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function hj(e,t,n,a,r,o,m,j,T){this.tag=1,this.containerInfo=e,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=zc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.hiddenUpdates=zc(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.transitionTypes=null,this.incompleteTransitions=new Map}function Dg(e,t,n,a,r,o,m,j,T,R,B,Y){return e=new hj(e,t,n,m,T,R,B,Y,j),t=1,o===!0&&(t|=24),o=Ht(3,null,null,t),e.current=o,o.stateNode=e,t=ou(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},mu(o),e}function Ug(e){return e?(e=Ta,e):Ta}function Hg(e,t,n,a,r,o){r=Ug(r),a.context===null?a.context=r:a.pendingContext=r,a=hl(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=ml(e,a,t),n!==null&&(qt(n,e,t),Us(n,e,t))}function Bg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fo(e,t){Bg(e,t),(e=e.alternate)&&Bg(e,t)}function Lg(e){if(e.tag===13||e.tag===31){var t=Bl(e,67108864);t!==null&&qt(t,e,67108864),Fo(e,67108864)}}function $g(e){if(e.tag===13||e.tag===31){var t=en();t=Ac(t);var n=Bl(e,t);n!==null&&qt(n,e,t),Fo(e,t)}}var ts=!0;function mj(e,t,n,a){var r=U.T;U.T=null;var o=I.p;try{I.p=2,Wo(e,t,n,a)}finally{I.p=o,U.T=r}}function pj(e,t,n,a){var r=U.T;U.T=null;var o=I.p;try{I.p=8,Wo(e,t,n,a)}finally{I.p=o,U.T=r}}function Wo(e,t,n,a){if(ts){var r=Po(a);if(r===null)Mo(e,t,a,Zr,n),Yg(e,a);else if(vj(r,e,t,n,a))a.stopPropagation();else if(Yg(e,a),t&4&&-1<gj.indexOf(e)){for(;r!==null;){var o=pa(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var m=Ml(o.pendingLanes);if(m!==0){var j=o;for(j.pendingLanes|=2,j.entangledLanes|=2;m;){var T=1<<31-Zt(m);j.entanglements[1]|=T,m&=~T}Rn(o),(Ue&6)===0&&(_r=Qt()+500,Ws(0))}}break;case 31:case 13:j=Bl(o,2),j!==null&&qt(j,o,2),Dr(),Fo(o,2)}if(o=Po(a),o===null&&Mo(e,t,a,Zr,n),o===r)break;r=o}r!==null&&a.stopPropagation()}else Mo(e,t,a,null,n)}}function Po(e){return e=Hc(e),ed(e)}var Zr=null;function ed(e){if(Zr=null,e=Rl(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Zr=e,null}function qg(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Cb()){case Tf:return 2;case Ef:return 8;case Ti:case zb:return 32;case Cf:return 268435456;default:return 32}default:return 32}}var td=!1,Tl=null,El=null,Cl=null,ii=new Map,ri=new Map,zl=[],gj="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 Yg(e,t){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":El=null;break;case"mouseover":case"mouseout":Cl=null;break;case"pointerover":case"pointerout":ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ri.delete(t.pointerId)}}function ci(e,t,n,a,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[r]},t!==null&&(t=pa(t),t!==null&&Lg(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function vj(e,t,n,a,r){switch(t){case"focusin":return Tl=ci(Tl,e,t,n,a,r),!0;case"dragenter":return El=ci(El,e,t,n,a,r),!0;case"mouseover":return Cl=ci(Cl,e,t,n,a,r),!0;case"pointerover":var o=r.pointerId;return ii.set(o,ci(ii.get(o)||null,e,t,n,a,r)),!0;case"gotpointercapture":return o=r.pointerId,ri.set(o,ci(ri.get(o)||null,e,t,n,a,r)),!0}return!1}function Gg(e){var t=Rl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,Df(e.priority,function(){$g(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Df(e.priority,function(){$g(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Kr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Po(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Uc=a,n.target.dispatchEvent(a),Uc=null}else return t=pa(n),t!==null&&Lg(t),e.blockedOn=n,!1;t.shift()}return!0}function Xg(e,t,n){Kr(e)&&n.delete(t)}function xj(){td=!1,Tl!==null&&Kr(Tl)&&(Tl=null),El!==null&&Kr(El)&&(El=null),Cl!==null&&Kr(Cl)&&(Cl=null),ii.forEach(Xg),ri.forEach(Xg)}function Jr(e,t){e.blockedOn===t&&(e.blockedOn=null,td||(td=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,xj)))}var Ir=null;function Qg(e){Ir!==e&&(Ir=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Ir===e&&(Ir=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(ed(a||n)===null)continue;break}var o=pa(n);o!==null&&(e.splice(t,3),t-=3,Du(o,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function ns(e){function t(T){return Jr(T,e)}Tl!==null&&Jr(Tl,e),El!==null&&Jr(El,e),Cl!==null&&Jr(Cl,e),ii.forEach(t),ri.forEach(t);for(var n=0;n<zl.length;n++){var a=zl[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<zl.length&&(n=zl[0],n.blockedOn===null);)Gg(n),n.blockedOn===null&&zl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],o=n[a+1],m=r[Ut]||null;if(typeof o=="function")m||Qg(n);else if(m){var j=null;if(o&&o.hasAttribute("formAction")){if(r=o,m=o[Ut]||null)j=m.formAction;else if(ed(r)!==null)continue}else j=m.action;typeof j=="function"?n[a+1]=j:(n.splice(a,3),a-=3),Qg(n)}}}function Vg(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function nd(e){this._internalRoot=e}Fr.prototype.render=nd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,a=en();Hg(n,a,e,t,null,null)},Fr.prototype.unmount=nd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hg(e.current,2,null,e,null,null),Dr(),t[ma]=null}};function Fr(e){this._internalRoot=e}Fr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zl.length&&t!==0&&t<zl[n].priority;n++);zl.splice(n,0,e),n===0&&Gg(e)}};var Zg=i.version;if(Zg!=="19.3.1")throw Error(u(527,Zg,"19.3.1"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var bj={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wr.isDisabled&&Wr.supportsFiber)try{gs=Wr.inject(bj),Vt=Wr}catch{}}return oi.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,a="",r=Um,o=Hm,m=Bm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Dg(e,1,!1,null,null,n,a,null,r,o,m,Vg),e[ma]=t.current,_o(e),new nd(t)},oi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var a=!1,r="",o=Um,m=Hm,j=Bm,T=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Dg(e,1,!0,t,n??null,a,r,T,o,m,j,Vg),t.context=Ug(null),n=t.current,a=en(),a=Ac(a),r=hl(a),r.callback=null,ml(n,r,a),n=a,t.current.lanes=n,xs(t,n),Rn(t),e[ma]=t.current,_o(e),new Fr(t)},oi.version="19.3.1",oi}var lv;function Aj(){if(lv)return ad.exports;lv=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),ad.exports=zj(),ad.exports}var Oj=Aj(),w=Gd();const _j=["searxng","exa","tavily","brave","serper","jina","firecrawl","perplexity","youcom","ollama"];function sx(){return _j.map(l=>({name:l,enabled:!1}))}class Ke extends Error{constructor(c,u){super(u);Xe(this,"status");this.status=c}}async function se(l,i){let c;try{c=await fetch(l,{credentials:"same-origin",...i})}catch(d){throw new Ke(0,`无法连接 Hob:${d instanceof Error?d.message:String(d)}`)}if(!c.ok){let d=`${c.status} ${c.statusText}`;try{const f=await c.json();f!=null&&f.error&&(d=f.error)}catch{}throw new Ke(c.status,d)}if(c.status===204)return;const u=await c.text();return u?JSON.parse(u):void 0}function nt(l,i="POST"){return{method:i,headers:{"content-type":"application/json"},body:JSON.stringify(l)}}const Mj=["assistant","assistant_removed","item","delta","job","delegation","job_step","activity","approval","draft","routine","routine_removed","profile"],Rj={me:()=>se("/api/me"),login:l=>se("/api/login",nt({password:l})),logout:()=>se("/api/logout",{method:"POST"}),bootstrap:()=>se("/api/bootstrap"),settings:()=>se("/api/settings"),models:()=>se("/api/models"),putSettings:(l,i)=>se("/api/settings",nt({revision:l,patch:i},"PUT")),providers:()=>se("/api/providers"),putProvider:(l,i)=>se(`/api/providers/${encodeURIComponent(l)}`,nt(i,"PUT")),putThinking:l=>se("/api/models/thinking",nt(l,"PUT")),deleteProvider:l=>se(`/api/providers/${encodeURIComponent(l)}`,{method:"DELETE"}),testProvider:l=>se("/api/providers/test",nt(l)),discoverProvider:l=>se("/api/providers/discover",nt(l)),providersImport:()=>se("/api/providers/import"),importProviders:l=>se("/api/providers/import",nt({ids:l})),skills:()=>se("/api/skills"),skillsImport:l=>se(`/api/skills/import/${l}`),importSkills:(l,i,c)=>se(`/api/skills/import/${l}`,nt({ids:i,overwrite:c})),deleteSkill:l=>se(`/api/skills/${encodeURIComponent(l)}`,{method:"DELETE"}),search:()=>se("/api/search"),putSearch:(l,i,c)=>se("/api/search",nt({revision:l,providers:i,keys:c},"PUT")),testSearch:(l,i,c)=>se("/api/search/test",nt({name:l,baseUrl:i,apiKey:c})),imageKey:()=>se("/api/image"),putImage:(l,i,c)=>se("/api/image",nt({revision:l,image:i,...c?{apiKey:c}:{}},"PUT")),imageTest:l=>se("/api/image/test",nt(l)),changePassword:(l,i)=>se("/api/password",nt({old:l,new:i})),about:()=>se("/api/about"),memory:()=>se("/api/memory"),putMemory:(l,i)=>se("/api/memory",nt({revision:l,provider:i},"PUT")),putLore:l=>se("/api/memory/lore",nt(l,"PUT")),loreTest:l=>se("/api/memory/lore-test",nt(l)),loreImport:()=>se("/api/memory/lore/import"),importLore:()=>se("/api/memory/lore/import",{method:"POST"}),items:(l,i)=>se(`/api/assistants/${encodeURIComponent(l)}/items?limit=60${i?`&before=${encodeURIComponent(i)}`:""}`),profile:l=>se(`/api/assistants/${encodeURIComponent(l)}/profile`),sendMessage:(l,i)=>se(`/api/assistants/${encodeURIComponent(l)}/messages`,nt(i)),stopAssistant:l=>se(`/api/assistants/${encodeURIComponent(l)}/stop`,{method:"POST"}),markRead:l=>se(`/api/assistants/${encodeURIComponent(l)}/read`,{method:"POST"}),patchAssistant:(l,i)=>se(`/api/assistants/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(i)}),mergeAssistant:l=>se(`/api/assistants/${encodeURIComponent(l)}/merge`,{method:"POST"}),deleteRule:(l,i)=>se(`/api/assistants/${encodeURIComponent(l)}/rules/${encodeURIComponent(i)}`,{method:"DELETE"}),retryDelegation:l=>se(`/api/delegations/${encodeURIComponent(l)}/retry`,{method:"POST"}),answerApproval:(l,i)=>se(`/api/approvals/${encodeURIComponent(l)}`,nt(i)),createDraft:l=>se(`/api/drafts/${encodeURIComponent(l)}/create`,{method:"POST"}),dismissDraft:l=>se(`/api/drafts/${encodeURIComponent(l)}/dismiss`,{method:"POST"}),createRoutine:l=>se("/api/routines",nt(l)),patchRoutine:(l,i)=>se(`/api/routines/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(i)}),deleteRoutine:l=>se(`/api/routines/${encodeURIComponent(l)}`,{method:"DELETE"}),runRoutine:l=>se(`/api/routines/${encodeURIComponent(l)}/run`,{method:"POST"}),replyJob:(l,i)=>se(`/api/jobs/${encodeURIComponent(l)}/reply`,nt({text:i})),stopJob:l=>se(`/api/jobs/${encodeURIComponent(l)}/stop`,{method:"POST"}),transcript:l=>se(`/api/jobs/${encodeURIComponent(l)}/transcript`),jobs:(l={})=>{const i=new URLSearchParams;l.assistantId&&i.set("assistantId",l.assistantId),l.status&&i.set("status",l.status),l.before&&i.set("before",l.before),l.limit&&i.set("limit",String(l.limit));const c=i.toString();return se(`/api/jobs${c?`?${c}`:""}`)},upload:async l=>{var u;const i=new FormData;i.append("file",l);const c=await se("/api/uploads",{method:"POST",body:i});if(!((u=c.file)!=null&&u.path))throw new Error("上传响应缺少文件路径");return c.file.path},fileUrl:(l,i)=>`/api/files?path=${encodeURIComponent(l)}${i!=null&&i.inline?"&inline=1":""}${i!=null&&i.truncate?"&truncate=1":""}`,fileMeta:l=>se(`/api/files/meta?path=${encodeURIComponent(l)}`),jobFiles:l=>se(`/api/jobs/${encodeURIComponent(l)}/files`),push:()=>se("/api/push"),subscribePush:(l,i)=>se("/api/push/subscribe",nt({subscription:l,label:i})).then(c=>c.push),unsubscribePush:l=>se("/api/push/subscribe",{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({endpoint:l})}),testPush:l=>se("/api/push/test",nt(l?{endpoint:l}:{})),visibility:(l,i)=>se("/api/visibility",nt({clientId:l,visible:i})),events:({onEvent:l,onReconnect:i,onDown:c},u)=>{const d=new EventSource(`/api/events${u?`?clientId=${encodeURIComponent(u)}`:""}`);let f=!1;const g=p=>{try{l(JSON.parse(p.data))}catch{}};d.onmessage=g;for(const p of Mj)d.addEventListener(p,g);return d.onerror=()=>{f=!0,c(d.readyState===EventSource.CLOSED?"实时连接已断开":"实时连接中断,正在重连")},d.onopen=()=>{f&&(f=!1,i())},()=>d.close()}},Dj=60;function Uj(l,i){return l.at===i.at?0:l.at<i.at?-1:1}function ix(l,i,c=Dj){const u=Array.isArray(i)?i:[i];if(!u.length)return l;const d=l.slice(),f=new Map;d.forEach((g,p)=>f.set(g.id,p));for(const g of u){const p=f.get(g.id);p===void 0?(f.set(g.id,d.length),d.push(g)):d[p]=g}return d.sort(Uj),d.length>c?d.slice(-c):d}function Hj(l,i,c){const u=l.findIndex(g=>g.id===i);if(u<0)return l;const d=l[u];if(d.kind!=="assistant")return l;const f=l.slice();return f[u]={...d,text:d.text+c},f}function rx(l){const i=l[l.length-1];return(i==null?void 0:i.kind)==="assistant"&&!!i.streaming}function Bj(l,i){return l.state==="writing"&&!i.seen&&!i.closed&&i.inChat&&l.assistantId===i.assistantId}function Lj(l,i){return l.filter(c=>c.assistantId===i&&c.state==="writing")}const $j=900,cs=new Map;function cx(l){for(const i of l)cs.has(i)||cs.set(i,window.setTimeout(()=>cs.delete(i),$j))}function qj(l){return cs.has(l)}function Yj(){for(const l of cs.values())window.clearTimeout(l);cs.clear()}function Un(l,i=180){const[c,u]=w.useState(l);return w.useEffect(()=>{if(l){u(!0);return}const d=window.setTimeout(()=>u(!1),i);return()=>window.clearTimeout(d)},[l,i]),{mounted:c,leaving:c&&!l}}function ux(l,i,c="",u=200){const[d,f]=w.useState([]),[g,p]=w.useState([]),h=w.useRef(null),v=w.useRef(c),b=w.useRef([]),k=w.useRef([]);return w.useEffect(()=>{const E=l.map(i);if(h.current===null||v.current!==c){h.current=new Set(E),v.current=c,b.current=l;return}const y=E.filter(N=>!h.current.has(N)),x=b.current.filter(N=>!E.includes(i(N)));if(h.current=new Set(E),b.current=l,y.length&&(f(N=>[...N,...y]),k.current.push(window.setTimeout(()=>f(N=>N.filter(z=>!y.includes(z))),1e3))),x.length){const N=x.map(z=>({item:z,key:i(z),state:"leave"}));p(z=>[...z,...N]),k.current.push(window.setTimeout(()=>p(z=>z.filter(O=>!N.some(X=>X.key===O.key))),u))}},[l,i,c,u]),w.useEffect(()=>{const E=k.current;return()=>{for(const y of E)window.clearTimeout(y)}},[]),[...l.map(E=>{const y=i(E);return{item:E,key:y,state:d.includes(y)?"enter":"still"}}),...g]}const ic=["off","minimal","low","medium","high","xhigh","max"],nc={off:"关闭",minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"很高",max:"最高"},Gj=40;function Xj(l,i){return i?/gpt/i.test(l)?ic.slice(0,6):[...ic]:["off"]}function Qj(l,i){return i==="google-generative-ai"||i==="google-vertex"?"high":l}function Vj(l,i,c,u){if(!i)return{levels:["off"],chars:{},map:{}};const d=Xj(l,i),f=[],g={},p={};for(const h of ic){const v=c==null?void 0:c[h];if(!(v!==void 0?v!==null:d.includes(h))){p[h]=null;continue}f.push(h);const k=typeof v=="string"?v.trim():"";g[h]=k,k?p[h]=k:(h==="xhigh"||h==="max")&&(p[h]=Qj(h,u))}return{levels:f,chars:g,map:p}}function Zj(l){if(!l||typeof l!="object"||Array.isArray(l))return;const i=l,c={};let u=!1;for(const d of ic){if(!(d in i))continue;u=!0;const f=i[d];if(f===null){c[d]=null;continue}const g=typeof f=="string"?f.trim():"";c[d]=g.length<=Gj?g:""}if(u)return c.off===null&&(c.off=""),c}const ox={"act-demo":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"act-think":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"act-tool":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"act-dark":{sel:"hob",panel:"now",collapsed:!1,dark:!0,mobile:"chat"},"act-home":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"list"},boot:{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"list"},bubbles:{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"bubbles-dark":{sel:"hob",panel:"now",collapsed:!1,dark:!0,mobile:"chat"},s1:{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"list"},s2:{sel:"bird",panel:"routine:r-daily",collapsed:!1,dark:!1,mobile:"list"},s3:{sel:"page",panel:"assistant",collapsed:!1,dark:!1,mobile:"list"},s4:{sel:"hob",panel:"now",collapsed:!0,dark:!1,mobile:"list"},s6:{sel:"hob",panel:"now",collapsed:!1,dark:!0,mobile:"list"},mlist:{sel:null,panel:"now",collapsed:!1,dark:!1,mobile:"list"},mchat:{sel:"page",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"d-running":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"d-waiting":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"d-done":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"d-dark":{sel:"hob",panel:"now",collapsed:!1,dark:!0,mobile:"chat"},"d-source":{sel:"server",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"d-mobile":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"h-hob":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"h-dark":{sel:"hob",panel:"now",collapsed:!1,dark:!0,mobile:"chat"},"h-source":{sel:"server",panel:"now",collapsed:!1,dark:!1,mobile:"chat"},"h-settings":{sel:"server",panel:"assistant",collapsed:!1,dark:!1,mobile:"chat"},"h-mobile":{sel:"hob",panel:"now",collapsed:!1,dark:!1,mobile:"chat"}},Yt=(()=>{let l=0;return i=>`${i}${++l}`})();function J(l,i,c=0){const u=new Date;return u.setDate(u.getDate()-l),u.setHours(i,c,0,0),u.toISOString()}function Ae(l){return new Date(Date.now()-l*6e4).toISOString()}function me(l){return JSON.parse(JSON.stringify(l))}const Kj=[{at:Ae(6),verb:"$",text:"npm run typecheck"},{at:Ae(5),verb:"读",text:"protocol/src/projection.ts"},{at:Ae(4),verb:"读",text:"client/src/runtime/store.ts"},{at:Ae(3),verb:"跑",text:"npm test -w protocol"},{at:Ae(2),verb:"读",text:"client/src/chat/Transcript.tsx"},{at:Ae(1),verb:"读",text:"client/src/chat/ToolRow.tsx"}];function Jj(l){const i=l==="s1"||l==="s6",c=l==="s4",u=i||l==="mlist",d=!u&&l!=="mchat",f=[{id:"hob",name:"Hob",duty:"主助手",sprite:"hob",primary:!0,pinned:!0,hidden:!1,notify:!0,instructions:"输出用中文短句;编写代码的任务先询问项目目录。",createdAt:J(30,9,0),last:{text:"已交给任务处理,完成后通知你。",at:J(0,10,5)},unread:0,busy:!0},{id:"page",name:"写作",duty:"周报和文章",sprite:"page",primary:!1,pinned:!0,hidden:!1,notify:!0,instructions:"口语化短句;标题不超过 20 字;配图自行生成;周报每周五提交。",models:{work:{ref:"faux/smart",thinking:"high"},allowed:["faux/smart","faux/vision"]},abilities:{exec:!1,write:!0,image:!0},createdAt:J(30,9,0),last:{text:"好的。每周五 17:00 撰写初稿,存入草稿箱,完成后通知你。",at:J(0,10,20)},unread:2,busy:!1},{id:"server",name:"服务器",duty:"线上和机器",sprite:"server",primary:!1,pinned:!0,hidden:!1,notify:!0,instructions:"清理日志前先查看保留天数的规则。",createdAt:J(28,9,0),last:{text:"凌晨 3 点清理 2.1GB 旧日志",at:J(1,3,5)},unread:0,busy:!1},{id:"bird",name:"行业动态",duty:"每天 6 条行业动态",sprite:"bird",primary:!1,pinned:!1,hidden:!1,notify:!0,instructions:"关注 agent 编排和本地部署,不包含融资新闻。",createdAt:J(7,9,0),splitFrom:{from:"hob",at:J(7,9,0),conversations:8},last:{text:"今天 6 条,挑选了 2 条重点",at:J(0,9,0)},unread:0,busy:!1},{id:"house",name:"家里 NAS",duty:"相册和备份",sprite:"house",primary:!1,pinned:!1,hidden:!1,notify:!1,instructions:"",createdAt:J(25,9,0),last:{text:"相册备份完成,新增 312 张",at:J(0,7,30)},unread:0,busy:!1},{id:"coin",name:"记账",duty:"账单和预算",sprite:"coin",primary:!1,pinned:!1,hidden:!1,notify:!1,instructions:"",createdAt:J(24,9,0),last:{text:"10 月账单已整理完成,比上月减少 12%",at:J(1,21,10)},unread:0,busy:!1},{id:"book",name:"读书",duty:"读书笔记",sprite:"book",primary:!1,pinned:!1,hidden:!0,notify:!1,instructions:"",createdAt:J(20,9,0),last:{text:"本周读书笔记已整理完成",at:J(3,20,0)},unread:0,busy:!1},{id:"leaf",name:"健身",duty:"每周训练",sprite:"leaf",primary:!1,pinned:!1,hidden:!0,notify:!1,instructions:"",createdAt:J(18,9,0),last:{text:"本周三次训练已记录",at:J(2,19,0)},unread:0,busy:!1}],g=(L,ue,Se,Le,Pe,de,Ve,Re,F)=>({id:L,assistantId:ue,title:Se,detail:Le,options:Pe,status:de?"answered":"pending",chosen:de?Ve:void 0,source:"router",ruleText:F,createdAt:Re,answeredAt:de?Re:void 0}),h={"ap-publish":g("ap-publish","page","发到公众号吗?",void 0,me([{key:"A",label:"发布"},{key:"B",label:"暂不发布"},{key:"C",label:"以后同类内容直接发布,无需确认",always:!0}]),d,"C",J(0,7,42),"发公众号"),"ap-split":g("ap-split","hob","是否创建一个专属助手「行业动态」?",i?"这两周你让我查询了 8 次模型和 agent 产品的动态。创建后它会记住你关注的内容,每天早上 9 点提供一份简报。":"这两周你让我查询了 8 次模型和 agent 产品的动态。",[{key:"A",label:"创建专属助手"},{key:"B",label:"暂不创建"}],!u,"A",J(0,10,15))},v={id:"d-bird",assistantId:"hob",status:c?"pending":"created",name:"行业动态",sprite:"bird",duty:"跟踪模型发布、agent 产品和开源项目",dutyLong:"跟踪模型发布、agent 产品和开源项目",routines:[{name:"每日简报",instruction:"挑最值得看的几条,最多 6 条",schedule:"0 9 * * *"}],routinesText:"每天 09:00 简报,最多 6 条;重要发布随时提醒",askFirst:["花钱订阅","替你对外发消息"],instructions:["关心 agent 编排和本地部署","不看融资新闻"],carry:{conversations:8},createdAssistantId:c?void 0:"bird",createdAt:J(0,10,17)},b={id:"t-0931",assistantId:"hob",title:"排查页面卡顿",instruction:"排查页面卡顿的原因,不要修改代码。",status:"running",createdAt:Ae(6),startedAt:Ae(6),stats:{reads:14,commands:3,edits:0},cwd:"/srv/example/site",activity:me(Kj)},k={id:"t-0927",assistantId:"server",title:"清理旧日志",instruction:"清理三天前的旧日志,不要影响正在运行的服务。",status:"done",createdAt:J(1,3,0),startedAt:J(1,3,0),endedAt:J(1,3,5),stats:{reads:4,commands:2,edits:0},summary:"已清理 2.1GB 旧日志,服务均正常运行。",files:["/srv/example/reports/log-cleanup-1031.md"],activity:[{at:J(1,3,0),verb:"$",text:"du -sh /var/log/*"},{at:J(1,3,1),verb:"读",text:"/var/log/nginx"},{at:J(1,3,3),verb:"跑",text:"find /var/log -mtime +3 -delete"},{at:J(1,3,5),verb:"说",text:"已清理 2.1GB,服务均正常运行。"}]},S={id:"t-0929",assistantId:"house",title:"整理相册备份",instruction:"把手机里这个月的照片备份到 NAS,重复的跳过。",status:"done",createdAt:Ae(58),startedAt:Ae(58),endedAt:Ae(51),stats:{reads:6,commands:2,edits:0},summary:"新增 312 张,重复跳过 87 张,占用 4.2GB。",activity:[{at:Ae(57),verb:"读",text:"/mnt/nas/photos"},{at:Ae(55),verb:"跑",text:"rsync -a --ignore-existing /sdcard/DCIM /mnt/nas/photos/"},{at:Ae(51),verb:"说",text:"新增 312 张,占用 4.2GB。"}]},E=[{id:"r-morning",assistantId:"hob",name:"早报",instruction:"汇总昨天交代的事项和今天的重要事项,早上汇报一次。",schedules:["0 8 * * *"],active:!0,createdAt:J(20,21,0),runs:[{jobId:"t-0901",at:J(0,8,0),status:"done"}]},{id:"r-weekly-reminder",assistantId:"hob",name:"周报提醒",instruction:"周五下午提醒查看本周周报。",schedules:["0 17 * * 5"],active:!0,createdAt:J(20,21,2),runs:[]},{id:"r-reconcile",assistantId:"hob",name:"月底对账",instruction:"月末核对账单,列出不一致的项目。",schedules:["0 9 28 * *"],active:!1,createdAt:J(19,10,0),runs:[{jobId:"t-0820",at:J(4,9,0),status:"done"}]},{id:"r-daily",assistantId:"bird",name:"每日简报",instruction:"挑模型发布、agent 产品和开源项目里最值得看的几条,每条一句话说清为什么重要。最多 6 条,不看融资新闻。",schedules:["0 9 * * *"],active:!0,createdAt:J(7,9,0),runs:[{jobId:"t-0926",at:J(0,9,0),status:"done"},{jobId:"t-0925",at:J(1,9,0),status:"done"},{jobId:"t-0924",at:J(2,9,1),status:"done"},{jobId:"t-0923",at:J(3,9,0),status:"done"}]},{id:"r-weekly-draft",assistantId:"page",name:"周报初稿",instruction:"每周五 17:00 撰写周报初稿,存入草稿箱,完成后通知我。",schedules:["0 17 * * 5"],active:!0,createdAt:J(0,10,21),runs:[]}],y=(L,ue,Se,Le)=>({kind:"assistant",id:L,at:ue,text:Se,routine:Le}),N=[y("i-h1",J(0,8,0),`早上好。昨晚交代的两件事均已完成:
51
-
52
- - 写作已将周报初稿存入草稿箱
53
- - 服务器凌晨 3 点清理了 2.1GB 旧日志`),{kind:"user",id:"i-h3",at:J(0,10,5),text:"页面为什么这么卡?排查一下原因,不要修改代码。"},y("i-h4",J(0,10,5),"已交给任务处理,完成后通知你。"),{kind:"job",id:"i-h5",at:J(0,10,5),jobId:"t-0931"},{kind:"question",id:"i-h6",at:J(0,10,i?9:15),approvalId:"ap-split"}];i||N.push({kind:"user",id:"i-h7",at:J(0,10,16),text:"创建专属助手吧。最多 6 条即可,不要包含融资新闻。"},y("i-h8",J(0,10,17),"草稿如下,需要修改请直接说明:"),{kind:"draft",id:"i-h9",at:J(0,10,17),draftId:"d-bird"});const z=c?N.filter(L=>!["i-h2","i-h3","i-h4","i-h5"].includes(L.id)):N,O=[y("i-p1",J(1,17,5),"周报初稿已完成,存放在草稿箱。"),{kind:"user",id:"i-p2",at:J(1,17,6),text:l==="mchat"?"好,周一发布。":"标题再短一些。"},y("i-p3",J(1,17,8),l==="mchat"?"好的,周一发布时我会再提醒你。":"已改为《这周:Hob 立项》。"),y("i-p4",J(0,7,40),"《Grok Bot 能借鉴什么》已完成,3200 字,包含 4 张配图。"),{kind:"file",id:"i-p5",at:J(0,7,41),path:"/srv/example/notes/Grok Bot 能借鉴什么.md",name:"Grok Bot 能借鉴什么.md",meta:"3200 字 · 4 张图"},{kind:"question",id:"i-p6",at:J(0,7,42),approvalId:"ap-publish"}];l!=="mchat"&&O.push({kind:"note",id:"i-p7",at:J(0,7,43),icon:"rule",text:"已记入写作的规则 · 发布公众号无需确认"},y("i-p8",J(0,7,44),"已发布。[查看文章](https://mp.weixin.qq.com/)"),{kind:"user",id:"i-p9",at:J(0,10,20),text:"以后周报也由你负责,周五下午提供初稿。"},y("i-p10",J(0,10,20),"好的。每周五 17:00 撰写初稿,存入草稿箱,完成后通知你。"),{kind:"note",id:"i-p11",at:J(0,10,21),icon:"routine",text:"新增定时任务 · 周报初稿 · 每周五 17:00"});const X=[{kind:"note",id:"i-b0",at:J(7,9,0),icon:"split",text:`${new Date(J(7,9,0)).getMonth()+1}月${new Date(J(7,9,0)).getDate()}日 由 Hob 创建 · 迁移 8 段对话、14 条记忆`},y("i-b1",J(1,9,0),"昨天 5 条,没有特别要紧的。[看全部 5 条](https://example.com/)",{id:"r-daily",name:"每日简报"}),y("i-b2",J(0,9,0),"今天 6 条,挑选 2 条重点:",{id:"r-daily",name:"每日简报"}),y("i-b3",J(0,9,0),`1. DeepSeek 公开 Super-agent 设计:路由只分派,任务隔离执行。
54
- 2. xAI 的 Grok Bot:常驻 Bot 加定时任务,结果直接回到对话。
55
-
56
- [看全部 6 条](https://example.com/)`),{kind:"user",id:"i-b4",at:J(0,9,12),text:"这个和 Hob 相比,差异在哪里?",quote:{itemId:"i-b3",text:"xAI 的 Grok Bot:常驻 Bot 加定时任务…"}},y("i-b5",J(0,9,12),"它的 Bot 有一台云电脑,能直接操作网页;Bot 之间也能互相发消息。定时任务、审批、助手创建,我们均已具备。"),{kind:"user",id:"i-b6",at:J(0,9,14),text:"以后不需要包含融资新闻。"},y("i-b7",J(0,9,14),"好的,已记录。"),{kind:"note",id:"i-b8",at:J(0,9,14),icon:"memory",text:"记忆已更新 · 不包含融资新闻"}],P=(L,ue,Se,Le)=>[y(`${L}-1`,J(1,20,0),ue),{kind:"user",id:`${L}-2`,at:J(1,20,2),text:Se},y(`${L}-3`,J(1,20,3),Le)],te={hob:z,page:O,bird:X,server:[...P("i-s","凌晨清理日志的任务已完成,清理 2.1GB,服务均正常运行。","好的,以后每月清理一次。","已记录:每月 1 号凌晨 3 点清理一次。"),{kind:"job",id:"i-s4",at:J(1,3,5),jobId:"t-0927"}],house:P("i-ho","相册备份已完成,新增 312 张,占用 4.2GB。","硬盘还剩多少?","剩余 1.8TB,可用约半年。"),coin:P("i-c","10 月账单已整理完成,比上月减少 12%。","哪一类支出较多?","餐饮和打车,比上月增加 800。"),book:P("i-bk","本周读书笔记已整理完成,共三条。","发给我看看。","已放入文件中。"),leaf:P("i-lf","本周三次训练已记录。","下周增加到四次。","好的,下周安排四次。")};(l==="bubbles"||l==="bubbles-dark")&&(te.hob=[{kind:"user",id:"bubble-user",at:Ae(3),text:"给我看看公式、代码和媒体。"},y("bubble-text",Ae(2),"行内公式 $E=mc^2$,整行公式:\n\n$$\\sum_{i=1}^{n} i = \\frac{n(n+1)}{2}$$\n\n```js\nconst answer = 42;\n```\n\n```sh\necho hello\n```\n\n价格是 $5 和 $10。"),{kind:"file",id:"bubble-audio",at:Ae(1),path:"/mock/audio.mp3",name:"语音样本.mp3"},{kind:"file",id:"bubble-video",at:Ae(1),path:"/mock/video.mp4",name:"视频样本.mp4"},{kind:"user",id:"bubble-user-2",at:Ae(1),text:"画个简单的表格给我,有几种方式?"},y("bubble-table",Ae(0),`主要有四种:
57
-
58
- | 方式 | 适合什么情况 | 能不能改 |
59
- | --- | --- | --- |
60
- | 聊天里直接画 | 简单的表,看一眼就行 | 让我重画 |
61
- | 发 Excel 或 CSV 文件 | 要下载、自己改或者算 | 能 |
62
- | 做成页面 | 能排序、筛选,以后还要更新 | 能 |
63
- | 做成图片 | 要转发给别人或者发朋友圈 | 不能 |
64
-
65
- 想要哪种?告诉我放什么内容。`)]);const V={},$={"t-0931":b,"t-0927":k,"t-0929":S};if(l.startsWith("d-")){const L=l==="d-waiting"||l==="d-mobile"?"waiting":l==="d-done"?"done":"running",ue={id:"dg-demo",from:"hob",to:"server",text:"检查服务器磁盘和服务状态,清理前先确认,不要影响正在运行的服务。",createdAt:Ae(6),status:L,jobIds:["t-delegated"],approvalIds:[]};V[ue.id]=ue,$["t-delegated"]={...b,id:"t-delegated",assistantId:"server",delegationId:ue.id,title:"检查服务器状态",status:L==="waiting"?"waiting":L},L==="waiting"&&(h["ap-delegation"]={id:"ap-delegation",assistantId:"server",title:"清理旧日志吗?",detail:"将清理七天前的日志。",options:[{key:"A",label:"清理旧日志"},{key:"B",label:"暂不清理"}],status:"pending",source:"job",jobId:"t-delegated",createdAt:Ae(2)}),te.hob=[{kind:"user",id:"d-user",at:Ae(7),text:"检查一下服务器的磁盘和服务状态。"},{kind:"delegation",id:"d-card",at:Ae(6),delegationId:ue.id}],te.server=[{kind:"user",id:"d-forward",at:Ae(6),text:ue.text,from:{assistantId:"hob",name:"Hob",delegationId:ue.id}},{kind:"job",id:"d-job",at:Ae(5),jobId:"t-delegated"},...L==="waiting"?[{kind:"question",id:"d-question",at:Ae(2),approvalId:"ap-delegation"}]:[]]}if(l.startsWith("h-")){const L=f.find(ue=>ue.id==="server");L&&(L.dutyLong="维护服务器、监控服务状态和磁盘空间;代理配置由其他助手负责。"),V["dg-returned"]={id:"dg-returned",from:"hob",to:"server",text:"检查代理节点为什么无法连接。",createdAt:Ae(4),status:"returned",reply:"退回:代理配置不属于服务器维护职责。",jobIds:[]},te.hob=[{kind:"user",id:"h-forward",at:Ae(8),text:"检查代理节点为什么无法连接。",from:{assistantId:"server",name:"服务器",delegationId:"hb-demo"}},{kind:"delegation",id:"h-card",at:Ae(4),delegationId:"dg-returned"}],te.server=[{kind:"user",id:"h-user",at:Ae(9),text:"检查代理节点为什么无法连接。"},{kind:"note",id:"h-note",at:Ae(8),icon:"info",text:"已交回 Hob:代理配置不属于我的职责。",handbackId:"hb-demo"},{kind:"user",id:"h-delegation-forward",at:Ae(4),text:"检查代理节点为什么无法连接。",from:{assistantId:"hob",name:"Hob",delegationId:"dg-returned"}}]}if(l.startsWith("act-")){const L=f.find(ue=>ue.id==="hob");L.busy=!0,L.activity=l==="act-think"||l==="act-demo"?{state:"thinking",label:"正在想…"}:{state:"tool",label:"搜索:最新 AI 动态"},te.hob=[{kind:"user",id:"act-user",at:Ae(1),text:"帮我搜索最新 AI 动态。"}],l==="act-home"&&(f.find(ue=>ue.id==="page").busy=!0)}return{assistants:f,items:te,jobs:$,delegations:V,approvals:h,drafts:{"d-bird":v},routines:E,rules:{hob:[{id:"rule-1",text:"花钱",mode:"ask",changedAt:J(10,9,0)},{id:"rule-2",text:"改线上服务",mode:"ask",changedAt:J(10,9,0)},{id:"rule-3",text:"清理我的文件",mode:"ask",changedAt:J(3,9,0)}],page:[{id:"rule-4",text:"删除草稿",mode:"ask",changedAt:J(9,9,0)},{id:"rule-5",text:"花钱",mode:"ask",changedAt:J(9,9,0)},{id:"rule-6",text:"发公众号",mode:"allow",changedAt:Ae(120)}],bird:[{id:"rule-7",text:"花钱订阅",mode:"ask",changedAt:J(7,9,0)}]},worklog:{hob:[{at:J(0,10,5),text:"任务已完成:排查页面卡顿",jobId:"t-0931"},{at:J(0,8,2),text:"转述写作的审批:发布公众号"},{at:J(0,8,0),text:"早报:两件事均已完成"}],page:[{at:J(0,10,21),text:"新增定时任务:周报初稿",jobId:"r-weekly-draft"},{at:J(0,7,44),text:"发布的文章:Grok Bot 能借鉴什么"},{at:J(0,7,40),text:"完成《Grok Bot 能借鉴什么》,3200 字"},{at:J(1,17,8),text:"周报初稿修改标题"}],bird:[{at:J(0,9,0),text:"每日简报:今天 6 条",jobId:"t-0926"},{at:J(1,9,0),text:"每日简报:昨天 5 条",jobId:"t-0925"}],server:[{at:J(1,3,5),text:"任务已完成:清理旧日志",jobId:"t-0927"}],house:[{at:J(0,7,30),text:"相册备份:新增 312 张"}],coin:[{at:J(1,21,10),text:"10 月账单已整理"}],book:[],leaf:[]},settings:{revision:1,settings:{general:{theme:l==="d-dark"||l==="h-dark"||l==="act-dark"?"dark":"system",timezone:"Asia/Tokyo",aboutYou:{name:"小林",language:"中文",notes:""}},providers:[{kind:"builtin",id:"anthropic"},{kind:"custom",id:"my-proxy",name:"我的代理",api:"openai-completions",baseUrl:"http://127.0.0.1:8080/v1",models:[{id:"gpt-x",name:"GPT X",input:["text","image"],reasoning:!0,contextWindow:2e5}]}],models:{roster:[{ref:"faux/fast",note:"响应快、成本低,适合日常对话",thinking:"low"},{ref:"faux/smart",note:"能力最强但速度较慢,适合复杂问题",thinking:"high"},{ref:"faux/vision",note:"支持图像输入,适合截图和图片",thinking:"medium"}],conversation:{ref:"faux/fast",thinking:"low"},work:{ref:"faux/smart",thinking:"high"}},image:{source:"off"},search:[{name:"searxng",enabled:!0,baseUrl:"http://127.0.0.1:8888"},{name:"exa",enabled:!0},...sx().filter(L=>L.name!=="searxng"&&L.name!=="exa")],work:{maxJobs:2,jobStallMinutes:15,routerStallMinutes:6},push:{email:""}}}}}const Ij={models:[{ref:"faux/fast",provider:"faux",id:"fast",name:"Faux Fast",reasoning:!1,thinkingLevels:["off"],input:["text"],contextWindow:128e3,maxTokens:8192,cost:{input:.1,output:.4}},{ref:"faux/smart",provider:"faux",id:"smart",name:"Faux Smart",reasoning:!0,thinkingLevels:["off","minimal","low","medium","high","xhigh","max"],input:["text"],contextWindow:4e5,maxTokens:32e3,cost:{input:3,output:15}},{ref:"faux/vision",provider:"faux",id:"vision",name:"Faux Vision",reasoning:!0,thinkingLevels:["off","minimal","low","medium","high","xhigh"],input:["text","image"],contextWindow:2e5,maxTokens:16e3,cost:{input:2,output:8}},{ref:"faux/tiny",provider:"faux",id:"tiny",name:"Faux Tiny",reasoning:!1,thinkingLevels:["off"],input:["text"],contextWindow:64e3,maxTokens:4096,cost:{input:.05,output:.2}},{ref:"sample/deep",provider:"sample",id:"deep",name:"Sample Deep",reasoning:!0,thinkingLevels:["off","minimal","low","medium","high","xhigh","max"],input:["text","image"],contextWindow:1e6,maxTokens:64e3,cost:{input:8,output:40}}],roster:[]},av={keyConfigured:!0},Fj=[{id:"anthropic",name:"Anthropic"},{id:"openai",name:"OpenAI"},{id:"google",name:"Google"},{id:"deepseek",name:"DeepSeek"},{id:"openrouter",name:"OpenRouter"}],Wj={anthropic:[{id:"claude-x",name:"Claude X",reasoning:!0},{id:"claude-x-haiku",name:"Claude X Haiku",reasoning:!1}],openai:[{id:"gpt-6-astra",name:"GPT-6 Astra",reasoning:!0}]};function ud(l,i){return(l.kind==="custom"?l.models.map(u=>{var d;return{id:u.id,name:((d=u.name)==null?void 0:d.trim())||u.id,reasoning:u.reasoning===!0}}):Wj[l.id]??[]).map(u=>{const d=`${l.id}/${u.id}`,f=i==null?void 0:i[d],g=Vj(u.id,u.reasoning,f,l.kind==="custom"?l.api:void 0);return{ref:d,id:u.id,name:u.name,reasoning:u.reasoning,levels:g.levels.map(p=>({level:p,text:g.chars[p]??""})),custom:f!==void 0}})}const Pj="/Users/me/.pi/agent",e1="/Users/me/.lore",t1=[{id:"anthropic",kind:"builtin",models:12,key:"literal",exists:!0,selectable:!0},{id:"my-proxy",kind:"custom",api:"openai-completions",baseUrl:"https://proxy.example/v1",models:4,key:"literal",exists:!1,selectable:!0},{id:"cmd-proxy",kind:"custom",api:"anthropic-messages",baseUrl:"http://127.0.0.1:8080",models:2,key:"command",exists:!1,selectable:!0,note:"Key 需通过命令获取,请导入后手动填写。"},{id:"work-laptop",kind:"builtin",models:6,key:"none",exists:!1,selectable:!1,note:"登录授权类凭据无法导入。"}],n1={anthropic:{kind:"builtin",id:"anthropic"},"my-proxy":{kind:"custom",id:"my-proxy",name:"my-proxy",api:"openai-completions",baseUrl:"https://proxy.example/v1",models:[{id:"gpt-x",name:"GPT X"},{id:"gpt-x-mini"}]},"cmd-proxy":{kind:"custom",id:"cmd-proxy",name:"cmd-proxy",api:"anthropic-messages",baseUrl:"http://127.0.0.1:8080",models:[{id:"claude-x"}]}};function l1(l="s1"){const i=Jj(l),c=new Set,u=y=>c.forEach(x=>x(y)),d=y=>i.assistants.find(x=>x.id===y),f=new Set(["anthropic","my-proxy"]),g=()=>({providers:i.settings.settings.providers.map(y=>({...y,keyConfigured:f.has(y.id)})),builtin:me(Fj),settings:me(i.settings),models:Object.fromEntries(i.settings.settings.providers.map(y=>[y.id,ud(y,i.settings.settings.models.thinking)]))}),p={revision:i.settings.revision,provider:"local",providerExplicit:!1,lore:{configured:!1,baseUrl:null,source:"none",tokenConfigured:!1}},h=[{endpoint:"https://push.example/mock-iphone",label:"iPhone",createdAt:new Date(Date.now()-3*864e5).toISOString()}],v=()=>({publicKey:"BOmockVapidPublicKeyForPreviewOnly",email:i.settings.settings.push.email,devices:me(h)}),b=y=>{const x=[];return y.activity.forEach((N,z)=>{if(N.verb==="$")return;const O=N.verb==="读"?"read":N.verb==="跑"?"bash":N.verb==="改"?"edit":N.verb==="说"?"report":"ls";x.push({id:`mock-${y.id}-${z}`,kind:"tool",at:N.at,name:O,title:O==="report"?"提交结果":`${N.verb} ${N.text}`,args:O==="bash"?{command:N.text}:O==="report"?{outcome:"done",summary:N.text}:{path:N.text},output:O==="report"?"结果已记录。":`${N.text}
66
- `,durationMs:120})}),y.id==="t-0931"&&x.push({id:"mock-search",kind:"tool",at:y.createdAt,name:"web_search",title:"联网搜索:浏览器页面性能优化",args:{query:"浏览器页面性能优化"},output:"演示结果:网页性能优化指南。",durationMs:120}),x};function k(y,x){const N=d(y);N&&(Object.assign(N,x),u({type:"assistant",assistant:me(N)}))}function S(y,x){var O;const N=(O=i.items)[y]??(O[y]=[]),z=N.findIndex(X=>X.id===x.id);z>=0?N[z]=x:N.push(x),u({type:"item",assistantId:y,item:x})}function E(y,x){k(y,{last:{text:x,at:new Date().toISOString()}})}return{me:async()=>{},login:async()=>{},logout:async()=>{},bootstrap:async()=>({assistants:me(i.assistants),jobs:me(Object.values(i.jobs)),delegations:me(Object.values(i.delegations)),routines:me(i.routines),approvals:me(Object.values(i.approvals).filter(y=>y.status==="pending")),settings:me(i.settings)}),settings:async()=>me(i.settings),models:async()=>({...me(Ij),roster:me(i.settings.settings.models.roster)}),providers:async()=>g(),putThinking:async y=>{const x=i.settings.settings.providers.find(P=>y.ref.startsWith(`${P.id}/`)),N=x?ud(x,i.settings.settings.models.thinking).find(P=>P.ref===y.ref):void 0;if(!x||!N)throw new Ke(400,`模型 ${y.ref} 不在已配置的服务商里。`);const z={...i.settings.settings.models.thinking??{}},O=y.levels===null?void 0:Zj(y.levels);O?z[y.ref]=O:delete z[y.ref],i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,models:{roster:i.settings.settings.models.roster,conversation:i.settings.settings.models.conversation,work:i.settings.settings.models.work,...Object.keys(z).length?{thinking:z}:{}}}};const X=ud(x,i.settings.settings.models.thinking).find(P=>P.ref===y.ref);return{settings:me(i.settings),thinking:X}},putProvider:async(y,x)=>{const N=x,z={...N,id:y};delete z.key;const O=i.settings.settings.providers.filter(X=>X.id!==y);return i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:[...O,z]}},N.key&&f.add(y),g()},deleteProvider:async y=>(i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:i.settings.settings.providers.filter(x=>x.id!==y)}},f.delete(y),g()),discoverProvider:async()=>({models:[{id:"gpt-x",name:"GPT X"},{id:"gpt-x-mini",name:"GPT X mini"},{id:"gpt-x-vision"}]}),providersImport:async()=>({source:Pj,items:t1.map(y=>({...y,exists:y.exists||i.settings.settings.providers.some(x=>x.id===y.id)}))}),importProviders:async y=>{const x=y.map(z=>n1[z]).filter(z=>z!==void 0);if(!x.length)throw new Ke(400,"没有可导入的服务商:请选择状态为可导入的项目。");const N=i.settings.settings.providers.filter(z=>!x.some(O=>O.id===z.id));i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:[...N,...x]}};for(const z of x)f.add(z.id);return g()},testProvider:async()=>{},imageKey:async()=>me(av),putImage:async(y,x,N)=>{if(y!==i.settings.revision)throw new Ke(409,"设置已在别处修改,已刷新");return i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,image:x}},{settings:me(i.settings),keyConfigured:!!N||av.keyConfigured}},skills:async()=>{var N;const y=((N=i.settings.settings.skills)==null?void 0:N.disabled)??[],x=(z,O,X,P,te=!1)=>({id:z,name:z,description:X,source:O,content:P,enabled:!y.includes(`${O}:${z}`),overridden:te});return{skills:[x("weekly-report","hob","按固定结构整理本周进展、风险和下周计划,生成可直接发出的周报。",`# 周报
67
-
68
- 1. 汇总本周完成的事项
69
- 2. 列出风险和需要的支持
70
- 3. 写下周计划`),x("research","hob","查阅可靠来源,交叉核对后整理结论,并为每条结论注明出处。",`# 研究
71
-
72
- 查阅可靠来源,整理结论并注明出处。`),x("server-checkup","hob","检查主机的磁盘、内存、服务状态和最近的错误日志,给出处理建议。",`# 主机巡检
73
-
74
- 逐台检查磁盘、内存、服务与日志。`),x("browser","common","在浏览器中打开页面、操作并截图,验证改动是否生效。",`# 浏览器
75
-
76
- 通过浏览器检查和验证页面。`),x("pdf","common","读取、拆分、合并 PDF,提取其中的表格和文字。",`# PDF
77
-
78
- 处理 PDF 文件。`),x("research","common","通用的资料检索流程。","# research",!0)],loreActive:!1,loreUrl:null}},skillsImport:async()=>({found:!0,skipped:[],skills:[{id:"review",name:"review",description:"检查代码与需求。",exists:!1},{id:"research",name:"research",description:"整理研究结果。",exists:!0}]}),importSkills:async(y,x)=>({imported:x,skipped:[],errors:[]}),deleteSkill:async()=>{},search:async()=>({providers:i.settings.settings.search.map(y=>({...y,keyConfigured:y.name==="exa"||y.name==="tavily"}))}),putSearch:async(y,x)=>{if(y!==i.settings.revision)throw new Ke(409,"设置已在别处修改,已刷新");return i.settings={revision:y+1,settings:{...i.settings.settings,search:x}},me(i.settings)},testSearch:async()=>({ok:!1,error:"演示模式不连接搜索服务商。"}),imageTest:async()=>({ok:!1,error:"演示模式不连接图像生成接口;正式运行时会实际生成图片。"}),putSettings:async(y,x)=>{var z;if(y!==i.settings.revision)throw new Ke(409,"设置已在别处修改,已刷新");const N=x.models??{};return i.settings={revision:i.settings.revision+1,settings:{general:{...i.settings.settings.general,...x.general??{},aboutYou:{...i.settings.settings.general.aboutYou,...((z=x.general)==null?void 0:z.aboutYou)??{}}},models:{roster:N.roster??i.settings.settings.models.roster,conversation:N.conversation??i.settings.settings.models.conversation,work:N.work??i.settings.settings.models.work,thinkingChoice:N.thinkingChoice??i.settings.settings.models.thinkingChoice,...N.thinking??i.settings.settings.models.thinking?{thinking:N.thinking??i.settings.settings.models.thinking}:{}},providers:i.settings.settings.providers,image:i.settings.settings.image,search:i.settings.settings.search,skills:x.skills??i.settings.settings.skills,work:{...i.settings.settings.work,...x.work??{}},push:{...i.settings.settings.push,...x.push??{}}}},me(i.settings)},changePassword:async y=>{if(y!=="test")throw new Ke(403,"旧密码不正确")},about:async()=>({version:"0.1.0",home:"/var/lib/hob"}),memory:async()=>me({...p,revision:i.settings.revision}),putMemory:async(y,x)=>{if(y!==i.settings.revision)throw new Ke(409,"设置已在别处修改,已刷新");if(x==="lore"&&!p.lore.configured)throw new Ke(400,"Lore 尚未配置:请先填写服务地址和 Token 并测试连接");return p.provider=x,p.providerExplicit=!0,i.settings.revision+=1,p.revision=i.settings.revision,me(p)},putLore:async y=>{const x=y.baseUrl.trim().replace(/\/+$/,"");if(!x)throw new Ke(400,"Lore 服务地址不能为空");const N=p.lore.baseUrl===x;return p.lore={configured:N?p.lore.tokenConfigured:!!y.token,baseUrl:x,source:"config",tokenConfigured:N?p.lore.tokenConfigured:!!y.token},me({...p,revision:i.settings.revision})},loreTest:async y=>{const x=(y.baseUrl??p.lore.baseUrl??"").trim().replace(/\/+$/,"");return x?x.startsWith("http://")&&!/^http:\/\/(localhost|127\.0\.0\.1|192\.168\.|10\.)/.test(x)?{ok:!1,reason:"insecure_http"}:!y.token&&!p.lore.tokenConfigured?{ok:!1,reason:"missing_token"}:{ok:!0,baseUrl:x}:{ok:!1,reason:"invalid_url"}},loreImport:async()=>({source:e1,found:!0,baseUrl:"https://api.loremem.com",tokenPresent:!0}),importLore:async()=>(p.lore={configured:!0,baseUrl:"https://api.loremem.com",source:"config",tokenConfigured:!0},me({...p,revision:i.settings.revision})),items:async y=>({items:me(i.items[y]??[]),approvals:me(Object.values(i.approvals)),jobs:me(Object.values(i.jobs)),drafts:me(Object.values(i.drafts)),delegations:me(Object.values(i.delegations)),hasMore:!1}),profile:async y=>{const x=d(y);if(!x)throw new Error(`没有这个助手:${y}`);return{assistant:me(x),rules:me(i.rules[y]??[]),routines:me(i.routines.filter(z=>z.assistantId===y)),worklog:me(i.worklog[y]??[])}},sendMessage:async(y,x)=>{const N=new Date().toISOString(),z={kind:"user",id:Yt("mock-u"),at:N,text:x.text,quote:x.quote,files:x.files&&x.files.length?x.files:void 0};return S(y,z),E(y,x.text),k(y,{busy:!0}),setTimeout(()=>{S(y,{kind:"assistant",id:Yt("mock-a"),at:new Date().toISOString(),text:"收到。"}),E(y,"收到。"),k(y,{busy:!1})},320),{item:z}},stopAssistant:async y=>k(y,{busy:!1}),markRead:async y=>k(y,{unread:0}),patchAssistant:async(y,x)=>{var N;if(!d(y))throw new Ke(404,"助手不存在。");if(x.rule){const z=(N=i.rules)[y]??(N[y]=[]),O=x.rule.id===void 0?void 0:z.find(V=>V.id===x.rule.id);if(x.rule.id!==void 0&&!O)throw new Ke(404,"规则不存在。");const X=x.rule.text===void 0?(O==null?void 0:O.text)??"":x.rule.text.trim();if(!X||X.length>1e3)throw new Ke(400,"规则内容不能为空或超过 1000 字。");if(z.some(V=>V.id!==x.rule.id&&V.text===X))throw new Ke(400,"规则内容已存在。");const P=x.rule.mode??(O==null?void 0:O.mode);if(P!=="ask"&&P!=="allow")throw new Ke(400,"规则模式无效。");const te={id:(O==null?void 0:O.id)??Yt("r-"),text:X,mode:P,changedAt:new Date().toISOString()};return O?Object.assign(O,te):z.push(te),u({type:"profile",assistantId:y}),{rule:me(te)}}k(y,x)},mergeAssistant:async y=>{var V,$;const x=d(y),N=i.assistants.find(L=>L.primary);if(!x)throw new Ke(404,"助手不存在");if(x.primary||!N)throw new Ke(400,"主助手不能并回自己");if(Object.values(i.jobs).filter(L=>L.assistantId===y&&(L.status==="running"||L.status==="queued"||L.status==="waiting")).length)throw new Ke(409,"请等任务结束后再并回");const O=i.routines.filter(L=>L.assistantId===y);for(const L of O)L.assistantId=N.id,u({type:"routine",routine:me(L)});const X=(V=i.rules)[$=N.id]??(V[$]=[]);let P=0;for(const L of i.rules[y]??[])X.some(ue=>ue.text===L.text)||(X.push({...L,id:Yt("rule")}),P+=1);i.rules[y]=[];const te=x.instructions.trim();te&&(N.instructions=[N.instructions.trim(),`来自「${x.name}」:`,te].filter(Boolean).join(`
79
- `),u({type:"assistant",assistant:me(N)})),S(N.id,{kind:"note",id:Yt("mock-n"),at:new Date().toISOString(),icon:"split",text:`已并回「${x.name}」:转来 ${O.length} 个定时任务、${P} 条规则`}),i.assistants=i.assistants.filter(L=>L.id!==y),u({type:"assistant_removed",id:y}),u({type:"profile",assistantId:N.id})},deleteRule:async(y,x)=>{i.rules[y]=(i.rules[y]??[]).filter(N=>N.id!==x),u({type:"profile",assistantId:y})},answerApproval:async(y,x)=>{var O,X,P,te;const N=i.approvals[y];if(!N||N.status==="answered")return;N.status="answered",x.key?N.chosen=x.key:N.answerText=(x.text??"").trim(),N.answeredAt=new Date().toISOString();const z=N.options.find(V=>V.key===x.key);z!=null&&z.always&&N.ruleText&&(((O=i.rules)[X=N.assistantId]??(O[X]=[])).push({id:Yt("rule"),text:N.ruleText,mode:"allow",changedAt:N.answeredAt}),S(N.assistantId,{kind:"note",id:Yt("mock-n"),at:N.answeredAt,icon:"rule",text:`已记入${((P=d(N.assistantId))==null?void 0:P.name)??""}的规则 · ${N.ruleText}无需确认`}),u({type:"profile",assistantId:N.assistantId})),u({type:"approval",approval:me(N)});for(const V of Object.values(i.delegations))((V.approvalIds??[]).includes(N.id)||N.jobId&&V.jobIds.includes(N.jobId))&&(V.status="running",N.jobId&&((te=i.jobs[N.jobId])==null?void 0:te.status)==="waiting"&&(i.jobs[N.jobId].status="running",u({type:"job",job:me(i.jobs[N.jobId])})),u({type:"delegation",delegation:me(V)}))},retryDelegation:async y=>{const x=i.delegations[y];if(!x||x.status!=="interrupted")throw new Ke(400,"只有已中断的委派可以重新转交");const N={...x,id:Yt("dg-"),status:"running",createdAt:new Date().toISOString(),jobIds:[],approvalIds:[],reportedAt:void 0,endedAt:void 0};i.delegations[N.id]=N,u({type:"delegation",delegation:me(N)}),S("hob",{kind:"delegation",id:Yt("item-"),at:N.createdAt,delegationId:N.id}),S(N.to,{kind:"user",id:Yt("item-"),at:N.createdAt,text:N.text,from:{assistantId:"hob",name:"Hob",delegationId:N.id}})},createDraft:async y=>{const x=i.drafts[y];x&&(x.status="created",x.createdAssistantId="bird",u({type:"draft",draft:me(x)}),S(x.assistantId,{kind:"note",id:Yt("mock-n"),at:new Date().toISOString(),icon:"split",text:`专属助手已创建 · ${x.name}`}))},dismissDraft:async y=>{const x=i.drafts[y];x&&(x.status="dismissed",u({type:"draft",draft:me(x)}))},createRoutine:async y=>{const x={...y,id:Yt("r"),createdAt:new Date().toISOString(),runs:[]};return i.routines.push(x),u({type:"routine",routine:me(x)}),me(x)},patchRoutine:async(y,x)=>{const N=i.routines.find(z=>z.id===y);N&&(Object.assign(N,x),u({type:"routine",routine:me(N)}))},deleteRoutine:async y=>{i.routines=i.routines.filter(x=>x.id!==y),u({type:"routine_removed",id:y})},runRoutine:async y=>{const x=i.routines.find(X=>X.id===y);if(!x)return;const N=new Date().toISOString(),z={id:Yt("t-"),assistantId:x.assistantId,title:`${x.name}(立即运行)`,instruction:x.instruction,status:"running",createdAt:N,startedAt:N,stats:{reads:0,commands:0,edits:0},routineId:x.id,activity:[{at:N,verb:"$",text:`立即运行 ${x.name}`}]};i.jobs[z.id]=z;const O={jobId:z.id,at:N,status:"running"};x.runs=[O,...x.runs].slice(0,20),S(x.assistantId,{kind:"job",id:Yt("mock-j"),at:N,jobId:z.id}),u({type:"job",job:me(z)}),u({type:"routine",routine:me(x)}),E(x.assistantId,`运行定时任务:${x.name}`)},replyJob:async(y,x)=>{const N=i.jobs[y];N&&(N.activity=[...N.activity,{at:new Date().toISOString(),verb:"说",text:x}],u({type:"activity",jobId:y,line:N.activity[N.activity.length-1],stats:me(N.stats)}))},transcript:async y=>{const x=i.jobs[y];if(!x)throw new Error(`没有这个任务:${y}`);return{job:me(x),steps:b(x)}},jobs:async(y={})=>{let x=Object.values(i.jobs).sort((O,X)=>X.createdAt.localeCompare(O.createdAt));if(y.assistantId&&(x=x.filter(O=>O.assistantId===y.assistantId)),y.status&&(x=x.filter(O=>O.status===y.status)),y.before){const O=x.findIndex(X=>X.id===y.before);O!==-1&&(x=x.slice(O+1))}const N=y.limit??30;return{jobs:me(x.slice(0,N)),hasMore:x.length>N}},stopJob:async y=>{const x=i.jobs[y];x&&(x.status="stopped",x.endedAt=new Date().toISOString(),u({type:"job",job:me(x)}))},upload:async y=>`mock://uploads/${encodeURIComponent(y.name)}`,fileUrl:(y,x)=>y.startsWith("/mock/")?y:`data:text/plain;charset=utf-8,${encodeURIComponent(`mock 模式没有真实文件。
80
-
81
- ${y}`)}`,fileMeta:async y=>{const x=y.split("/").pop()??y,N=x.lastIndexOf("."),z=N>0?x.slice(N).toLowerCase():"",O=z===".md"?"markdown":z===".csv"?"csv":z===".html"?"html":z===".json"?"json":"text";return{path:y,name:x,size:2048,modifiedAt:new Date().toISOString(),mime:"text/plain; charset=utf-8",kind:O,text:!0}},jobFiles:async y=>{if(!i.jobs[y])throw new Ke(404,"任务不存在");return{files:[],hasMore:!1}},push:async()=>v(),subscribePush:async(y,x)=>{const N=h.filter(z=>z.endpoint!==y.endpoint);return h.splice(0,h.length,...N,{endpoint:y.endpoint,label:x.trim()||"本机",createdAt:new Date().toISOString()}),v()},unsubscribePush:async y=>{const x=h.findIndex(N=>N.endpoint===y);return x>=0&&h.splice(x,1),v()},testPush:async()=>({sent:1,removed:0}),visibility:async()=>{},events:y=>{c.add(y.onEvent);const x=[];return l==="act-demo"&&(x.push(setTimeout(()=>u({type:"router-activity",assistantId:"hob",activity:{state:"tool",label:"搜索:最新 AI 动态"}}),2500)),x.push(setTimeout(()=>{u({type:"router-activity",assistantId:"hob",activity:null}),u({type:"item",assistantId:"hob",item:{kind:"assistant",id:"act-answer",at:new Date().toISOString(),text:"正在整理搜索结果…",streaming:!0}})},5500)),x.push(setTimeout(()=>{u({type:"item",assistantId:"hob",item:{kind:"assistant",id:"act-answer",at:new Date().toISOString(),text:"已整理好最新动态。"}}),u({type:"assistant",assistant:{...i.assistants.find(N=>N.id==="hob"),busy:!1,activity:null}})},7500))),()=>{x.forEach(clearTimeout),c.delete(y.onEvent)}}}}function a1(l){return/iPhone/i.test(l)?"iPhone":/iPad/i.test(l)?"iPad":/Android/i.test(l)?"Android":/Macintosh|Mac OS X/i.test(l)?"Mac":/Windows/i.test(l)?"Windows":/Linux/i.test(l)?"Linux":"浏览器"}function s1(l){const i=l.replace(/-/g,"+").replace(/_/g,"/"),c=i.padEnd(Math.ceil(i.length/4)*4,"="),u=atob(c),d=new Uint8Array(u.length);for(let f=0;f<u.length;f+=1)d[f]=u.charCodeAt(f);return d}function Xd(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window&&"Notification"in window}function i1(l){var d,f;const i=l.toJSON(),c=((d=i.keys)==null?void 0:d.p256dh)??"",u=((f=i.keys)==null?void 0:f.auth)??"";return!i.endpoint||!c||!u?null:{endpoint:i.endpoint,keys:{p256dh:c,auth:u}}}async function Qd(){if(!Xd())return null;const l=await navigator.serviceWorker.getRegistration();return await(l==null?void 0:l.pushManager.getSubscription())??null}async function r1(l){if(!Xd())return{error:"这个浏览器不支持推送"};let i=Notification.permission;if(i==="default")try{i=await Notification.requestPermission()}catch{return{error:"浏览器拒绝授予通知权限"}}if(i!=="granted")return{error:"浏览器未授予通知权限"};const c=await navigator.serviceWorker.getRegistration();if(!c)return{error:"离线页面尚未就绪,请刷新后重试"};let u=await c.pushManager.getSubscription();if(!u)try{u=await c.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s1(l).buffer})}catch(f){return{error:`浏览器订阅推送失败:${f instanceof Error?f.message:String(f)}`}}const d=i1(u);return d?{subscription:d}:{error:"浏览器返回的订阅信息不完整"}}function c1(l,i){const c=l.findIndex(d=>d.id===i.id);if(c<0)return[...l,i];const u=l.slice();return u[c]=i,u}function u1(l,i){const c=new Set(i.map(d=>d.id)),u=i.slice();for(const d of l)c.has(d.id)||u.push(d);return u}function o1(l){var d;const i=[];let c=[];const u=()=>{if(!c.length)return;const f=c.join(`
82
-
83
- `);return c=[],f};for(const f of l){if(f.kind==="thinking"){const p=(d=f.text)==null?void 0:d.trim();p&&c.push(p);continue}if(f.kind==="text"&&f.from==="user"){i.push(f);continue}const g=u();i.push(g?{...f,thinking:g}:f)}return{rows:i,thinking:u()??null}}const sv=400,d1=2e5,iv=3;function f1(l,i){const c=l===""?[]:l.split(`
84
- `),u=i===""?[]:i.split(`
85
- `);let d=0;for(;d<c.length&&d<u.length&&c[d]===u[d];)d+=1;let f=c.length,g=u.length;for(;f>d&&g>d&&c[f-1]===u[g-1];)f-=1,g-=1;const p=Math.min(d,iv),h=Math.min(c.length-f,iv),v=c.slice(d-p,d).map(b=>({sign:" ",text:b}));return v.push(...h1(c.slice(d,f),u.slice(d,g))),v.push(...c.slice(f,f+h).map(b=>({sign:" ",text:b}))),v.length<=sv?v:[...v.slice(0,sv),{sign:" ",text:"…"}]}function h1(l,i){if(!l.length)return i.map(g=>({sign:"+",text:g}));if(!i.length)return l.map(g=>({sign:"-",text:g}));if(l.length*i.length>d1)return[...l.slice(0,190).map(p=>({sign:"-",text:p})),...l.length>190||i.length>190?[{sign:" ",text:"…"}]:[],...i.slice(0,190).map(p=>({sign:"+",text:p}))];const c=Array.from({length:l.length+1},()=>new Int32Array(i.length+1));for(let g=l.length-1;g>=0;g-=1)for(let p=i.length-1;p>=0;p-=1)c[g][p]=l[g]===i[p]?c[g+1][p+1]+1:Math.max(c[g+1][p],c[g][p+1]);const u=[];let d=0,f=0;for(;d<l.length&&f<i.length;)l[d]===i[f]?(u.push({sign:" ",text:l[d]}),d+=1,f+=1):c[d+1][f]>=c[d][f+1]?(u.push({sign:"-",text:l[d]}),d+=1):(u.push({sign:"+",text:i[f]}),f+=1);for(;d<l.length;)u.push({sign:"-",text:l[d++]});for(;f<i.length;)u.push({sign:"+",text:i[f++]});return u}const m1=new Set(["排队中","进行中","待确认","已完成","受阻","失败","已停止"]);function dx(l){var c;const i=(c=l.statusReason)==null?void 0:c.trim();if(!(!i||m1.has(i)))return i}function p1(l){return l.split(/`/).map((i,c)=>({text:i,mono:c%2===1})).filter(i=>i.text.length>0)}function g1(l,i){const c=l==="dark"||l==="system"&&i;return{dark:c,color:c?"#1b1b1d":"#f6f6f4"}}function v1(l,i){return l.phase!=="ready"?i?"bg":"side":l.filePreview&&(i||l.filePreview.full)?"bg":i?l.detail||l.page==="settings"?"bg":l.sheet?"panel":"bg":l.page==="settings"?"bg":"side"}function fx(l,i){var d;const c=document.documentElement;c.style.setProperty("--status-background",`var(--${v1(l,i)})`);const u=getComputedStyle(c).backgroundColor;(d=document.querySelector('meta[name="theme-color"]'))==null||d.setAttribute("content",u)}const x1={general:{theme:"system",timezone:"UTC",aboutYou:{name:"",language:"",notes:""}},providers:[],models:{roster:[],conversation:{ref:"",thinking:"low"},work:{ref:"",thinking:"high"}},image:{source:"off"},search:sx(),work:{maxJobs:2,jobStallMinutes:15,routerStallMinutes:6},push:{email:""}},sa=new URLSearchParams(location.search),ds=sa.get("mock")==="1",b1=["act-demo","act-think","act-tool","act-dark","act-home","boot","bubbles","bubbles-dark","s1","s2","s3","s4","s6","mlist","mchat","d-running","d-waiting","d-done","d-dark","d-source","d-mobile","h-hob","h-dark","h-source","h-settings","h-mobile"],od=sa.get("scene"),mc=od&&b1.includes(od)?od:"s1",le=ds?l1(mc):Rj,Vd="hob.theme",hx=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;let rv=!1;function cv(l){return l==="assistant"||l==="now"?{kind:l}:l.startsWith("routine:")?{kind:"routine",id:l.slice(8)}:{kind:"now"}}function mx(){const l=localStorage.getItem(Vd);return l==="light"||l==="dark"||l==="system"?l:null}const px=sa.get("dark")==="1";function y1(){const l=ox[ds?mc:"s1"],i={phase:"loading",error:null,notice:null,offline:null,assistants:[],jobs:{},delegations:{},routines:[],approvals:{},drafts:{},settings:{revision:0,settings:x1},page:"main",section:null,sub:null,items:{},itemGen:{},profiles:{},sel:"hob",panel:{kind:"now"},detail:null,filePreview:null,livePages:{},steps:{},worklog:null,collapsed:!1,theme:mx()??"system",query:"",quote:null,text:"",files:[],nonce:0,mobile:"list",sheet:!1,search:!1,menu:null,tick:0,updateReady:!1,loggingIn:!1};ds&&(i.sel=l.sel,i.panel=cv(l.panel),i.collapsed=l.collapsed,i.mobile=l.mobile,i.theme=l.dark?"dark":"light");const c=sa.get("a");c&&(i.sel=c);const u=sa.get("panel");return u&&(i.panel=cv(u)),sa.get("collapsed")==="1"&&(i.collapsed=!0),px&&(i.theme="dark"),i}let re=y1();function j1(){return ds?ox[mc].mobile==="chat":!!sa.get("a")||window.innerWidth>=768}ds||px||mx();const Nd=new Set;function G(l){re={...re,...typeof l=="function"?l(re):l},Nd.forEach(i=>i())}function gx(l){return Nd.add(l),()=>Nd.delete(l)}const ia=()=>re;function Ne(){return w.useSyncExternalStore(gx,ia,ia)}function he(l){return l instanceof Ke||l instanceof Error?l.message:String(l)}function kn(l){const i={};for(const c of l)i[c.id]=c;return i}function uv(l,i){const c=l.findIndex(d=>d.id===i.id);if(c<0)return[...l,i];const u=l.slice();return u[c]=i,u}function k1(l,i){var u;const c=i.models??{};return{general:{...l.general,...i.general??{},aboutYou:{...l.general.aboutYou,...((u=i.general)==null?void 0:u.aboutYou)??{}}},models:{roster:c.roster??l.models.roster,conversation:c.conversation??l.models.conversation,work:c.work??l.models.work,thinkingChoice:c.thinkingChoice??l.models.thinkingChoice,...c.thinking??l.models.thinking?{thinking:c.thinking??l.models.thinking}:{}},image:l.image,search:l.search,providers:l.providers,work:{...l.work,...i.work??{}},push:{...l.push,...i.push??{}}}}let ov=Promise.resolve();function Zd(l){const i=ov.then(()=>N1(typeof l=="function"?l(re.settings.settings):l));return ov=i.then(()=>{},()=>{}),i}async function N1(l){var u;const i=re.settings,c={revision:i.revision,settings:k1(i.settings,l)};G({settings:c,theme:c.settings.general.theme}),(u=l.general)!=null&&u.theme&&la(l.general.theme);try{const d=await le.putSettings(i.revision,l);return G({settings:d,theme:d.settings.general.theme}),la(d.settings.general.theme),localStorage.setItem(Vd,d.settings.general.theme),!0}catch(d){if(d instanceof Ke&&d.status===409){try{const f=await le.settings();G({settings:f,theme:f.settings.general.theme}),la(f.settings.general.theme)}catch{G({settings:i})}return G({notice:"设置已在别处修改,已刷新"}),!1}return G({settings:i,theme:i.settings.general.theme,notice:`保存失败:${he(d)}`}),la(i.settings.general.theme),!1}}async function S1(l,i){try{return await le.changePassword(l,i),null}catch(c){return he(c)}}async function w1(){try{return await le.about()}catch(l){return G({notice:`无法读取版本信息:${he(l)}`}),null}}async function Kd(){try{return await le.models()}catch(l){return G({notice:`无法读取模型列表:${he(l)}`}),null}}async function Jd(l){return G({settings:l.settings}),l}async function T1(){try{return{ok:!0,view:await le.providers()}}catch(l){return{ok:!1,error:he(l)}}}async function dv(l,i){try{return{ok:!0,view:await Jd(await le.putProvider(l,i))}}catch(c){return{ok:!1,error:he(c)}}}async function E1(l,i){try{const c=await le.putThinking({ref:l,levels:i});return G({settings:c.settings}),{ok:!0,settings:c.settings,thinking:c.thinking}}catch(c){return{ok:!1,error:he(c)}}}async function C1(l){try{return{ok:!0,view:await Jd(await le.deleteProvider(l))}}catch(i){return{ok:!1,error:he(i)}}}async function fv(l){try{return await le.testProvider(l),null}catch(i){return he(i)}}async function z1(l){try{return{ok:!0,models:(await le.discoverProvider(l)).models}}catch(i){return{ok:!1,error:he(i)}}}async function A1(){try{return{ok:!0,view:await le.providersImport()}}catch(l){return{ok:!1,error:he(l)}}}async function O1(l){try{return{ok:!0,view:await Jd(await le.importProviders(l))}}catch(i){return{ok:!1,error:he(i)}}}const _1=()=>le.skills(),M1=l=>le.skillsImport(l),R1=(l,i,c)=>le.importSkills(l,i,c),D1=l=>le.deleteSkill(l),U1=()=>le.search(),H1=(l,i,c)=>le.testSearch(l,i,c);async function B1(l,i){try{const c=await le.putSearch(re.settings.revision,l,i);return G({settings:c}),null}catch(c){return c instanceof Ke&&c.status===409&&G({settings:await le.settings()}),he(c)}}async function L1(){try{return await le.imageKey()}catch(l){return G({notice:`无法读取图像生成设置:${he(l)}`}),null}}async function hv(l,i){try{const c=await le.putImage(re.settings.revision,l,i);return G({settings:c.settings}),{ok:!0,keyConfigured:c.keyConfigured}}catch(c){if(c instanceof Ke&&c.status===409){try{G({settings:await le.settings()})}catch{}return{ok:!1,error:"设置已在别处修改,已刷新,请重新保存",conflict:!0}}return{ok:!1,error:he(c),conflict:!1}}}async function mv(l){try{return await le.imageTest(l)}catch(i){return{ok:!1,error:`生成测试图片的请求失败:${he(i)}`}}}async function dd(){try{return{ok:!0,config:await le.memory()}}catch(l){return{ok:!1,error:`无法读取记忆设置:${he(l)}`}}}async function pv(l,i){try{const c=await le.putMemory(l,i);return G(u=>({settings:{...u.settings,revision:Math.max(u.settings.revision,c.revision)}})),{ok:!0,config:c}}catch(c){return{ok:!1,error:he(c)}}}async function $1(l){try{return{ok:!0,config:await le.putLore(l)}}catch(i){return{ok:!1,error:he(i)}}}async function gv(l){try{return{ok:!0,result:await le.loreTest(l)}}catch(i){return{ok:!1,error:`测试请求失败:${he(i)}`}}}async function q1(){try{return{ok:!0,view:await le.loreImport()}}catch(l){return{ok:!1,error:he(l)}}}async function Y1(){try{return{ok:!0,config:await le.importLore()}}catch(l){return{ok:!1,error:he(l)}}}async function pc(){try{return{ok:!0,view:await le.push()}}catch(l){return{ok:!1,error:`无法读取推送设置:${he(l)}`}}}async function G1(){const l=await pc();if(!l.ok)return l;try{const i=await r1(l.view.publicKey);return"error"in i?{ok:!1,error:i.error}:{ok:!0,view:await le.subscribePush(i.subscription,a1(navigator.userAgent))}}catch(i){return{ok:!1,error:`订阅推送失败:${he(i)}`}}}async function X1(){try{const l=await Qd();if(l)try{await l.unsubscribe()}catch{}return vx((l==null?void 0:l.endpoint)??await Q1())}catch(l){return{ok:!1,error:`关闭推送失败:${he(l)}`}}}async function Q1(){var i;const l=await pc();return l.ok?((i=l.view.devices[0])==null?void 0:i.endpoint)??"":""}async function vx(l){if(!l)return pc();try{return{ok:!0,view:await le.unsubscribePush(l)}}catch(i){return{ok:!1,error:`删除设备失败:${he(i)}`}}}async function V1(){const l=await Qd();try{return{ok:!0,sent:(await le.testPush(l==null?void 0:l.endpoint)).sent}}catch(i){return{ok:!1,error:he(i)}}}const xx=window.matchMedia("(prefers-color-scheme: dark)");function la(l){const{dark:i}=g1(l,xx.matches);document.documentElement.classList.toggle("dark",i),document.documentElement.style.colorScheme=i?"dark":"light",fx(re,window.innerWidth<768)}xx.addEventListener("change",()=>la(re.theme));let vv=!1,xv=null;async function Z1(){if(!vv){if(vv=!0,la(re.theme),ds){if(mc==="boot")return;await rc();return}try{await le.me()}catch(l){if(l instanceof Ke&&l.status===401){G({phase:"login"});return}G({phase:"error",error:he(l)});return}await rc()}}async function K1(l){if(!re.loggingIn){G({loggingIn:!0,error:null});try{await le.login(l)}catch(i){G({loggingIn:!1,error:i instanceof Ke&&i.status===401?"密码不正确":`登录失败:${he(i)}`});return}G({loggingIn:!1,phase:"loading"}),await rc()}}async function rc(){var l,i;try{const c=await le.bootstrap();G({phase:"ready",error:null,offline:null,assistants:c.assistants,jobs:kn(c.jobs),delegations:kn(c.delegations??[]),routines:c.routines,approvals:kn(c.approvals),settings:c.settings,theme:c.settings.settings.general.theme}),la(c.settings.settings.general.theme),localStorage.setItem(Vd,c.settings.settings.general.theme),xv||(xv=le.events({onEvent:yx,onReconnect:()=>{G({offline:null}),rc()},onDown:d=>G({offline:d})},hx),I1());const u=re.sel&&c.assistants.some(d=>d.id===re.sel)?re.sel:((l=c.assistants.find(d=>d.primary))==null?void 0:l.id)??((i=c.assistants[0])==null?void 0:i.id)??null;u&&await ln(u,!0,j1())}catch(c){G({phase:"error",error:he(c)})}}const bx=new Set;function yx(l){var i;switch(l.type){case"page-live":{const c=!re.livePages[l.callId];G(u=>({livePages:{...u.livePages,[l.callId]:l},...Bj(l,{seen:!c,closed:bx.has(l.callId),assistantId:u.sel,inChat:u.page==="main"&&(u.mobile==="chat"||!window.matchMedia("(max-width: 767px)").matches)})?{filePreview:{path:"",full:!1,liveId:l.callId}}:{}}));break}case"assistant":{const c=l.assistant;G(u=>({assistants:uv(u.assistants,c),profiles:u.profiles[c.id]?{...u.profiles,[c.id]:{...u.profiles[c.id],assistant:c}}:u.profiles}));break}case"router-activity":G(c=>({assistants:c.assistants.map(u=>u.id===l.assistantId?{...u,activity:l.activity}:u)}));break;case"assistant_removed":G(c=>{var u;return{assistants:c.assistants.filter(d=>d.id!==l.id),sel:c.sel===l.id?((u=c.assistants.find(d=>d.primary))==null?void 0:u.id)??null:c.sel}});break;case"item":{const c=re.items[l.assistantId];if(!c)break;c.some(u=>u.id===l.item.id)||cx([l.item.id]),G(u=>({items:{...u.items,[l.assistantId]:ix(c,l.item)}}));break}case"delta":{const c=re.items[l.assistantId];if(!c)break;const u=Hj(c,l.itemId,l.text);u!==c&&G(d=>({items:{...d.items,[l.assistantId]:u}}));break}case"job":G(c=>({jobs:{...c.jobs,[l.job.id]:l.job}})),J1(l.job.status)&&((i=re.detail)==null?void 0:i.kind)==="job"&&re.detail.id===l.job.id&&re.steps[l.job.id]&&Sx(l.job.id);break;case"delegation":G(c=>({delegations:{...c.delegations,[l.delegation.id]:l.delegation}}));break;case"job_step":{const c=re.steps[l.jobId];if(!c)break;G(u=>({steps:{...u.steps,[l.jobId]:c1(c,l.step)}}));break}case"activity":{const c=re.jobs[l.jobId];if(!c)break;G(u=>({jobs:{...u.jobs,[l.jobId]:{...c,stats:l.stats,activity:[...c.activity,l.line].slice(-200)}}}));break}case"approval":G(c=>({approvals:{...c.approvals,[l.approval.id]:l.approval}}));break;case"draft":G(c=>({drafts:{...c.drafts,[l.draft.id]:l.draft}}));break;case"routine":G(c=>({routines:uv(c.routines,l.routine)}));break;case"routine_removed":G(c=>({routines:c.routines.filter(u=>u.id!==l.id),panel:c.panel.kind==="routine"&&c.panel.id===l.id?{kind:"now"}:c.panel}));break;case"profile":jx(l.assistantId);break}}function J1(l){return l==="done"||l==="stuck"||l==="failed"||l==="stopped"}function bv(){le.visibility(hx,document.visibilityState==="visible").catch(()=>{})}function I1(){rv||(rv=!0,document.addEventListener("visibilitychange",bv),bv())}async function ln(l,i=!1,c=!0,u=!1){G(f=>({sel:l,...f.sel!==l&&!u?{detail:null,worklog:null}:{},...c?{mobile:"chat",sheet:!1,search:!1}:{},quote:null,...i?{}:{panel:{kind:"now"}}}));const d=re.assistants.find(f=>f.id===l);d&&d.unread>0&&(G(f=>({assistants:f.assistants.map(g=>g.id===l?{...g,unread:0}:g)})),le.markRead(l).catch(()=>{})),await Promise.all([F1(l),jx(l)])}async function F1(l){const i=new Set(Object.keys(re.livePages));try{const c=await le.items(l);Yj();const u=new Set((c.pageLive??[]).map(d=>d.callId));G(d=>{var p;const f=Object.fromEntries(Object.entries(d.livePages).filter(([h,v])=>v.assistantId!==l||v.state==="done"||!i.has(h)||u.has(h))),g=((p=d.filePreview)==null?void 0:p.liveId)&&!f[d.filePreview.liveId];return{livePages:f,...g?{filePreview:null}:{}}});for(const d of c.pageLive??[])yx({type:"page-live",...d});G(d=>({items:{...d.items,[l]:c.items},itemGen:{...d.itemGen,[l]:(d.itemGen[l]??0)+1},jobs:{...d.jobs,...kn(c.jobs)},approvals:{...d.approvals,...kn(c.approvals)},drafts:{...d.drafts,...kn(c.drafts)},delegations:{...d.delegations,...kn(c.delegations??[])}}))}catch(c){G({notice:`无法加载对话:${he(c)}`})}}async function jx(l){try{const i=await le.profile(l);G(c=>({profiles:{...c.profiles,[l]:i}}))}catch(i){G({notice:`无法加载档案:${he(i)}`})}}function Id(l){G({text:l})}function cc(l){G({quote:l,nonce:re.nonce+1})}function W1(l){G(i=>({files:[...i.files,...l]}))}function P1(l){G(i=>({files:i.files.filter(c=>c!==l)}))}async function ek(l){for(const i of Array.from(l))try{const c=await le.upload(i);W1([c])}catch(c){G({notice:`上传失败:${he(c)}`})}}async function yv(){const l=re.sel,i=re.text.trim();if(!l||!i)return;const c={text:i,quote:re.quote??void 0,files:re.files.length?re.files:void 0};G({text:"",quote:null,files:[],nonce:re.nonce+1});try{const u=await le.sendMessage(l,c);u!=null&&u.item&&(cx([u.item.id]),G(d=>({items:{...d.items,[l]:ix(d.items[l]??[],u.item)}})))}catch(u){G({notice:`发送失败:${he(u)}`,text:i,quote:c.quote??null,files:c.files??[]})}}async function jv(l,i){const c=re.approvals[l];if(c){G(u=>({approvals:{...u.approvals,[l]:{...c,status:"answered",...i.key?{chosen:i.key}:{answerText:(i.text??"").trim()}}}}));try{await le.answerApproval(l,i)}catch(u){G({approvals:{...re.approvals,[l]:c},notice:`提交失败:${he(u)}`})}}}async function tk(l){try{await le.createDraft(l)}catch(i){G({notice:`创建助手失败:${he(i)}`})}}async function nk(l){try{await le.mergeAssistant(l);const i=re.assistants.find(c=>c.primary);re.sel===l&&i&&await ln(i.id,!0)}catch(i){G({notice:`并回失败:${he(i)}`})}}async function lk(l){try{await le.retryDelegation(l)}catch(i){G({notice:`重新转交失败:${he(i)}`})}}async function kv(l,i,c){await kx(l,i,c?"forward":"handback")}async function Fd(l,i,c){await kx(l,i,c?"forward":"delegation")}async function kx(l,i,c){(re.sel!==l||!re.items[l])&&await ln(l);const u=d=>{var f;return c==="forward"?d.kind==="user"&&((f=d.from)==null?void 0:f.delegationId)===i:c==="handback"?d.kind==="note"&&d.handbackId===i:d.kind==="delegation"&&d.delegationId===i};try{let d=re.items[l]??[];for(;!d.some(u)&&d.length;){const f=await le.items(l,d[0].id);if(!f.items.length||(d=[...f.items,...d],G(g=>({items:{...g.items,[l]:d},jobs:{...g.jobs,...kn(f.jobs)},approvals:{...g.approvals,...kn(f.approvals)},delegations:{...g.delegations,...kn(f.delegations??[])}})),!f.hasMore))break}if(!d.some(u)){G({notice:"未找到对应的转交消息"});return}requestAnimationFrame(()=>requestAnimationFrame(()=>{var f;return(f=document.getElementById(`${c}-${i}`))==null?void 0:f.scrollIntoView({block:"center",behavior:"smooth"})}))}catch(d){G({notice:`无法定位转交消息:${he(d)}`})}}async function Sd(l,i){try{await le.replyJob(l,i)}catch(c){G({notice:`发送失败:${he(c)}`})}}async function Nx(l){try{await le.stopJob(l)}catch(i){G({notice:`停止失败:${he(i)}`})}}async function ls(l,i){const c=re.routines.find(u=>u.id===l);if(c){G(u=>({routines:u.routines.map(d=>d.id===l?{...d,...i}:d)}));try{await le.patchRoutine(l,i)}catch(u){G({routines:re.routines.map(d=>d.id===l?c:d),notice:`保存失败:${he(u)}`})}}}async function ak(l){const i=new Set(re.routines.map(d=>d.id));let c;try{c=await le.createRoutine(l)}catch(d){G({notice:`创建失败:${he(d)}`});return}const u=c!=null&&c.id?c:re.routines.find(d=>!i.has(d.id));u&&Pd(u.id)}async function sk(l){try{await le.deleteRoutine(l)}catch(i){G({notice:`删除失败:${he(i)}`})}}async function ik(l){try{await le.runRoutine(l)}catch(i){G({notice:`运行失败:${he(i)}`})}}async function wd(l,i){const c=re.assistants.find(d=>d.id===l),u=re.profiles[l];if(!c)return"助手不存在。";G(d=>({assistants:d.assistants.map(f=>f.id===l?{...f,...i}:f),profiles:d.profiles[l]?{...d.profiles,[l]:{...d.profiles[l],assistant:{...d.profiles[l].assistant,...i}}}:d.profiles}));try{return await le.patchAssistant(l,i),null}catch(d){const f=`保存失败:${he(d)}`;return G(g=>({assistants:g.assistants.map(p=>p.id===l?c:p),profiles:u?{...g.profiles,[l]:u}:g.profiles,notice:f})),f}}async function rk(l,i,c){try{const u=await le.patchAssistant(l,{rule:{text:i,mode:c}});if(!(u!=null&&u.rule))throw new Error("保存响应缺少规则。");const d=u.rule;return G(f=>{const g=f.profiles[l];return!g||g.rules.some(p=>p.id===d.id)?{}:{profiles:{...f.profiles,[l]:{...g,rules:[...g.rules,d]}}}}),null}catch(u){return`保存失败:${he(u)}`}}async function ck(l,i){try{return await le.patchAssistant(l,{rule:i}),G(c=>{const u=c.profiles[l];return u?{profiles:{...c.profiles,[l]:{...u,rules:u.rules.map(d=>d.id===i.id?{...d,...i,changedAt:new Date().toISOString()}:d)}}}:{}}),null}catch(c){return`保存失败:${he(c)}`}}async function uk(l,i){const c=re.profiles[l];if(c){G(u=>({profiles:{...u.profiles,[l]:{...c,rules:c.rules.filter(d=>d.id!==i)}}}));try{await le.deleteRule(l,i)}catch(u){G({profiles:{...re.profiles,[l]:c},notice:`删除失败:${he(u)}`})}}}async function Sx(l){try{const{job:i,steps:c}=await le.transcript(l);G(u=>({jobs:{...u.jobs,[i.id]:i},steps:{...u.steps,[i.id]:u.steps[i.id]?u1(u.steps[i.id],c):c}}))}catch(i){G({notice:`无法加载任务过程:${he(i)}`})}}function ra(l){G(i=>{var c;return{detail:{kind:"job",id:l},worklog:((c=i.detail)==null?void 0:c.kind)==="jobs"?i.worklog:null}}),Sx(l)}function Wd(l=null){G({detail:{kind:"jobs"}}),Td({assistantId:l,status:null})}function hi(){G({detail:null})}function wx(){G(l=>({detail:l.worklog?{kind:"jobs"}:null}))}async function Td(l={}){const i=l.assistantId??null,c=l.status??null;G({worklog:{jobs:[],assistantId:i,status:c,hasMore:!1,loading:!0}});try{const u=await le.jobs({...i?{assistantId:i}:{},...c?{status:c}:{},limit:30});Tx(u,i,c)}catch(u){G({worklog:null,notice:`无法加载任务记录:${he(u)}`})}}async function ok(){const l=re.worklog;if(!l||!l.hasMore||l.loading)return;const i=l.jobs[l.jobs.length-1];G({worklog:{...l,loading:!0}});try{const c=await le.jobs({...l.assistantId?{assistantId:l.assistantId}:{},...l.status?{status:l.status}:{},...i?{before:i.id}:{},limit:30});Tx(c,l.assistantId,l.status)}catch(c){G(u=>({worklog:u.worklog?{...u.worklog,loading:!1}:null,notice:`无法加载更多:${he(c)}`}))}}function Tx(l,i,c){G(u=>{var g;const d=new Set((((g=u.worklog)==null?void 0:g.jobs)??[]).map(p=>p.id));return{worklog:{jobs:u.worklog&&u.worklog.assistantId===i&&u.worklog.status===c?[...u.worklog.jobs,...l.jobs.filter(p=>!d.has(p.id))]:l.jobs,assistantId:i,status:c,hasMore:l.hasMore,loading:!1},jobs:{...u.jobs,...kn(l.jobs)}}})}function yi(){G({nonce:re.nonce+1,mobile:"chat",sheet:!1})}function Ex(){const l=re.assistants.find(i=>i.primary);l&&(ln(l.id),G({text:"我想创建一个专属助手,负责:",nonce:re.nonce+1,mobile:"chat",sheet:!1}))}async function dk(l,i){(re.sel!==l||!re.items[l])&&await ln(l),requestAnimationFrame(()=>{var c;(c=document.getElementById(`job-${i}`))==null||c.scrollIntoView({block:"center",behavior:"smooth"})})}function Pd(l){G({panel:{kind:"routine",id:l},collapsed:!1,sheet:!0})}function fk(){G({panel:{kind:"newRoutine"},collapsed:!1,sheet:!0})}function Cx(){G({panel:{kind:"assistant"},collapsed:!1,sheet:!0})}function Nv(l,i,c){G({menu:{id:l,x:i,y:c}})}function fd(){re.menu&&G({menu:null})}function ef(){G({page:"settings",section:null,sub:null,sheet:!1,search:!1})}function Ed(){G({page:"main"})}function us(l){G({section:l,sub:null})}function tl(l){G({sub:l})}function pn(){G({sub:null})}function tf(){G({panel:{kind:"now"},sheet:!1})}function hk(){G({collapsed:!0,sheet:!1})}function mk(){G({collapsed:!1,panel:{kind:"now"}})}function zx(l){G({query:l})}function Ax(l){G({mobile:l,sheet:!1,search:!1})}function pk(){G({sheet:!0})}function Cd(){G({sheet:!1})}function Sv(l){G({search:l,query:l?re.query:""})}function gk(){G({notice:null})}function gc(l){G({notice:l})}function vk(){G({updateReady:!0})}function xk(){G({tick:re.tick+1})}function Rt(l,i){return le.fileUrl(l,i)}function Ox(l){return le.fileMeta(l)}async function bk(l){try{return await le.jobFiles(l)}catch(i){return G({notice:`无法加载产出文件:${he(i)}`}),null}}function _l(l,i){G({filePreview:{path:l,full:!1,...i?{title:i}:{}}})}function yk(l){G({filePreview:{path:"",full:!1,liveId:l}})}function uc(){var l;(l=re.filePreview)!=null&&l.liveId&&bx.add(re.filePreview.liveId),G({filePreview:null})}function jk(){G(l=>l.filePreview?{filePreview:{...l.filePreview,full:!l.filePreview.full}}:{})}const kk=500,wv=10;function _x(l){const i=w.useRef(null),c=w.useRef(null),u=w.useRef(!1),d=()=>{i.current!==null&&window.clearTimeout(i.current),i.current=null,c.current=null};return w.useEffect(()=>d,[]),{handlers:{onContextMenu(g){g.preventDefault(),d(),Nv(l.id,g.clientX,g.clientY)},onPointerDown(g){g.pointerType==="touch"&&(d(),u.current=!1,c.current={x:g.clientX,y:g.clientY},i.current=window.setTimeout(()=>{i.current=null;const p=c.current;p&&(u.current=!0,window.setTimeout(()=>u.current=!1,1e3),Nv(l.id,p.x,p.y))},kk))},onPointerMove(g){const p=c.current;p&&(Math.abs(g.clientX-p.x)>wv||Math.abs(g.clientY-p.y)>wv)&&d()},onPointerUp:d,onPointerCancel:d},takeHeld(){return u.current?(u.current=!1,!0):!1}}}function Tv(){const l=Ne(),i=l.menu,c=w.useRef(null);if(w.useEffect(()=>{if(!i)return;const h=b=>{c.current&&!c.current.contains(b.target)&&fd()},v=b=>{b.key==="Escape"&&fd()};return document.addEventListener("pointerdown",h,!0),window.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",h,!0),window.removeEventListener("keydown",v)}},[i]),!i)return null;const u=l.assistants.find(h=>h.id===i.id);if(!u)return null;const d=h=>{fd(),h()},f=u.primary?1:3,g=Math.max(8,Math.min(i.x,window.innerWidth-172)),p=Math.max(8,Math.min(i.y,window.innerHeight-(f*34+16)));return s.jsxs("div",{className:"amenu",ref:c,style:{left:g,top:p,transformOrigin:`${i.x-g}px ${i.y-p}px`},onContextMenu:h=>h.preventDefault(),children:[u.primary?null:s.jsx("button",{onClick:()=>d(()=>void wd(u.id,{pinned:!u.pinned})),children:u.pinned?"取消置顶":"放在顶部"}),u.primary?null:s.jsx("button",{onClick:()=>d(()=>void wd(u.id,{hidden:!u.hidden})),children:u.hidden?"放回列表":"收起这个助手"}),s.jsx("button",{onClick:()=>d(()=>{ln(u.id,!1,!1),Cx()}),children:"助手设置"})]})}const Mx={search:'<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',plus:'<path d="M12 5v14M5 12h14"/>',edit:'<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>',gear:'<path d="M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"/><circle cx="15" cy="6" r="2"/><circle cx="9" cy="12" r="2"/><circle cx="17" cy="18" r="2"/>',dbl:'<path d="m6 17 5-5-5-5M13 17l5-5-5-5"/>',left:'<path d="m15 18-6-6 6-6"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7.5V12l3 2"/>',pause:'<circle cx="12" cy="12" r="9"/><path d="M10 9v6M14 9v6"/>',check:'<path d="M5 12.5 10 17l9-10"/>',spin:'<path d="M12 3a9 9 0 1 0 9 9" />',out:'<path d="M7 17 17 7M8.5 7H17v8.5"/>',reply:'<path d="M9 14 4 9l5-5"/><path d="M4 9h10a6 6 0 0 1 6 6v3"/>',smile:'<circle cx="12" cy="12" r="9"/><path d="M8.5 14.5s1.3 1.8 3.5 1.8 3.5-1.8 3.5-1.8M9 9.5h.01M15 9.5h.01"/>',more:'<circle cx="5" cy="12" r="1.2"/><circle cx="12" cy="12" r="1.2"/><circle cx="19" cy="12" r="1.2"/>',doc:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5M9 13h6M9 17h4"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',table:'<rect x="3.5" y="4.5" width="17" height="15" rx="2.5"/><path d="M3.5 9.5h17M3.5 14.5h17M10 9.5v10"/>',code:'<path d="m8 8-4 4 4 4M16 8l4 4-4 4M14 5l-4 14"/>',globe:'<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>',archive:'<rect x="4" y="7" width="16" height="13" rx="2"/><rect x="3" y="4" width="18" height="4" rx="1"/><path d="M10 12h4"/>',panel:'<rect x="3" y="4" width="18" height="16" rx="2.5"/><path d="M15 4v16"/>',mem:'<path d="M12 3.5 14 9l5.5 2-5.5 2-2 5.5-2-5.5L4.5 11 10 9z"/>',rule:'<path d="M12 3 4 6v6c0 4.5 3.4 8.2 8 9 4.6-.8 8-4.5 8-9V6z"/><path d="m8.5 12 2.5 2.5 4.5-5"/>',chev:'<path d="m9 6 6 6-6 6"/>',down:'<path d="m6 9 6 6 6-6"/>',updown:'<path d="m8 9 4-4 4 4M8 15l4 4 4-4"/>',bulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6M10 22h4"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>',send:'<path d="M12 20V5M5.5 11.5 12 5l6.5 6.5"/>',close:'<path d="m6 6 12 12M18 6 6 18"/>',copy:'<rect x="9" y="9" width="11" height="11" rx="2.5"/><path d="M15 6.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h1.5"/>',split:'<path d="M4 5h4l8 14h4M4 19h4l8-14h4"/>',stop:'<rect x="6" y="6" width="12" height="12" rx="2"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 7.9h.01"/>',term:'<path d="m5 16 5-4-5-4M12 17h7"/>',dl:'<path d="M12 4v11M7.5 11.5 12 16l4.5-4.5"/><path d="M5 20h14"/>',image:'<rect x="3.5" y="4.5" width="17" height="15" rx="2.5"/><circle cx="9" cy="10" r="1.6"/><path d="m20.5 16-4.5-4.5L7 19.5"/>'};function zd(l,i=16){return`<svg class="i" width="${i}" height="${i}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${Mx[l]}</svg>`}function Z({name:l,size:i=16,w:c=1.7,className:u,style:d}){return s.jsx("svg",{className:`i${u?` ${u}`:""}`,width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",style:d,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:Mx[l]}})}const is=["......k.....",".....kok....",".....kook...","..k.koook...",".kokoooook..",".kooooooook.","kooyyyyyyook","koyyeyyeyyok","koyyeyyeyyok","koyyyyyyyyok",".kooyyyyook.","..kkkkkkkk.."],mn=16,Ev="#40261a",fs={orange:{name:"橙",o:"#ff7a2e",y:"#ffcf4a",bg:"#ffe6d3"},red:{name:"红",o:"#ff5a3c",y:"#ffd2a8",bg:"#ffe3dc"},pink:{name:"粉",o:"#ff6b8a",y:"#ffd6de",bg:"#ffe4ef"},purple:{name:"紫",o:"#8f7bff",y:"#ddd6ff",bg:"#e9e5ff"},blue:{name:"蓝",o:"#4ea3ff",y:"#cfe6ff",bg:"#fff0c4"},slate:{name:"灰蓝",o:"#6f8fb3",y:"#d8e5f2",bg:"#e3eeff"},teal:{name:"青",o:"#20b8b0",y:"#c2f0ea",bg:"#d6f3f1"},green:{name:"绿",o:"#2fbf71",y:"#c9f2da",bg:"#e4f5d9"}},Ct=(l,i)=>[...Array(l).fill(""),...i],ca={hob:{label:"主助手",color:"orange",dx:2,pal:{},art:[]},page:{label:"写作/文档",color:"purple",dx:1,pal:{p:"#ff9db0",g:"#b9c0c8",h:"#ffc21a",b:"#f2c58f"},art:Ct(5,["............kkkk","............kppk","............kppk","............kggk","............khhk","............khhk","............khhk","............khhk","............kbbk",".............kk."])},server:{label:"服务器/运维",color:"slate",dx:2,pal:{h:"#ffc21a",w:"#fff1b8"},art:Ct(2,["......kkkk......",".....khhwwk.....","....khhhhwhk....","....khhhhhhk....","...kkkkkkkkkk..."])},bird:{label:"资讯/动态",color:"blue",dx:0,pal:{l:"#dff3ff",w:"#ffffff"},art:Ct(6,["..........kkkk..",".........kllllk.",".........kwlllk.",".........kllllk.",".........kllllk.","..........kkkk..",".............kk.","..............kk","...............k"])},house:{label:"家/NAS/生活",color:"teal",dx:0,pal:{r:"#ff8b6a",w:"#fff7ea",d:"#9b6b52"},art:Ct(9,["............k...","...........krk..","..........krrrk.",".........krrrrrk","..........kwwwk.","..........kwdwk.","..........kkkkk."])},coin:{label:"钱/记账",color:"green",dx:0,pal:{h:"#ffc21a",w:"#fff1b8",d:"#d18f00"},art:Ct(9,["...........kkk..","..........khhhk.",".........khwdhhk",".........khwdhhk",".........khhdhhk","..........khhhk.","...........kkk.."])},book:{label:"学习/读书",color:"red",dx:2,pal:{d:"#3a3f58",t:"#ffc21a"},art:Ct(1,[".......kk.......",".....kkddkk.....","...kkddddddkk...",".kkddddddddddkk.","...kkddddddkk.t.","....kddddddk..t.","....kkkkkkkk..t.","..............t."])},leaf:{label:"健康/植物",color:"pink",dx:2,pal:{g:"#5ccf6b",s:"#3a9a4f"},art:Ct(0,["....kk.....kk...","...kggk...kggk..","....kggkskggk...",".....kk.s.kk...."])},wifi:{label:"网络/路由器",color:"teal",dx:2,pal:{},art:Ct(0,["......kkkkk.....",".....k.....k....",".......kkk......","......k...k....."])},calendar:{label:"日程/提醒",color:"purple",dx:0,pal:{r:"#ff4d4d",w:"#ffffff"},art:Ct(8,["..........k...k.",".........kkkkkkk",".........krrrrrk",".........kkkkkkk",".........kwwwwwk",".........kwwkwwk",".........kwwwwwk",".........kkkkkkk"])},chef:{label:"做饭/饮食",color:"red",dx:2,pal:{w:"#ffffff",g:"#d9dde2"},art:Ct(1,[".....kk..kk.....","....kwwkkwwk....","...kwwwwwwwwk...","...kwwwwwwwwk...","....kwwwwwwk....","....kggggggk....","....kkkkkkkk...."])},chart:{label:"股票/数据",color:"slate",dx:0,pal:{w:"#ffffff",g:"#f04848"},art:Ct(9,[".........kkkkkkk",".........kwwwwgk",".........kwwgwgk",".........kwwgwgk",".........kgwgwgk",".........kgwgwgk",".........kkkkkkk"])},bag:{label:"旅行/出行",color:"blue",dx:0,pal:{b:"#e8833a",s:"#ffd59a"},art:Ct(9,["...........kkk..","...........k.k..",".........kkkkkkk",".........kbsbsbk",".........kbsbsbk",".........kbsbsbk",".........kkkkkkk"])},paw:{label:"宠物",color:"purple",dx:0,pal:{c:"#ffb36b",p:"#ff8fa6"},art:Ct(9,[".........k.....k",".........kck.kck",".........kccccck",".........kckckck",".........kccpcck","..........kkkkk."])},note:{label:"音乐",color:"pink",dx:1,pal:{},art:Ct(2,["..............k.","..............kk","..............kk","..............k.","..............k.","............kkk.","............kkk."])},code:{label:"代码/开发",color:"green",dx:0,pal:{d:"#2b3240",g:"#6ef0a0"},art:Ct(10,[".........kkkkkkk",".........kgddddk",".........kdgdddk",".........kgdggdk",".........kdddddk",".........kkkkkkk"])},gym:{label:"健身/运动",color:"blue",dx:2,pal:{r:"#ff3b5c"},art:Ct(9,["...krrrrrrrrk...","..krrrrrrrrrrkr.","...............r"])}},Nk=Object.keys(ca),Sk=Object.keys(fs);function Rx(l){if(l==="custom")return{prop:"custom",color:"orange"};if(l.startsWith("custom:")){const f=l.slice(7);return Object.hasOwn(fs,f)?{prop:"custom",color:f}:void 0}const[i,c,...u]=l.split(":");if(u.length||!Object.hasOwn(ca,i))return;const d=i;return c===void 0?{prop:d,color:ca[d].color}:Object.hasOwn(fs,c)?{prop:d,color:c}:void 0}function hd(l){return l==="orange"?"custom":`custom:${l}`}const wk=/^#[0-9a-f]{6}$/;function Tk(l){if(!l||typeof l!="object"||Array.isArray(l))return{ok:!1,error:"prop_art 要是一个对象:art(字符串数组)、pal(字母 → 颜色)、dx(0|1|2)"};const{art:i,pal:c,dx:u}=l;if(!Array.isArray(i)||i.length===0)return{ok:!1,error:"prop_art.art 要是非空的字符串数组"};if(i.length>mn)return{ok:!1,error:`prop_art.art 最多 ${mn} 行,收到 ${i.length} 行`};for(const h of i){if(typeof h!="string")return{ok:!1,error:"prop_art.art 的每行都要是字符串"};if([...h].length!==mn)return{ok:!1,error:`prop_art.art 每行要正好 ${mn} 个字符,这一行是 ${[...h].length} 个:「${h}」`}}if(!c||typeof c!="object"||Array.isArray(c))return{ok:!1,error:"prop_art.pal 要是对象:单个小写字母 → #rrggbb"};const d=Object.entries(c);if(d.length>6)return{ok:!1,error:`prop_art.pal 最多 6 种颜色,收到 ${d.length} 种`};for(const[h,v]of d){if(!/^[a-z]$/.test(h))return{ok:!1,error:`pal 的键要是单个小写字母,收到「${h}」`};if(h==="k")return{ok:!1,error:"pal 不能有 k:描边色是固定的,art 里直接用 k 就行"};if("oye".includes(h))return{ok:!1,error:`pal 不能用 ${h}:这是火苗自己的颜色`};if(typeof v!="string"||!wk.test(v))return{ok:!1,error:`pal[${h}] 要是 #rrggbb 格式的颜色,收到「${String(v)}」`}}const f=i.join("");for(const h of new Set([...f].filter(v=>v!==".")))if(h!=="k"&&!Object.hasOwn(c,h))return{ok:!1,error:`art 里的「${h}」没有在 pal 里定义颜色`};const g=[...f].filter(h=>h!==".").length;if(g<6)return{ok:!1,error:`至少要画 6 个像素,现在只有 ${g} 个`};if(u!==0&&u!==1&&u!==2)return{ok:!1,error:`prop_art.dx 要是 0、1 或 2,收到 ${String(u)}`};const p=mn-is.length;for(let h=0;h<is.length;h++)for(let v=0;v<is[h].length;v++){if(is[h][v]!=="e")continue;const b=i[p+h],k=b==null?void 0:b[u+v];if(k&&k!==".")return{ok:!1,error:`art 第 ${p+h+1} 行第 ${u+v+1} 列会盖住火苗的眼睛,把图案挪开(或调小 dx)`}}return{ok:!0,prop:{art:i,pal:c,dx:u}}}function md(l,i){return i===ca[l].color?l:`${l}:${i}`}function Ek(l,i){const c=Rx(l)??{prop:"hob",color:"slate"},u=c.prop==="custom"&&i?Tk(i):void 0,d=c.prop==="custom"?u!=null&&u.ok?u.prop:ca.hob:ca[c.prop],f=fs[c.color],g=[...Array(mn-is.length).fill(""),...is].map((k,S)=>{const E=k?`${".".repeat(d.dx)}${k}`.padEnd(mn,"."):".".repeat(mn),y=d.art[S]??"";return[...E].map((x,N)=>y[N]&&y[N]!=="."?y[N]:x).join("")});let[p,h,v,b]=[mn,mn,0,0];return g.forEach((k,S)=>[...k].forEach((E,y)=>{E!=="."&&([p,h,v,b]=[Math.min(p,y),Math.min(h,S),Math.max(v,y+1),Math.max(b,S+1)])})),{rows:g,pal:{k:Ev,e:Ev,o:f.o,y:f.y,...d.pal},bg:f.bg,offset:[(p+v-mn)/2,(h+b-mn)/2]}}function Ck(l){const i=[];return{body:l.rows.map((u,d)=>[...u].map((f,g)=>f!=="e"?f:(i.push([g,d]),"y")).join("")),eyes:i}}function Cv({art:l}){const i=[];return l.rows.forEach((c,u)=>{for(let d=0;d<c.length;){const f=c[d];let g=d+1;for(;g<c.length&&c[g]===f;)g++;f!=="."&&l.pal[f]&&i.push({x:d,y:u,w:g-d,fill:l.pal[f]}),d=g}}),s.jsx(s.Fragment,{children:i.map((c,u)=>s.jsx("rect",{x:c.x,y:c.y,width:c.w+.02,height:1.02,fill:c.fill},u))})}function vt({sprite:l,prop:i,size:c,title:u,onClick:d,motion:f,busyDot:g}){const p=Ek(l,i),h=f?Ck(p):void 0,v=f?`${-([...l].reduce((b,k)=>(b*31+k.charCodeAt(0))%9973,7)%4e3)/1e3}s`:void 0;return s.jsx("div",{className:`av${f?` av-motion av-${f}`:""}${g?" av-busy":""}`,title:u,onClick:d,style:{width:c,height:c,"--av-bg":p.bg},children:s.jsx("svg",{viewBox:`${p.offset[0]} ${p.offset[1]} 16 16`,shapeRendering:"crispEdges","aria-hidden":"true",style:v?{"--eye-delay":v}:void 0,children:h?s.jsxs(s.Fragment,{children:[s.jsx(Cv,{art:{...p,rows:h.body}}),s.jsx("g",{className:"av-eyes",children:s.jsx("g",{className:"av-blink",children:h.eyes.map(([b,k])=>s.jsx("rect",{x:b,y:k,width:1.02,height:1.02,fill:p.pal.e},`${b}-${k}`))})})]}):s.jsx(Cv,{art:p})})})}var zk=ax();const Ak={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"};function Ok(l){const i=l.lastIndexOf(".");return i===-1?!1:l.slice(i).toLowerCase()in Ak}async function nf(l){try{const i=navigator.clipboard;return i!=null&&i.writeText?(await i.writeText(l),!0):!1}catch{return!1}}const _k="modulepreload",Mk=function(l){return"/"+l},zv={},Rk=function(i,c,u){let d=Promise.resolve();if(c&&c.length>0){let g=function(v){return Promise.all(v.map(b=>Promise.resolve(b).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),h=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));d=g(c.map(v=>{if(v=Mk(v),v in zv)return;zv[v]=!0;const b=v.endsWith(".css"),k=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${k}`))return;const S=document.createElement("link");if(S.rel=b?"stylesheet":_k,b||(S.as="script"),S.crossOrigin="",S.href=v,h&&S.setAttribute("nonce",h),document.head.appendChild(S),b)return new Promise((E,y)=>{S.addEventListener("load",E),S.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${v}`)))})}))}function f(g){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=g,window.dispatchEvent(p),!p.defaultPrevented)throw g}return d.then(g=>{for(const p of g||[])p.status==="rejected"&&f(p.reason);return i().catch(f)})};function lf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var da=lf();function Dx(l){da=l}var vi={exec:()=>null};function Be(l,i=""){let c=typeof l=="string"?l:l.source;const u={replace:(d,f)=>{let g=typeof f=="string"?f:f.source;return g=g.replace(Dt.caret,"$1"),c=c.replace(d,g),u},getRegex:()=>new RegExp(c,i)};return u}var Dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i")},Dk=/^(?:[ \t]*(?:\n|$))+/,Uk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ki=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,af=/(?:[*+-]|\d{1,9}[.)])/,Ux=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hx=Be(Ux).replace(/bull/g,af).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Lk=Be(Ux).replace(/bull/g,af).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),sf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$k=/^[^\n]+/,rf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,qk=Be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yk=Be(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,af).getRegex(),vc="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cf=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gk=Be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",cf).replace("tag",vc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bx=Be(sf).replace("hr",ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vc).getRegex(),Xk=Be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bx).getRegex(),uf={blockquote:Xk,code:Uk,def:qk,fences:Hk,heading:Bk,hr:ki,html:Gk,lheading:Hx,list:Yk,newline:Dk,paragraph:Bx,table:vi,text:$k},Av=Be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vc).getRegex(),Qk={...uf,lheading:Lk,table:Av,paragraph:Be(sf).replace("hr",ki).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Av).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vc).getRegex()},Vk={...uf,html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cf).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Be(sf).replace("hr",ki).replace("heading",` *#{1,6} *[^
86
- ]`).replace("lheading",Hx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lx=/^( {2,}|\\)\n(?!\s*$)/,Jk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xc=/[\p{P}\p{S}]/u,of=/[\s\p{P}\p{S}]/u,$x=/[^\s\p{P}\p{S}]/u,Ik=Be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,of).getRegex(),qx=/(?!~)[\p{P}\p{S}]/u,Fk=/(?!~)[\s\p{P}\p{S}]/u,Wk=/(?:[^\s\p{P}\p{S}]|~)/u,Pk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Yx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,eN=Be(Yx,"u").replace(/punct/g,xc).getRegex(),tN=Be(Yx,"u").replace(/punct/g,qx).getRegex(),Gx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nN=Be(Gx,"gu").replace(/notPunctSpace/g,$x).replace(/punctSpace/g,of).replace(/punct/g,xc).getRegex(),lN=Be(Gx,"gu").replace(/notPunctSpace/g,Wk).replace(/punctSpace/g,Fk).replace(/punct/g,qx).getRegex(),aN=Be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$x).replace(/punctSpace/g,of).replace(/punct/g,xc).getRegex(),sN=Be(/\\(punct)/,"gu").replace(/punct/g,xc).getRegex(),iN=Be(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),rN=Be(cf).replace("(?:-->|$)","-->").getRegex(),cN=Be("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",rN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,uN=Be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",oc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xx=Be(/^!?\[(label)\]\[(ref)\]/).replace("label",oc).replace("ref",rf).getRegex(),Qx=Be(/^!?\[(ref)\](?:\[\])?/).replace("ref",rf).getRegex(),oN=Be("reflink|nolink(?!\\()","g").replace("reflink",Xx).replace("nolink",Qx).getRegex(),df={_backpedal:vi,anyPunctuation:sN,autolink:iN,blockSkip:Pk,br:Lx,code:Kk,del:vi,emStrongLDelim:eN,emStrongRDelimAst:nN,emStrongRDelimUnd:aN,escape:Zk,link:uN,nolink:Qx,punctuation:Ik,reflink:Xx,reflinkSearch:oN,tag:cN,text:Jk,url:vi},dN={...df,link:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",oc).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oc).getRegex()},Ad={...df,emStrongRDelimAst:lN,emStrongLDelim:tN,url:Be(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},fN={...Ad,br:Be(Lx).replace("{2,}","*").getRegex(),text:Be(Ad.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pr={normal:uf,gfm:Qk,pedantic:Vk},di={normal:df,gfm:Ad,breaks:fN,pedantic:dN},hN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ov=l=>hN[l];function Dn(l,i){if(i){if(Dt.escapeTest.test(l))return l.replace(Dt.escapeReplace,Ov)}else if(Dt.escapeTestNoEncode.test(l))return l.replace(Dt.escapeReplaceNoEncode,Ov);return l}function _v(l){try{l=encodeURI(l).replace(Dt.percentDecode,"%")}catch{return null}return l}function Mv(l,i){var f;const c=l.replace(Dt.findPipe,(g,p,h)=>{let v=!1,b=p;for(;--b>=0&&h[b]==="\\";)v=!v;return v?"|":" |"}),u=c.split(Dt.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((f=u.at(-1))!=null&&f.trim())&&u.pop(),i)if(u.length>i)u.splice(i);else for(;u.length<i;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(Dt.slashPipe,"|");return u}function fi(l,i,c){const u=l.length;if(u===0)return"";let d=0;for(;d<u&&l.charAt(u-d-1)===i;)d++;return l.slice(0,u-d)}function mN(l,i){if(l.indexOf(i[1])===-1)return-1;let c=0;for(let u=0;u<l.length;u++)if(l[u]==="\\")u++;else if(l[u]===i[0])c++;else if(l[u]===i[1]&&(c--,c<0))return u;return c>0?-2:-1}function Rv(l,i,c,u,d){const f=i.href,g=i.title||null,p=l[1].replace(d.other.outputLinkReplace,"$1");u.state.inLink=!0;const h={type:l[0].charAt(0)==="!"?"image":"link",raw:c,href:f,title:g,text:p,tokens:u.inlineTokens(p)};return u.state.inLink=!1,h}function pN(l,i,c){const u=l.match(c.other.indentCodeCompensation);if(u===null)return i;const d=u[1];return i.split(`
87
- `).map(f=>{const g=f.match(c.other.beginningSpace);if(g===null)return f;const[p]=g;return p.length>=d.length?f.slice(d.length):f}).join(`
88
- `)}var dc=class{constructor(l){Xe(this,"options");Xe(this,"rules");Xe(this,"lexer");this.options=l||da}space(l){const i=this.rules.block.newline.exec(l);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(l){const i=this.rules.block.code.exec(l);if(i){const c=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?c:fi(c,`
89
- `)}}}fences(l){const i=this.rules.block.fences.exec(l);if(i){const c=i[0],u=pN(c,i[3]||"",this.rules);return{type:"code",raw:c,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:u}}}heading(l){const i=this.rules.block.heading.exec(l);if(i){let c=i[2].trim();if(this.rules.other.endingHash.test(c)){const u=fi(c,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(c=u.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:c,tokens:this.lexer.inline(c)}}}hr(l){const i=this.rules.block.hr.exec(l);if(i)return{type:"hr",raw:fi(i[0],`
90
- `)}}blockquote(l){const i=this.rules.block.blockquote.exec(l);if(i){let c=fi(i[0],`
91
- `).split(`
92
- `),u="",d="";const f=[];for(;c.length>0;){let g=!1;const p=[];let h;for(h=0;h<c.length;h++)if(this.rules.other.blockquoteStart.test(c[h]))p.push(c[h]),g=!0;else if(!g)p.push(c[h]);else break;c=c.slice(h);const v=p.join(`
93
- `),b=v.replace(this.rules.other.blockquoteSetextReplace,`
94
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
95
- ${v}`:v,d=d?`${d}
96
- ${b}`:b;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,f,!0),this.lexer.state.top=k,c.length===0)break;const S=f.at(-1);if((S==null?void 0:S.type)==="code")break;if((S==null?void 0:S.type)==="blockquote"){const E=S,y=E.raw+`
97
- `+c.join(`
98
- `),x=this.blockquote(y);f[f.length-1]=x,u=u.substring(0,u.length-E.raw.length)+x.raw,d=d.substring(0,d.length-E.text.length)+x.text;break}else if((S==null?void 0:S.type)==="list"){const E=S,y=E.raw+`
99
- `+c.join(`
100
- `),x=this.list(y);f[f.length-1]=x,u=u.substring(0,u.length-S.raw.length)+x.raw,d=d.substring(0,d.length-E.raw.length)+x.raw,c=y.substring(f.at(-1).raw.length).split(`
101
- `);continue}}return{type:"blockquote",raw:u,tokens:f,text:d}}}list(l){let i=this.rules.block.list.exec(l);if(i){let c=i[1].trim();const u=c.length>1,d={type:"list",raw:"",ordered:u,start:u?+c.slice(0,-1):"",loose:!1,items:[]};c=u?`\\d{1,9}\\${c.slice(-1)}`:`\\${c}`,this.options.pedantic&&(c=u?c:"[*+-]");const f=this.rules.other.listItemRegex(c);let g=!1;for(;l;){let h=!1,v="",b="";if(!(i=f.exec(l))||this.rules.block.hr.test(l))break;v=i[0],l=l.substring(v.length);let k=i[2].split(`
102
- `,1)[0].replace(this.rules.other.listReplaceTabs,z=>" ".repeat(3*z.length)),S=l.split(`
103
- `,1)[0],E=!k.trim(),y=0;if(this.options.pedantic?(y=2,b=k.trimStart()):E?y=i[1].length+1:(y=i[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,b=k.slice(y),y+=i[1].length),E&&this.rules.other.blankLine.test(S)&&(v+=S+`
104
- `,l=l.substring(S.length+1),h=!0),!h){const z=this.rules.other.nextBulletRegex(y),O=this.rules.other.hrRegex(y),X=this.rules.other.fencesBeginRegex(y),P=this.rules.other.headingBeginRegex(y),te=this.rules.other.htmlBeginRegex(y);for(;l;){const V=l.split(`
105
- `,1)[0];let $;if(S=V,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),$=S):$=S.replace(this.rules.other.tabCharGlobal," "),X.test(S)||P.test(S)||te.test(S)||z.test(S)||O.test(S))break;if($.search(this.rules.other.nonSpaceChar)>=y||!S.trim())b+=`
106
- `+$.slice(y);else{if(E||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(k)||P.test(k)||O.test(k))break;b+=`
107
- `+S}!E&&!S.trim()&&(E=!0),v+=V+`
108
- `,l=l.substring(V.length+1),k=$.slice(y)}}d.loose||(g?d.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(g=!0));let x=null,N;this.options.gfm&&(x=this.rules.other.listIsTask.exec(b),x&&(N=x[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:v,task:!!x,checked:N,loose:!1,text:b,tokens:[]}),d.raw+=v}const p=d.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let h=0;h<d.items.length;h++)if(this.lexer.state.top=!1,d.items[h].tokens=this.lexer.blockTokens(d.items[h].text,[]),!d.loose){const v=d.items[h].tokens.filter(k=>k.type==="space"),b=v.length>0&&v.some(k=>this.rules.other.anyLine.test(k.raw));d.loose=b}if(d.loose)for(let h=0;h<d.items.length;h++)d.items[h].loose=!0;return d}}html(l){const i=this.rules.block.html.exec(l);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(l){const i=this.rules.block.def.exec(l);if(i){const c=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:c,raw:i[0],href:u,title:d}}}table(l){var g;const i=this.rules.block.table.exec(l);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;const c=Mv(i[1]),u=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(g=i[3])!=null&&g.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
109
- `):[],f={type:"table",raw:i[0],header:[],align:[],rows:[]};if(c.length===u.length){for(const p of u)this.rules.other.tableAlignRight.test(p)?f.align.push("right"):this.rules.other.tableAlignCenter.test(p)?f.align.push("center"):this.rules.other.tableAlignLeft.test(p)?f.align.push("left"):f.align.push(null);for(let p=0;p<c.length;p++)f.header.push({text:c[p],tokens:this.lexer.inline(c[p]),header:!0,align:f.align[p]});for(const p of d)f.rows.push(Mv(p,f.header.length).map((h,v)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:f.align[v]})));return f}}lheading(l){const i=this.rules.block.lheading.exec(l);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(l){const i=this.rules.block.paragraph.exec(l);if(i){const c=i[1].charAt(i[1].length-1)===`
110
- `?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:c,tokens:this.lexer.inline(c)}}}text(l){const i=this.rules.block.text.exec(l);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(l){const i=this.rules.inline.escape.exec(l);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(l){const i=this.rules.inline.tag.exec(l);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(l){const i=this.rules.inline.link.exec(l);if(i){const c=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(c)){if(!this.rules.other.endAngleBracket.test(c))return;const f=fi(c.slice(0,-1),"\\");if((c.length-f.length)%2===0)return}else{const f=mN(i[2],"()");if(f===-2)return;if(f>-1){const p=(i[0].indexOf("!")===0?5:4)+i[1].length+f;i[2]=i[2].substring(0,f),i[0]=i[0].substring(0,p).trim(),i[3]=""}}let u=i[2],d="";if(this.options.pedantic){const f=this.rules.other.pedanticHrefTitle.exec(u);f&&(u=f[1],d=f[3])}else d=i[3]?i[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(c)?u=u.slice(1):u=u.slice(1,-1)),Rv(i,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(l,i){let c;if((c=this.rules.inline.reflink.exec(l))||(c=this.rules.inline.nolink.exec(l))){const u=(c[2]||c[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=i[u.toLowerCase()];if(!d){const f=c[0].charAt(0);return{type:"text",raw:f,text:f}}return Rv(c,d,c[0],this.lexer,this.rules)}}emStrong(l,i,c=""){let u=this.rules.inline.emStrongLDelim.exec(l);if(!u||u[3]&&c.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!c||this.rules.inline.punctuation.exec(c)){const f=[...u[0]].length-1;let g,p,h=f,v=0;const b=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,i=i.slice(-1*l.length+f);(u=b.exec(i))!=null;){if(g=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!g)continue;if(p=[...g].length,u[3]||u[4]){h+=p;continue}else if((u[5]||u[6])&&f%3&&!((f+p)%3)){v+=p;continue}if(h-=p,h>0)continue;p=Math.min(p,p+h+v);const k=[...u[0]][0].length,S=l.slice(0,f+u.index+k+p);if(Math.min(f,p)%2){const y=S.slice(1,-1);return{type:"em",raw:S,text:y,tokens:this.lexer.inlineTokens(y)}}const E=S.slice(2,-2);return{type:"strong",raw:S,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(l){const i=this.rules.inline.code.exec(l);if(i){let c=i[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(c),d=this.rules.other.startingSpaceChar.test(c)&&this.rules.other.endingSpaceChar.test(c);return u&&d&&(c=c.substring(1,c.length-1)),{type:"codespan",raw:i[0],text:c}}}br(l){const i=this.rules.inline.br.exec(l);if(i)return{type:"br",raw:i[0]}}del(l){const i=this.rules.inline.del.exec(l);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(l){const i=this.rules.inline.autolink.exec(l);if(i){let c,u;return i[2]==="@"?(c=i[1],u="mailto:"+c):(c=i[1],u=c),{type:"link",raw:i[0],text:c,href:u,tokens:[{type:"text",raw:c,text:c}]}}}url(l){var c;let i;if(i=this.rules.inline.url.exec(l)){let u,d;if(i[2]==="@")u=i[0],d="mailto:"+u;else{let f;do f=i[0],i[0]=((c=this.rules.inline._backpedal.exec(i[0]))==null?void 0:c[0])??"";while(f!==i[0]);u=i[0],i[1]==="www."?d="http://"+i[0]:d=i[0]}return{type:"link",raw:i[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(l){const i=this.rules.inline.text.exec(l);if(i){const c=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:c}}}},Pn=class Od{constructor(i){Xe(this,"tokens");Xe(this,"options");Xe(this,"state");Xe(this,"tokenizer");Xe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||da,this.options.tokenizer=this.options.tokenizer||new dc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const c={other:Dt,block:Pr.normal,inline:di.normal};this.options.pedantic?(c.block=Pr.pedantic,c.inline=di.pedantic):this.options.gfm&&(c.block=Pr.gfm,this.options.breaks?c.inline=di.breaks:c.inline=di.gfm),this.tokenizer.rules=c}static get rules(){return{block:Pr,inline:di}}static lex(i,c){return new Od(c).lex(i)}static lexInline(i,c){return new Od(c).inlineTokens(i)}lex(i){i=i.replace(Dt.carriageReturn,`
111
- `),this.blockTokens(i,this.tokens);for(let c=0;c<this.inlineQueue.length;c++){const u=this.inlineQueue[c];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,c=[],u=!1){var d,f,g;for(this.options.pedantic&&(i=i.replace(Dt.tabCharGlobal," ").replace(Dt.spaceLine,""));i;){let p;if((f=(d=this.options.extensions)==null?void 0:d.block)!=null&&f.some(v=>(p=v.call({lexer:this},i,c))?(i=i.substring(p.raw.length),c.push(p),!0):!1))continue;if(p=this.tokenizer.space(i)){i=i.substring(p.raw.length);const v=c.at(-1);p.raw.length===1&&v!==void 0?v.raw+=`
112
- `:c.push(p);continue}if(p=this.tokenizer.code(i)){i=i.substring(p.raw.length);const v=c.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
113
- `+p.raw,v.text+=`
114
- `+p.text,this.inlineQueue.at(-1).src=v.text):c.push(p);continue}if(p=this.tokenizer.fences(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.heading(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.hr(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.blockquote(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.list(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.html(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.def(i)){i=i.substring(p.raw.length);const v=c.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
115
- `+p.raw,v.text+=`
116
- `+p.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title});continue}if(p=this.tokenizer.table(i)){i=i.substring(p.raw.length),c.push(p);continue}if(p=this.tokenizer.lheading(i)){i=i.substring(p.raw.length),c.push(p);continue}let h=i;if((g=this.options.extensions)!=null&&g.startBlock){let v=1/0;const b=i.slice(1);let k;this.options.extensions.startBlock.forEach(S=>{k=S.call({lexer:this},b),typeof k=="number"&&k>=0&&(v=Math.min(v,k))}),v<1/0&&v>=0&&(h=i.substring(0,v+1))}if(this.state.top&&(p=this.tokenizer.paragraph(h))){const v=c.at(-1);u&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=`
117
- `+p.raw,v.text+=`
118
- `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):c.push(p),u=h.length!==i.length,i=i.substring(p.raw.length);continue}if(p=this.tokenizer.text(i)){i=i.substring(p.raw.length);const v=c.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=`
119
- `+p.raw,v.text+=`
120
- `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):c.push(p);continue}if(i){const v="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,c}inline(i,c=[]){return this.inlineQueue.push({src:i,tokens:c}),c}inlineTokens(i,c=[]){var p,h,v;let u=i,d=null;if(this.tokens.links){const b=Object.keys(this.tokens.links);if(b.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)b.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let f=!1,g="";for(;i;){f||(g=""),f=!1;let b;if((h=(p=this.options.extensions)==null?void 0:p.inline)!=null&&h.some(S=>(b=S.call({lexer:this},i,c))?(i=i.substring(b.raw.length),c.push(b),!0):!1))continue;if(b=this.tokenizer.escape(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.tag(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.link(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(b.raw.length);const S=c.at(-1);b.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=b.raw,S.text+=b.text):c.push(b);continue}if(b=this.tokenizer.emStrong(i,u,g)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.codespan(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.br(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.del(i)){i=i.substring(b.raw.length),c.push(b);continue}if(b=this.tokenizer.autolink(i)){i=i.substring(b.raw.length),c.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(i))){i=i.substring(b.raw.length),c.push(b);continue}let k=i;if((v=this.options.extensions)!=null&&v.startInline){let S=1/0;const E=i.slice(1);let y;this.options.extensions.startInline.forEach(x=>{y=x.call({lexer:this},E),typeof y=="number"&&y>=0&&(S=Math.min(S,y))}),S<1/0&&S>=0&&(k=i.substring(0,S+1))}if(b=this.tokenizer.inlineText(k)){i=i.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(g=b.raw.slice(-1)),f=!0;const S=c.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=b.raw,S.text+=b.text):c.push(b);continue}if(i){const S="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return c}},fc=class{constructor(l){Xe(this,"options");Xe(this,"parser");this.options=l||da}space(l){return""}code({text:l,lang:i,escaped:c}){var f;const u=(f=(i||"").match(Dt.notSpaceStart))==null?void 0:f[0],d=l.replace(Dt.endingNewline,"")+`
121
- `;return u?'<pre><code class="language-'+Dn(u)+'">'+(c?d:Dn(d,!0))+`</code></pre>
122
- `:"<pre><code>"+(c?d:Dn(d,!0))+`</code></pre>
123
- `}blockquote({tokens:l}){return`<blockquote>
124
- ${this.parser.parse(l)}</blockquote>
125
- `}html({text:l}){return l}heading({tokens:l,depth:i}){return`<h${i}>${this.parser.parseInline(l)}</h${i}>
126
- `}hr(l){return`<hr>
127
- `}list(l){const i=l.ordered,c=l.start;let u="";for(let g=0;g<l.items.length;g++){const p=l.items[g];u+=this.listitem(p)}const d=i?"ol":"ul",f=i&&c!==1?' start="'+c+'"':"";return"<"+d+f+`>
128
- `+u+"</"+d+`>
129
- `}listitem(l){var c;let i="";if(l.task){const u=this.checkbox({checked:!!l.checked});l.loose?((c=l.tokens[0])==null?void 0:c.type)==="paragraph"?(l.tokens[0].text=u+" "+l.tokens[0].text,l.tokens[0].tokens&&l.tokens[0].tokens.length>0&&l.tokens[0].tokens[0].type==="text"&&(l.tokens[0].tokens[0].text=u+" "+Dn(l.tokens[0].tokens[0].text),l.tokens[0].tokens[0].escaped=!0)):l.tokens.unshift({type:"text",raw:u+" ",text:u+" ",escaped:!0}):i+=u+" "}return i+=this.parser.parse(l.tokens,!!l.loose),`<li>${i}</li>
130
- `}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
131
- `}table(l){let i="",c="";for(let d=0;d<l.header.length;d++)c+=this.tablecell(l.header[d]);i+=this.tablerow({text:c});let u="";for(let d=0;d<l.rows.length;d++){const f=l.rows[d];c="";for(let g=0;g<f.length;g++)c+=this.tablecell(f[g]);u+=this.tablerow({text:c})}return u&&(u=`<tbody>${u}</tbody>`),`<table>
132
- <thead>
133
- `+i+`</thead>
134
- `+u+`</table>
135
- `}tablerow({text:l}){return`<tr>
136
- ${l}</tr>
137
- `}tablecell(l){const i=this.parser.parseInline(l.tokens),c=l.header?"th":"td";return(l.align?`<${c} align="${l.align}">`:`<${c}>`)+i+`</${c}>
138
- `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Dn(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:i,tokens:c}){const u=this.parser.parseInline(c),d=_v(l);if(d===null)return u;l=d;let f='<a href="'+l+'"';return i&&(f+=' title="'+Dn(i)+'"'),f+=">"+u+"</a>",f}image({href:l,title:i,text:c,tokens:u}){u&&(c=this.parser.parseInline(u,this.parser.textRenderer));const d=_v(l);if(d===null)return Dn(c);l=d;let f=`<img src="${l}" alt="${c}"`;return i&&(f+=` title="${Dn(i)}"`),f+=">",f}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Dn(l.text)}},ff=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}},el=class _d{constructor(i){Xe(this,"options");Xe(this,"renderer");Xe(this,"textRenderer");this.options=i||da,this.options.renderer=this.options.renderer||new fc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ff}static parse(i,c){return new _d(c).parse(i)}static parseInline(i,c){return new _d(c).parseInline(i)}parse(i,c=!0){var d,f;let u="";for(let g=0;g<i.length;g++){const p=i[g];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[p.type]){const v=p,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(v.type)){u+=b||"";continue}}const h=p;switch(h.type){case"space":{u+=this.renderer.space(h);continue}case"hr":{u+=this.renderer.hr(h);continue}case"heading":{u+=this.renderer.heading(h);continue}case"code":{u+=this.renderer.code(h);continue}case"table":{u+=this.renderer.table(h);continue}case"blockquote":{u+=this.renderer.blockquote(h);continue}case"list":{u+=this.renderer.list(h);continue}case"html":{u+=this.renderer.html(h);continue}case"paragraph":{u+=this.renderer.paragraph(h);continue}case"text":{let v=h,b=this.renderer.text(v);for(;g+1<i.length&&i[g+1].type==="text";)v=i[++g],b+=`
139
- `+this.renderer.text(v);c?u+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):u+=b;continue}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}parseInline(i,c=this.renderer){var d,f;let u="";for(let g=0;g<i.length;g++){const p=i[g];if((f=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&f[p.type]){const v=this.options.extensions.renderers[p.type].call({parser:this},p);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){u+=v||"";continue}}const h=p;switch(h.type){case"escape":{u+=c.text(h);break}case"html":{u+=c.html(h);break}case"link":{u+=c.link(h);break}case"image":{u+=c.image(h);break}case"strong":{u+=c.strong(h);break}case"em":{u+=c.em(h);break}case"codespan":{u+=c.codespan(h);break}case"br":{u+=c.br(h);break}case"del":{u+=c.del(h);break}case"text":{u+=c.text(h);break}default:{const v='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}},kd,lc=(kd=class{constructor(l){Xe(this,"options");Xe(this,"block");this.options=l||da}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}provideLexer(){return this.block?Pn.lex:Pn.lexInline}provideParser(){return this.block?el.parse:el.parseInline}},Xe(kd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),kd),Vx=class{constructor(...l){Xe(this,"defaults",lf());Xe(this,"options",this.setOptions);Xe(this,"parse",this.parseMarkdown(!0));Xe(this,"parseInline",this.parseMarkdown(!1));Xe(this,"Parser",el);Xe(this,"Renderer",fc);Xe(this,"TextRenderer",ff);Xe(this,"Lexer",Pn);Xe(this,"Tokenizer",dc);Xe(this,"Hooks",lc);this.use(...l)}walkTokens(l,i){var u,d;let c=[];for(const f of l)switch(c=c.concat(i.call(this,f)),f.type){case"table":{const g=f;for(const p of g.header)c=c.concat(this.walkTokens(p.tokens,i));for(const p of g.rows)for(const h of p)c=c.concat(this.walkTokens(h.tokens,i));break}case"list":{const g=f;c=c.concat(this.walkTokens(g.items,i));break}default:{const g=f;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[g.type]?this.defaults.extensions.childTokens[g.type].forEach(p=>{const h=g[p].flat(1/0);c=c.concat(this.walkTokens(h,i))}):g.tokens&&(c=c.concat(this.walkTokens(g.tokens,i)))}}return c}use(...l){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(c=>{const u={...c};if(u.async=this.defaults.async||u.async||!1,c.extensions&&(c.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const f=i.renderers[d.name];f?i.renderers[d.name]=function(...g){let p=d.renderer.apply(this,g);return p===!1&&(p=f.apply(this,g)),p}:i.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const f=i[d.level];f?f.unshift(d.tokenizer):i[d.level]=[d.tokenizer],d.start&&(d.level==="block"?i.startBlock?i.startBlock.push(d.start):i.startBlock=[d.start]:d.level==="inline"&&(i.startInline?i.startInline.push(d.start):i.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(i.childTokens[d.name]=d.childTokens)}),u.extensions=i),c.renderer){const d=this.defaults.renderer||new fc(this.defaults);for(const f in c.renderer){if(!(f in d))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;const g=f,p=c.renderer[g],h=d[g];d[g]=(...v)=>{let b=p.apply(d,v);return b===!1&&(b=h.apply(d,v)),b||""}}u.renderer=d}if(c.tokenizer){const d=this.defaults.tokenizer||new dc(this.defaults);for(const f in c.tokenizer){if(!(f in d))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;const g=f,p=c.tokenizer[g],h=d[g];d[g]=(...v)=>{let b=p.apply(d,v);return b===!1&&(b=h.apply(d,v)),b}}u.tokenizer=d}if(c.hooks){const d=this.defaults.hooks||new lc;for(const f in c.hooks){if(!(f in d))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;const g=f,p=c.hooks[g],h=d[g];lc.passThroughHooks.has(f)?d[g]=v=>{if(this.defaults.async)return Promise.resolve(p.call(d,v)).then(k=>h.call(d,k));const b=p.call(d,v);return h.call(d,b)}:d[g]=(...v)=>{let b=p.apply(d,v);return b===!1&&(b=h.apply(d,v)),b}}u.hooks=d}if(c.walkTokens){const d=this.defaults.walkTokens,f=c.walkTokens;u.walkTokens=function(g){let p=[];return p.push(f.call(this,g)),d&&(p=p.concat(d.call(this,g))),p}}this.defaults={...this.defaults,...u}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,i){return Pn.lex(l,i??this.defaults)}parser(l,i){return el.parse(l,i??this.defaults)}parseMarkdown(l){return(c,u)=>{const d={...u},f={...this.defaults,...d},g=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&d.async===!1)return g(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof c>"u"||c===null)return g(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return g(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));f.hooks&&(f.hooks.options=f,f.hooks.block=l);const p=f.hooks?f.hooks.provideLexer():l?Pn.lex:Pn.lexInline,h=f.hooks?f.hooks.provideParser():l?el.parse:el.parseInline;if(f.async)return Promise.resolve(f.hooks?f.hooks.preprocess(c):c).then(v=>p(v,f)).then(v=>f.hooks?f.hooks.processAllTokens(v):v).then(v=>f.walkTokens?Promise.all(this.walkTokens(v,f.walkTokens)).then(()=>v):v).then(v=>h(v,f)).then(v=>f.hooks?f.hooks.postprocess(v):v).catch(g);try{f.hooks&&(c=f.hooks.preprocess(c));let v=p(c,f);f.hooks&&(v=f.hooks.processAllTokens(v)),f.walkTokens&&this.walkTokens(v,f.walkTokens);let b=h(v,f);return f.hooks&&(b=f.hooks.postprocess(b)),b}catch(v){return g(v)}}}onError(l,i){return c=>{if(c.message+=`
140
- Please report this to https://github.com/markedjs/marked.`,l){const u="<p>An error occurred:</p><pre>"+Dn(c.message+"",!0)+"</pre>";return i?Promise.resolve(u):u}if(i)return Promise.reject(c);throw c}}},ua=new Vx;function Qe(l,i){return ua.parse(l,i)}Qe.options=Qe.setOptions=function(l){return ua.setOptions(l),Qe.defaults=ua.defaults,Dx(Qe.defaults),Qe};Qe.getDefaults=lf;Qe.defaults=da;Qe.use=function(...l){return ua.use(...l),Qe.defaults=ua.defaults,Dx(Qe.defaults),Qe};Qe.walkTokens=function(l,i){return ua.walkTokens(l,i)};Qe.parseInline=ua.parseInline;Qe.Parser=el;Qe.parser=el.parse;Qe.Renderer=fc;Qe.TextRenderer=ff;Qe.Lexer=Pn;Qe.lexer=Pn.lex;Qe.Tokenizer=dc;Qe.Hooks=lc;Qe.parse=Qe;Qe.options;Qe.setOptions;Qe.use;Qe.walkTokens;Qe.parseInline;el.parse;Pn.lex;function xi(l){return l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let Md,gN;function vN(){return gN??(gN=Rk(()=>import("./math-zZ4JA8eM.js"),__vite__mapDeps([0,1])).then(l=>{Md=l.default}))}function xN(l){let i=!1;return hc.walkTokens(hc.lexer(l),c=>{(c.type==="inlineMath"||c.type==="displayMath")&&(i=!0)}),i}function Dv(l,i,c){if(!Md)return xi(c);try{return Md.renderToString(l,{displayMode:i,throwOnError:!0,trust:!1})}catch{return xi(c)}}const hc=new Vx({extensions:[{name:"displayMath",level:"block",start(l){return l.search(/\$\$|\\\[/)},tokenizer(l){const i=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])(?:\n|$)/.exec(l);if(i)return{type:"displayMath",raw:i[0],text:i[1]??i[2]}},renderer(l){return`<div class="math-display">${Dv(String(l.text),!0,l.raw.trimEnd())}</div>`}},{name:"inlineMath",level:"inline",start(l){return l.search(/\$|\\\(/)},tokenizer(l){const i=/^(?:\$(?!\$|\s)([^$`\n]*?[^$`\s])\$(?!\d)|\\\((.+?)\\\))/.exec(l);if(i)return{type:"inlineMath",raw:i[0],text:i[1]??i[2]}},renderer(l){return Dv(String(l.text),!1,l.raw)}}],renderer:{html(l){return xi(l.text??"")},code(l){var u;const i=((u=l.lang)==null?void 0:u.trim().split(/\s+/)[0])??"";return`<div class="code-block">${i?`<div class="code-head">${xi(i)}</div>`:""}<button type="button" class="code-copy" aria-label="复制代码" title="复制代码">${zd("copy",15)}</button><pre><code>${xi(l.text)}
141
- </code></pre></div>`}}}),bN=/^(https?:|mailto:|\/|#|\.)/i;function yN(l){return hc.parse(l,{async:!1,gfm:!0,breaks:!0}).replace(/<a href="([^"]*)"/g,(c,u)=>bN.test(u.trim())?`<a target="_blank" rel="noreferrer" href="${u}"`:"<a")}function jN(l){const i=[];for(const u of hc.lexer(l,{gfm:!0})){const d=u.type==="table",f=i.at(-1);f&&!f.table&&!d?f.md+=u.raw:i.push({table:d,md:u.raw})}const c=i.filter(u=>u.table||u.md.trim());return c.length?c:[{table:!1,md:l}]}function hs({text:l,className:i,streaming:c}){const[,u]=w.useState(0);return w.useEffect(()=>{let d=!0;return xN(l)&&vN().then(()=>{d&&u(f=>f+1)}).catch(()=>{}),()=>{d=!1}},[l]),s.jsx("div",{className:i,onClick:d=>{var p,h;const f=d.target.closest(".code-copy");if(!f)return;d.stopPropagation();const g=((h=(p=f.closest(".code-block"))==null?void 0:p.querySelector("code"))==null?void 0:h.textContent)??"";nf(g.endsWith(`
142
- `)?g.slice(0,-1):g).then(v=>{if(!v){gc("复制失败:浏览器不允许写入剪贴板");return}f.innerHTML=zd("check",15),f.setAttribute("aria-label","已复制"),window.setTimeout(()=>{f.innerHTML=zd("copy",15),f.setAttribute("aria-label","复制代码")},1500)})},dangerouslySetInnerHTML:{__html:yN(l)+(c?'<span class="cur"></span>':"")}})}const kN={".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".webp":"image",".avif":"image",".bmp":"image",".ico":"image",".svg":"svg",".pdf":"pdf",".mp3":"audio",".wav":"audio",".ogg":"audio",".m4a":"audio",".flac":"audio",".aac":"audio",".mp4":"video",".webm":"video",".mov":"video",".m4v":"video",".md":"markdown",".markdown":"markdown",".json":"json",".jsonl":"json",".ndjson":"json",".csv":"csv",".tsv":"csv",".html":"html",".htm":"html",".xml":"xml",".ts":"code",".tsx":"code",".js":"code",".jsx":"code",".mjs":"code",".cjs":"code",".py":"code",".sh":"code",".bash":"code",".zsh":"code",".go":"code",".rs":"code",".java":"code",".kt":"code",".swift":"code",".c":"code",".h":"code",".cc":"code",".cpp":"code",".hpp":"code",".cs":"code",".rb":"code",".php":"code",".scala":"code",".lua":"code",".pl":"code",".css":"code",".scss":"code",".less":"code",".vue":"code",".svelte":"code",".yaml":"code",".yml":"code",".toml":"code",".ini":"code",".conf":"code",".cfg":"code",".properties":"code",".sql":"code",".graphql":"code",".proto":"code",".diff":"code",".patch":"code",".log":"text",".txt":"text",".text":"text"};function NN(l){const i=l.lastIndexOf(".");return i>0?l.slice(i).toLowerCase():""}function SN(l){return kN[NN(l)]}function wN(l,i){return Array.from({length:i},(c,u)=>{const d=Math.floor(u*l.length/i),f=Math.floor((u+1)*l.length/i);let g=0;for(let p=d;p<f;p++)g=Math.max(g,Math.abs(l[p]));return g})}let as=null;function TN({path:l,name:i,fallback:c}){const u=w.useRef(null),[d,f]=w.useState(null),[g,p]=w.useState(0),[h,v]=w.useState(0),[b,k]=w.useState(!0),[S,E]=w.useState(1);w.useEffect(()=>{const N=new AbortController;let z;return(async()=>{var O;try{const X=await fetch(Rt(l),{signal:N.signal});if(!X.ok||Number(X.headers.get("content-length"))>20*1024*1024)return;const P=(O=X.body)==null?void 0:O.getReader();if(!P)return;const te=[];let V=0;for(;;){const{done:Se,value:Le}=await P.read();if(Se)break;if(V+=Le.byteLength,V>20*1024*1024){await P.cancel();return}te.push(Le)}const $=new Uint8Array(V);let L=0;for(const Se of te)$.set(Se,L),L+=Se.byteLength;z=new AudioContext;const ue=await z.decodeAudioData($.buffer);N.signal.aborted||f(wN(ue.getChannelData(0),50))}catch{}finally{z&&z.close()}})(),()=>{N.abort(),as===u.current&&(as=null)}},[l]);const y=h?Math.min(1,g/h):0,x=N=>`${Math.floor(N/60)}:${String(Math.floor(N%60)).padStart(2,"0")}`;return s.jsxs("div",{className:"media-audio",children:[s.jsx("audio",{ref:u,src:Rt(l),preload:"metadata",onError:c,onPlay:N=>{as&&as!==N.currentTarget&&as.pause(),as=N.currentTarget,k(!1)},onPause:()=>k(!0),onTimeUpdate:N=>p(N.currentTarget.currentTime),onLoadedMetadata:N=>v(N.currentTarget.duration)}),s.jsx("button",{className:"audio-play","aria-label":b?"播放":"暂停",onClick:()=>{const N=u.current;N&&(N.paused?N.play().catch(c):N.pause())},children:s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",fill:"currentColor",children:b?s.jsx("path",{d:"M8.5 5.8v12.4a1 1 0 0 0 1.5.86l10-6.2a1 1 0 0 0 0-1.72l-10-6.2a1 1 0 0 0-1.5.86Z"}):s.jsx("path",{d:"M7 5h3.5v14H7zM13.5 5H17v14h-3.5z"})})}),s.jsxs("div",{className:"audio-main",children:[s.jsx("button",{className:"audio-name",onClick:()=>_l(l,i),children:i}),s.jsxs("div",{className:"audio-track",children:[d?s.jsx("div",{className:"audio-bars","aria-hidden":"true",children:d.map((N,z)=>s.jsx("i",{className:z/d.length<y?"played":"",style:{height:`${Math.max(12,N*100)}%`}},z))}):s.jsx("div",{className:"audio-line",children:s.jsx("i",{style:{width:`${y*100}%`}})}),s.jsx("input",{type:"range","aria-label":"播放进度",min:0,max:h||0,step:"0.01",value:Math.min(g,h||0),onChange:N=>{u.current&&(u.current.currentTime=Number(N.target.value))}})]})]}),s.jsx("span",{className:"audio-time",children:x(h||0)}),s.jsxs("button",{className:"audio-rate",onClick:()=>{const N=S===1?1.5:S===1.5?2:1;E(N),u.current&&(u.current.playbackRate=N)},children:[S,"×"]})]})}function Uv({path:l,name:i,fallback:c}){const[u,d]=w.useState(!1);if(u)return c;const f=SN(l);return f==="audio"?s.jsx(TN,{path:l,name:i,fallback:()=>d(!0)}):f==="video"?s.jsxs("div",{className:"media-video",children:[s.jsx("video",{controls:!0,playsInline:!0,preload:"metadata",src:Rt(l),onError:()=>d(!0)}),s.jsx("button",{onClick:()=>_l(l,i),children:i})]}):c}const Zx={};for(const[l,i]of Object.entries({image:"png jpg jpeg gif webp bmp ico avif",table:"csv tsv xls xlsx ods",code:"ts tsx js jsx mjs cjs py go sh bash zsh json jsonl yaml yml toml xml css scss java c cpp h rs rb php sql vue svelte",doc:"md markdown txt pdf doc docx odt rtf",globe:"html htm svg",archive:"zip rar 7z tar gz bz2 xz tgz"}))for(const c of i.split(" "))Zx[c]=l;function hf(l){const i=l.split(/[\\/]/).pop()??"",c=i.lastIndexOf(".");return c>0?Zx[i.slice(c+1).toLowerCase()]??"file":"file"}const Kx=["日","一","二","三","四","五","六"];function mi(l){return`${String(l.getHours()).padStart(2,"0")}:${String(l.getMinutes()).padStart(2,"0")}`}function mf(l,i){const c=new Date(l),u=new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),d=new Date(c.getFullYear(),c.getMonth(),c.getDate()).getTime();return Math.round((u-d)/864e5)}function Ol(l,i=new Date){const c=new Date(l);if(Number.isNaN(c.getTime()))return"";const u=mf(l,i);return u===0?`今天 ${mi(c)}`:u===1?`昨天 ${mi(c)}`:u===-1?`明天 ${mi(c)}`:`${c.getMonth()+1}月${c.getDate()}日 ${mi(c)}`}function ac(l,i=new Date){if(!l)return"";const c=new Date(l);if(Number.isNaN(c.getTime()))return"";const u=mf(l,i);return u===0?mi(c):u===1?"昨天":`${c.getMonth()+1}月${c.getDate()}日`}function pf(l,i=Date.now()){const c=Math.max(0,Math.round((i-new Date(l).getTime())/6e4));if(c<1)return"刚刚";if(c<60)return`${c} 分钟`;const u=Math.floor(c/60),d=c%60;return d?`${u} 小时 ${d} 分钟`:`${u} 小时`}function bc(l){const i=Math.max(0,Math.round(l/1e3));if(i<60)return`${i} 秒`;const c=Math.floor(i/60);if(c<60){const u=i%60;return u?`${c} 分 ${u} 秒`:`${c} 分钟`}return`${Math.floor(c/60)} 小时 ${c%60} 分钟`}function Hv(l){if(l<1e3)return String(l);const i=l/1e3;return`${i<10?i.toFixed(1):Math.round(i)}k`}function gf(l){return l<1024?`${l} B`:l<1024*1024?`${l<10240?(l/1024).toFixed(1):Math.round(l/1024)} KB`:l<1024*1024*1024?`${(l/1024/1024).toFixed(1)} MB`:`${(l/1024/1024/1024).toFixed(1)} GB`}function EN(l,i=new Date){return mf(l,i)===0}function CN(l,i){return l?new Date(i).getTime()-new Date(l).getTime()>300*1e3:!1}function vf(l){const i={kind:"raw",hour:9,minute:0,weekday:5,day:1,raw:l},c=l.trim().split(/\s+/);if(c.length!==5)return i;const[u,d,f,g,p]=c;if(!/^\d+$/.test(u)||!/^\d+$/.test(d)||g!=="*")return i;const h=Number(u),v=Number(d);return h>59||v>23?i:f==="*"&&p==="*"?{...i,kind:"daily",hour:v,minute:h}:f==="*"&&/^\d$/.test(p)?{...i,kind:"weekly",hour:v,minute:h,weekday:Number(p)}:/^\d{1,2}$/.test(f)&&p==="*"?{...i,kind:"monthly",hour:v,minute:h,day:Number(f)}:i}function zN(l){const i=String(l.minute).padStart(2,"0"),c=String(l.hour).padStart(2,"0");return l.kind==="daily"?`${l.minute} ${l.hour} * * *`:l.kind==="weekly"?`${l.minute} ${l.hour} * * ${l.weekday}`:l.kind==="monthly"?`${l.minute} ${l.hour} ${l.day} * *`:l.raw.trim()||`${i} ${c} * * *`}function xf(l){const i=vf(l),c=`${String(i.hour).padStart(2,"0")}:${String(i.minute).padStart(2,"0")}`;return i.kind==="daily"?`每天 ${c}`:i.kind==="weekly"?`每周${Kx[i.weekday]??"?"} ${c}`:i.kind==="monthly"?`每月${i.day}日 ${c}`:l}function AN(l,i,c){const u=i-l.x,d=c-l.y;let f=l.direction;return f==="pending"&&Math.hypot(u,d)>8&&(u<-8&&Math.abs(u)>Math.abs(d)*1.5?f="horizontal":(Math.abs(d)>Math.abs(u)||u>8)&&(f="vertical")),{...l,direction:f,distance:f==="horizontal"?Math.max(0,-u):0}}function Bv(l){return l.direction==="horizontal"&&l.distance>48}function ON(l,i){return{top:l.bottom+8+92<=i.bottom?l.bottom+8:Math.max(i.top+8,l.top-92-8),left:Math.max(i.left+8,Math.min(l.right-160,i.right-168))}}function _N(l,i){return i.type==="open"?i.id:i.type==="outside"&&i.inside?l:null}const MN={memory:"mem",rule:"rule",routine:"clock",split:"split",info:"info"};function Rd(l){return l.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`#>]/g,"").trim()}function RN(){const[l,i]=w.useState(()=>window.matchMedia("(hover: none)").matches);return w.useEffect(()=>{const c=window.matchMedia("(hover: none)"),u=()=>i(c.matches);return c.addEventListener("change",u),()=>c.removeEventListener("change",u)},[]),l}function Dd({text:l,itemId:i,menu:c=!1,close:u}){const[d,f]=w.useState(!1),g=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(g.current),[]);const p=async()=>{if(!await nf(l)){gc("复制失败:浏览器不允许写入剪贴板");return}if(c){u==null||u();return}f(!0),window.clearTimeout(g.current),g.current=window.setTimeout(()=>f(!1),1500)};return s.jsxs("div",{className:`tools${c?" menu":""}`,children:[s.jsxs("button",{title:"回复","aria-label":"回复",onClick:()=>{cc({itemId:i,text:Rd(l).slice(0,60)}),yi(),u==null||u()},children:[s.jsx(Z,{name:"reply",size:16}),c?"回复":null]}),s.jsxs("button",{className:d?"copied":"",title:d?"已复制":"复制","aria-label":d?"已复制":"复制",onClick:()=>void p(),children:[s.jsx(Z,{name:d?"check":"copy",size:16}),c?"复制":null]})]})}function Lv({anchor:l,text:i,itemId:c,close:u}){const[d,f]=w.useState(null),g=w.useRef(null);if(w.useLayoutEffect(()=>{const b=l.current,k=b==null?void 0:b.closest(".mmsgs, .msgs");b&&k&&f({bubble:b.getBoundingClientRect(),area:k.getBoundingClientRect()})},[l]),w.useLayoutEffect(()=>{!d||!g.current||!l.current||g.current.replaceChildren(l.current.cloneNode(!0))},[l,d]),!d)return null;const{bubble:p,area:h}=d,v=ON(p,h);return zk.createPortal(s.jsxs("div",{className:"message-popup",onPointerDown:b=>b.stopPropagation(),children:[s.jsx("div",{className:"message-shade",style:{left:h.left,top:h.top,width:h.width,height:h.height},onPointerDown:u}),s.jsx("div",{ref:g,className:"message-popup-bubble",style:{left:p.left,top:p.top,width:p.width}}),s.jsx("div",{className:"message-popup-menu",style:v,children:s.jsx(Dd,{text:i,itemId:c,menu:!0,close:u})})]}),document.body)}function DN(l,i){const c=l.currentTarget.closest(".col"),u=[...(c==null?void 0:c.querySelectorAll(".message-row[data-item-id]"))??[]].find(f=>f.dataset.itemId===i),d=u==null?void 0:u.querySelector(".hov.msg > .u, .hov.msg > .b");d&&(d.scrollIntoView({behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",block:"center"}),d.classList.remove("quote-flash"),d.offsetWidth,d.classList.add("quote-flash"),window.setTimeout(()=>d.classList.remove("quote-flash"),1100))}const sc={running:{text:"进行中",icon:"spin",cls:"spin"},queued:{text:"排队中",icon:"clock",cls:""},waiting:{text:"待确认",icon:"pause",cls:""},done:{text:"已完成",icon:"check",cls:""},stuck:{text:"受阻",icon:"close",cls:""},failed:{text:"失败",icon:"close",cls:""},stopped:{text:"已停止",icon:"stop",cls:""}};function $v(l){const i=l.durationMs??(l.startedAt&&l.endedAt?Date.parse(l.endedAt)-Date.parse(l.startedAt):void 0);return i===void 0?void 0:bc(i)}function UN({job:l,fresh:i}){const c=Ne(),[u,d]=w.useState(!1),[f,g]=w.useState(""),[p,h]=w.useState(!1),v=Un(u,200),b=sc[l.status],k=l.status==="done",S=l.status==="running",E=S||l.status==="waiting",y=l.status==="stuck"||l.status==="failed",x=dx(l),N=c.assistants.find(O=>O.id===l.assistantId),z=w.useRef(l.status);return w.useEffect(()=>{if(z.current===l.status)return;z.current=l.status,h(!0);const O=window.setTimeout(()=>h(!1),400);return()=>window.clearTimeout(O)},[l.status]),s.jsx("div",{className:`hov${i?" enter":""}`,id:`job-${l.id}`,children:s.jsxs("div",{className:"b jobcard",role:"button",tabIndex:0,onClick:()=>ra(l.id),onKeyDown:O=>{O.key==="Enter"&&ra(l.id)},children:[s.jsxs("div",{className:"tt",children:[N?s.jsx("span",{className:"jav",children:s.jsx(vt,{sprite:N.sprite,prop:N.prop,size:28})}):null,s.jsx("span",{className:"jt",children:l.title}),s.jsxs("span",{className:`st${k?" done":""}`,children:[s.jsxs("span",{className:"stico",children:[s.jsx(Z,{name:"spin",size:14,w:2,className:`spin stspin${S?"":" off"}`}),S?null:s.jsx(Z,{name:b.icon,size:14,w:2,className:`stic${k?" pop":""}${p?" anim":""}`})]}),b.text,S?` · ${pf(l.startedAt??l.createdAt)}`:$v(l)?` · 用时 ${$v(l)}`:null]})]}),x?s.jsx("div",{className:`meta${y?" bad":""}`,children:x}):null,E||S?s.jsxs("div",{className:"acts",children:[E?s.jsxs("button",{className:`btn job-reply${u?" selected":""}`,"aria-pressed":u,onClick:O=>{O.stopPropagation(),d(X=>!X)},children:[s.jsx(Z,{name:"edit",size:14}),"补充要求"]}):null,S?s.jsxs("button",{className:"btn job-stop",onClick:O=>{O.stopPropagation(),Nx(l.id)},children:[s.jsx(Z,{name:"stop",size:14}),"停止"]}):null]}):null,v.mounted?s.jsx("div",{className:`replywrap${v.leaving?" leaving":""}`,onClick:O=>O.stopPropagation(),children:s.jsx("div",{className:"replyclip",children:s.jsxs("div",{className:"replybox",children:[s.jsx("input",{autoFocus:!0,value:f,placeholder:"补充说明或更正方向",onChange:O=>g(O.target.value),onKeyDown:O=>{O.key==="Enter"&&f.trim()&&(Sd(l.id,f.trim()),g(""),d(!1)),O.key==="Escape"&&d(!1)}}),s.jsx("button",{className:"pbtn solid",onClick:()=>{f.trim()&&Sd(l.id,f.trim()),g(""),d(!1)},children:"发送"})]})})}):null]})})}function qv({draft:l}){const i=Ne(),c=l.status==="created"&&l.createdAssistantId,u=c?i.assistants.find(g=>g.id===l.createdAssistantId):void 0,d=(u==null?void 0:u.prop)??l.prop,f=!!c&&!u;return s.jsxs("div",{className:"draft",children:[s.jsxs("div",{className:"top",children:[s.jsx(vt,{sprite:(u==null?void 0:u.sprite)??l.sprite,prop:d,size:46}),s.jsxs("div",{children:[s.jsx("div",{className:"dn",children:l.name}),s.jsx("div",{className:"ds",children:l.status==="created"?"新助手 · 已创建":"新助手 · 草稿"})]})]}),s.jsxs("div",{className:"kv",children:[s.jsx("span",{className:"k",children:"职责"}),s.jsx("span",{children:l.dutyLong})]}),s.jsx("div",{className:`expand${c?"":" open"}`,inert:!!c,children:s.jsxs("div",{children:[s.jsxs("div",{className:"kv",children:[s.jsx("span",{className:"k",children:"定时任务"}),s.jsx("span",{className:l.routinesText?void 0:"none",children:l.routinesText||"没有"})]}),s.jsxs("div",{className:"kv",children:[s.jsx("span",{className:"k",children:"执行前确认"}),s.jsx("span",{className:l.askFirst.length?void 0:"none",children:l.askFirst.join(" · ")||"没有"})]}),s.jsxs("div",{className:"kv",children:[s.jsx("span",{className:"k",children:"补充说明"}),l.instructions.length?s.jsx("span",{children:l.instructions.map((g,p)=>s.jsx("span",{className:"line",children:g},p))}):s.jsx("span",{className:"none",children:"没有"})]}),s.jsxs("div",{className:"kv",children:[s.jsx("span",{className:"k",children:"迁移"}),s.jsxs("span",{children:[l.carry.conversations," 段对话"]})]})]})}),s.jsxs("div",{className:"acts swap",style:{marginTop:12},children:[s.jsxs("div",{className:c?"off":void 0,children:[s.jsx("button",{className:"btn solid",onClick:()=>void tk(l.id),children:"创建"}),s.jsx("button",{className:"btn",style:{background:"var(--bubble)"},onClick:()=>{Id("请修改草稿:"),yi()},children:"修改草稿"})]}),s.jsx("div",{className:c?void 0:"off",children:s.jsx("button",{className:"btn solid",disabled:f,onClick:()=>void ln(l.createdAssistantId),children:f?"已并回 Hob":"已创建 · 查看"})})]})]})}function HN({delegation:l,fresh:i}){const c=Ne(),[u,d]=w.useState(!1),f=c.assistants.find(v=>v.id===l.to),g=(f==null?void 0:f.name)??l.to,p={running:"进行中",waiting:"等你确认",done:"已完成",stuck:"受阻",interrupted:"已中断",returned:"已退回"},h=Object.values(c.approvals).filter(v=>v.status==="pending"&&((l.approvalIds??[]).includes(v.id)||!!(v.jobId&&l.jobIds.includes(v.jobId))));return s.jsx("div",{className:`hov${i?" enter":""}`,id:`delegation-${l.id}`,children:s.jsxs("div",{className:"b jobcard delegation-card",children:[s.jsxs("div",{className:"tt",children:[f?s.jsx("span",{className:"jav",children:s.jsx(vt,{sprite:f.sprite,prop:f.prop,size:28})}):null,s.jsxs("span",{className:"jt",children:["交给「",g,"」"]}),s.jsxs("span",{className:`st${l.status==="done"?" done":""}${l.status==="stuck"||l.status==="interrupted"||l.status==="returned"?" bad":""}`,children:[s.jsx(Z,{name:l.status==="running"?"spin":l.status==="done"?"check":l.status==="waiting"?"pause":"close",className:l.status==="running"?"spin":"",size:14}),p[l.status]]})]}),s.jsx("button",{className:`delegation-text${u?" expanded":""}`,onClick:()=>d(!u),title:u?"收起":"查看全文",children:l.text}),l.status==="returned"&&l.reply?s.jsx("div",{className:"note",children:l.reply}):null,l.jobIds.map(v=>{const b=c.jobs[v];return b?s.jsxs("button",{className:`delegation-job ${b.status}`,onClick:()=>ra(v),title:sc[b.status].text,children:[s.jsx(Z,{name:sc[b.status].icon,size:14,w:2,className:sc[b.status].cls}),s.jsx("span",{children:b.title}),s.jsx(Z,{name:"chev",size:14,className:"go"})]},v):null}),h.map(v=>s.jsx(Jx,{approval:v,fresh:!1},v.id)),s.jsxs("div",{className:"delegation-actions",children:[s.jsxs("button",{onClick:()=>void Fd(l.to,l.id,!0),children:["去「",g,"」看看 →"]}),l.status==="interrupted"?s.jsx("button",{onClick:()=>void lk(l.id),children:"重新转交"}):null]})]})})}function Jx({approval:l,fresh:i}){var E;const c=l.options.find(y=>y.key===l.chosen),u=l.status==="answered"&&c?l.chosen:void 0,[d,f]=w.useState(null),[g,p]=w.useState(""),h=d??u,v=d!==null,b=l.status==="answered"?l.answerText:void 0,k=g.trim(),S=()=>{k&&jv(l.id,{text:k})};return s.jsxs("div",{className:`b q${i?" enter":""}`,children:[s.jsx("div",{className:"qt",children:l.title}),l.detail?s.jsx("div",{className:"qs",children:l.detail}):null,s.jsxs("div",{className:"opts",children:[b?s.jsxs("div",{className:"opt chosen",children:[s.jsx("span",{className:"key",children:s.jsx(Z,{name:"user",size:12})}),b,s.jsx("span",{className:"ck",children:s.jsx(Z,{name:"check",size:16})})]}):h&&!v?s.jsxs("div",{className:"opt chosen",children:[s.jsx("span",{className:"key",children:h}),(E=l.options.find(y=>y.key===h))==null?void 0:E.label,s.jsx("span",{className:"ck",children:s.jsx(Z,{name:"check",size:16})})]}):l.options.map(y=>{const x=y.key===h;return s.jsx("div",{className:`optrow${v&&!x?" away":""}`,children:s.jsx("div",{className:"optclip",children:s.jsxs("button",{className:`opt${x?" chosen":""}`,disabled:v,onClick:()=>{f(y.key),jv(l.id,{key:y.key})},children:[s.jsx("span",{className:"key",children:y.key}),y.label,x&&v?s.jsx("span",{className:"ck",children:s.jsx(Z,{name:"check",size:16})}):null]})})},y.key)}),b||v||h?null:s.jsxs("div",{className:"other",children:[s.jsx("input",{value:g,placeholder:"其他想法…",onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&S()}}),k?s.jsx("button",{className:"ib other-send",title:"发送",onClick:S,children:s.jsx(Z,{name:"send",size:16})}):null]})]})]})}function BN({name:l,path:i,meta:c,fresh:u}){return s.jsxs("button",{className:`att filecard${u?" enter":""}`,onClick:()=>_l(i,l),children:[s.jsx("span",{className:"ico",children:s.jsx(Z,{name:hf(i),size:18})}),s.jsxs("span",{children:[s.jsx("span",{className:"n",style:{display:"block"},children:l}),c?s.jsx("span",{className:"m",children:c}):null]})]})}function LN({name:l,path:i,fresh:c}){return s.jsx("button",{className:`imgcard${c?" enter":""}`,onClick:()=>_l(i),title:l,children:s.jsx("img",{src:Rt(i),alt:l,loading:"lazy"})})}function $N(l){const i=w.useRef(null);return w.useLayoutEffect(()=>{const c=i.current;if(!c||(c.style.maxWidth="",l===void 0))return;let u=!0;const d=()=>{if(!u)return;c.style.maxWidth="";const f=c.getBoundingClientRect();if(!f.width)return;let g=0;const p=document.createRange(),h=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(let b=h.nextNode();b;b=h.nextNode()){let k;if(b instanceof Element){if(getComputedStyle(b).display!=="inline")continue;k=b.getClientRects()}else p.selectNodeContents(b),k=p.getClientRects();for(const S of k)g=Math.max(g,S.right)}if(!g)return;const v=Math.ceil(g-f.left+parseFloat(getComputedStyle(c).paddingRight));v>=f.width-1||(c.style.maxWidth=`${v}px`,c.getBoundingClientRect().height>f.height+.5&&(c.style.maxWidth=""))};return d(),document.fonts.ready.then(d),()=>{u=!1}},[l]),i}function qN({item:l,inlineDraft:i,fresh:c,tools:u}){var k;const d=Ne(),f=c?" enter":"",g=$N(l.kind==="user"?l.text:void 0),p=u.touch?S=>S.preventDefault():void 0,h=u.distance?{transform:`translateX(-${Math.min(64,u.distance*.8)}px)`,transition:"none"}:void 0,v=Math.min(1,u.distance/48),b=u.distance>0?s.jsx("span",{className:`swipe-reply${u.ready?" ready":""}`,style:{opacity:v,transform:`scale(${v})`},children:s.jsx("span",{className:"swipe-reply-inner",children:s.jsx(Z,{name:"reply",size:18})})}):null;if(l.kind==="user")return s.jsxs("div",{className:"message-row right",id:l.from?`forward-${l.from.delegationId}`:void 0,"data-item-id":l.id,onPointerDown:u.start,onContextMenu:p,children:[b,s.jsxs("div",{className:`hov right msg${c?" enter-right":""}`,children:[s.jsxs("div",{className:"u",ref:g,style:h,children:[l.from?s.jsxs("button",{className:"forward-label",onClick:()=>void(l.from.assistantId==="hob"?Fd(l.from.assistantId,l.from.delegationId,!1):kv(l.from.assistantId,l.from.delegationId,!1)),children:[(()=>{const S=d.assistants.find(E=>E.id===l.from.assistantId);return S?s.jsx(vt,{sprite:S.sprite,prop:S.prop,size:16}):null})(),"转自 ",l.from.assistantId==="hob"?l.from.name:`「${l.from.name}」`]}):null,l.quote?s.jsx("button",{className:"quote",onClick:S=>DN(S,l.quote.itemId),children:l.quote.text}):null,l.text,(k=l.files)!=null&&k.length?l.files.map(S=>s.jsx(Uv,{path:S,name:S.split("/").pop()??S,fallback:s.jsxs("button",{className:"ufile",onClick:()=>_l(S),children:[s.jsx(Z,{name:"doc",size:13}),S.split("/").pop()]})},S)):null]}),s.jsx(Dd,{text:l.text,itemId:l.id})]}),u.open?s.jsx(Lv,{anchor:g,text:l.text,itemId:l.id,close:u.close}):null]});if(l.kind==="assistant")return s.jsxs(s.Fragment,{children:[l.routine?s.jsxs("div",{className:`tag${c?" enter-fade":""}`,children:[s.jsx(Z,{name:"clock",size:13}),l.routine.name]}):null,s.jsxs("div",{className:"message-row","data-item-id":l.id,onPointerDown:u.start,onContextMenu:p,children:[b,s.jsxs("div",{className:`hov msg${f}`,children:[jN(l.text).map((S,E,y)=>S.table?s.jsx("div",{className:"tablecard",ref:E===0?g:void 0,style:E===0?h:void 0,children:s.jsx(hs,{text:S.md})},E):s.jsxs("div",{className:`b${i&&E===y.length-1?" wide":""}`,ref:E===0?g:void 0,style:E===0?h:void 0,children:[s.jsx(hs,{text:S.md,streaming:l.streaming&&E===y.length-1}),i&&E===y.length-1?s.jsx(qv,{draft:i}):null]},E)),s.jsx(Dd,{text:l.text,itemId:l.id})]}),u.open?s.jsx(Lv,{anchor:g,text:l.text,itemId:l.id,close:u.close}):null]})]});if(l.kind==="note")return s.jsxs("div",{className:`sys${c?" enter-fade":""}`,id:l.handbackId?`handback-${l.handbackId}`:void 0,children:[l.icon!=="split"?s.jsx(Z,{name:MN[l.icon],size:14}):null,l.handbackId?s.jsx("button",{onClick:()=>void kv("hob",l.handbackId,!0),children:l.text}):l.text]});if(l.kind==="question"){const S=d.approvals[l.approvalId];return S?s.jsx(Jx,{approval:S,fresh:c}):null}if(l.kind==="job"){const S=d.jobs[l.jobId];return S?s.jsx(UN,{job:S,fresh:c}):null}if(l.kind==="draft"){const S=d.drafts[l.draftId];return S?s.jsx("div",{className:`b wide${f}`,children:s.jsx(qv,{draft:S})}):null}if(l.kind==="delegation"){const S=d.delegations[l.delegationId];return S?s.jsx(HN,{delegation:S,fresh:c}):null}return Ok(l.path)?s.jsx(LN,{path:l.path,name:l.name,fresh:c}):s.jsx(Uv,{path:l.path,name:l.name,fallback:s.jsx(BN,{path:l.path,name:l.name,meta:l.meta,fresh:c})})}function YN(l,i){return l?l.kind==="user"!=(i.kind==="user")||!!i.lead:!1}function Ix({items:l}){const i=Ne(),c=RN(),[u,d]=w.useReducer(_N,null),f=w.useRef(null),[g,p]=w.useState(null);w.useEffect(()=>{const v=()=>{f.current&&window.clearTimeout(f.current.timer),f.current=null,p(null)},b=y=>{d({type:"outside",inside:y.target instanceof Element&&!!y.target.closest(".tools.menu")})},k=y=>{var z;const x=f.current;if(!x||x.pointerId!==y.pointerId)return;if(x.swipe=AN(x.swipe,y.clientX,y.clientY),Math.hypot(y.clientX-x.swipe.x,y.clientY-x.swipe.y)>10&&window.clearTimeout(x.timer),x.swipe.direction==="vertical"){v();return}if(x.swipe.direction!=="horizontal")return;window.clearTimeout(x.timer);const N=Bv(x.swipe);if(N&&!x.ready&&((z=navigator.vibrate)==null||z.call(navigator,10)),x.ready=N,window.matchMedia("(prefers-reduced-motion: reduce)").matches){N&&(cc({itemId:x.id,text:Rd(x.text).slice(0,60)}),yi(),v());return}p({id:x.id,distance:x.swipe.distance,ready:N})},S=y=>{const x=f.current;!x||x.pointerId!==y.pointerId||(Bv(x.swipe)&&(cc({itemId:x.id,text:Rd(x.text).slice(0,60)}),yi()),v())},E=()=>{v(),d({type:"close"})};return document.addEventListener("pointerdown",b,!0),document.addEventListener("pointermove",k,!0),document.addEventListener("pointerup",S,!0),document.addEventListener("pointercancel",v,!0),document.addEventListener("scroll",E,!0),()=>{v(),document.removeEventListener("pointerdown",b,!0),document.removeEventListener("pointermove",k,!0),document.removeEventListener("pointerup",S,!0),document.removeEventListener("pointercancel",v,!0),document.removeEventListener("scroll",E,!0)}},[]);const h=[];l.length&&!EN(l[0].at)&&l[0].kind!=="note"&&h.push(s.jsx("div",{className:"div",children:Ol(l[0].at)},"first-div"));for(let v=0;v<l.length;v++){const b=l[v],k=l[v-1],S=l[v+1],E=qj(b.id),y=b.kind==="assistant"&&(S==null?void 0:S.kind)==="draft"?i.drafts[S.draftId]:void 0,x={open:c&&u===b.id,touch:c,distance:(g==null?void 0:g.id)===b.id?g.distance:0,ready:(g==null?void 0:g.id)===b.id&&g.ready,close:()=>d({type:"close"}),start:c?N=>{if(N.pointerType!=="touch"||b.kind!=="user"&&b.kind!=="assistant"||N.target.closest("a,button,input,textarea,select,[contenteditable],.draft"))return;f.current&&window.clearTimeout(f.current.timer);const{clientX:z,clientY:O,pointerId:X}=N,P=window.setTimeout(()=>{f.current=null,d({type:"open",id:b.id})},500);f.current={timer:P,pointerId:X,id:b.id,text:b.text,swipe:{x:z,y:O,direction:"pending",distance:0},ready:!1}}:void 0};y&&v++,h.push(s.jsxs(w.Fragment,{children:[CN(k==null?void 0:k.at,b.at)?s.jsx("div",{className:`div${E?" enter-fade":""}`,children:Ol(b.at)}):YN(k,b)?s.jsx("div",{className:"g"}):null,s.jsx(qN,{item:b,inlineDraft:y,fresh:E,tools:x})]},b.id))}for(const v of Lj(Object.values(i.livePages),i.sel))h.push(s.jsxs("button",{className:`att filecard${v.state==="failed"?" bad":""}`,onClick:()=>yk(v.callId),children:[s.jsx("span",{className:"ico",children:s.jsx(Z,{name:v.state==="writing"?"spin":"close",className:v.state==="writing"?"spin":"",size:18})}),s.jsxs("span",{children:[s.jsx("span",{className:"n",style:{display:"block"},children:v.title||"正在写页面…"}),s.jsx("span",{className:"m",children:v.state==="failed"?`生成失败:${v.error}`:"生成中"})]})]},v.callId));return s.jsx(s.Fragment,{children:h})}function Fx({leaving:l,gap:i,a:c}){var u,d;return s.jsxs(s.Fragment,{children:[i?s.jsx("div",{className:"g"}):null,s.jsx("div",{className:`hov think${l?" leaving":""}`,children:s.jsxs("div",{className:"activity-line",role:"status",children:[s.jsx(vt,{sprite:c.sprite,prop:c.prop,size:28,motion:((u=c.activity)==null?void 0:u.state)==="tool"?"work":"think"}),s.jsx("span",{className:"activity-shimmer",children:((d=c.activity)==null?void 0:d.label)??"正在想…"})]})})]})}function Wx(l,i,c,u){const d=w.useRef(!0),f=w.useRef({key:"",len:0});w.useEffect(()=>{const g=l.current;if(!g)return;let p=g.scrollTop;const h=()=>{g.scrollHeight-g.scrollTop-g.clientHeight<80?d.current=!0:g.scrollTop<p-2&&(d.current=!1),p=g.scrollTop},v=new ResizeObserver(()=>{d.current&&(g.scrollTop=g.scrollHeight,p=g.scrollTop)});g.addEventListener("scroll",h,{passive:!0}),v.observe(g);for(const b of Array.from(g.children))v.observe(b);return()=>{g.removeEventListener("scroll",h),v.disconnect()}},[l]),w.useLayoutEffect(()=>{const g=l.current;if(!g)return;const p=f.current;f.current={key:i,len:c},p.key!==i||c<p.len?(d.current=!0,g.scrollTop=g.scrollHeight):c>p.len&&(d.current||u)&&(d.current=!0,g.scrollTo({top:g.scrollHeight,behavior:"smooth"}))},[l,i,c,u])}function Px(l){return(l==null?void 0:l.kind)==="user"&&!l.from}const GN=["查看这台电脑的磁盘和内存占用","每天早上 9 点给我一份科技新闻简报","把附件里的会议记录整理成要点"];function eb({a:l}){const c=Ne().settings.settings.models,u=c.roster.length>0&&c.conversation.ref!=="";return s.jsxs("div",{className:"hello",children:[s.jsx(vt,{sprite:l.sprite,prop:l.prop,size:56}),s.jsx("div",{className:"t",children:`我是${tb(l.name,!1)}${l.primary?",你的主助手":""}`}),s.jsx("div",{className:"d",children:l.primary?"交给我的事,我会分派给后台任务执行,完成、受阻或需要你确认时再告诉你;也可以让我定时执行。同类工作多了,我会建议创建专属助手。":`负责${l.duty}。`}),u?l.primary?s.jsx("div",{className:"ex",children:GN.map(d=>s.jsx("button",{className:"btn",onClick:()=>{Id(d),yi()},children:d},d))}):null:s.jsxs("div",{className:"setup",children:[s.jsx("div",{children:"开始使用前,请先添加模型服务商并选择模型。"}),s.jsx("button",{className:"btn solid",onClick:()=>{ef(),us("providers")},children:"前往设置"})]})]})}function tb(l,i=!0){const c=u=>!!(u&&/[A-Za-z0-9]/.test(u));return`${c(l[0])?" ":""}${l}${i&&c(l.at(-1))?" ":""}`}function nb(l,i){return`${l??""}|${i??0}`}function XN(){var h,v,b;const l=Ne(),i=l.assistants.find(k=>k.id===l.sel),c=l.sel?l.items[l.sel]??[]:[],u=!!(i&&l.sel&&((h=l.items[l.sel])==null?void 0:h.length)===0&&!i.busy),d=w.useRef(null),f=nb(l.sel,l.sel?l.itemGen[l.sel]:0),g=!!(i!=null&&i.busy)&&!rx(c),p=Un(g,180);return Wx(d,f,c.length,Px(c.at(-1))),s.jsxs("main",{className:"chat",children:[s.jsxs("div",{className:"head",children:[i?s.jsx(vt,{sprite:i.sprite,prop:i.prop,size:24,motion:i.busy?((v=i.activity)==null?void 0:v.state)==="tool"?"work":"think":void 0,busyDot:i.busy}):null,s.jsx("span",{className:"nm",children:(i==null?void 0:i.name)??""}),s.jsx("span",{className:"sp"}),l.collapsed?s.jsx("button",{className:"ib",title:"展开右栏",onClick:mk,children:s.jsx(Z,{name:"panel",size:18})}):null]}),s.jsx("div",{className:"msgs",ref:d,children:s.jsxs("div",{className:`col${u?" mid":""}`,children:[u&&i?s.jsx(eb,{a:i}):s.jsx(Ix,{items:c}),p.mounted&&i?s.jsx(Fx,{a:i,leaving:p.leaving,gap:((b=c.at(-1))==null?void 0:b.kind)==="user"}):null]})}),s.jsx(lb,{})]})}function lb({variant:l="desktop"}){var h;const i=Ne(),c=i.assistants.find(v=>v.id===i.sel),u=w.useRef(null),d=i.text.trim().length>0,f=Un(i.quote!==null,180);w.useLayoutEffect(()=>{const v=u.current;if(!v)return;v.style.height="auto";const b=l==="mobile"?120:180;v.style.height=`${Math.min(v.scrollHeight,b)}px`},[i.text,i.nonce,l]),w.useEffect(()=>{var v;i.nonce&&((v=u.current)==null||v.focus())},[i.nonce]);const g=w.useRef(null);w.useLayoutEffect(()=>{const v=g.current,b=v==null?void 0:v.closest(".chat");if(!v||!b)return;const k=new ResizeObserver(()=>b.style.setProperty("--comp-h",`${v.offsetHeight}px`));return k.observe(v),()=>k.disconnect()},[l]);const p=s.jsxs("div",{className:l==="mobile"?"mcomp":"comp",children:[f.mounted?s.jsxs("div",{className:`comp-quote${f.leaving?" leaving":""}`,children:[s.jsx("div",{className:"quote",children:(h=i.quote)==null?void 0:h.text}),s.jsx("button",{className:"ib",style:{width:20,height:20},onClick:()=>cc(null),title:"取消引用",children:s.jsx(Z,{name:"close",size:13})})]}):null,i.files.length?s.jsx("div",{className:"comp-files",children:i.files.map(v=>s.jsxs("span",{className:"filechip",children:[s.jsx(Z,{name:"doc",size:12}),v.split("/").pop(),s.jsx("button",{onClick:()=>P1(v),title:"移除",children:s.jsx(Z,{name:"close",size:11})})]},v))}):null,s.jsxs("div",{className:"comp-main",children:[s.jsxs("label",{className:"pl",title:"加文件",children:[s.jsx(Z,{name:"plus",size:19}),s.jsx("input",{type:"file",multiple:!0,hidden:!0,onChange:v=>{const b=Array.from(v.target.files??[]);v.target.value="",b.length&&ek(b)}})]}),s.jsx("textarea",{ref:u,className:"ta",rows:1,value:i.text,placeholder:`给${tb((c==null?void 0:c.name)??"")}发消息`,onChange:v=>Id(v.target.value),onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&!v.nativeEvent.isComposing&&(v.preventDefault(),yv())}}),s.jsx("button",{className:"sendbtn",title:"发送",disabled:!d,onClick:()=>void yv(),children:s.jsx(Z,{name:"send",size:17})})]})]});return l==="mobile"?s.jsx("div",{className:"mcomp-wrap",ref:g,children:p}):s.jsx("div",{className:"compwrap",ref:g,children:s.jsx("div",{className:"col",children:p})})}function QN(){var h,v,b;const l=Ne(),i=l.assistants.find(k=>k.id===l.sel),c=l.sel?l.items[l.sel]??[]:[],u=!!(i&&l.sel&&((h=l.items[l.sel])==null?void 0:h.length)===0&&!i.busy),d=w.useRef(null),f=!!(i!=null&&i.busy)&&!rx(c),g=Un(f,180),p=nb(l.sel,l.sel?l.itemGen[l.sel]:0);return Wx(d,p,c.length,Px(c.at(-1))),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mchat-head",children:[s.jsx("button",{className:"ib",style:{marginLeft:-8},title:"返回",onClick:()=>Ax("list"),children:s.jsx(Z,{name:"left",size:22})}),i?s.jsx(vt,{sprite:i.sprite,prop:i.prop,size:30,motion:i.busy?((v=i.activity)==null?void 0:v.state)==="tool"?"work":"think":void 0,busyDot:i.busy}):null,s.jsx("span",{className:"nm",children:(i==null?void 0:i.name)??""}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"ib",title:"助手信息",onClick:pk,children:s.jsx(Z,{name:"more",size:20})})]}),s.jsx("div",{className:"mmsgs",ref:d,children:s.jsxs("div",{className:`col${u?" mid":""}`,children:[u&&i?s.jsx(eb,{a:i}):s.jsx(Ix,{items:c}),g.mounted&&i?s.jsx(Fx,{a:i,leaving:g.leaving,gap:((b=c.at(-1))==null?void 0:b.kind)==="user"}):null]})}),s.jsx(lb,{variant:"mobile"})]})}const VN="document.addEventListener('click',function(e){if(!e.isTrusted)return;const a=e.target.closest('a[href]');if(!a||!/^https?:\\/\\//i.test(a.getAttribute('href')||''))return;let u;try{u=new URL(a.href)}catch{return}if(!['http:','https:'].includes(u.protocol))return;e.preventDefault();if(window.parent!==window)window.parent.postMessage({type:'hob-page-link',url:u.href},'*');else window.open(u.href,'_blank','noopener')});",ZN="addEventListener('DOMContentLoaded',function(){document.querySelectorAll('main table').forEach(function(t){if(t.parentElement.classList.contains('tw'))return;var w=document.createElement('div');w.className='tw';t.before(w);w.append(t)});document.querySelectorAll('main figure>svg').forEach(function(g){var v=g.viewBox&&g.viewBox.baseVal;if(v&&v.width)g.style.minWidth=Math.round(v.width*0.75)+'px'})});",KN="(function(){function f(){var h=location.hash;document.documentElement.classList.toggle('dark',h==='#dark'||(h!=='#light'&&matchMedia('(prefers-color-scheme: dark)').matches))}f();addEventListener('hashchange',f)})();",JN="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data: https:; media-src data: https:; font-src data:",IN=`:root{--bg:#fff;--soft:#f5f5f2;--line:#e8e8e5;--ink:#18181a;--muted:#6d6d72;--faint:#a4a4a9;--accent:#ff6a2b;--accent-soft:#fff0e7;--ok:#1f9a5f;--ok-soft:#e8f5ee;--warn:#b7740a;--warn-soft:#fbf2df;--bad:#d92d20;--bad-soft:#fcebe9;color-scheme:light}
143
- :root.dark{--bg:#151516;--soft:#1f1f21;--line:#2c2c2f;--ink:#ececed;--muted:#a1a1a7;--faint:#6b6b71;--accent:#ff7a42;--accent-soft:#36211a;--ok:#3cc183;--ok-soft:#15281e;--warn:#e9a53a;--warn-soft:#2c2414;--bad:#ff6b5e;--bad-soft:#321b19;color-scheme:dark}
144
- *{box-sizing:border-box}
145
- html{background:var(--bg);color:var(--ink);font:16px/1.75 system-ui,-apple-system,"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Microsoft YaHei",sans-serif;-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility}
146
- body{margin:0;padding:52px 24px 80px}
147
- .page{max-width:760px;margin:0 auto}
148
- .hd{margin-bottom:40px;padding-bottom:28px;border-bottom:1px solid var(--line)}
149
- .hd h1{font-size:32px;line-height:1.25;letter-spacing:-.015em;margin:0 0 10px;font-weight:700}
150
- .hd p{margin:0;color:var(--muted);font-size:17px;line-height:1.6}
151
- h2{font-size:22px;line-height:1.35;letter-spacing:-.01em;margin:48px 0 14px;font-weight:700}
152
- h3{font-size:16.5px;line-height:1.45;margin:28px 0 8px;font-weight:650}
153
- main>h2:first-child,main>section:first-child>h2:first-child{margin-top:0}
154
- p,ul,ol,table,pre,figure,blockquote,.note,.cards,.cols,.kpis,.steps{margin:0 0 18px}
155
- ul,ol{padding-left:1.4em}li{margin:5px 0}li::marker{color:var(--faint)}
156
- a{color:var(--accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,transparent)}
157
- strong,b{font-weight:650}
158
- .muted{color:var(--muted)}.accent{color:var(--accent)}.ok{color:var(--ok)}.warn{color:var(--warn)}.bad{color:var(--bad)}
159
- code{font:.88em/1.5 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;background:var(--soft);padding:.12em .4em;border-radius:5px}
160
- pre{background:var(--soft);border-radius:12px;padding:14px 18px;overflow:auto;line-height:1.6}pre code{background:none;padding:0;font-size:13.5px}
161
- blockquote{border-left:3px solid var(--line);padding:2px 0 2px 16px;color:var(--muted)}
162
- hr{border:0;border-top:1px solid var(--line);margin:36px 0}
163
- table{width:100%;border-collapse:collapse;font-size:14.5px;line-height:1.6}
164
- .tw{overflow-x:auto;margin:0 0 18px}.tw>table{margin:0}
165
- th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}
166
- th{font-size:13px;font-weight:600;color:var(--muted);border-bottom-width:1.5px;white-space:nowrap}
167
- td{min-width:5.5em}
168
- th:first-child,td:first-child{padding-left:0}th:last-child,td:last-child{padding-right:0}
169
- .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
170
- .card{background:var(--soft);border-radius:14px;padding:16px 18px}.card h3{margin:0 0 6px;font-size:15.5px}
171
- .cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px 28px}
172
- .cols>div>h3:first-child{margin-top:0}
173
- .kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
174
- .kpi{border:1px solid var(--line);border-radius:14px;padding:14px 16px 12px}
175
- .kpi b{display:block;font-size:28px;line-height:1.2;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}.kpi span{color:var(--muted);font-size:13.5px}
176
- .steps{list-style:none;padding:0;counter-reset:s}
177
- .steps>li{position:relative;margin:0;padding:1px 0 20px 44px;counter-increment:s}
178
- .steps>li::before{content:counter(s);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:14px;line-height:28px;text-align:center}
179
- .steps>li::after{content:"";position:absolute;left:13.5px;top:34px;bottom:6px;width:1px;background:var(--line)}
180
- .steps>li:last-child{padding-bottom:0}.steps>li:last-child::after{display:none}.steps>li>b:first-child{display:block}
181
- .note{border-radius:12px;padding:12px 16px;background:var(--accent-soft)}.note.ok{background:var(--ok-soft)}.note.warn{background:var(--warn-soft)}.note.bad{background:var(--bad-soft)}
182
- .card>:last-child,.note>:last-child,.cols>div>:last-child,section>:last-child{margin-bottom:0}
183
- .tag{display:inline-block;font-size:12px;line-height:1.7;padding:0 8px;border-radius:99px;background:var(--soft);color:var(--muted);vertical-align:.08em;white-space:nowrap}
184
- .card .tag{background:var(--bg)}
185
- .tag.accent{background:var(--accent-soft);color:var(--accent)}.tag.ok{background:var(--ok-soft);color:var(--ok)}.tag.warn{background:var(--warn-soft);color:var(--warn)}.tag.bad{background:var(--bad-soft);color:var(--bad)}
186
- figure{margin:28px 0;overflow-x:auto}img,svg{max-width:100%;height:auto}figure>svg,figure>img{display:block;margin:0 auto}
187
- figcaption{color:var(--muted);font-size:13.5px;margin-top:10px;text-align:center}
188
- svg{color:var(--ink)}svg text{fill:var(--ink);font-family:inherit;font-size:13px}
189
- svg .box{fill:var(--bg);stroke:var(--line);stroke-width:1.5}svg .hl{fill:var(--accent-soft);stroke:var(--accent);stroke-width:1.5}
190
- svg .line{fill:none;stroke:var(--faint);stroke-width:1.5}svg text.muted{fill:var(--muted)}svg text.accent{fill:var(--accent)}
191
- @media (max-width:600px){body{padding:32px 18px 64px}.hd{margin-bottom:32px}.hd h1{font-size:26px}h2{font-size:19.5px;margin-top:40px}}`,pd=l=>l.replace(/[&<>"]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[i]);function FN(){return WN("","","").replace("</body>",`<script>
192
- (function(){
193
- let latest, scheduled = false, follow = true;
194
- addEventListener('scroll', function(){ follow = document.documentElement.scrollHeight - innerHeight - scrollY < 48; }, {passive:true});
195
- addEventListener('message', function(e){
196
- if(e.source !== parent || e.data?.type !== 'hob-page-live') return;
197
- latest = e.data;
198
- if(scheduled) return;
199
- scheduled = true;
200
- requestAnimationFrame(function(){
201
- scheduled = false;
202
- document.documentElement.classList.toggle('dark', !!latest.dark);
203
- document.title = latest.title || '';
204
- document.querySelector('.hd h1').textContent = latest.title || '';
205
- document.querySelector('.hd p').textContent = latest.summary || '';
206
- const main = document.querySelector('main');
207
- const template = document.createElement('template');
208
- template.innerHTML = (latest.html || '').replace(/<[^>]*$/, '');
209
- template.content.querySelectorAll('script,iframe,object,embed').forEach(function(el){el.remove()});
210
- template.content.querySelectorAll('*').forEach(function(el){
211
- Array.from(el.attributes).forEach(function(a){if(/^on/i.test(a.name)||a.name.toLowerCase()==='srcdoc'||/^\\s*javascript:/i.test(a.value))el.removeAttribute(a.name)});
212
- });
213
- main.innerHTML = template.innerHTML;
214
- main.querySelectorAll('table').forEach(function(t){const w=document.createElement('div');w.className='tw';t.before(w);w.append(t)});
215
- main.querySelectorAll('figure>svg').forEach(function(g){const v=g.viewBox&&g.viewBox.baseVal;if(v&&v.width)g.style.minWidth=Math.round(v.width*.75)+'px'});
216
- if(follow) scrollTo(0, document.documentElement.scrollHeight);
217
- });
218
- });
219
- })();<\/script></body>`)}function WN(l,i,c){return`<!doctype html>
220
- <html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
221
- <meta http-equiv="Content-Security-Policy" content="${JN}">
222
- <title>${pd(l)}</title><script>${KN}${ZN}<\/script><style>${IN}</style></head>
223
- <body><div class="page"><header class="hd"><h1>${pd(l)}</h1><p>${pd(i)}</p></header>
224
- <main>
225
- ${c}
226
- </main></div><script>${VN}<\/script></body></html>
227
- `}function PN(l){const[i,...c]=l;return i?i.map((u,d)=>c.length>0&&c.every(f=>{var p;const g=(p=f[d])==null?void 0:p.trim();return!!g&&/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(g)&&Number.isFinite(Number(g))})):[]}const eS=1024*1024;function gd(){const l=Ne(),i=l.filePreview,c=Un(!!i,180),u=w.useRef(i);i&&(u.current=i),w.useEffect(()=>{if(!i)return;const f=g=>{g.key==="Escape"&&uc()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[i]);const d=i??u.current;return!c.mounted||!d?null:s.jsx("div",{className:`fpwrap${c.leaving?" leaving":""}`,onClick:uc,children:s.jsx("div",{className:`fp${d.full?" full":""}`,onClick:f=>f.stopPropagation(),children:d.liveId&&l.livePages[d.liveId]?s.jsx(tS,{page:l.livePages[d.liveId]}):s.jsx(nS,{path:d.path,title:d.title})})})}function tS({page:l}){const i=w.useRef(null),c=w.useRef(l);c.current=l;const[u,d]=w.useState(null),f=w.useMemo(()=>FN(),[]),g=()=>{var h,v;return(v=(h=i.current)==null?void 0:h.contentWindow)==null?void 0:v.postMessage({type:"hob-page-live",title:c.current.title,summary:c.current.summary,html:c.current.html,dark:document.documentElement.classList.contains("dark")},"*")};w.useEffect(()=>{g()},[l]),w.useEffect(()=>{const h=new MutationObserver(g);h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const v=b=>{var k,S,E;if(!(b.source!==((k=i.current)==null?void 0:k.contentWindow)||((S=b.data)==null?void 0:S.type)!=="hob-page-link"||!((E=navigator.userActivation)!=null&&E.isActive)))try{const y=new URL(b.data.url);["http:","https:"].includes(y.protocol)&&window.open(y.href,"_blank","noopener")}catch{}};return window.addEventListener("message",v),()=>{h.disconnect(),window.removeEventListener("message",v)}},[]),w.useEffect(()=>{let h=!0;return l.path&&Ox(l.path).then(v=>{h&&d(v)}).catch(v=>gc(`无法加载文件信息:${v instanceof Error?v.message:String(v)}`)),()=>{h=!1}},[l.path]);const p=l.state!=="done";return s.jsxs(s.Fragment,{children:[s.jsx(ab,{name:l.title||"正在写页面…",meta:u,path:l.path||"page.html",liveStatus:l.state==="writing"?"正在生成…":l.state==="failed"?`生成失败:${l.error}`:void 0,disabled:p}),s.jsx("div",{className:"fp-body",children:l.state==="done"&&/<\s*script\b/i.test(l.html)&&u?s.jsx(sb,{meta:u}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fp-note",children:"网页在隔离环境中显示,不能访问 Hob 的数据。"}),s.jsx("iframe",{ref:i,className:"fp-frame",sandbox:"allow-scripts",srcDoc:f,onLoad:g,title:l.title||"正在写页面"})]})})]})}function nS({path:l,title:i}){const[c,u]=w.useState({state:"loading"});w.useEffect(()=>{let g=!0;return u({state:"loading"}),Ox(l).then(p=>{g&&u({state:"ok",meta:p})}).catch(p=>{if(!g)return;const h=p instanceof Error?p.message:String(p),v=h.includes("只允许读 Hob 自己的文件");u({state:"error",outside:v,message:h})}),()=>{g=!1}},[l]);const d=c.state==="ok"?c.meta:null,f=i??(d==null?void 0:d.name)??l.split("/").pop()??l;return s.jsxs(s.Fragment,{children:[s.jsx(ab,{name:f,meta:d,path:l}),s.jsx("div",{className:"fp-body",children:c.state==="loading"?s.jsx("div",{className:"fp-center dim",children:"正在读取文件信息…"}):c.state==="error"?s.jsx("div",{className:"fp-center",children:s.jsxs("div",{className:"fp-nofile",children:[s.jsx(Z,{name:"doc",size:22}),s.jsx("div",{children:c.outside?"这个文件不在 Hob 的数据目录里,无法预览":c.message}),s.jsx("button",{className:"pbtn",onClick:()=>void nf(l).then(g=>gc(g?"路径已复制":"复制失败:浏览器不允许写入剪贴板")),children:"复制路径"})]})}):s.jsx(lS,{meta:c.meta})})]})}function ab({name:l,meta:i,path:c,liveStatus:u,disabled:d}){return s.jsxs("div",{className:"fphead",children:[s.jsx("button",{className:"ib",title:"关闭",onClick:uc,children:s.jsx(Z,{name:"left",size:18})}),s.jsx(Z,{name:hf(c),size:18,className:"fp-file-icon"}),s.jsxs("div",{className:"fpt",children:[s.jsx("div",{className:"n",title:l,children:l}),u?s.jsx("div",{className:"m",children:u}):i?s.jsxs("div",{className:"m",children:[gf(i.size)," · ",Ol(i.modifiedAt)]}):null]}),d?s.jsx("button",{className:"ib fp-act",title:"下载",disabled:!0,children:s.jsx(Z,{name:"dl",size:17})}):s.jsx("a",{className:"ib fp-act",title:"下载",href:Rt(c),download:l,children:s.jsx(Z,{name:"dl",size:17})}),s.jsx("button",{className:"ib fp-act",title:"在新窗口打开",disabled:d,onClick:()=>window.open(Rt(c,{inline:!0}),"_blank","noopener"),children:s.jsx(Z,{name:"out",size:17})}),s.jsx("button",{className:"ib fp-act fp-wide-btn",title:"切换全宽",onClick:jk,children:s.jsx(Z,{name:"dbl",size:17})})]})}function sb({meta:l}){const i=w.useRef(null);return w.useEffect(()=>{const c=u=>{var d,f,g;if(!(!l.page||u.source!==((d=i.current)==null?void 0:d.contentWindow)||((f=u.data)==null?void 0:f.type)!=="hob-page-link"||!((g=navigator.userActivation)!=null&&g.isActive)))try{const p=new URL(u.data.url);(p.protocol==="https:"||p.protocol==="http:")&&window.open(p.href,"_blank","noopener")}catch{}};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[l.page]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fp-note",children:"网页在隔离环境中显示,不能访问 Hob 的数据。"}),s.jsx("iframe",{ref:i,className:"fp-frame",sandbox:"allow-scripts",src:Rt(l.path,{inline:!0})+(l.page?document.documentElement.classList.contains("dark")?"#dark":"#light":""),title:l.name})]})}function lS({meta:l}){switch(l.kind){case"image":return s.jsx(Yv,{path:l.path,name:l.name,svg:!1});case"svg":return s.jsx(Yv,{path:l.path,name:l.name,svg:!0});case"pdf":return s.jsx("iframe",{className:"fp-frame",src:Rt(l.path),title:l.name});case"audio":return s.jsx("div",{className:"fp-center",children:s.jsx("audio",{controls:!0,src:Rt(l.path)})});case"video":return s.jsx("div",{className:"fp-center",children:s.jsx("video",{controls:!0,src:Rt(l.path)})});case"html":return s.jsx(sb,{meta:l});case"other":return s.jsx("div",{className:"fp-center",children:s.jsxs("div",{className:"fp-nofile",children:[s.jsx(Z,{name:"doc",size:22}),s.jsx("div",{children:"这种文件不在浏览器里预览,可以下载后打开。"}),s.jsx("a",{className:"pbtn solid",href:Rt(l.path),download:l.name,children:"下载"})]})});default:return s.jsx(aS,{meta:l})}}function Yv({path:l,name:i,svg:c}){const[u,d]=w.useState(!1),f=Rt(l,c?{inline:!0}:void 0);return w.useEffect(()=>{if(!u)return;const g=p=>{p.key==="Escape"&&(p.stopImmediatePropagation(),d(!1))};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[u]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fp-img",children:s.jsx("button",{onClick:()=>d(!0),title:"放大",children:s.jsx("img",{src:f,alt:i})})}),u?s.jsx("div",{className:"lightbox",role:"dialog","aria-label":i,onClick:()=>d(!1),children:s.jsx("img",{src:f,alt:i})}):null]})}function aS({meta:l}){const[i,c]=w.useState(null),[u,d]=w.useState(null);if(w.useEffect(()=>{let g=!0;return c(null),d(null),(async()=>{try{const p=await fetch(Rt(l.path,{truncate:!0}));if(!p.ok)throw new Error(`读取失败(${p.status})`);g&&c(await p.text())}catch(p){g&&d(p instanceof Error?p.message:String(p))}})(),()=>{g=!1}},[l.path]),u)return s.jsx("div",{className:"fp-center fp-nofile",children:u});if(i===null)return s.jsx("div",{className:"fp-center dim",children:"正在读取内容…"});const f=l.size>eS?s.jsxs("div",{className:"fp-note",children:["文件有 ",gf(l.size),",只显示前 1 MB,完整内容请下载。"]}):null;if(l.kind==="markdown")return s.jsxs(s.Fragment,{children:[f,s.jsx(hs,{className:"fp-md",text:i})]});if(l.kind==="json"){let g=i;try{g=JSON.stringify(JSON.parse(i),null,2)}catch{}return s.jsxs(s.Fragment,{children:[f,s.jsx(Gv,{text:g})]})}return l.kind==="csv"?s.jsxs(s.Fragment,{children:[f,s.jsx(sS,{text:i,tsv:l.mime.includes("tab-separated")})]}):s.jsxs(s.Fragment,{children:[f,s.jsx(Gv,{text:i})]})}function Gv({text:l}){const[i,c]=w.useState(!0),u=w.useMemo(()=>l.split(`
228
- `),[l]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"fp-codebar",children:[s.jsxs("span",{className:"dim",children:[u.length," 行"]}),s.jsx("button",{className:"pbtn",onClick:()=>c(!i),children:i?"不自动换行":"自动换行"})]}),s.jsx("div",{className:`fp-code mono${i?" wrap":""}`,children:u.map((d,f)=>s.jsxs("div",{className:"cl",children:[s.jsx("span",{className:"ln",children:f+1}),s.jsx("span",{className:"ct",children:d||" "})]},f))})]})}function sS({text:l,tsv:i}){const c=w.useMemo(()=>iS(l,i?" ":","),[l,i]),u=w.useMemo(()=>PN(c),[c]),d=c.slice(0,1e3),[f,...g]=d;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fp-codebar",children:s.jsxs("span",{className:"dim",children:[c.length," 行",c.length>1e3?"(只显示前 1000 行)":""]})}),s.jsx("div",{className:"fp-table-wrap",children:s.jsxs("table",{className:"fp-table",children:[f?s.jsx("thead",{children:s.jsx("tr",{children:f.map((p,h)=>s.jsx("th",{className:u[h]?"numeric":void 0,children:p},h))})}):null,s.jsx("tbody",{children:g.map((p,h)=>s.jsx("tr",{children:p.map((v,b)=>s.jsx("td",{className:u[b]?"numeric":void 0,children:v},b))},h))})]})})]})}function iS(l,i){const c=[];let u=[],d="",f=!1;for(let g=0;g<l.length;g+=1){const p=l[g];f?p==='"'?l[g+1]==='"'?(d+='"',g+=1):f=!1:d+=p:p==='"'?f=!0:p===i?(u.push(d),d=""):p===`
229
- `?(u.push(d),c.push(u),u=[],d=""):p!=="\r"&&(d+=p)}return(d||u.length)&&(u.push(d),c.push(u)),c}const ib={queued:{text:"排队中",icon:"clock"},running:{text:"进行中",icon:"spin",spin:!0},waiting:{text:"待确认",icon:"pause"},done:{text:"已完成",icon:"check"},stuck:{text:"受阻",icon:"close",bad:!0},failed:{text:"失败",icon:"close",bad:!0},stopped:{text:"已停止",icon:"stop"}},rS={off:"关",minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"很高",max:"最高"},cS=["running","waiting","queued","done","stuck","failed","stopped"],uS={bash:"term",overview:"clock",generate_image:"image",read:"doc",write:"edit",edit:"edit",ls:"doc",grep:"search",find:"search",report:"rule",ask_user:"info"};function pi(l){return l.status==="running"||l.status==="queued"||l.status==="waiting"}function bf({job:l}){const i=ib[l.status];return s.jsxs("span",{className:`jt-st${i.bad?" bad":""}${l.status==="done"?" ok":""}${l.status==="running"?" live":""}`,children:[s.jsx(Z,{name:i.icon,size:13,className:`${i.spin?"spin ":""}${i.bad?"bad":""}`}),i.text]})}function vd({embedded:l=!1}){const i=Ne(),c=i.detail,u=Un(!!c,180),d=w.useRef(c);c&&(d.current=c),w.useEffect(()=>{if(!c)return;const p=h=>{h.key==="Escape"&&!i.filePreview&&hi()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[c,i.filePreview]);const f=c??d.current;if(!u.mounted||!f)return null;const g=f.kind==="job"&&i.worklog;return s.jsx("div",{className:`${l?"jd-embedded":"jd-overlay"}${u.leaving?" leaving":""}`,onClick:l?void 0:hi,children:s.jsxs("div",{className:"jd",onClick:p=>p.stopPropagation(),children:[s.jsxs("div",{className:"jdhead",children:[s.jsx("button",{className:"ib",title:g?"返回任务记录":"关闭",onClick:g?wx:hi,children:s.jsx(Z,{name:"left",size:18})}),s.jsx("span",{className:"t",children:f.kind==="jobs"?"任务记录":"任务"}),s.jsx("button",{className:"ib",title:"关闭",onClick:hi,children:s.jsx(Z,{name:"close",size:17})})]}),f.kind==="jobs"?s.jsx(bS,{}):s.jsx(oS,{id:f.id},f.id)]})})}function oS({id:l}){var N,z;const i=Ne(),c=i.jobs[l],u=i.steps[l],d=w.useRef(null),f=w.useRef(c?pi(c):!0),[g,p]=w.useState(null);if(w.useEffect(()=>{Kd().then(O=>p((O==null?void 0:O.models)??null))},[]),w.useEffect(()=>{const O=d.current;if(!O)return;const X=()=>{f.current=O.scrollHeight-O.scrollTop-O.clientHeight<80};return O.addEventListener("scroll",X),()=>O.removeEventListener("scroll",X)},[]),w.useEffect(()=>{const O=d.current;O&&f.current&&(O.scrollTop=O.scrollHeight)},[u==null?void 0:u.length,(N=u==null?void 0:u[u.length-1])==null?void 0:N.id]),!c)return s.jsx("div",{className:"jdbody",children:s.jsx("div",{className:"empty",children:"无法读取这个任务。"})});const h=i.assistants.find(O=>O.id===c.assistantId),v=!pi(c),b=c.model?((z=g==null?void 0:g.find(O=>O.ref===c.model))==null?void 0:z.name)??c.model:"",k=c.startedAt??c.createdAt,S=c.durationMs??(pi(c)?Date.now()-new Date(k).getTime():void 0),E=c.usage,y=dx(c),x=u===void 0?void 0:o1(u);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"jdbody",ref:d,children:[s.jsx("div",{className:"jd-title",children:c.title}),s.jsxs("div",{className:"jd-meta",children:[s.jsx(bf,{job:c}),h||c.assistantName?s.jsxs("span",{className:"jd-owner",children:[h?s.jsx(vt,{sprite:h.sprite,prop:h.prop,size:16}):null,(h==null?void 0:h.name)??c.assistantName]}):null,s.jsx("span",{children:Ol(k)}),S!==void 0?s.jsxs("span",{children:["用时 ",bc(S)]}):null]}),c.model||E?s.jsxs("div",{className:"jd-meta dim",children:[c.model?s.jsx("span",{className:b===c.model?"mono":void 0,title:c.model,children:b}):null,c.thinking?s.jsxs("span",{children:["思考 ",rS[c.thinking]??c.thinking]}):null,c.modelReason?s.jsx("span",{children:c.modelReason}):null,E?s.jsxs("span",{children:["输入 ",Hv(E.input)," · 输出 ",Hv(E.output),E.cost>0?` · $${E.cost.toFixed(4)}`:""]}):null]}):null,y?s.jsx("div",{className:"jd-reason",children:y}):null,v?s.jsx(Xv,{job:c}):null,s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("div",{className:"jd-instruction",children:c.instruction}),s.jsx("div",{className:"lbl",children:"执行过程"}),s.jsx("div",{className:"jd-timeline",children:x===void 0?s.jsx("div",{className:"empty",children:"正在读取执行过程…"}):x.rows.length||x.thinking?s.jsxs(s.Fragment,{children:[x.rows.map(O=>s.jsx(fS,{step:O,cwd:c.cwd},O.id)),x.thinking?s.jsx(hS,{text:x.thinking}):null]}):s.jsx("div",{className:"empty",children:"还没有执行步骤。"})}),s.jsx(xS,{job:c}),v?null:s.jsx(Xv,{job:c})]}),pi(c)?s.jsx(dS,{job:c}):null]})}function dS({job:l}){const[i,c]=w.useState(""),u=i.trim().length>0,d=()=>{u&&(Sd(l.id,i.trim()),c(""))};return s.jsxs("div",{className:"jd-foot",children:[s.jsx("input",{value:i,placeholder:"补充说明或更正方向",onChange:f=>c(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.nativeEvent.isComposing&&d()}}),s.jsx("button",{className:"pbtn solid",disabled:!u,onClick:d,children:"发送"}),l.status==="running"?s.jsx("button",{className:"pbtn",onClick:()=>void Nx(l.id),children:"停止"}):null]})}function fS({step:l,cwd:i}){const[c,u]=w.useState(!1),d=Un(c,180);if(l.kind==="text")return l.from==="user"?s.jsx("div",{className:"jd-mine",children:l.text}):s.jsxs("div",{className:"jd-textrow",children:[l.thinking?s.jsx(rb,{text:l.thinking,open:!1}):null,s.jsx(hs,{className:"jd-text",text:l.text??""})]});const f=l.title??l.name??"",g=p1(f);return s.jsxs("div",{className:`jd-tool${l.isError?" bad":""}${c?" open":""}`,children:[s.jsxs("button",{className:"jd-tool-head",onClick:()=>u(p=>!p),children:[s.jsx("span",{className:"ico",children:l.running?s.jsx(Z,{name:"spin",size:14,className:"spin"}):s.jsx(Z,{name:uS[l.name??""]??(/^(lore|memory)_/.test(l.name??"")?"mem":"more"),size:14})}),s.jsx("span",{className:"tt",children:g.map((p,h)=>s.jsx("span",{className:p.mono?"mono":void 0,children:p.text},h))}),l.thinking?s.jsx("span",{className:"blb",title:"有思考过程",children:s.jsx(Z,{name:"bulb",size:13})}):null,s.jsx("span",{className:"tm",children:l.isError?"出错":l.durationMs&&l.durationMs>=1e3?bc(l.durationMs):""}),s.jsx(Z,{name:c?"down":"chev",size:13})]}),s.jsx("div",{className:`expand${c?" open":""}`,inert:!c,children:s.jsx("div",{children:d.mounted?s.jsx(pS,{step:l,cwd:i}):null})})]})}function rb({text:l,open:i}){const[c,u]=w.useState(i);return s.jsxs("div",{className:"jd-think-in",children:[s.jsxs("button",{className:"jd-think-head",title:c?"收起思考过程":"展开思考过程",onClick:()=>u(d=>!d),children:[s.jsx("span",{className:"ico",children:s.jsx(Z,{name:"bulb",size:13})}),s.jsx("span",{className:"tt",children:"思考过程"}),s.jsx(Z,{name:c?"down":"chev",size:12})]}),c?s.jsx("div",{className:"jd-think-body",children:l}):null]})}function hS({text:l}){const[i,c]=w.useState(!1);return s.jsxs("div",{className:"jd-think",children:[s.jsxs("button",{onClick:()=>c(u=>!u),children:[s.jsx("span",{className:"ico",children:s.jsx(Z,{name:"bulb",size:14})}),s.jsx("span",{className:"tt",children:"思考中"}),s.jsx(Z,{name:i?"down":"chev",size:13})]}),i?s.jsx("div",{className:"jd-think-body",children:l}):null]})}function mS(l){var c;const i=(c=l.args)==null?void 0:c.edits;return Array.isArray(i)?i.map(u=>({oldText:String((u==null?void 0:u.oldText)??""),newText:String((u==null?void 0:u.newText)??"")})):[]}function Ud({path:l,cwd:i}){if(!l)return null;const c=l.startsWith("/")?l:i?`${i.replace(/\/+$/,"")}/${l}`:null;return c?s.jsx("button",{className:"jd-kv mono jd-path",title:c,onClick:()=>_l(c),children:l}):s.jsx("div",{className:"jd-kv mono",children:l})}function pS({step:l,cwd:i}){const c=l.args??{},u=mS(l);return s.jsxs("div",{className:"jd-tool-body",children:[l.thinking?s.jsx(rb,{text:l.thinking,open:!0}):null,u.length?s.jsxs(s.Fragment,{children:[s.jsx(Ud,{path:String(c.path??""),cwd:i}),u.map((d,f)=>s.jsx(vS,{before:d.oldText,after:d.newText},f))]}):s.jsx(gS,{step:l,args:c,cwd:i}),l.output?s.jsx(Hd,{text:l.output,className:"jd-out mono"}):null,l.outputPath?s.jsxs("button",{className:"jd-file",onClick:()=>_l(l.outputPath),children:[s.jsx(Z,{name:"doc",size:12}),"完整输出"]}):null]})}function gS({step:l,args:i,cwd:c}){if(l.name==="bash")return s.jsx(Hd,{text:String(i.command??""),className:"jd-arg mono",lines:8});if(l.name==="write")return s.jsxs("div",{className:"jd-kv-wrap",children:[s.jsx(Ud,{path:String(i.path??""),cwd:c}),s.jsxs("span",{className:"jd-kv-len",children:[String(i.contentLength??0)," 字"]})]});if(l.name==="read"||l.name==="ls"||l.name==="edit")return s.jsx(Ud,{path:String(i.path??""),cwd:c});const u=JSON.stringify(i,null,2);return u==="{}"?null:s.jsx(Hd,{text:u,className:"jd-arg mono",lines:6})}function vS({before:l,after:i}){const[c,u]=w.useState(!1),d=f1(l,i),f=c?d:d.slice(0,24);return s.jsxs("div",{className:"jd-diff",children:[f.map((g,p)=>s.jsxs("div",{className:`dl ${g.sign==="-"?"del":g.sign==="+"?"add":""}`,children:[s.jsx("span",{className:"sg",children:g.sign}),s.jsx("span",{className:"mono",children:g.text||" "})]},p)),d.length>f.length?s.jsxs("button",{className:"jd-more",onClick:()=>u(!0),children:["展开全部 ",d.length," 行"]}):null]})}function Hd({text:l,className:i,lines:c=12}){const[u,d]=w.useState(!1),f=l.split(`
230
- `).length;return s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:`${i}${u?" all":""}`,style:u?void 0:{maxHeight:`${c*1.6}em`},children:l}),f>c?s.jsx("button",{className:"jd-more",onClick:()=>d(!u),children:u?"收起":`展开全部 ${f} 行`}):null]})}function Xv({job:l}){return l.summary?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"报告"}),s.jsx(hs,{className:"jd-report",text:l.summary})]}):null}function xS({job:l}){const[i,c]=w.useState(null);w.useEffect(()=>{let f=!0;return c(null),bk(l.id).then(g=>{f&&c((g==null?void 0:g.files)??[])}),()=>{f=!1}},[l.id]);const u=new Set,d=[];for(const f of l.files??[])u.has(f)||(u.add(f),d.push({path:f,rel:f.split("/").pop()??f}));for(const f of i??[])u.has(f.path)||(u.add(f.path),d.push({path:f.path,rel:f.rel,size:f.size}));return d.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"产出文件"}),d.map(f=>s.jsxs("button",{className:"att plain filecard",onClick:()=>_l(f.path),children:[s.jsx("span",{className:"ico",children:s.jsx(Z,{name:hf(f.path),size:18})}),s.jsxs("span",{children:[s.jsx("span",{className:"n",style:{display:"block"},children:f.rel.split("/").pop()}),s.jsxs("span",{className:"m",children:[f.rel,f.size!==void 0?` · ${gf(f.size)}`:""]})]})]},f.path))]}):null}function bS(){const l=Ne(),i=l.worklog,c=(i==null?void 0:i.assistantId)??null,u=(i==null?void 0:i.status)??null;return s.jsxs("div",{className:"jdbody",children:[s.jsxs("div",{className:"jd-filters",children:[s.jsxs("select",{className:"pick",value:c??"",onChange:d=>void Td({assistantId:d.target.value||null,status:u}),children:[s.jsx("option",{value:"",children:"全部助手"}),l.assistants.map(d=>s.jsx("option",{value:d.id,children:d.name},d.id))]}),s.jsxs("select",{className:"pick",value:u??"",onChange:d=>void Td({assistantId:c,status:d.target.value||null}),children:[s.jsx("option",{value:"",children:"全部状态"}),cS.map(d=>s.jsx("option",{value:d,children:ib[d].text},d))]}),s.jsx("span",{className:"sp"}),i?s.jsxs("span",{className:"dim",children:[i.jobs.length," 个"]}):null]}),i===null?s.jsx("div",{className:"empty",children:"正在读取任务记录…"}):i.jobs.length?s.jsx("div",{className:"jd-rows",children:i.jobs.map(d=>{const f=l.jobs[d.id]??d,g=l.assistants.find(p=>p.id===f.assistantId);return s.jsxs("button",{className:"jd-row",onClick:()=>{g&&ln(f.assistantId,!1,!0,!0),ra(f.id)},children:[g?s.jsx(vt,{sprite:g.sprite,prop:g.prop,size:26}):s.jsx("span",{style:{width:26}}),s.jsx("span",{className:"n",children:f.title}),s.jsx(bf,{job:f}),s.jsx("span",{className:"tm",children:Ol(f.startedAt??f.createdAt)}),s.jsx("span",{className:"du",children:f.durationMs!==void 0?bc(f.durationMs):pi(f)?pf(f.startedAt??f.createdAt):""})]},f.id)})}):s.jsx("div",{className:"empty",children:"没有符合条件的任务。"}),i!=null&&i.hasMore?s.jsx("button",{className:"pbtn jd-morebtn",onClick:()=>void ok(),children:i.loading?"正在读取…":"加载更多"}):null]})}function yS(){const l=Ne(),[i,c]=w.useState(""),[u,d]=w.useState(!1);w.useEffect(()=>{if(!l.error)return;d(!0);const g=window.setTimeout(()=>d(!1),260);return()=>window.clearTimeout(g)},[l.error]);const f=()=>{i&&K1(i)};return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"card",children:[s.jsx(vt,{sprite:"hob",size:56}),s.jsx("div",{className:"nm",children:"Hob"}),s.jsx("div",{className:"ds",children:"请输入密码"}),s.jsx("label",{className:`field${u?" shake":""}`,children:s.jsx("input",{type:"password",autoFocus:!0,value:i,placeholder:"密码",onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&f()}})}),s.jsx("button",{className:"btn solid",onClick:f,disabled:l.loggingIn,children:l.loggingIn?"正在登录…":"登录"}),l.error?s.jsx("div",{className:"err",style:{width:"100%"},children:l.error}):null]})})}const jS=5,kS=24*3600*1e3;function bi(l,i){var u;const c=i.trim();return c?l.name.includes(c)||l.duty.includes(c)||(((u=l.last)==null?void 0:u.text)??"").includes(c):!0}function Qv(l,i){var c,u;return(((c=i.last)==null?void 0:c.at)??"").localeCompare(((u=l.last)==null?void 0:u.at)??"")}const Vv=l=>l.status==="running"||l.status==="queued"||l.status==="waiting";function cb(l,i){return(i.startedAt??i.createdAt).localeCompare(l.startedAt??l.createdAt)}function ub(l,i){return(i.endedAt??i.createdAt).localeCompare(l.endedAt??l.createdAt)}function Zv(l){const i=vf(l.schedules[0]??"");return i.kind==="raw"?1440:i.hour*60+i.minute}function NS(l,i=Date.now()){const c=l.query.trim().length>0,u=new Date(i-kS).toISOString(),d=Object.values(l.jobs),f=l.assistants.filter(E=>E.pinned&&!E.hidden&&bi(E,l.query)),g=l.assistants.filter(E=>!E.pinned&&!E.hidden&&bi(E,l.query)).sort(Qv),p=l.assistants.filter(E=>E.hidden&&bi(E,l.query)).sort(Qv),h=c?[]:Object.values(l.approvals).filter(E=>E.status==="pending").sort((E,y)=>y.createdAt.localeCompare(E.createdAt)),v=c?[]:d.filter(Vv).sort(cb),b=c?[]:d.filter(E=>!Vv(E)&&(E.endedAt??E.createdAt)>u).sort(ub).slice(0,jS),k=c?[]:l.routines.filter(E=>E.active).sort((E,y)=>Zv(E)-Zv(y)),S=!c&&!h.length&&!v.length&&!g.length&&!p.length&&!b.length&&!k.length;return{searching:c,pins:f,rows:g,hidden:p,asks:h,live:v,recent:b,routines:k,empty:S}}function ob(l){let i=l.trim();for(;;){const u=i.replace(/^cd\s+(?:"[^"]*"|'[^']*'|[^\s;&|]+)\s*(?:&&|;)\s*/,"").replace(/^timeout\s+(?:-[ks]\s+\S+\s+|-\S+\s+)*\d+(?:\.\d+)?[smhd]?\s+/,"");if(u===i)break;i=u}const c=SS.exec(i);if(c){let u=c[2];const d=Kv(u);if(d){let[f,g]=d;const p=/^(?:ba)?sh\s+-l?c\s+/.exec(f),h=p?Kv(f.slice(p[0].length)):void 0;h&&(f=h[0]+h[1]),u=f+g}i=`${c[1]}: ${ob(u)}`}return i||l.trim()}const SS=/^ssh\s+(?:-[BbcDEeFIiJLlmOoPpQRSWw]\s*\S+\s+|-[46AaCfGgKkMNnqsTtVvXxYy]+\s+)*([^\s'"-]\S*)\s+(.+)$/s;function Kv(l){const i=/^'([^']*)'?/.exec(l)??/^"((?:[^"\\]|\\.)*)"?/s.exec(l);return i?[l[0]==='"'?i[1].replace(/\\(["\\$`])/g,"$1"):i[1],l.slice(i[0].length)]:void 0}const rs=["off","minimal","low","medium","high","xhigh","max"];function db(l){return(l==null?void 0:l.thinkingLevels)??["off"]}function ji(l,i){const c=db(l);if(!l||c.includes(i))return i;const u=rs.indexOf(i);return[...c].reverse().find(d=>rs.indexOf(d)<=u)??"off"}function wS(l,i){const c=i.trim().toLowerCase();return c?l.filter(u=>u.name.toLowerCase().includes(c)||u.ref.toLowerCase().includes(c)):l}function TS(l){const i=[];for(const c of l){let u=i.find(d=>d.provider===c.provider);u||(u={provider:c.provider,models:[]},i.push(u)),u.models.push(c)}return i}const Bd={queued:"排队中",running:"进行中",waiting:"待确认",done:"已完成",stuck:"受阻",failed:"失败",stopped:"已停止"},ES={读:"读取",跑:"运行",改:"修改",写:"写入",搜:"搜索"};function Ld(l){return[ES[l.verb]??l.verb,l.verb==="跑"?ob(l.text):l.text]}function fb({mobile:l=!1}){var h;const i=Ne(),c=i.panel.kind,u=((h=i.assistants.find(v=>v.id===i.sel))==null?void 0:h.name)??"",d=c==="routine"?"定时任务":c==="newRoutine"?"新建定时任务":c==="now"?l?u:"":"助手设置",f=()=>c==="now"?Cd():tf(),g=w.useRef(!0);w.useEffect(()=>{g.current=!1},[]);const p=c==="routine"?`routine:${i.panel.id}`:c;return s.jsxs("aside",{className:"panel",children:[s.jsxs("div",{className:"phead",children:[c==="now"?l?s.jsx("button",{className:"ib",onClick:Cd,title:"收起",children:s.jsx(Z,{name:"left",size:17})}):null:s.jsx("button",{className:"ib",onClick:f,title:"返回",children:s.jsx(Z,{name:"left",size:17})}),s.jsx("span",{className:"t",children:d}),c==="now"?s.jsx("button",{className:"ib",title:"助手设置",onClick:Cx,children:s.jsx(Z,{name:"gear",size:17})}):null,l?null:s.jsx("button",{className:"ib",title:"收起右栏",onClick:hk,children:s.jsx(Z,{name:"dbl",size:17})})]}),s.jsx("div",{className:`pbody${g.current?"":c==="now"?" from-left":" from-right"}`,children:c==="routine"?s.jsx(OS,{id:i.panel.kind==="routine"?i.panel.id:""},i.panel.kind==="routine"?i.panel.id:""):c==="newRoutine"?s.jsx(AS,{}):c==="assistant"?s.jsx(HS,{},i.sel??"hob"):s.jsx(zS,{})},g.current?"first":p)]})}const CS=l=>l.id;function zS(){var y;const l=Ne(),i=Object.values(l.jobs),c=x=>x.assistantId===(l.sel??"hob"),u=x=>!!x&&(x.status==="running"||x.status==="queued"),d=i.filter(x=>c(x)&&u(x)).sort(cb)[0],f=i.filter(x=>c(x)&&!u(x)).sort(ub)[0],g=d??f,p=l.routines.filter(x=>x.assistantId===l.sel),h=ux(p,CS,l.sel??""),v=((y=l.profiles[l.sel??"hob"])==null?void 0:y.worklog)??[],b=((g==null?void 0:g.activity)??[]).slice(-8),k=b.map(x=>`${x.at}|${x.verb}|${x.text}`),S=w.useRef(null);S.current===null&&(S.current=new Set(k));const E=new Set(k.filter(x=>!S.current.has(x)));return w.useEffect(()=>{for(const x of k)S.current.add(x)}),s.jsxs(s.Fragment,{children:[g?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:`screen jd-open${d?"":" idle"}`,title:"打开任务详情",onClick:()=>ra(g.id),children:[b.map((x,N)=>x.verb==="$"?s.jsxs("div",{className:E.has(k[N])?"new":void 0,children:[s.jsx("span",{className:"p",children:"$"})," ",x.text]},k[N]):s.jsxs("div",{className:E.has(k[N])?"new":void 0,children:[s.jsx("span",{className:"v",children:Ld(x)[0]}),Ld(x)[1]]},k[N])),d?s.jsx("div",{children:s.jsx("span",{className:"cur"})}):s.jsxs("div",{className:"end",children:["— ",Bd[g.status]," —"]})]}),s.jsxs("div",{className:"caprow",children:[s.jsx("button",{className:"cap jd-open",onClick:()=>ra(g.id),children:d?`进行中 · ${g.title}`:`上一个任务 · ${g.title} · ${Bd[g.status]}`}),s.jsx("button",{className:"more",onClick:()=>Wd(l.sel??"hob"),children:"任务记录"})]})]}):s.jsx("div",{className:"slot pslot",children:"分派的任务会显示在这里"}),l.sel==="hob"?Object.values(l.delegations).filter(x=>x.status==="running"||x.status==="waiting").map(x=>{const N=l.assistants.find(z=>z.id===x.to);return s.jsxs("button",{className:"delegation-panel",onClick:()=>void Fd("hob",x.id,!1),children:[s.jsx(Z,{name:x.status==="waiting"?"pause":"spin",size:14,className:x.status==="running"?"spin":""}),"交给「",(N==null?void 0:N.name)??x.to,"」 · ",x.status==="waiting"?"等你确认":"进行中"]},x.id)}):null,s.jsxs("div",{className:"sech",children:[s.jsx("span",{children:"定时任务"}),s.jsx("button",{className:"ib",style:{width:18,height:18},title:"新建定时任务",onClick:fk,children:s.jsx(Z,{name:"plus",size:16})})]}),h.length?h.map(x=>s.jsx("div",{className:`rtrow${x.state==="still"?"":` ${x.state}`}`,children:s.jsx("div",{className:"rtclip",children:s.jsxs("button",{className:`rt${x.item.active?"":" paused"}`,onClick:()=>Pd(x.key),children:[s.jsx(Z,{name:x.item.active?"clock":"pause",size:17}),s.jsxs("div",{children:[s.jsx("div",{className:"n",children:x.item.name}),s.jsx("div",{className:"s",children:x.item.active?xf(x.item.schedules[0]??""):"已暂停"})]})]})})},x.key)):s.jsx("div",{className:"empty",children:"这个助手还没有定时任务"}),v.length?s.jsxs("div",{className:"wlgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"工作日志"})}),v.slice(0,6).map((x,N)=>s.jsxs("div",{className:"wl",children:[s.jsx("span",{className:"t",children:Ol(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${N}`))]}):null]})}function hb({value:l,onSave:i,onRemove:c}){const[u,d]=w.useState(!1),f=vf(l);if(!u)return s.jsxs("button",{className:"w",onClick:()=>d(!0),children:[s.jsx(Z,{name:"clock",size:15}),xf(l)]});const g=h=>{const v=f.kind==="raw"?{...f,kind:"daily"}:f;i(zN({...v,...h}))},p=`${String(f.hour).padStart(2,"0")}:${String(f.minute).padStart(2,"0")}`;return s.jsxs("div",{className:"w sched-edit",children:[s.jsxs("select",{value:f.kind,onChange:h=>g({kind:h.target.value}),children:[s.jsx("option",{value:"daily",children:"每天"}),s.jsx("option",{value:"weekly",children:"每周"}),s.jsx("option",{value:"monthly",children:"每月"}),s.jsx("option",{value:"raw",children:"自定义"})]}),f.kind==="weekly"?s.jsx("select",{value:f.weekday,onChange:h=>g({weekday:Number(h.target.value)}),children:Kx.map((h,v)=>s.jsxs("option",{value:v,children:["周",h]},v))}):null,f.kind==="monthly"?s.jsx("input",{type:"number",min:1,max:28,value:f.day,onChange:h=>g({day:Number(h.target.value)||1})}):null,f.kind==="raw"?s.jsx("input",{className:"rawcron",value:f.raw,onChange:h=>i(h.target.value)}):s.jsx("input",{type:"time",value:p,onChange:h=>{const[v,b]=h.target.value.split(":").map(Number);g({hour:v||0,minute:b||0})}}),c?s.jsx("button",{className:"pbtn",onClick:c,children:"删除"}):null,s.jsx("button",{className:"pbtn",onClick:()=>d(!1),children:"完成"})]})}function AS(){const l=Ne(),[i,c]=w.useState(""),[u,d]=w.useState(""),[f,g]=w.useState("0 9 * * *"),[p,h]=w.useState(!1),v=i.trim()!==""&&u.trim()!==""&&!p,b=async()=>{h(!0),await ak({assistantId:l.sel??"hob",name:i.trim(),instruction:u.trim(),schedules:[f],active:!0}),h(!1)};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"名称"}),s.jsx("label",{className:"field",children:s.jsx("input",{autoFocus:!0,value:i,placeholder:"如「每日简报」",onChange:k=>c(k.target.value)})}),s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("label",{className:"field",children:s.jsx("textarea",{rows:4,value:u,placeholder:"到点后交给后台任务执行的内容,写清楚需要什么结果",onChange:k=>d(k.target.value)})}),s.jsx("div",{className:"lbl",children:"执行时间"}),s.jsx("div",{className:"when",children:s.jsx(hb,{value:f,onSave:g})}),s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"sp"}),s.jsx("button",{className:"pbtn",onClick:tf,children:"取消"}),s.jsx("button",{className:"pbtn solid",disabled:!v,onClick:()=>void b(),children:"创建"})]})]})}function OS({id:l}){const i=Ne(),c=i.routines.find(u=>u.id===l);return c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:`tog${c.active?"":" off"}`,title:c.active?"暂停":"启用",onClick:()=>void ls(c.id,{active:!c.active})}),s.jsx("span",{style:{fontSize:14},children:"启用"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void ik(c.id),children:"立即运行"})]}),s.jsx("div",{className:"lbl",children:"名称"}),s.jsx("label",{className:"field",children:s.jsx("input",{defaultValue:c.name,onBlur:u=>{const d=u.target.value.trim();d&&d!==c.name&&ls(c.id,{name:d})}})}),s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("label",{className:"field",children:s.jsx("textarea",{rows:4,defaultValue:c.instruction,onBlur:u=>{u.target.value!==c.instruction&&ls(c.id,{instruction:u.target.value})}})}),s.jsx("div",{className:"lbl",children:"执行时间"}),s.jsxs("div",{className:"when",children:[c.schedules.map((u,d)=>s.jsx(hb,{value:u,onSave:f=>{const g=c.schedules.slice();g[d]=f,ls(c.id,{schedules:g})},onRemove:c.schedules.length>1?()=>void ls(c.id,{schedules:c.schedules.filter((f,g)=>g!==d)}):void 0},d)),s.jsxs("button",{className:"w",onClick:()=>void ls(c.id,{schedules:[...c.schedules,"0 9 * * *"]}),children:[s.jsx(Z,{name:"plus",size:14}),"添加执行时间"]})]}),s.jsx("div",{className:"lbl",children:"运行记录"}),c.runs.length?c.runs.map(u=>{const d=i.jobs[u.jobId],f=(d==null?void 0:d.status)??u.status,g=f==="running"||f==="queued",p=f==="failed"||f==="stuck";return s.jsxs("button",{className:`run${p?" bad":""}`,onClick:()=>void dk(c.assistantId,u.jobId),children:[s.jsx("span",{children:Ol(u.at)}),s.jsx(Z,{name:g?"spin":p?"close":"check",size:16,className:g?"spin":""})]},u.jobId)}):s.jsx("div",{className:"empty",children:"还没有运行记录"}),s.jsx("div",{style:{marginTop:18},children:s.jsx("button",{className:"pbtn",onClick:async()=>{window.confirm(`删除定时任务「${c.name}」?已有的运行记录会保留在对话里。`)&&(await sk(c.id),tf())},children:"删除定时任务"})})]}):s.jsx("div",{className:"empty",children:"这个定时任务已不存在。"})}function yc(l){const[i,c]=w.useState(null),[u,d]=w.useState(!1);return w.useEffect(()=>{if(i!=="已保存")return;const g=setTimeout(()=>c(null),3e3);return()=>clearTimeout(g)},[i]),{save:async g=>{d(!0);const p=await wd(l,g);return d(!1),c(p??"已保存"),!p},busy:u,message:i,fail:g=>c(g)}}function jc({message:l}){return l?s.jsx("div",{role:"status",className:l==="已保存"?"okline":"badline",children:l}):null}function ec({value:l,multiline:i,placeholder:c,save:u}){const[d,f]=w.useState(l);w.useEffect(()=>f(l),[l]);const g={value:d,placeholder:c,onChange:p=>f(p.target.value),onBlur:()=>{d!==l&&u(d).then(p=>{p||f(l)})},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),p.currentTarget.blur())}};return s.jsx("label",{className:"field",children:i?s.jsx("textarea",{rows:4,...g}):s.jsx("input",{...g})})}function _S({aid:l}){const i=Ne(),c=yc(l),u=i.profiles[l],[d,f]=w.useState(null);w.useEffect(()=>{Kd().then(f)},[]);const g=i.settings.settings.models.roster;if(!u)return null;const p=u.assistant.models??{},h=i.settings.settings.models,v=N=>{var z;return((z=d==null?void 0:d.models.find(O=>O.ref===N))==null?void 0:z.name)??N},b=N=>g.find(z=>z.ref===N),k=N=>void c.save({models:N}),S=N=>z=>{var X;const O={...p};if(z){const P=N==="conversation"?h.conversation.thinking:h.work.thinking;O[N]={ref:z,thinking:ji(d==null?void 0:d.models.find(te=>te.ref===z),((X=b(z))==null?void 0:X.thinking)??P)}}else delete O[N];k(O)},E=p.allowed??[],y=N=>{const z={...p};N.length?z.allowed=N:delete z.allowed,k(z)},x=(N,z)=>{var O;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:N}),s.jsx("div",{className:"ctl",children:s.jsxs("select",{className:"pick grow",value:((O=p[z])==null?void 0:O.ref)??"",onChange:X=>S(z)(X.target.value),children:[s.jsxs("option",{value:"",children:["跟随全局(",v(z==="conversation"?h.conversation.ref:h.work.ref),")"]}),g.map(X=>s.jsx("option",{value:X.ref,children:v(X.ref)},X.ref))]})})]})};return s.jsxs(s.Fragment,{children:[s.jsx(jc,{message:c.message}),x("对话模型","conversation"),x("默认任务模型","work"),s.jsx("div",{className:"lbl",children:"可分派的模型"}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:`pbtn${E.length?"":" solid"}`,onClick:()=>y([]),children:"全部"}),s.jsx("button",{className:`pbtn${E.length?" solid":""}`,onClick:()=>y(g.map(N=>N.ref)),children:"指定"}),s.jsx("span",{className:"note",style:{margin:0},children:E.length?`已选 ${E.length} 个`:`可用模型共 ${g.length} 个`})]}),E.length?s.jsx("div",{className:"chips",style:{marginTop:8},children:g.map(N=>{const z=E.includes(N.ref);return s.jsx("button",{className:`chip${z?" on":""}`,onClick:()=>y(z?E.filter(O=>O!==N.ref):[...E,N.ref]),children:v(N.ref)},N.ref)})}):null]})}function MS({aid:l}){const i=Ne(),c=yc(l),u=i.profiles[l];if(!u)return null;const d=u.assistant.abilities??{exec:!0,write:!0,image:!0},f=i.settings.settings.image.source!=="off",g=h=>void c.save({abilities:{...d,...h}}),p=(h,v,b,k)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:h}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${v?"":" off"}`,title:v?"关闭":"开启",onClick:b})]}),k?s.jsx("div",{className:"note",children:k}):null]});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"能力"}),s.jsx(jc,{message:c.message}),p("执行命令",d.exec,()=>g({exec:!d.exec}),"开启后,任务可以运行命令,并可通过命令访问网络。"),p("修改文件",d.write,()=>g({write:!d.write}),"开启后,任务可以创建和修改文件。"),f?p("图像生成",d.image,()=>g({image:!d.image}),"开启后,任务可以生成图片,图片以缩略图显示在对话中。"):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctl",style:{marginTop:8},children:[s.jsx("span",{style:{fontSize:14,color:"var(--text3)"},children:"图像生成"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"tog off",disabled:!0,title:"需要先在 设置 → 图像生成 中完成配置"})]}),s.jsx("div",{className:"note",children:"需要先在 设置 → 图像生成 中完成配置。"})]}),s.jsx("div",{className:"note",children:"读取文件始终可用。"})]})}function RS({aid:l,sprite:i,prop:c,onDone:u}){const d=yc(l),f=Rx(i)??{prop:"hob",color:"slate"},g=p=>{p!==i&&d.save({sprite:p})};return s.jsxs(s.Fragment,{children:[s.jsx(jc,{message:d.message}),s.jsxs("div",{className:"sprite-pick",children:[c?s.jsx("button",{className:f.prop==="custom"?"on":void 0,title:"自画道具",onClick:()=>g(hd(f.color)),children:s.jsx(vt,{sprite:hd(f.color),prop:c,size:34})}):null,Nk.map(p=>s.jsx("button",{className:p===f.prop?"on":void 0,title:ca[p].label,onClick:()=>g(md(p,f.color)),children:s.jsx(vt,{sprite:md(p,f.color),size:34})},p))]}),s.jsxs("div",{className:"sprite-colors",children:[Sk.map(p=>s.jsx("button",{className:p===f.color?"on":void 0,title:fs[p].name,style:{background:fs[p].o},onClick:()=>g(f.prop==="custom"?hd(p):md(f.prop,p))},p)),s.jsx("button",{className:"pbtn",onClick:u,children:"完成"})]})]})}function DS({aid:l,rule:i}){const[c,u]=w.useState(!1),[d,f]=w.useState(i.text),[g,p]=w.useState(!1),[h,v]=w.useState(!1),[b,k]=w.useState(null),S=w.useRef(!1);w.useEffect(()=>{if(b!=="已保存")return;const x=setTimeout(()=>k(null),3e3);return()=>clearTimeout(x)},[b]);const E=async x=>{v(!0);const N=await ck(l,{id:i.id,...x});v(!1),k(N??"已保存"),N||u(!1)},y=()=>{if(S.current){S.current=!1;return}const x=d.trim();if(x===i.text){u(!1);return}if(!x){k("规则内容不能为空。");return}E({text:x})};return s.jsxs("div",{className:"rule-wrap",children:[s.jsxs("div",{className:"rule",children:[c?s.jsx("input",{className:"rule-input",autoFocus:!0,value:d,maxLength:1e3,disabled:h,onChange:x=>f(x.target.value),onBlur:y,onKeyDown:x=>{x.key==="Enter"&&x.currentTarget.blur(),x.key==="Escape"&&(S.current=!0,f(i.text),u(!1))}}):s.jsx("button",{className:"rule-text",onClick:()=>{S.current=!1,f(i.text),u(!0)},disabled:h,title:"编辑规则",children:i.text}),s.jsxs("span",{className:"v",children:[s.jsx("button",{className:"rule-mode",disabled:h,onClick:()=>void E({mode:i.mode==="ask"?"allow":"ask"}),title:"切换确认方式",children:i.mode==="ask"?"需确认":"直接执行"}),s.jsx("button",{className:"del",title:"删除这条规则",disabled:h,onClick:()=>p(!0),children:s.jsx(Z,{name:"close",size:13})})]})]}),g?s.jsxs("div",{className:"rule-confirm",children:[s.jsx("span",{children:"确定删除这条规则?"}),s.jsx("button",{className:"pbtn",onClick:()=>p(!1),children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>void uk(l,i.id),children:"确认删除"})]}):null,b?s.jsx("div",{className:b==="已保存"?"okline":"badline",role:"status",children:b}):null]})}function US({aid:l}){const[i,c]=w.useState(!1),[u,d]=w.useState(""),[f,g]=w.useState("ask"),[p,h]=w.useState(!1),[v,b]=w.useState(null);w.useEffect(()=>{if(v!=="已保存")return;const E=setTimeout(()=>b(null),3e3);return()=>clearTimeout(E)},[v]);const k=()=>{c(!1),d(""),g("ask"),b(null)},S=async()=>{if(p||!u.trim())return;h(!0),b(null);const E=await rk(l,u.trim(),f);if(h(!1),E){b(E);return}d(""),g("ask"),c(!1),b("已保存")};return s.jsxs("div",{className:"rule-wrap",children:[i?s.jsxs("form",{className:"rule-new",onSubmit:E=>{E.preventDefault(),S()},onKeyDown:E=>{E.key==="Escape"&&!p&&(E.preventDefault(),k())},children:[s.jsx("input",{className:"rule-input",autoFocus:!0,"aria-label":"规则文字",placeholder:"输入规则内容",maxLength:1e3,value:u,disabled:p,onChange:E=>d(E.target.value)}),s.jsxs("div",{className:"ctl",children:[s.jsxs("select",{className:"pick","aria-label":"规则确认方式",value:f,disabled:p,onChange:E=>g(E.target.value),children:[s.jsx("option",{value:"ask",children:"需确认"}),s.jsx("option",{value:"allow",children:"直接执行"})]}),s.jsx("span",{className:"sp"}),s.jsx("button",{type:"button",className:"pbtn",disabled:p,onClick:k,children:"取消"}),s.jsx("button",{type:"submit",className:"pbtn solid",disabled:p||!u.trim(),children:p?"正在保存…":"保存"})]})]}):s.jsx("button",{className:"rule-add",onClick:()=>{b(null),c(!0)},children:"+ 新增规则"}),v?s.jsx("div",{className:v==="已保存"?"okline":"badline",role:"status",children:v}):null]})}function HS(){const l=Ne(),i=l.sel??"hob",c=l.profiles[i],[u,d]=w.useState(!1),[f,g]=w.useState(!1),p=yc(i);if(!c)return s.jsx("div",{className:"empty",children:"正在读取档案…"});const h=c.assistant;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"pgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"基本信息"})}),s.jsx("div",{className:"bigav",children:s.jsx(vt,{sprite:h.sprite,prop:h.prop,size:68,onClick:()=>d(v=>!v),title:"换头像"})}),u?s.jsx(RS,{aid:i,sprite:h.sprite,prop:h.prop,onDone:()=>d(!1)}):null,s.jsx(jc,{message:p.message}),s.jsx("div",{className:"lbl",children:"名字"}),s.jsx(ec,{value:h.name,save:v=>v.trim()?p.save({name:v.trim()}):(p.fail("名字不能为空。"),Promise.resolve(!1))}),s.jsx("div",{className:"lbl",children:"职责简介"}),s.jsx(ec,{value:h.duty,save:v=>p.save({duty:v})}),s.jsx("div",{className:"lbl",children:"详细职责"}),s.jsx(ec,{multiline:!0,value:h.dutyLong??"",save:v=>p.save({dutyLong:v})}),s.jsx("div",{className:"lbl",children:"补充说明"}),s.jsx(ec,{multiline:!0,value:h.instructions,placeholder:"这个助手特有的做法,如“周报先列要点再展开”",save:v=>p.save({instructions:v})})]}),s.jsxs("div",{className:"pgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"工作方式"})}),s.jsx("div",{className:"lbl",children:"执行前确认"}),s.jsx("div",{className:"note",children:"标为「需确认」的事项,助手执行前会先征求你的同意。"}),s.jsxs("div",{className:"field",style:{padding:"2px 12px"},children:[c.rules.length?c.rules.map(v=>s.jsx(DS,{aid:i,rule:v},v.id)):s.jsx("div",{className:"empty",children:"还没有需要执行前确认的规则"}),s.jsx(US,{aid:i},i)]}),s.jsx(_S,{aid:i}),s.jsx(MS,{aid:i})]}),s.jsxs("div",{className:"pgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"显示与通知"})}),s.jsx("div",{className:"lbl",children:"通知"}),s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:"需要确认时通知我"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${h.notify?"":" off"}`,title:h.notify?"关闭通知":"开启通知",disabled:p.busy,onClick:()=>void p.save({notify:!h.notify})})]}),s.jsx("div",{className:"note",children:"要在手机上接收推送,请先在 设置 → 通知 中开启本机推送。"}),h.primary?null:s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"位置"}),s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:"放在顶部"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${h.pinned?"":" off"}`,title:h.pinned?"取消置顶":"放在顶部",disabled:p.busy,onClick:()=>void p.save({pinned:!h.pinned})})]})]}),h.primary?null:s.jsx("div",{className:"mergebar",children:s.jsx("button",{className:"pbtn",onClick:()=>void p.save({hidden:!h.hidden}),children:h.hidden?"放回列表":"收起这个助手"})})]}),h.primary?null:s.jsxs("div",{className:"pgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"危险操作"})}),s.jsx("div",{className:"mergebar",children:f?s.jsxs("div",{className:"mergeconfirm",children:["将「",h.name,"」并回 Hob?它的定时任务和执行前确认规则会转给 Hob,对话记录会保留归档,这个助手会从列表中移除。",s.jsxs("div",{className:"acts",children:[s.jsx("button",{className:"pbtn solid",onClick:()=>void nk(i),children:"确认并回"}),s.jsx("button",{className:"pbtn",onClick:()=>g(!1),children:"取消"})]})]}):s.jsx("button",{className:"pbtn danger",onClick:()=>g(!0),children:"并回 Hob"})})]})]})}function yf(l){const i=Ne();return!!(l&&(l.busy||Object.values(i.jobs).some(c=>c.assistantId===l.id&&["running","queued","waiting"].includes(c.status))||Object.values(i.delegations).some(c=>(c.from===l.id||c.to===l.id)&&["running","waiting"].includes(c.status))))}function mb({a:l,sel:i,size:c=52}){const u=_x(l),d=yf(l);return s.jsxs("button",{className:`pin${i?" sel":""}`,...u.handlers,onClick:()=>{u.takeHeld()||ln(l.id)},children:[s.jsx(vt,{sprite:l.sprite,prop:l.prop,size:c,motion:d?"home":void 0}),l.unread>0?s.jsx("span",{className:"badge"}):null,s.jsx("div",{className:"nm",children:l.name}),s.jsx("div",{className:"sub",children:l.duty})]})}function pb(l){return l===1?{cls:" n1",size:72}:l===2?{cls:" n2",size:62}:{cls:"",size:52}}function Jv({a:l,sel:i,size:c=42,onClick:u}){var g,p;const d=_x(l),f=yf(l);return s.jsxs("button",{className:`row${i?" sel":""}`,...d.handlers,onClick:()=>{d.takeHeld()||(u?u():ln(l.id))},children:[s.jsx(vt,{sprite:l.sprite,prop:l.prop,size:c,motion:f?"home":void 0}),s.jsxs("div",{className:"main",children:[s.jsxs("div",{className:"l1",children:[s.jsx("span",{className:"nm",children:l.name}),s.jsx("span",{className:"tm",children:ac((g=l.last)==null?void 0:g.at)})]}),s.jsx("div",{className:"pv",children:((p=l.last)==null?void 0:p.text)??l.duty})]})]})}function BS(l,i){const c=l.activity.at(-1);return[i==null?void 0:i.name,c?Ld(c).join(" "):""].filter(Boolean).join(" · ")}function Iv(l,i){i&&ln(l.assistantId),ra(l.id)}function Fv({job:l,owner:i,time:c,text:u,size:d,onClick:f}){return s.jsxs("button",{className:"row job",onClick:f,children:[s.jsx($d,{owner:i,size:d}),s.jsx("span",{className:"nm",children:l.title}),s.jsx("span",{className:"tm",children:c}),s.jsx("span",{className:"pv",children:u}),s.jsx(bf,{job:l})]})}function ss({title:l,more:i,children:c}){return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gt",children:[s.jsx("span",{children:l}),i]}),c]})}function $d({owner:l,size:i}){const c=yf(l);return l?s.jsx(vt,{sprite:l.sprite,prop:l.prop,size:i,motion:c?"home":void 0}):s.jsx("span",{style:{width:i,flex:"none"}})}function Wv({title:l,text:i}){return s.jsx(ss,{title:l,children:s.jsx("div",{className:"slot",children:i})})}function gb({size:l=42,markSel:i=!1}){const c=Ne(),[u,d]=w.useState(!0),f=NS(c),g=h=>c.assistants.find(v=>v.id===h),p=!u||f.searching;return s.jsxs(s.Fragment,{children:[f.asks.length?s.jsx(ss,{title:"待确认",children:f.asks.map(h=>{var v;return s.jsxs("button",{className:"row",onClick:()=>void ln(h.assistantId),children:[s.jsx($d,{owner:g(h.assistantId),size:l}),s.jsxs("div",{className:"main",children:[s.jsxs("div",{className:"l1",children:[s.jsx("span",{className:"nm",children:h.title}),s.jsx("span",{className:"tm",children:ac(h.createdAt)})]}),s.jsxs("div",{className:"pv",children:[((v=g(h.assistantId))==null?void 0:v.name)??""," · 等待你的选择"]})]})]},h.id)})}):null,f.live.length?s.jsx(ss,{title:"进行中",children:f.live.map(h=>s.jsx(Fv,{job:h,owner:g(h.assistantId),time:pf(h.startedAt??h.createdAt),text:BS(h,g(h.assistantId)),size:l,onClick:()=>Iv(h,g(h.assistantId))},h.id))}):null,f.rows.length||f.hidden.length?s.jsxs(ss,{title:"日常",children:[f.rows.map(h=>s.jsx(Jv,{a:h,size:l,sel:i&&h.id===c.sel},h.id)),f.hidden.length&&!f.searching?s.jsxs("button",{className:"fold",onClick:()=>d(h=>!h),children:[s.jsx("span",{children:"收起的助手"}),s.jsxs("span",{children:[f.hidden.length,s.jsx(Z,{name:u?"chev":"down",size:13})]})]}):null,s.jsx("div",{className:`expand${p?" open":""}`,inert:!p,children:s.jsx("div",{children:f.hidden.map(h=>s.jsx(Jv,{a:h,size:l,sel:i&&h.id===c.sel},h.id))})})]}):null,f.recent.length?s.jsx(ss,{title:"最近任务",more:s.jsx("button",{className:"more",onClick:()=>Wd(),children:"全部"}),children:f.recent.map(h=>s.jsx(Fv,{job:h,owner:g(h.assistantId),time:ac(h.endedAt??h.createdAt),text:h.summary||h.statusReason||"",size:l,onClick:()=>Iv(h,g(h.assistantId))},h.id))}):null,f.routines.length?s.jsx(ss,{title:"定时任务",children:f.routines.map(h=>{const v=h.runs[0];return s.jsxs("button",{className:"row",onClick:()=>{ln(h.assistantId,!1,!1),Pd(h.id)},children:[s.jsx($d,{owner:g(h.assistantId),size:l}),s.jsxs("div",{className:"main",children:[s.jsxs("div",{className:"l1",children:[s.jsx("span",{className:"nm",children:h.name}),s.jsx("span",{className:"tm",children:xf(h.schedules[0]??"")})]}),s.jsx("div",{className:"pv",children:v?`上次运行 ${ac(v.at)} · ${Bd[v.status]}`:"尚未运行"})]})]},h.id)})}):null,f.empty?s.jsxs(s.Fragment,{children:[s.jsx(Wv,{title:"最近任务",text:"分派的任务会显示在这里"}),s.jsx(Wv,{title:"定时任务",text:"定时任务会显示在这里"})]}):null]})}function LS(){const l=Ne(),i=l.assistants.filter(u=>u.pinned&&!u.hidden&&bi(u,l.query)),c=pb(i.length);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mhead",children:[s.jsx("button",{className:"me",title:"设置",onClick:ef,children:s.jsx(Z,{name:"user",size:17})}),s.jsx("span",{className:"sp"}),l.search?s.jsxs("div",{className:"msearch",children:[s.jsx(Z,{name:"search",size:15}),s.jsx("input",{autoFocus:!0,value:l.query,placeholder:"搜索助手",onChange:u=>zx(u.target.value)}),s.jsx("button",{onClick:()=>Sv(!1),title:"关闭搜索",children:s.jsx(Z,{name:"close",size:14})})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"ib",title:"搜索助手",onClick:()=>Sv(!0),children:s.jsx(Z,{name:"search",size:19})}),s.jsx("button",{className:"ib",title:"创建专属助手",onClick:Ex,children:s.jsx(Z,{name:"plus",size:21})})]})]}),s.jsx("div",{className:`mpins${c.cls}`,children:i.map(u=>s.jsx(mb,{a:u,size:c.size},u.id))}),s.jsx("div",{className:"mlist",children:s.jsx(gb,{size:36})})]})}function $S({leaving:l}){return s.jsx("div",{className:`mfull${l?" leaving":""}`,children:s.jsx(fb,{mobile:!0})})}const vb={smart:[{value:25,label:"一般"},{value:50,label:"较聪明"},{value:75,label:"很聪明"},{value:100,label:"最聪明"}],cost:[{value:0,label:"免费"},{value:20,label:"很低"},{value:50,label:"中等"},{value:75,label:"较高"},{value:100,label:"特别贵"}],speed:[{value:25,label:"较慢"},{value:50,label:"中等"},{value:75,label:"较快"},{value:100,label:"很快"}]};function jf(l){const i=`${l.id} ${l.name}`;return/(?:^|[^a-z])mini|haiku|lite/i.test(i)?{smart:40,cost:10,speed:95}:/flash/i.test(i)?{smart:60,cost:20,speed:85}:/gpt[-\s]?[56](?:\D|$)|opus|pro|sol/i.test(i)?{smart:90,cost:80,speed:40}:l.reasoning?{smart:70,cost:50,speed:50}:{smart:50,cost:50,speed:60}}function Pv(l,i){return vb[l].reduce((c,u)=>Math.abs(u.value-i)<Math.abs(c.value-i)?u:c).label}function xb(l){return`聪明 ${l.smart}% · 成本 ${l.cost}% · 速度 ${l.speed}%`}function kf(l){if(l>=1e6){const i=l/1e6;return`${Number.isInteger(i)?i:i.toFixed(1)}M`}return`${Math.round(l/1e3)}K`}function dt({title:l,desc:i}){return s.jsxs("div",{className:"setintro",children:[s.jsx("div",{className:"h",children:l}),s.jsx("div",{className:"d",children:i})]})}function ms({items:l,value:i,onChange:c,disabled:u}){return s.jsx("div",{className:"seg",role:"radiogroup",style:{"--seg-count":l.length,"--seg-index":Math.max(0,l.findIndex(d=>d.key===i))},children:l.map(d=>s.jsx("button",{role:"radio","aria-checked":i===d.key,className:i===d.key?"on":void 0,onClick:()=>c(d.key),disabled:u,children:d.label},d.key))})}function xe({children:l}){return s.jsx("div",{className:"group",children:l})}function fa({saved:l,error:i,children:c}){return s.jsxs("div",{className:"sfoot",children:[l&&!i?s.jsx("span",{className:"okline",children:"已保存"}):null,i?s.jsx("span",{className:"badline",children:i}):null,s.jsx("span",{className:"sp"}),c]})}function aa(){const[l,i]=w.useState(null),[c,u]=w.useState(!1);return w.useEffect(()=>{if(l!=="已保存")return;const f=setTimeout(()=>i(null),3e3);return()=>clearTimeout(f)},[l]),{save:async f=>{u(!0);const g=await Zd(f);return u(!1),i(g?"已保存":ia().notice??"保存失败,请重试。"),g},busy:c,message:l}}function nn({message:l,toast:i=!1}){return l?s.jsx("span",{className:`${l==="已保存"?"okline":"badline"}${i?" savetoast":""}`,role:"status",children:l}):null}function os({value:l,placeholder:i,multiline:c,onSave:u}){const[d,f]=w.useState(l),[g,p]=w.useState(!1);w.useEffect(()=>f(l),[l]);const h=async()=>{if(g||d===l)return;p(!0);const b=await u(d);p(!1),b||f(l)},v={value:d,placeholder:i,disabled:g,onChange:b=>f(b.target.value),onBlur:()=>void h(),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),b.currentTarget.blur())}};return s.jsx("div",{className:"field",children:c?s.jsx("textarea",{...v,rows:3}):s.jsx("input",{...v})})}const xd=[{id:"general",label:"通用"},{id:"providers",label:"服务商"},{id:"models",label:"模型"},{id:"memory",label:"记忆"},{id:"image",label:"图像生成"},{id:"search",label:"联网搜索"},{id:"skills",label:"技能"},{id:"work",label:"任务"},{id:"push",label:"通知"},{id:"about",label:"关于"}],qS=[{key:"system",label:"跟随系统"},{key:"light",label:"浅色"},{key:"dark",label:"深色"}];function YS(){var i;return((i=Intl.supportedValuesOf)==null?void 0:i.call(Intl,"timeZone"))??[]}function GS({narrow:l,leaving:i}){var f,g;const c=Ne(),u=c.section??(l?null:"general"),d=w.useRef(null);return w.useEffect(()=>{var p;(p=d.current)==null||p.scrollTo(0,0)},[u,c.sub]),l&&u===null?s.jsxs("div",{className:`setpage narrow${i?" leaving":""}`,children:[s.jsxs("div",{className:"sethead",children:[s.jsx("button",{className:"ib",title:"返回",onClick:Ed,children:s.jsx(Z,{name:"left",size:17})}),s.jsx("span",{className:"t",children:"设置"})]}),s.jsx("div",{className:"setbody",children:xd.map(p=>s.jsxs("button",{className:"setitem",onClick:()=>us(p.id),children:[s.jsx("span",{children:p.label}),s.jsx(Z,{name:"chev",size:15})]},p.id))})]}):s.jsxs("div",{className:`setpage${l?" narrow":""}${i?" leaving":""}`,children:[l?s.jsxs("div",{className:"sethead",children:[s.jsx("button",{className:"ib",title:"返回",onClick:c.sub?pn:()=>us(null),children:s.jsx(Z,{name:"left",size:17})}),s.jsx("span",{className:"t",children:((f=c.sub)==null?void 0:f.title)??((g=xd.find(p=>p.id===u))==null?void 0:g.label)??"设置"})]}):s.jsxs("div",{className:"setnav",children:[s.jsx("div",{className:"setnavtitle",children:"设置"}),xd.map(p=>s.jsx("button",{className:`navrow${u===p.id?" sel":""}`,onClick:()=>us(p.id),children:p.label},p.id)),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"navrow",onClick:Ed,children:"返回 Hob"})]}),s.jsx("div",{className:"setmain",ref:d,children:u==="providers"?s.jsx(JS,{}):u==="models"?s.jsx(nw,{}):u==="memory"?s.jsx(dw,{}):u==="image"?s.jsx(pw,{}):u==="search"?s.jsx(jw,{}):u==="skills"?s.jsx(xw,{}):u==="work"?s.jsx(iw,{}):u==="push"?s.jsx(rw,{}):u==="about"?s.jsx(Nw,{}):s.jsx(XS,{})})]})}function XS(){const l=Ne(),i=l.settings.settings.general.aboutYou,c=aa(),u=aa(),d=aa(),f=aa(),[g,p]=w.useState(null);return w.useEffect(()=>{if(!g)return;const h=setTimeout(()=>p(null),4e3);return()=>clearTimeout(h)},[g]),s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"通用",desc:"主题、头像、时区、个人信息、登录密码。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"主题"}),s.jsx(ms,{items:qS,value:l.theme,disabled:c.busy,onChange:h=>void c.save({general:{theme:h}})}),s.jsx(nn,{message:c.message})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"头像底色"}),s.jsx("button",{className:`tog${l.settings.settings.general.avatarBackground===!1?" off":""}`,"aria-label":"头像底色","aria-pressed":l.settings.settings.general.avatarBackground!==!1,disabled:f.busy,onClick:()=>void f.save({general:{avatarBackground:l.settings.settings.general.avatarBackground===!1}})}),s.jsx(nn,{message:f.message}),s.jsx("div",{className:"note",children:"关掉后头像只显示像素小人,不带彩色圆底。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"时区"}),s.jsx(QS,{value:l.settings.settings.general.timezone,onSave:h=>u.save({general:{timezone:h}})}),s.jsx(nn,{message:u.message}),s.jsx("div",{className:"note",children:"助手的「现在时间」和定时任务都按这个时区算。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"展示页面"}),s.jsx("button",{className:`tog${l.settings.settings.general.showPage===!1?" off":""}`,"aria-label":"展示页面","aria-pressed":l.settings.settings.general.showPage!==!1,disabled:c.busy,onClick:()=>void c.save({general:{showPage:l.settings.settings.general.showPage===!1}})}),s.jsx(nn,{message:c.message}),s.jsx("div",{className:"note",children:"允许助手把适合可视化的内容展示为页面。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"个人信息"}),s.jsx("div",{className:"lbl sub",children:"称呼"}),s.jsx(os,{placeholder:"如「王先生」",value:i.name,onSave:h=>d.save({general:{aboutYou:{name:h.trim()}}})}),s.jsx("div",{className:"lbl sub",children:"语言"}),s.jsx(os,{placeholder:"如「中文」",value:i.language,onSave:h=>d.save({general:{aboutYou:{language:h.trim()}}})}),s.jsx("div",{className:"lbl sub",children:"其他"}),s.jsx(os,{multiline:!0,placeholder:"如「不要看融资新闻」",value:i.notes,onSave:h=>d.save({general:{aboutYou:{notes:h}}})}),s.jsx(nn,{message:d.message}),s.jsx("div",{className:"note",children:"所有助手都会参考这些信息;未填写的项不使用。"})]}),s.jsx(xe,{children:s.jsxs("div",{className:"formcard",children:[s.jsx(VS,{onDone:p}),g?s.jsx("div",{className:"note",children:g}):null]})})]})}function QS({value:l,onSave:i}){const c=YS(),[u,d]=w.useState(l),[f,g]=w.useState(!1),[p,h]=w.useState(null),v=w.useRef(null);w.useEffect(()=>d(l),[l]),w.useEffect(()=>{if(!f)return;const S=E=>{var y;(y=v.current)!=null&&y.contains(E.target)||g(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const b=c.filter(S=>S.toLowerCase().includes(u.trim().toLowerCase())).slice(0,40),k=S=>{g(!1),h(null),d(S),S!==l&&i(S).then(E=>{E||d(l)})};return s.jsxs("div",{className:"tz",ref:v,children:[s.jsx("label",{className:"field",children:s.jsx("input",{value:u,placeholder:"搜索时区,如 Berlin",onFocus:()=>g(!0),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),S.currentTarget.blur())},onChange:S=>{d(S.target.value),g(!0)},onBlur:()=>{u.trim()!==l&&(c.includes(u.trim())?k(u.trim()):(d(l),h("时区无效,请从列表中选择。")))}})}),p?s.jsx("div",{className:"badline",role:"status",children:p}):null,f&&b.length?s.jsx("div",{className:"tzlist",children:b.map(S=>s.jsx("button",{className:S===l?"sel":"",onMouseDown:()=>k(S),children:S},S))}):null]})}function VS({onDone:l}){const[i,c]=w.useState(""),[u,d]=w.useState(""),[f,g]=w.useState(""),[p,h]=w.useState(!1),v=async()=>{if(p)return;if(!i||!u){l("请填写旧密码和新密码。");return}if(u!==f){l("两次输入的新密码不一致。");return}h(!0);const b=await S1(i,u);if(h(!1),b){l(`修改失败:${b}`);return}c(""),d(""),g(""),l("密码已修改。")};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"登录密码"}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",placeholder:"旧密码",value:i,onChange:b=>c(b.target.value)})}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",placeholder:"新密码",value:u,onChange:b=>d(b.target.value)})}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",placeholder:"再次输入新密码",value:f,onChange:b=>g(b.target.value)})}),s.jsxs(fa,{saved:!1,error:null,children:[i||u||f?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",disabled:p||!(i||u||f),onClick:()=>{c(""),d(""),g(""),l("")},children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void v(),disabled:p||!i||!u||!f,children:p?"正在验证…":"保存"})]})]})}function bb({value:l,options:i,label:c,icon:u,onChange:d}){return s.jsxs("span",{className:"ctl",children:[u?s.jsx(Z,{name:u,size:14}):null,s.jsx("select",{className:"pick","aria-label":c,value:l,onChange:f=>d(f.target.value),children:i.map(f=>s.jsx("option",{value:f.value,children:f.text},f.value))})]})}function yb({value:l,model:i,onChange:c}){const u=db(i);return u.length===1?null:s.jsx(bb,{value:l,label:"思考强度",icon:"bulb",options:u.map(d=>({value:d,text:nc[d]})),onChange:c})}function ex({modelRef:l,info:i,disabled:c,onSaved:u}){const[d,f]=w.useState(!1),[g,p]=w.useState(null),[h,v]=w.useState(""),[b,k]=w.useState(!1),[S,E]=w.useState(null),[y,x]=w.useState(!1);w.useEffect(()=>{if(!y)return;const V=setTimeout(()=>x(!1),3e3);return()=>clearTimeout(V)},[y]);const N=g??i.levels,z=rs.filter(V=>!N.some($=>$.level===V)),O=g!==null,X=V=>{p(V.slice().sort(($,L)=>rs.indexOf($.level)-rs.indexOf(L.level))),E(null),x(!1)},P=async V=>{k(!0),E(null);const $=await E1(l,V);if(k(!1),!$.ok){p(null),E($.error);return}p(null),x(!0),u($.thinking,$.settings)},te=(V=N)=>{const $={};for(const L of rs){const ue=V.find(Se=>Se.level===L);$[L]=ue?ue.text.trim():null}P($)};return s.jsxs("div",{className:"think-levels",children:[s.jsxs("button",{className:"thinkhead",onClick:()=>f(V=>!V),disabled:b,children:[s.jsx("span",{className:"lbl sub",children:"思考档"}),s.jsxs("span",{className:"note",children:[N.length," 档",i.custom?" · 有自定义":" · 默认"]}),s.jsx(Z,{name:d?"down":"chev",size:14})]}),s.jsx("div",{className:`expand${d?" open":""}`,inert:!d,children:s.jsxs("div",{children:[s.jsx("div",{className:"thinkrows",children:N.map(V=>s.jsxs("div",{className:"thinkrow",children:[s.jsx("span",{className:"tname",children:nc[V.level]}),s.jsx("input",{className:"ttext",value:V.text,placeholder:"默认",title:"留空就按服务商协议的默认值发",onChange:$=>X(N.map(L=>L.level===V.level?{...L,text:$.target.value}:L)),onBlur:()=>{O&&te()},onKeyDown:$=>{$.key==="Enter"&&$.currentTarget.blur()},disabled:b||c}),V.level==="off"?s.jsx("span",{className:"rremove still",title:"关闭这一档不能删","aria-hidden":!0}):s.jsx("button",{className:"rremove",title:`删掉「${nc[V.level]}」`,onClick:()=>te(N.filter($=>$.level!==V.level)),disabled:b||c,children:s.jsx(Z,{name:"close",size:13})})]},V.level))}),s.jsxs("div",{className:"ctl",style:{gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsxs("select",{className:"pick",value:h,onChange:V=>v(V.target.value),disabled:b||c||!z.length,"aria-label":"添加思考档",children:[s.jsx("option",{value:"",children:z.length?"选择档位":"七个档都用上了"}),z.map(V=>s.jsx("option",{value:V,children:nc[V]},V))]}),s.jsx("button",{className:"pbtn",onClick:()=>{h&&(te([...N,{level:h,text:""}]),v(""))},disabled:b||c||!h,children:"添加思考档"}),s.jsx("span",{className:"sp"}),i.custom?s.jsx("button",{className:"pbtn",onClick:()=>void P(null),disabled:b||c,children:"恢复默认"}):null]}),s.jsx("div",{className:"note",children:"留空就按服务商协议的默认值发;填了才按你写的发(例如 DeepSeek 的「中」填 high)。 关闭这一档不能删,其余档删掉后不再出现在思考强度里。"}),S?s.jsx("div",{className:"badline",children:S}):null,y?s.jsx("div",{className:"okline",children:"已保存思考档"}):null]})})]})}function jb({info:l}){const i=kf(l.contextWindow);return s.jsxs("span",{className:"caps",children:[l.input.includes("image")?s.jsx("span",{title:"支持图片输入","aria-label":"支持图片输入",children:s.jsx(Z,{name:"image",size:14})}):null,l.reasoning?s.jsx("span",{title:"支持推理","aria-label":"支持推理",children:s.jsx(Z,{name:"bulb",size:14})}):null,s.jsx("span",{className:"ctx",title:`上下文 ${i}`,children:i})]})}const kb=[{key:"openai-completions",label:"OpenAI 兼容"},{key:"openai-responses",label:"OpenAI Responses 兼容"},{key:"anthropic-messages",label:"Anthropic 兼容"},{key:"google-generative-ai",label:"Google 兼容"}],ZS=Object.fromEntries(kb.map(l=>[l.key,l.label])),tc=128e3,bd=l=>l.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""),KS={literal:"包含 Key",env:"包含 Key",command:"需手动填写",none:"无 Key"};function JS(){const i=Ne().sub,[c,u]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),[h,v]=w.useState({}),b=(E,y)=>v(x=>({...x,[E]:y}));if(w.useEffect(()=>{T1().then(E=>E.ok?u(E.view):f(E.error))},[]),w.useEffect(()=>{i&&p(null)},[i]),w.useEffect(()=>{c&&v(E=>Object.fromEntries(Object.entries(E).filter(([y])=>c.providers.some(x=>x.id===y))))},[c]),d)return s.jsx("div",{className:"note",children:d});if(!c)return s.jsx("div",{className:"empty",children:"正在读取服务商…"});const k=(E,y)=>{y.startsWith("已导入")&&v({}),u(E),p(y),pn()},S=(E,y,x)=>{u(N=>N&&{...N,settings:x,models:{...N.models,[E]:(N.models[E]??[]).map(z=>z.ref===y.ref?y:z)}})};return(i==null?void 0:i.kind)==="provider"?s.jsx(FS,{id:i.id,view:c,onView:u,onSaved:k,onThinking:S,onConnection:b}):(i==null?void 0:i.kind)==="addProvider"?s.jsx(WS,{view:c,onSaved:k,onConnection:b}):(i==null?void 0:i.kind)==="importProviders"?s.jsx(PS,{onSaved:k}):s.jsx(IS,{view:c,notice:g,connectionStatus:h})}function IS({view:l,notice:i,connectionStatus:c}){const u=f=>{var g;return((g=l.builtin.find(p=>p.id===f))==null?void 0:g.name)??f},d=f=>f.kind==="builtin"?u(f.id):f.name;return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"服务商",desc:"模型服务商与 API Key。内置服务商只需填写 API Key;兼容接口需填写服务地址、协议与模型。API Key 只保存在本机,保存后不再显示。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn solid",onClick:()=>tl({kind:"addProvider",title:"添加服务商"}),children:"添加服务商"})}),s.jsx("div",{className:"lbl",children:"已配置的服务商"}),s.jsxs("div",{className:"roster",children:[l.providers.map(f=>{var g;return s.jsxs("button",{className:"rrow",onClick:()=>tl({kind:"provider",id:f.id,title:d(f)}),children:[s.jsxs("div",{className:"rmain",children:[s.jsx("div",{className:"rname",children:d(f)}),s.jsx("div",{className:"rprov",children:f.kind==="builtin"?"内置服务商":"兼容接口"})]}),s.jsx("span",{className:f.keyConfigured&&c[f.id]!=="failed"?"note":"badline",children:f.keyConfigured?`${c[f.id]==="connected"?"已连接":c[f.id]==="failed"?"连接失败":"未验证"} · ${((g=l.models[f.id])==null?void 0:g.length)??0} 个模型`:"未填 Key"}),s.jsx(Z,{name:"chev",size:15,className:"rgo"})]},f.id)}),s.jsxs("button",{className:"maddrow",onClick:()=>tl({kind:"importProviders",title:"从本机导入"}),children:[s.jsx(Z,{name:"doc",size:16}),"从本机导入"]})]}),l.providers.length?null:s.jsx("div",{className:"note",children:"尚未配置服务商。请先添加服务商,再选择需要使用的模型。"}),s.jsx("div",{className:"note",children:"从本机导入会只读本机配置并一次性复制到 Hob,不会修改来源。"}),i?s.jsx("div",{className:"okline",children:i}):null]})]})}function FS({id:l,view:i,onView:c,onSaved:u,onThinking:d,onConnection:f}){const g=i.providers.find(h=>h.id===l);if(w.useEffect(()=>{g||pn()},[g]),!g)return null;const p=g.kind==="builtin"?{kind:"builtin",isNew:!1,id:g.id,key:""}:{kind:"custom",isNew:!1,id:g.id,name:g.name,api:g.api,baseUrl:g.baseUrl,key:"",models:g.models};return s.jsx(Nb,{view:i,initial:p,onSaved:u,onView:c,onConnection:f,onThinking:(h,v)=>d(l,h,v),extra:s.jsx(ew,{view:i,provider:g,onDeleted:h=>{c(h),pn()}})})}function WS({view:l,onSaved:i,onConnection:c}){const[u,d]=w.useState(null),[f,g]=w.useState(null),p=l.builtin.filter(v=>!l.providers.some(b=>b.id===v.id));if(u===null)return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"服务商"}),s.jsx(dt,{title:"添加服务商",desc:"内置服务商只需填写 API Key;兼容接口需填写服务地址、协议与模型。"}),s.jsx(xe,{children:s.jsxs("div",{className:"mcard",children:[s.jsxs("button",{className:"mrow",onClick:()=>d("builtin"),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:"内置服务商"}),s.jsx("span",{className:"sp"}),s.jsx(Z,{name:"chev",size:14})]}),s.jsx("span",{className:"mprev",children:"提供完整的模型目录,填写 API Key 即可。"})]}),s.jsxs("button",{className:"mrow",onClick:()=>d("custom"),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:"兼容接口"}),s.jsx("span",{className:"sp"}),s.jsx(Z,{name:"chev",size:14})]}),s.jsx("span",{className:"mprev",children:"填写服务地址、协议与模型;模型列表可从接口获取。"})]})]})})]});if(u==="builtin"&&f===null)return s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:"subback",onClick:()=>d(null),children:[s.jsx(Z,{name:"left",size:15}),"添加服务商"]}),s.jsx(dt,{title:"选择内置服务商",desc:"选择服务商后填写 API Key。"}),s.jsx(xe,{children:s.jsx("div",{className:"mcard",children:p.length?p.map(v=>s.jsxs("button",{className:"mrow",onClick:()=>g(v.id),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:v.name}),s.jsx("span",{className:"sp"}),s.jsx(Z,{name:"chev",size:14})]}),s.jsx("span",{className:"mprev",children:"内置服务商"})]},v.id)):s.jsx("div",{className:"empty",children:"所有内置服务商均已添加。"})})})]});const h=u==="builtin"?{kind:"builtin",isNew:!0,id:f??"",key:""}:{kind:"custom",isNew:!0,id:"",name:"",api:"openai-completions",baseUrl:"",key:"",models:[]};return s.jsx(Nb,{view:l,initial:h,onSaved:i,onConnection:c,onThinking:()=>{}})}function PS({onSaved:l}){const[i,c]=w.useState(null),[u,d]=w.useState(new Set),[f,g]=w.useState(!1),[p,h]=w.useState(null);w.useEffect(()=>{A1().then(k=>{if(!k.ok){h(k.error);return}c(k.view),d(new Set(k.view.items.filter(S=>S.selectable&&!S.exists).map(S=>S.id)))})},[]);const v=k=>d(S=>{const E=new Set(S);return E.has(k)?E.delete(k):E.add(k),E}),b=async()=>{if(f||!u.size)return;g(!0),h(null);const k=[...u],S=await O1(k);if(g(!1),!S.ok){h(S.error);return}l(S.view,`已导入 ${k.length} 个服务商`)};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"服务商"}),s.jsx(dt,{title:"从本机导入",desc:"读取本机其他客户端保存的服务商配置。来源文件只读,导入后 Key 存入 Hob,不再显示。"}),i===null?p?null:s.jsx("div",{className:"empty",children:"正在读取…"}):s.jsxs(xe,{children:[s.jsxs("div",{className:"sline",children:["来源:",i.source]}),i.items.length?s.jsx("div",{className:"roster",style:{marginTop:8},children:i.items.map(k=>s.jsxs("label",{className:`rrow${k.selectable?"":" gone"}`,children:[s.jsx("input",{type:"checkbox",className:"rcheck",checked:u.has(k.id),disabled:!k.selectable||f,onChange:()=>v(k.id)}),s.jsxs("div",{className:"rmain",children:[s.jsxs("div",{className:"rname",children:[k.id,s.jsxs("span",{className:"rtags",children:[s.jsx("span",{className:"rtag",children:k.kind==="builtin"?"内置服务商":`兼容接口${k.api?` · ${ZS[k.api]}`:""}`}),k.models?s.jsxs("span",{className:"rtag",children:[k.models," 个模型"]}):null,k.exists?s.jsx("span",{className:"rtag",children:"将覆盖"}):null]})]}),k.baseUrl?s.jsx("div",{className:"rprov",children:k.baseUrl}):null,s.jsx("div",{className:"rfoot",children:s.jsx("span",{className:k.key==="none"&&!k.note?"rtag bad":"rtag",children:KS[k.key]})}),k.note?s.jsx("div",{className:"note",children:k.note}):null]})]},k.id))}):s.jsx("div",{className:"empty",style:{marginTop:8},children:"未找到可导入的配置。"}),s.jsxs("div",{className:"ctl",style:{gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsx("button",{className:"pbtn solid",onClick:()=>void b(),disabled:f||!u.size,children:f?"正在导入…":"导入所选"}),s.jsx("button",{className:"pbtn",onClick:pn,disabled:f,children:"取消"})]})]}),p?s.jsx("div",{className:"badline",children:p}):null]})}function ew({view:l,provider:i,onDeleted:c}){var S;const[u,d]=w.useState(!1),[f,g]=w.useState(null),[p,h]=w.useState(!1),v=["conversation","work"].filter(E=>l.settings.settings.models[E].ref.startsWith(`${i.id}/`)),b=i.kind==="builtin"?((S=l.builtin.find(E=>E.id===i.id))==null?void 0:S.name)??i.id:i.name,k=async()=>{if(u)return;d(!0),g(null);const E=await C1(i.id);if(d(!1),!E.ok){g(E.error);return}c(E.view)};return s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"危险操作"}),s.jsx("div",{className:"mcard",children:p?s.jsxs("div",{className:"ctl",style:{padding:12,gap:8,flexWrap:"wrap"},children:[s.jsxs("span",{children:["删除「",b,"」后,该服务商的模型将不可用。",v.length?`受影响的默认模型:${v.map(E=>E==="conversation"?"对话":"任务执行").join("、")}。`:"当前默认模型不受影响。"]}),s.jsx("button",{className:"pbtn",onClick:()=>h(!1),disabled:u,children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>void k(),disabled:u,children:"确认删除"})]}):s.jsx("button",{className:"mline danger",onClick:()=>h(!0),disabled:u,children:"删除服务商"})}),f?s.jsx("div",{className:"badline",children:f}):null]})}function Nb({view:l,initial:i,onSaved:c,onView:u,onConnection:d,onThinking:f,extra:g}){var ge,ze,Oe;const p=Ne(),[h,v]=w.useState(i),[b,k]=w.useState(!1),[S,E]=w.useState(null);w.useEffect(()=>{if(!S||S!=="已保存")return;const U=setTimeout(()=>E(null),3e3);return()=>clearTimeout(U)},[S]);const[y,x]=w.useState([]),[N,z]=w.useState(i.isNew||!((ge=l.providers.find(U=>U.id===i.id))!=null&&ge.keyConfigured)),[O,X]=w.useState(null),[P,te]=w.useState(null),[V,$]=w.useState(null),[L,ue]=w.useState(!1),Se=new Set(l.providers.map(U=>U.id)),Le=U=>{var I;return((I=l.builtin.find(ie=>ie.id===U))==null?void 0:I.name)??U},Pe=U=>{var I;return(I=l.models[h.id])==null?void 0:I.find(ie=>ie.id===U)},de=U=>v(I=>({...I,...U})),Ve=h.isNew||JSON.stringify(h)!==JSON.stringify(i),Re=h.kind==="builtin"?{kind:"builtin",id:h.id,...h.key.trim()?{apiKey:h.key.trim()}:{}}:{kind:"custom",...h.id?{id:h.id}:{},api:h.api,baseUrl:h.baseUrl.trim(),...h.key.trim()?{apiKey:h.key.trim()}:{}},F=JSON.stringify(Re),fe=async()=>{if(L)return;ue(!0),$(null),te(null);const U=await fv(Re);if(ue(!1),!Ve&&h.id&&d(h.id,U?"failed":"connected"),U){X(null),$(U);return}X(F),te("连接成功")},oe=U=>{const I=`${h.id}/${U.id}`,ie=p.settings.settings.models,xt=ie.roster.some(ft=>ft.ref===I),Tt=ie.conversation.ref===I||ie.work.ref===I;return s.jsxs("label",{className:"ctl",children:[s.jsx("input",{type:"checkbox",checked:xt,disabled:h.isNew||!Pe(U.id)||b||L||Tt,onChange:()=>{const ft=xt?ie.roster.filter(et=>et.ref!==I):[...ie.roster,{ref:I,note:"",scores:jf({id:U.id,name:U.name??U.id,reasoning:!!U.reasoning}),scoresConfirmed:!1}];k(!0),E(null),Zd({models:{roster:ft}}).then(et=>{k(!1),E(et?"已保存":"保存失败,请重试。")})}}),s.jsx("span",{children:Tt?"默认模型已加入":"加入可用模型"})]})},De=async()=>{if(h.kind!=="custom"||L)return;ue(!0),$(null);const U=await z1({api:h.api,baseUrl:h.baseUrl.trim(),...h.key.trim()?{apiKey:h.key.trim()}:{},...h.id?{id:h.id}:{}});if(ue(!1),!U.ok){$(U.error),x([]);return}x(U.models)},je=async U=>{if(h.kind!=="custom")return;if(h.isNew){de({models:U});return}const I=l.providers.find(et=>et.id===h.id);if(!I||I.kind!=="custom")return;ue(!0),$(null);const{id:ie,keyConfigured:xt,...Tt}=I,ft=await dv(ie,{...Tt,models:U});if(ue(!1),!ft.ok){$(ft.error);return}de({models:U}),u==null||u(ft.view),E("已保存")},zt=U=>{if(h.kind!=="custom")return;const I=h.models.some(ie=>ie.id===U.id);je(I?h.models.filter(ie=>ie.id!==U.id):[...h.models,{id:U.id,...U.name?{name:U.name}:{}}])},Gt=U=>{if(h.kind!=="custom")return;const I=U.trim();!I||h.models.some(ie=>ie.id===I)||je([...h.models,{id:I}])},Xt=(U,I)=>{h.kind==="custom"&&je(h.models.map(ie=>ie.id===U?{...ie,...I}:ie))},A=U=>{const I=l.models[U]??[];return I.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"模型"}),s.jsx("div",{className:"roster",children:I.map(ie=>{var xt;return s.jsx("div",{className:"rrow",children:s.jsxs("div",{className:"rmain",children:[s.jsxs("div",{className:"rname",children:[ie.name,s.jsx("span",{className:"rtags",children:s.jsx("span",{className:"rtag mono",children:ie.id})})]}),s.jsxs("div",{className:"caps",children:[(xt=ie.input)!=null&&xt.includes("image")?s.jsx("span",{title:"支持图片输入","aria-label":"支持图片输入",children:s.jsx(Z,{name:"image",size:14})}):null,ie.reasoning?s.jsx("span",{title:"支持推理","aria-label":"支持推理",children:s.jsx(Z,{name:"bulb",size:14})}):null,ie.contextWindow?s.jsx("span",{className:"ctx",children:kf(ie.contextWindow)}):null]}),oe(ie),ie.reasoning?s.jsx(ex,{modelRef:ie.ref,info:ie,disabled:L,onSaved:f}):s.jsx("div",{className:"note",children:"不推理,没有思考档。"})]})},ie.id)})}),s.jsx("div",{className:"note",children:"模型由服务商提供。会推理的模型可以改每个思考档发给服务商的字符。"})]}):null},Q=async()=>{if(L)return;ue(!0),$(null);const U=l.providers.find(Tt=>Tt.id===h.id),I=h.kind==="builtin"?{kind:"builtin",...h.key.trim()?{key:h.key.trim()}:{}}:{kind:"custom",name:h.name.trim(),api:h.api,baseUrl:h.baseUrl.trim(),models:h.models,...(U==null?void 0:U.kind)==="custom"&&U.extra?{extra:U.extra}:{},...h.key.trim()?{key:h.key.trim()}:{}},ie=h.kind==="custom"&&h.isNew?h.id.trim()||bd(h.name):h.id;if(!ie){ue(!1),$("保存失败:请填写标识。模型引用使用该标识,只能包含小写字母、数字、点和短横线,例如 my-proxy。");return}if(h.isNew&&Se.has(ie)){ue(!1),$("该服务商标识已存在,请使用其他标识。");return}if(O!==F){te("正在验证连接…");const Tt=await fv(Re);if(te(null),Tt){ue(!1),$(`测试连接失败:${Tt}`);return}}const xt=await dv(ie,I);if(ue(!1),!xt.ok){$(xt.error);return}d(ie,"connected"),c(xt.view,"已保存")},K=h.kind==="builtin"?h.isNew?"添加内置服务商":Le(h.id):h.isNew?"添加兼容接口":h.name||"兼容接口",ee=h.kind==="builtin"?h.id:h.id||bd(h.name);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"服务商"}),s.jsx(dt,{title:K,desc:ee?s.jsx("span",{className:"mono",children:ee}):null}),h.kind==="builtin"?s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"连接"}),s.jsxs("div",{className:"formcard",children:[s.jsx("div",{className:"lbl sub",children:"服务商"}),s.jsx("div",{className:"ctl",children:s.jsx("select",{className:"pick grow",value:h.id,onChange:U=>de({id:U.target.value}),disabled:!0,children:l.builtin.filter(U=>!h.isNew||!Se.has(U.id)).map(U=>s.jsxs("option",{value:U.id,children:[U.name,Se.has(U.id)?"(已配置)":""]},U.id))})}),s.jsx("div",{className:"lbl sub",children:"API Key"}),N?s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:h.key,placeholder:(ze=l.providers.find(U=>U.id===h.id))!=null&&ze.keyConfigured?"已保存,留空则沿用":"sk-…",onChange:U=>de({key:U.target.value}),disabled:L})}):s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:"已保存"}),s.jsx("button",{className:"pbtn",onClick:()=>z(!0),children:"更换"})]}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:"pbtn",disabled:L,onClick:()=>void fe(),children:"测试连接"}),s.jsx("span",{className:"note",children:"测试会请求模型,可能产生费用。"}),P&&O===F?s.jsx("span",{className:"okline",children:P}):null]}),s.jsx(tx,{busy:L,error:V,dirty:Ve,onCancel:pn,onSave:()=>void Q()})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"连接"}),s.jsxs("div",{className:"formcard",children:[s.jsx("div",{className:"lbl sub",children:"名称"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:h.name,placeholder:"如「我的代理」",onChange:U=>de({name:U.target.value}),disabled:L})}),h.isNew?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl sub",children:"标识"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:h.id,placeholder:bd(h.name)||"my-proxy",onChange:U=>de({id:U.target.value}),disabled:L})}),s.jsx("div",{className:"note",children:"模型引用使用该标识,例如 my-proxy/gpt-x。留空则按名称自动生成。"})]}):s.jsxs("div",{className:"note mono",children:["标识:",h.id]}),s.jsx("div",{className:"lbl sub",children:"协议"}),s.jsx("div",{className:"ctl",children:s.jsx("select",{className:"pick grow",value:h.api,onChange:U=>de({api:U.target.value}),disabled:L,children:kb.map(U=>s.jsx("option",{value:U.key,children:U.label},U.key))})}),s.jsx("div",{className:"lbl sub",children:"服务地址"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:h.baseUrl,placeholder:"http://127.0.0.1:8080/v1",onChange:U=>de({baseUrl:U.target.value}),disabled:L})}),s.jsx("div",{className:"lbl sub",children:"API Key"}),N?s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:h.key,placeholder:(Oe=l.providers.find(U=>U.id===h.id))!=null&&Oe.keyConfigured?"已保存,留空则沿用":"sk-…",onChange:U=>de({key:U.target.value}),disabled:L})}):s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:"已保存"}),s.jsx("button",{className:"pbtn",onClick:()=>z(!0),children:"更换"})]}),s.jsxs("div",{className:"ctl",style:{gap:8,flexWrap:"wrap"},children:[s.jsx("button",{className:"pbtn",disabled:L||!h.baseUrl.trim(),onClick:()=>void fe(),children:"测试连接"}),P&&O===F?s.jsx("span",{className:"okline",children:P}):null,s.jsx("button",{className:"pbtn",onClick:()=>void De(),disabled:L||!h.baseUrl.trim(),children:L?"正在获取…":"获取模型列表"}),s.jsx("span",{className:"note",children:"从接口获取模型列表,选择需要使用的模型。"})]}),s.jsx(tx,{busy:L,error:V,dirty:Ve,onCancel:pn,onSave:()=>void Q()})]})]}),y.length?s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"接口上的模型"}),s.jsx("div",{className:"chips",children:y.map(U=>{const I=h.models.some(ie=>ie.id===U.id);return s.jsx("button",{className:`chip${I?" on":""}`,onClick:()=>zt(U),disabled:L,children:U.name??U.id},U.id)})}),s.jsx("div",{className:"note",children:"点击添加或移除,添加后可在下方修改模型能力。"})]}):null,s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"模型"}),h.models.length?s.jsx("div",{className:"roster",children:h.models.map(U=>{var I;return s.jsxs("div",{className:"rrow",children:[s.jsxs("div",{className:"rmain",children:[s.jsx("div",{className:"rname mono",children:U.id}),s.jsxs("div",{className:"rfoot",children:[s.jsx("button",{className:`chip${(I=U.input)!=null&&I.includes("image")?" on":""}`,onClick:()=>{var ie;return Xt(U.id,{input:(ie=U.input)!=null&&ie.includes("image")?["text"]:["text","image"]})},disabled:L,children:"支持图片输入"}),s.jsx("button",{className:`chip${U.reasoning?" on":""}`,onClick:()=>Xt(U.id,{reasoning:!U.reasoning}),disabled:L,children:"支持推理"}),s.jsx("span",{className:"rtag",children:"上下文"}),s.jsx("input",{className:"pmctx",type:"number",min:1,defaultValue:U.contextWindow??tc,title:"上下文窗口(token)",onBlur:ie=>{const xt=Number(ie.target.value)||tc;xt!==(U.contextWindow??tc)&&Xt(U.id,{contextWindow:xt})},onKeyDown:ie=>{ie.key==="Enter"&&ie.currentTarget.blur()},disabled:L},`${U.id}:${U.contextWindow??tc}`)]}),oe(U),U.reasoning?Pe(U.id)?s.jsx(ex,{modelRef:`${h.id}/${U.id}`,info:Pe(U.id),disabled:L,onSaved:f}):s.jsx("div",{className:"note",children:"保存服务商后可以设置思考档。"}):null]}),s.jsx("button",{className:"rremove",title:"移除该模型",disabled:L,onClick:()=>void je(h.models.filter(ie=>ie.id!==U.id)),children:s.jsx(Z,{name:"close",size:13})})]},U.id)})}):s.jsx("div",{className:"empty",children:"尚未添加模型。可获取模型列表后勾选,或手动填写模型 ID。"}),s.jsx(tw,{disabled:L,onAdd:Gt})]})]}),h.kind==="builtin"&&!h.isNew?s.jsx(xe,{children:A(h.id)}):null,S?s.jsx("div",{className:S==="已保存"?"okline":"badline",role:"status",children:S}):null,g]})}function tw({disabled:l,onAdd:i}){const[c,u]=w.useState(""),d=()=>{c.trim()&&(i(c),u(""))};return s.jsxs("div",{className:"ctl",style:{gap:8,marginTop:10},children:[s.jsx("div",{className:"field",style:{flex:1},children:s.jsx("input",{value:c,placeholder:"手动填写模型 ID,如 gpt-4o-mini",onChange:f=>u(f.target.value),onKeyDown:f=>{f.key==="Enter"&&d()},disabled:l})}),s.jsx("button",{className:"pbtn",onClick:d,disabled:l||!c.trim(),children:"添加"})]})}function tx({busy:l,error:i,dirty:c,onCancel:u,onSave:d}){return s.jsxs(fa,{saved:!1,error:i,children:[!i&&c?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",onClick:u,disabled:l,children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:d,disabled:l||!c,children:l?"正在验证…":"保存"})]})}function nw(){var u,d;const l=Ne(),[i,c]=w.useState(null);return w.useEffect(()=>{Kd().then(c)},[]),i?((u=l.sub)==null?void 0:u.kind)==="model"?s.jsx(aw,{view:i,modelRef:l.sub.ref}):((d=l.sub)==null?void 0:d.kind)==="addModels"?s.jsx(sw,{view:i}):s.jsx(lw,{view:i}):s.jsx("div",{className:"empty",children:"正在读取模型列表…"})}function qd(l,i){return{scores:l.scores??jf(i??{id:l.ref.split("/").at(-1)??l.ref,name:"",reasoning:!1}),unconfirmed:!l.scores||l.scoresConfirmed!==!0}}function Sb({entry:l,info:i,update:c,collapsible:u=!1}){const d=qd(l,i),[f,g]=w.useState(!u||d.unconfirmed),[p,h]=w.useState(d.scores),[v,b]=w.useState(l.note),k=w.useRef(!1),S=w.useRef(p);S.current=p,w.useEffect(()=>{k.current||h(qd(l,i).scores)},[l.scores,i]),w.useEffect(()=>b(l.note),[l.note]);const E=N=>c({scores:N,scoresConfirmed:!0}),y=()=>{if(!k.current)return;k.current=!1;const N=l.scores,z=S.current;(!N||l.scoresConfirmed!==!0||N.smart!==z.smart||N.cost!==z.cost||N.speed!==z.speed)&&E(z)};if(!f)return s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:xb(l.scores??p)}),s.jsx("button",{className:"pbtn",onClick:()=>g(!0),children:"修改"})]});const x={smart:"聪明程度",cost:"成本",speed:"速度"};return s.jsxs("div",{className:"group",children:[s.jsxs("div",{className:"note",children:["Hob 按用途选择分派任务的模型。",d.unconfirmed?"数值按模型名称推测,请确认。":""]}),Object.keys(x).map(N=>s.jsxs("div",{className:"score-row",children:[s.jsxs("div",{className:"score-head",children:[s.jsx("label",{htmlFor:`${l.ref}-${N}`,children:x[N]}),s.jsxs("span",{children:[Pv(N,p[N])," · ",p[N],"%"]})]}),s.jsx("input",{id:`${l.ref}-${N}`,className:"score-range",type:"range",min:"0",max:"100",step:"5",value:p[N],onChange:z=>{k.current=!0,h({...S.current,[N]:Number(z.target.value)})},onPointerUp:y,onTouchEnd:y,onKeyUp:y,onBlur:y}),s.jsx("div",{className:"score-ticks",children:vb[N].map(z=>s.jsx("button",{style:{left:`${z.value}%`},className:z.value===0?"first":z.value===100?"last":void 0,"aria-pressed":z.label===Pv(N,p[N]),onClick:()=>{const O={...S.current,[N]:z.value};h(O),E(O)},children:z.label},z.value))})]},N)),s.jsx("div",{className:"field",children:s.jsx("input",{value:v,onChange:N=>b(N.target.value),onBlur:()=>{v!==l.note&&c({note:v})},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()},placeholder:"补充说明(选填),如「中文写作特别好」"})}),u?s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>g(!1),children:"收起"})}):null]})}function Nf(){const i=Ne().settings.settings.models,c=aa(),u=p=>void c.save({models:p});return{models:i,save:u,setRoster:p=>u({roster:p}),update:(p,h)=>void c.save(v=>({models:{roster:v.models.roster.map(b=>b.ref===p?{...b,...h}:b)}})),roles:p=>[i.conversation.ref===p?"对话":null,i.work.ref===p?"任务执行":null].filter(h=>h!==null),feedback:c}}function Hn({label:l="模型"}){return s.jsxs("button",{className:"subback",onClick:pn,children:[s.jsx(Z,{name:"left",size:15}),l]})}function lw({view:l}){const{models:i,save:c,roles:u,feedback:d}=Nf(),f=new Map(l.models.map(h=>[h.ref,h])),g=h=>[...i.roster.length?[]:[{value:"",text:"未设置"}],...i.roster.filter(v=>f.has(v.ref)||v.ref===h).map(v=>{var b;return{value:v.ref,text:((b=f.get(v.ref))==null?void 0:b.name)??v.ref}})],p=(h,v,b)=>s.jsxs("div",{className:"mline",children:[s.jsx("span",{className:"k",children:v}),s.jsxs("span",{className:"vals",children:[s.jsx(bb,{value:i[h].ref,label:b,options:g(i[h].ref),onChange:k=>c({[h]:{ref:k,thinking:ji(f.get(k),i[h].thinking)}})}),s.jsx(yb,{value:ji(f.get(i[h].ref),i[h].thinking),model:f.get(i[h].ref),onChange:k=>c({[h]:{...i[h],thinking:k}})})]})]});return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"模型",desc:"可用模型来自「服务商」,默认模型从可用模型中选择。"}),s.jsx(nn,{message:d.message,toast:!0}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"默认模型"}),s.jsxs("div",{className:"mcard",children:[p("conversation","对话","对话模型"),p("work","任务执行","默认任务模型")]}),s.jsx("div",{className:"note",children:"助手分派任务时未指定模型,使用任务执行的模型。"}),s.jsx("div",{className:"lbl",children:"任务的思考档"}),s.jsx(ms,{items:[{key:"auto",label:"助手按任务选择"},{key:"fixed",label:"固定使用默认档"}],value:i.thinkingChoice??"auto",disabled:d.busy,onChange:h=>c({thinkingChoice:h})}),s.jsx("div",{className:"note",children:"按任务选择时,助手会给简单的活用低档、复杂的活用高档;固定时一律使用上面设置的默认档。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"可用模型"}),s.jsxs("div",{className:"mcard",children:[i.roster.map(h=>{const v=f.get(h.ref),b=(v==null?void 0:v.name)??h.ref,k=qd(h,v);return s.jsxs("button",{className:`mrow${v?"":" gone"}`,onClick:()=>tl({kind:"model",ref:h.ref,title:b}),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:b}),s.jsx("span",{className:"sp"}),v?s.jsx(jb,{info:v}):s.jsx("span",{className:"mbad",children:"不可用"}),s.jsx(Z,{name:"chev",size:14})]}),s.jsxs("span",{className:"mprev",children:[u(h.ref).map(S=>s.jsx("span",{className:"mrole",children:S},S)),xb(k.scores),k.unconfirmed?s.jsx("span",{className:"model-use-warning",children:"请确认用途"}):null,v?null:" · 该模型的服务商已删除或未配置 Key"]})]},h.ref)}),s.jsxs("button",{className:"maddrow",onClick:()=>tl({kind:"addModels",title:"添加模型"}),children:[s.jsx(Z,{name:"plus",size:16}),"添加模型"]})]}),s.jsx("div",{className:"note",children:"助手分派任务时,按用途说明在可用模型中选择。"})]})]})}function aw({view:l,modelRef:i}){const{models:c,setRoster:u,update:d,roles:f,feedback:g}=Nf(),[p,h]=w.useState(!1),v=c.roster.find(S=>S.ref===i);if(w.useEffect(()=>{v||pn()},[v]),!v)return null;const b=l.models.find(S=>S.ref===i),k=f(i);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{}),s.jsx(dt,{title:(b==null?void 0:b.name)??i,desc:s.jsx("span",{className:"mono",children:i})}),s.jsx(nn,{message:g.message,toast:!0}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"用途说明"}),s.jsx(Sb,{entry:v,info:b,update:S=>d(i,S)})]}),b!=null&&b.reasoning?s.jsxs(xe,{children:[s.jsx("div",{className:"mcard",children:s.jsxs("div",{className:"mline",children:[s.jsx("span",{className:"k",children:"分派时的思考强度"}),s.jsx(yb,{value:ji(b,v.thinking??c.work.thinking),model:b,onChange:S=>d(i,{thinking:S})})]})}),s.jsx("div",{className:"note",children:"助手把任务分派给这个模型时使用。作为默认模型时,以「默认模型」中的设置为准。"})]}):null,s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"信息"}),s.jsxs("div",{className:"kvcard",children:[s.jsxs("div",{className:"kvrow",children:[s.jsx("span",{className:"k",children:"服务商"}),s.jsx("span",{className:"v",children:(b==null?void 0:b.provider)??"不可用"})]}),b?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"kvrow",children:[s.jsxs("span",{className:"k kicon",children:[s.jsx(Z,{name:"image",size:14}),"图片输入"]}),s.jsx("span",{className:"v",children:b.input.includes("image")?"支持":"不支持"})]}),s.jsxs("div",{className:"kvrow",children:[s.jsxs("span",{className:"k kicon",children:[s.jsx(Z,{name:"bulb",size:14}),"推理"]}),s.jsx("span",{className:"v",children:b.reasoning?"支持":"不支持"})]}),s.jsxs("div",{className:"kvrow",children:[s.jsx("span",{className:"k",children:"上下文"}),s.jsx("span",{className:"v",children:kf(b.contextWindow)})]})]}):null]})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"危险操作"}),s.jsx("div",{className:"mcard",children:p?s.jsxs("div",{className:"ctl",style:{flexWrap:"wrap",padding:12},children:[s.jsx("span",{children:"确定从可用模型中移除?"}),s.jsx("button",{className:"pbtn",onClick:()=>h(!1),children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>u(c.roster.filter(S=>S.ref!==i)),children:"确认移除"})]}):s.jsx("button",{className:"mline danger",disabled:k.length>0,onClick:()=>h(!0),children:"从可用模型中移除"})}),k.length?s.jsxs("div",{className:"note",children:["这是",k.join("和"),"的默认模型。要移除,请先在「默认模型」中更换。"]}):null]})]})}function sw({view:l}){const{models:i,setRoster:c,roles:u,update:d,feedback:f}=Nf(),[g,p]=w.useState(""),h=new Set(i.roster.map(x=>x.ref)),[v,b]=w.useState(()=>[...new Set(l.models.filter(x=>h.has(x.ref)).map(x=>x.provider))]),k=TS(wS(l.models,g)),S=g.trim().length>0,E=x=>b(N=>N.includes(x)?N.filter(z=>z!==x):[...N,x]),y=x=>c(h.has(x.ref)?i.roster.filter(N=>N.ref!==x.ref):[...i.roster,{ref:x.ref,scores:jf(x),note:"",scoresConfirmed:!1,...x.reasoning?{thinking:ji(x,"medium")}:{}}]);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{}),s.jsx(dt,{title:"添加模型",desc:"「服务商」提供的全部模型,打勾的已在可用模型中。"}),s.jsx(nn,{message:f.message,toast:!0}),l.models.length===0?s.jsxs(xe,{children:[s.jsx("div",{className:"empty",children:"尚无可用模型。请先在「服务商」中配置服务商并填写 API Key。"}),s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>us("providers"),children:"配置服务商"})})]}):s.jsxs("div",{className:"mcard",children:[s.jsxs("label",{className:"mfind",children:[s.jsx(Z,{name:"search",size:15}),s.jsx("input",{value:g,placeholder:"搜索名称或引用,如 claude",onChange:x=>p(x.target.value)})]}),k.length===0?s.jsx("div",{className:"mempty",children:"没有匹配的模型。"}):k.map(x=>{const N=S||v.includes(x.provider),z=x.models.filter(O=>h.has(O.ref)).length;return s.jsxs(w.Fragment,{children:[s.jsxs("button",{className:"mgroup","aria-expanded":N,onClick:()=>E(x.provider),children:[s.jsx("span",{className:"n",children:x.provider}),s.jsx("span",{className:"c",children:z?`已加入 ${z} / ${x.models.length}`:x.models.length}),s.jsx(Z,{name:N?"down":"chev",size:14})]}),N?x.models.map(O=>{const X=h.has(O.ref),P=u(O.ref).length>0,te=i.roster.find(V=>V.ref===O.ref);return s.jsxs("div",{children:[s.jsxs("button",{className:`madd${X?" on":""}`,disabled:P,title:P?"默认模型不能在这里移除":X?"从可用模型中移除":"加入可用模型",onClick:()=>y(O),children:[s.jsx("span",{className:"mname",children:O.name}),s.jsx(jb,{info:O}),s.jsx(Z,{name:X?"check":"plus",size:16,className:"mtog"})]}),te?s.jsx("div",{className:"model-use-inline",children:s.jsx(Sb,{entry:te,info:O,collapsible:!0,update:V=>d(O.ref,V)})}):null]},O.ref)}):null]},x.provider)})]})]})}function iw(){const i=Ne().settings.settings.work,c=aa(),u=d=>c.save({work:d});return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"任务",desc:"任务并行数、无响应判定时间,以及全部任务的任务记录。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"最大并行任务数"}),s.jsx("div",{className:"ctl",children:s.jsx("select",{className:"pick",value:i.maxJobs,disabled:c.busy,onChange:d=>void u({maxJobs:Number(d.target.value)}),children:[1,2,3,4,5,6,7,8].map(d=>s.jsx("option",{value:d,children:d},d))})}),s.jsx("div",{className:"note",children:"同时运行的最大任务数,超出后排队。"}),s.jsx(nn,{message:c.message})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"无响应判定时间"}),s.jsx("div",{className:"lbl sub",children:"任务"}),s.jsxs("div",{className:"ctl",children:[s.jsx(os,{value:String(i.jobStallMinutes),onSave:d=>u({jobStallMinutes:Number(d)})}),s.jsx("span",{className:"note",children:"分钟"})]}),s.jsx("div",{className:"lbl sub",children:"助手回复"}),s.jsxs("div",{className:"ctl",children:[s.jsx(os,{value:String(i.routerStallMinutes),onSave:d=>u({routerStallMinutes:Number(d)})}),s.jsx("span",{className:"note",children:"分钟"})]}),s.jsx(nn,{message:c.message}),s.jsx("div",{className:"note",children:"修改后立即生效,无需重启。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"任务记录"}),s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>Wd(),children:"查看全部任务"})}),s.jsx("div",{className:"note",children:"可查看每个任务的完整执行过程。"})]})]})}function rw(){const l=Ne(),i=aa(),[c,u]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),[h,v]=w.useState(null),[b,k]=w.useState(!1),[S,E]=w.useState(null),[y,x]=w.useState(null),N=Xd(),z=()=>void Qd().then($=>p(($==null?void 0:$.endpoint)??null));if(w.useEffect(()=>{pc().then($=>$.ok?u($.view):f($.error)),z()},[]),d)return s.jsx("div",{className:"note",children:d});if(!c)return s.jsx("div",{className:"empty",children:"正在读取推送设置…"});const O=typeof Notification<"u"&&Notification.permission==="denied",X=!!(g&&c.devices.some($=>$.endpoint===g)),P=async()=>{if(!b){k(!0),E(null),x(null);try{const $=X?await X1():await G1();if(!$.ok){E($.error);return}u($.view),z(),x(X?"此设备将不再接收推送":"此设备将接收推送")}finally{k(!1)}}},te=async $=>{const L=await vx($);if(!L.ok){E(L.error);return}u(L.view),v(null),z()},V=async()=>{if(!b){k(!0),E(null),x(null);try{const $=await V1();if(!$.ok){E($.error);return}x($.sent?"测试通知已发送":"未发送:这台设备尚未订阅")}finally{k(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"通知",desc:"本机推送与已订阅的设备。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"本机推送"}),N?s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:"需要确认或任务受阻时推送给我"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${X?"":" off"}`,title:X?"关闭本机推送":"开启本机推送",onClick:()=>void P(),disabled:b})]}):s.jsx("div",{className:"note",children:"这个浏览器不支持推送:请使用 Chrome、Edge、Safari 16.4+,或在 iPhone 上将 Hob 添加到主屏幕。"}),O?s.jsx("div",{className:"note",children:"浏览器已拒绝通知权限:点击地址栏左侧的图标 → 通知 → 允许,然后刷新本页并重新开启。"}):null,s.jsx("div",{className:"note",children:"页面在前台时不推送,页面不在前台或锁屏时才推送。各助手还需在助手设置中开启「需要确认时通知我」。"}),s.jsx("div",{className:"note",children:"在 iPhone 上需先将 Hob 添加到主屏幕,再从主屏幕打开才能接收推送。"})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"已订阅的设备"}),c.devices.length?c.devices.map($=>s.jsxs("div",{className:"dev",children:[s.jsx("span",{className:"n",children:$.label}),s.jsx("span",{className:"tm",children:Ol($.createdAt)}),s.jsx("span",{className:"sp"}),h===$.endpoint?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"note",children:"确认删除?"}),s.jsx("button",{className:"pbtn",onClick:()=>v(null),children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>void te($.endpoint),children:"确认删除"})]}):s.jsx("button",{className:"del",title:"删除这台设备",onClick:()=>v($.endpoint),children:"删除"})]},$.endpoint)):s.jsx("div",{className:"empty",children:"暂无已订阅的设备"}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:"pbtn",onClick:()=>void V(),disabled:b||!c.devices.length,children:"发送测试通知"}),y&&!S?s.jsx("span",{className:"okline",children:y}):null,S?s.jsx("span",{className:"badline",children:S}):null]})]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"推送服务联系邮箱(选填)"}),s.jsx(os,{placeholder:"name@example.com",value:l.settings.settings.push.email,onSave:$=>i.save({push:{email:$.trim()}})}),s.jsx(nn,{message:i.message}),s.jsx("div",{className:"note",children:"推送服务使用此地址联系你;留空使用 hob@localhost。"})]})]})}const gi="https://api.loremem.com",cw={saas:"https://app.loremem.com/login"},uw=[{key:"saas",label:"Lore 云服务"},{key:"self",label:"自部署"}],ow=[{key:"local",label:"本地记忆"},{key:"lore",label:"Lore"},{key:"off",label:"关闭"}],nx={invalid_url:"服务地址无效。",insecure_http:"公网地址必须使用 https,明文 http 仅允许本机或局域网地址。",missing_token:"缺少 API Token。",unauthorized:"API Token 被拒绝。",unreachable:"无法连接该地址。"},Yd=l=>l.trim().replace(/\/+$/,"");function lx(l){return l===null||Yd(l)===gi?"saas":"self"}function dw(){const[l,i]=w.useState(null),[c,u]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState("saas"),[h,v]=w.useState(gi),[b,k]=w.useState(""),[S,E]=w.useState(!1),[y,x]=w.useState(!1),[N,z]=w.useState(null),[O,X]=w.useState(!1),[P,te]=w.useState(null),[V,$]=w.useState(!1),[L,ue]=w.useState(null),[Se,Le]=w.useState(null),[Pe,de]=w.useState(!1);w.useEffect(()=>{if(!V)return;const K=setTimeout(()=>$(!1),3e3);return()=>clearTimeout(K)},[V]);const Ve=K=>{i(K),u(null),f(null),p(lx(K.lore.baseUrl)),v(K.lore.baseUrl??gi),k(""),E(!1),x(!1),z(null),te(null),$(!1)};if(w.useEffect(()=>{dd().then(K=>{K.ok?Ve(K.config):u(K.error)})},[]),c)return s.jsx("div",{className:"note",children:c});if(!l)return s.jsx("div",{className:"empty",children:"正在读取记忆设置…"});const Re=d??l.provider,F=l.lore.tokenConfigured&&Yd(h)===Yd(l.lore.baseUrl??""),fe=d==="lore"&&!S?l.lore.configured:y,oe=d!==null||S,De=async K=>{if(O)return;if(K===l.provider){f(null);return}if(te(null),$(!1),K==="lore"&&!l.lore.configured){f("lore");return}X(!0);const ee=await pv(l.revision,K);if(X(!1),!ee.ok){te(ee.error);return}Ve(ee.config),$(!0)},je=K=>{O||(K(),E(!0),x(!1),z(null),te(null),$(!1))},zt=K=>je(()=>{p(K),v(K==="saas"?gi:lx(l.lore.baseUrl)==="self"?l.lore.baseUrl??"":"")}),Gt=async()=>{if(O)return;X(!0),Le(null),de(!1);const K=await q1();if(!K.ok){X(!1),Le(K.error);return}if(ue({source:K.view.source,found:K.view.found}),!K.view.found){X(!1);return}const ee=await Y1();if(X(!1),!ee.ok){Le(ee.error);return}Ve(ee.config),f("lore"),de(!0)},Xt=async()=>{if(O)return;X(!0),z(null);const K={baseUrl:h.trim(),...b?{token:b}:{}},ee=await gv(K);if(X(!1),!ee.ok){z({ok:!1,text:ee.error});return}ee.result.ok?(x(!0),z({ok:!0,text:"已连接"})):z({ok:!1,text:nx[ee.result.reason]})},A=async()=>{if(O||!oe)return;if(X(!0),te(null),Re==="lore"&&!fe){const ge=await gv({baseUrl:h.trim(),...b?{token:b}:{}});if(!ge.ok){X(!1),te(ge.error);return}if(!ge.result.ok){X(!1),te(nx[ge.result.reason]);return}x(!0)}let K=l;if(Re==="lore"&&S){const ge=await $1({baseUrl:h.trim(),...b?{token:b}:{}});if(!ge.ok){X(!1),te(ge.error);return}K=ge.config}const ee=await pv(K.revision,Re);if(X(!1),!ee.ok){te(ee.error),/已刷新/.test(ee.error)&&dd().then(ge=>ge.ok&&Ve(ge.config));return}Ve(ee.config),$(!0)},Q=l.provider==="lore"?l.lore.configured?"Lore · 已连接":"Lore · 尚未配置完成:请填写服务地址与 API Token 后保存":l.provider==="local"?"本地记忆 · 已启用":"关闭 · 助手不使用长期记忆";return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"记忆",desc:"所有助手共用同一份长期记忆。各助手特有的做法写在助手设置的「补充说明」中。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"提供者"}),s.jsx(ms,{items:ow,value:Re,onChange:K=>void De(K),disabled:O}),s.jsx("div",{className:"sline",children:Q}),s.jsx(nn,{message:P??(V?"已保存":null)})]}),Re==="lore"?s.jsxs(s.Fragment,{children:[s.jsx(xe,{children:s.jsxs("div",{className:"formcard",children:[s.jsx("div",{className:"lbl",children:"部署方式"}),s.jsx(ms,{items:uw,value:g,onChange:zt,disabled:O}),s.jsx("div",{className:"lbl",children:"服务地址"}),g==="saas"?s.jsx("div",{className:"field ro",children:gi}):s.jsx("div",{className:"field",children:s.jsx("input",{value:h,placeholder:"http://192.168.1.10:18901",onChange:K=>je(()=>v(K.target.value)),disabled:O})}),s.jsxs("div",{className:"lblrow",children:[s.jsx("span",{className:"lbl",children:"Token"}),s.jsx("a",{className:"link",href:cw.saas,target:"_blank",rel:"noreferrer",children:"注册 / 登录 Lore"})]}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:b,placeholder:F?"已保存,留空则沿用":"lm_…",onChange:K=>je(()=>k(K.target.value)),disabled:O})}),s.jsxs("div",{className:"ctl",style:{gap:10,flexWrap:"wrap"},children:[s.jsx("button",{className:"pbtn",onClick:()=>void Xt(),disabled:O||h.trim()==="",children:"测试连接"}),N?s.jsx("span",{className:N.ok?"okline":"badline",children:N.text}):null]}),s.jsxs(fa,{saved:V&&!oe,error:P,children:[!P&&oe?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",onClick:()=>void dd().then(K=>K.ok?Ve(K.config):u(K.error)),disabled:O||!oe,children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void A(),disabled:O||!oe,children:O?"正在验证…":"保存"})]})]})}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"本机配置"}),s.jsxs("div",{className:"ctl",style:{gap:10,flexWrap:"wrap"},children:[s.jsx("button",{className:"pbtn",onClick:()=>void Gt(),disabled:O,children:O?"正在导入…":"从本机导入"}),Pe?s.jsx("span",{className:"okline",children:"已导入本机的连接"}):null]}),s.jsx("div",{className:"note",children:"读取这台电脑上已保存的 Lore 连接,导入后无需重新填写。"}),L?s.jsxs("div",{className:"sline",children:["来源:",L.source]}):null,L&&!L.found?s.jsx("div",{className:"note",children:"未找到可导入的配置。"}):null,Se?s.jsx("div",{className:"badline",children:Se}):null]})]}):null]})}const fw=[{key:"off",label:"关闭"},{key:"openai",label:"OpenAI 兼容接口"}],hw=["1024x1024","1536x1024","1024x1536","512x512"],mw=l=>l.trim().replace(/\/+$/,"");function pw(){const i=Ne().settings.settings.image,[c,u]=w.useState(i.source),[d,f]=w.useState(i.source==="openai"?i.baseUrl:""),[g,p]=w.useState(i.source==="openai"?i.model:""),[h,v]=w.useState(i.source==="openai"?i.size??"":""),[b,k]=w.useState(""),[S,E]=w.useState(!1),[y,x]=w.useState(null),[N,z]=w.useState(null),[O,X]=w.useState(!1),[P,te]=w.useState(null),[V,$]=w.useState(null);w.useEffect(()=>{if(!P)return;const de=setTimeout(()=>te(null),3e3);return()=>clearTimeout(de)},[P]),w.useEffect(()=>{L1().then(de=>{de&&E(de.keyConfigured)})},[]);const L=c==="openai"?{source:"openai",baseUrl:mw(d),model:g.trim(),...h?{size:h}:{}}:{source:"off"},ue=JSON.stringify(L)!==JSON.stringify(i)||b.trim()!=="",Se=JSON.stringify({form:L,apiKey:b.trim()});w.useEffect(()=>{x(null),z(null)},[Se]);const Le=async()=>{if(O)return;X(!0),x(null);const de=await mv({image:L,...b.trim()?{apiKey:b.trim()}:{}});X(!1),de.ok?(z(Se),x({ok:!0,text:"生成成功",path:de.path})):(z(null),x({ok:!1,text:de.error}))},Pe=async()=>{if(O||!ue)return;if(X(!0),$(null),te(null),L.source==="openai"&&N!==Se){const Ve=await mv({image:L,...b.trim()?{apiKey:b.trim()}:{}});if(!Ve.ok){X(!1),z(null),$(`测试连接失败:${Ve.error}`);return}z(Se),x({ok:!0,text:"生成成功",path:Ve.path})}const de=await hv(L,b.trim()||void 0);if(X(!1),!de.ok){$(de.error);return}L.source==="openai"&&(f(L.baseUrl),p(L.model)),k(""),E(de.keyConfigured),x(null),te("已保存")};return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"图像生成",desc:"选择图像生成方式:关闭,或使用 OpenAI 兼容接口。配置完成后,开启了图像生成能力的助手可以在任务中生成图片。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"生成方式"}),s.jsx(ms,{items:fw,value:c,onChange:de=>{x(null),$(null),te(null),de==="off"&&i.source!=="off"?(X(!0),hv({source:"off"}).then(Ve=>{if(X(!1),!Ve.ok){$(Ve.error);return}u("off"),k(""),te("已保存")})):u(de)},disabled:O})]}),c==="openai"?s.jsx(xe,{children:s.jsxs("div",{className:"formcard",children:[s.jsx("div",{className:"lbl",children:"服务地址"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:d,placeholder:"http://127.0.0.1:8080/v1",onChange:de=>f(de.target.value),disabled:O})}),s.jsx("div",{className:"lbl",children:"模型名称"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:g,placeholder:"gpt-image-1",onChange:de=>p(de.target.value),disabled:O})}),s.jsx("div",{className:"lbl",children:"默认尺寸"}),s.jsx("div",{className:"ctl",children:s.jsxs("select",{className:"pick grow",value:h,onChange:de=>v(de.target.value),disabled:O,children:[s.jsx("option",{value:"",children:"不指定,使用接口默认值"}),hw.map(de=>s.jsx("option",{value:de,children:de},de))]})}),s.jsx("div",{className:"lbl",children:"API Key"}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:b,placeholder:S?"已保存,留空则沿用":"sk-…",onChange:de=>k(de.target.value),disabled:O})}),s.jsx("div",{className:"note",children:"API Key 只保存在本机,保存后不再显示。保存前会生成测试图片,可能产生费用。"}),s.jsx("div",{className:"lbl",children:"测试"}),s.jsxs("div",{className:"testrow",children:[s.jsx("button",{className:"pbtn",onClick:()=>void Le(),disabled:O,children:O?"正在生成…":"生成测试图片"}),y?s.jsxs("div",{className:"testout",children:[s.jsx("span",{className:y.ok?"okline":"badline",children:y.text}),y.ok&&y.path?s.jsx("button",{className:"imgcard testshot",onClick:()=>window.open(Rt(y.path),"_blank","noopener"),title:"查看原图",children:s.jsx("img",{src:Rt(y.path),alt:"生成的图片"})}):null]}):null]}),s.jsxs(fa,{saved:P!==null&&!ue,error:V,children:[!V&&ue?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",disabled:O||!ue,onClick:()=>{u(i.source),f(i.source==="openai"?i.baseUrl:""),p(i.source==="openai"?i.model:""),v(i.source==="openai"?i.size??"":""),k(""),x(null),z(null),$(null)},children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void Pe(),disabled:O||!ue,children:O?"正在验证…":"保存"})]})]})}):s.jsx(nn,{message:V??P})]})}const gw={hob:"Hob 的技能",common:"通用技能 · ~/.agents/skills",lore:"Lore 技能"},vw=[{key:"claude",label:"Claude Code"},{key:"codex",label:"Codex"},{key:"pi",label:"pi"}],yd=l=>`${l.source}:${l.id}`,oa=l=>l instanceof Error?l.message:String(l);function xw(){const l=Ne(),i=l.sub,[c,u]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),h=async()=>{try{u(await _1()),f(null)}catch(E){f(oa(E))}};w.useEffect(()=>{h()},[]),w.useEffect(()=>{i&&p(null)},[i]);const v=async E=>{var z;const y=`${E.source}:${E.name}`,x=((z=l.settings.settings.skills)==null?void 0:z.disabled)??[],N=E.enabled?[...x,y]:x.filter(O=>O!==y);await Zd({skills:{disabled:N}})?await h():f(ia().notice??"保存失败")},b=E=>{h(),p(E),pn()};if(!c)return d?s.jsx("div",{className:"badline",children:d}):s.jsx("div",{className:"empty",children:"正在读取技能…"});if((i==null?void 0:i.kind)==="skill")return s.jsx(bw,{skill:c.skills.find(E=>yd(E)===i.key),onDeleted:b});if((i==null?void 0:i.kind)==="importSkills")return s.jsx(yw,{onDone:b});const k=(E,y)=>E.length?E.map(x=>s.jsxs("div",{className:`rrow${x.enabled?"":" gone"}`,children:[s.jsxs("button",{className:"rmain rbtn",onClick:()=>tl({kind:"skill",key:yd(x),title:x.name}),children:[s.jsxs("div",{className:"rname",children:[x.name,x.overridden?s.jsx("span",{className:"rtag",children:"被同名技能覆盖"}):null]}),s.jsx("div",{className:"rprov rclamp",children:x.description})]}),s.jsx("button",{className:`tog${x.enabled?"":" off"}`,"aria-label":`${x.name}启用`,"aria-pressed":x.enabled,onClick:()=>void v(x)})]},yd(x))):s.jsx("div",{className:"rempty",children:y}),S=c.skills.filter(E=>E.source==="hob");return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"技能",desc:"技能是写好的做法说明,任务按需读取。同名时 Hob 的技能优先,其次是 Lore,最后是通用技能。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"Hob 的技能"}),s.jsxs("div",{className:"roster",children:[k(S,"还没有技能,可以从其他工具导入"),s.jsxs("button",{className:"maddrow",onClick:()=>tl({kind:"importSkills",title:"导入技能"}),children:[s.jsx(Z,{name:"plus",size:16}),"从 Claude Code、Codex、pi 导入"]})]}),g?s.jsx("div",{className:"okline",children:g}):null]}),s.jsxs(xe,{children:[s.jsxs("div",{className:"lbl",children:["通用技能 ",s.jsx("span",{className:"lbl-aside",children:"~/.agents/skills"})]}),s.jsx("div",{className:"roster",children:k(c.skills.filter(E=>E.source==="common"),"目录中没有技能")})]}),s.jsxs(xe,{children:[s.jsxs("div",{className:"lbl",children:["Lore 技能",c.loreActive&&c.loreUrl?s.jsx("a",{className:"lbl-aside",href:c.loreUrl,target:"_blank",rel:"noreferrer",children:"在 Lore 控制台管理"}):null]}),c.loreActive?s.jsx("div",{className:"roster",children:k(c.skills.filter(E=>E.source==="lore"),"Lore 中没有技能")}):s.jsx("div",{className:"note",children:"在 设置 → 记忆 中连接 Lore 后,这里会列出 Lore 中的技能。"})]}),d?s.jsx("div",{className:"badline",role:"alert",children:d}):null]})}function bw({skill:l,onDeleted:i}){const[c,u]=w.useState(null);if(!l)return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"技能"}),s.jsx("div",{className:"note",children:"技能不存在或已删除。"})]});const d=async()=>{if(window.confirm(`删除技能「${l.name}」?此操作不能撤销。`))try{await D1(l.id),i(`已删除「${l.name}」`)}catch(f){u(oa(f))}};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"技能"}),s.jsx(dt,{title:l.name,desc:l.description}),s.jsxs("div",{className:"sline",children:[gw[l.source],l.overridden?" · 被优先级更高的同名技能覆盖":"",l.enabled?"":" · 已停用"]}),s.jsx(hs,{className:"skill-doc fp-md",text:l.content}),l.source==="hob"?s.jsx(fa,{saved:!1,error:c,children:s.jsx("button",{className:"pbtn danger",onClick:()=>void d(),children:"删除技能"})}):null]})}function yw({onDone:l}){const[i,c]=w.useState("claude"),[u,d]=w.useState(null),[f,g]=w.useState([]),[p,h]=w.useState(!1),[v,b]=w.useState(!1),[k,S]=w.useState(null);w.useEffect(()=>{let y=!0;return d(null),g([]),S(null),M1(i).then(x=>{y&&d(x)}).catch(x=>{y&&S(oa(x))}),()=>{y=!1}},[i]);const E=async()=>{b(!0),S(null);try{const y=await R1(i,f,p),x=[...y.skipped,...y.errors];x.length?S(x.join(";")):l(`已导入 ${y.imported.length} 个技能`)}catch(y){S(oa(y))}finally{b(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"技能"}),s.jsx(dt,{title:"导入技能",desc:"从其他工具的技能目录复制到 Hob,来源只读。"}),s.jsx(xe,{children:s.jsx(ms,{items:vw,value:i,onChange:c,disabled:v})}),s.jsxs(xe,{children:[u===null?k?null:s.jsx("div",{className:"empty",children:"正在读取…"}):u.found?s.jsx("div",{className:"roster",children:u.skills.length?u.skills.map(y=>s.jsxs("label",{className:"rrow",children:[s.jsx("input",{type:"checkbox",className:"rcheck",checked:f.includes(y.id),disabled:v,onChange:x=>g(x.target.checked?[...f,y.id]:f.filter(N=>N!==y.id))}),s.jsxs("div",{className:"rmain",children:[s.jsxs("div",{className:"rname",children:[y.name,y.exists?s.jsx("span",{className:"rtag",children:"已存在"}):null]}),s.jsx("div",{className:"rprov rclamp",children:y.description})]})]},y.id)):s.jsx("div",{className:"rempty",children:"目录中没有技能"})}):s.jsx("div",{className:"empty",children:"未找到这个工具的技能目录。"}),u==null?void 0:u.skipped.map(y=>s.jsx("div",{className:"note",children:y},y))]}),u!=null&&u.skills.some(y=>y.exists)?s.jsxs("label",{className:"ctl skill-overwrite",children:[s.jsx("input",{type:"checkbox",className:"rcheck",checked:p,onChange:y=>h(y.target.checked)}),"覆盖已存在的同名技能"]}):null,s.jsxs(fa,{saved:!1,error:k,children:[s.jsx("button",{className:"pbtn",onClick:pn,disabled:v,children:"取消"}),s.jsx("button",{className:"pbtn solid",disabled:v||!f.length,onClick:()=>void E(),children:v?"正在导入…":f.length?`导入 ${f.length} 个`:"导入所选"})]})]})}const na={searxng:{label:"SearXNG",desc:"自建的元搜索服务,填写服务地址即可",url:!0,keyOptional:!0},exa:{label:"Exa",desc:"语义搜索,适合查找技术资料"},tavily:{label:"Tavily",desc:"面向 AI 的搜索接口"},brave:{label:"Brave Search",desc:"Brave 的独立网页索引"},serper:{label:"Serper",desc:"Google 搜索结果"},jina:{label:"Jina",desc:"搜索并读取网页正文"},firecrawl:{label:"Firecrawl",desc:"搜索并抓取网页正文"},perplexity:{label:"Perplexity",desc:"带摘要的搜索结果"},youcom:{label:"You.com",desc:"You.com 搜索接口"},ollama:{label:"Ollama",desc:"Ollama 的网页搜索",url:!0}};function jw(){const l=Ne(),i=l.sub,c=l.settings.settings.search,[u,d]=w.useState(null),[f,g]=w.useState(null),[p,h]=w.useState(!1),v=async()=>d(await U1());w.useEffect(()=>{v().catch(x=>g(oa(x)))},[]),w.useEffect(()=>{i&&g(null)},[i]);const b=x=>{var N;return((N=u==null?void 0:u.providers.find(z=>z.name===x))==null?void 0:N.keyConfigured)??!1},k=async(x,N)=>{h(!0);try{const z=await B1(x,N);return z?(g(z),z):(await v(),null)}catch(z){const O=oa(z);return g(O),O}finally{h(!1)}},S=c.filter(x=>x.enabled),E=(x,N)=>{const z=S.map(P=>P.name),O=z.indexOf(x),X=O+N;X<0||X>=z.length||([z[O],z[X]]=[z[X],z[O]],k([...z.map(P=>c.find(te=>te.name===P)),...c.filter(P=>!P.enabled)]))};if((i==null?void 0:i.kind)==="searchProvider"){const x=c.find(N=>N.name===i.name);return x?s.jsx(kw,{provider:x,configured:b(x.name),busy:p,save:(N,z)=>k(c.map(O=>O.name===N.name?N:O),z===void 0?void 0:{[N.name]:z})}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"联网搜索"}),s.jsx("div",{className:"note",children:"没有这个服务商。"})]})}const y=x=>b(x.name)?"已配置 Key":x.baseUrl?"已填服务地址":"未配置";return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"联网搜索",desc:"助手和任务通过这里的服务商搜索网页、读取正文。可以启用多个,按顺序使用,前一个失败时自动换下一个。"}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:"已启用"}),S.length?s.jsx("div",{className:"roster",children:S.map((x,N)=>s.jsxs("div",{className:"rrow",children:[s.jsx("span",{className:"rorder",children:N+1}),s.jsxs("button",{className:"rmain rbtn",onClick:()=>tl({kind:"searchProvider",name:x.name,title:na[x.name].label}),children:[s.jsx("div",{className:"rname",children:na[x.name].label}),s.jsx("div",{className:"rprov",children:na[x.name].desc})]}),s.jsx("button",{className:"ib rmove",title:"上移",disabled:p||N===0,onClick:()=>E(x.name,-1),children:s.jsx(Z,{name:"down",size:15,className:"up"})}),s.jsx("button",{className:"ib rmove",title:"下移",disabled:p||N===S.length-1,onClick:()=>E(x.name,1),children:s.jsx(Z,{name:"down",size:15})})]},x.name))}):s.jsx("div",{className:"note",children:"尚未启用服务商,助手和任务暂时不能联网搜索。"}),f?s.jsx("div",{className:"badline",children:f}):null]}),s.jsxs(xe,{children:[s.jsx("div",{className:"lbl",children:S.length?"其他服务商":"选择服务商"}),s.jsx("div",{className:"roster",children:c.filter(x=>!x.enabled).map(x=>s.jsxs("button",{className:"rrow",onClick:()=>tl({kind:"searchProvider",name:x.name,title:na[x.name].label}),children:[s.jsxs("div",{className:"rmain",children:[s.jsx("div",{className:"rname",children:na[x.name].label}),s.jsx("div",{className:"rprov",children:na[x.name].desc})]}),s.jsx("span",{className:"note",children:y(x)}),s.jsx(Z,{name:"chev",size:15,className:"rgo"})]},x.name))})]})]})}function kw({provider:l,configured:i,busy:c,save:u}){const d=na[l.name],[f,g]=w.useState(l.baseUrl??""),[p,h]=w.useState(""),[v,b]=w.useState(null),[k,S]=w.useState(!1),[E,y]=w.useState(null),[x,N]=w.useState(!1);w.useEffect(()=>g(l.baseUrl??""),[l.baseUrl]);const z=f.trim()!==(l.baseUrl??"")||!!p.trim(),O=i||!!p.trim()||d.keyOptional&&!!f.trim(),X=async()=>{S(!0),b(null);try{const V=await H1(l.name,f.trim(),p.trim()||void 0);return b({ok:V.ok,text:V.ok?`搜索成功,返回 ${V.count} 条结果`:V.error??"搜索失败"}),V.ok}catch(V){return b({ok:!1,text:oa(V)}),!1}finally{S(!1)}},P=async(V,$)=>{y(null),N(!1);const L=await u(V,$);return L?(y(L),!1):(N(!0),!0)},te=async()=>{await X()&&await P({...l,baseUrl:f.trim()||void 0},p.trim()||void 0)&&h("")};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"联网搜索"}),s.jsx(dt,{title:d.label,desc:d.desc}),s.jsxs(xe,{children:[s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:"启用"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${l.enabled?"":" off"}`,"aria-label":`${d.label}启用`,"aria-pressed":l.enabled,disabled:c||!l.enabled&&!O,onClick:()=>void P({...l,enabled:!l.enabled})})]}),!l.enabled&&!O?s.jsxs("div",{className:"note",children:[d.url?"填写服务地址":"填写 API Key","并保存后即可启用。"]}):null]}),s.jsx(xe,{children:s.jsxs("div",{className:"formcard",children:[d.url?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"服务地址"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:f,onChange:V=>{g(V.target.value),b(null)},placeholder:"http://127.0.0.1:8888",disabled:c})})]}):null,s.jsxs("div",{className:"lbl",children:["API Key",d.keyOptional?"(可选)":""]}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:p,onChange:V=>{h(V.target.value),b(null)},placeholder:i?"已保存,留空则沿用":"填写 API Key",disabled:c})}),s.jsx("div",{className:"note",children:"API Key 只保存在本机,保存后不再显示。"}),s.jsxs("div",{className:"testrow",children:[s.jsx("button",{className:"pbtn",onClick:()=>void X(),disabled:c||k,children:k?"正在搜索…":"测试搜索"}),v?s.jsx("span",{className:v.ok?"okline":"badline",children:v.text}):null]}),s.jsxs(fa,{saved:x&&!z,error:E,children:[i?s.jsx("button",{className:"pbtn",disabled:c,onClick:()=>void P(l,""),children:"删除 Key"}):null,s.jsx("button",{className:"pbtn solid",disabled:c||k||!z,onClick:()=>void te(),children:"保存"})]})]})})]})}function Nw(){const[l,i]=w.useState(null);if(w.useEffect(()=>{w1().then(i)},[]),!l)return s.jsx("div",{className:"empty",children:"正在读取版本信息…"});const c=[["Hob 版本",l.version],["数据目录",l.home]];return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"关于",desc:"Hob 的版本与数据目录。"}),s.jsx("div",{className:"kvcard",children:c.map(([u,d])=>s.jsxs("div",{className:"kvrow",children:[s.jsx("span",{className:"k",children:u}),s.jsx("span",{className:"v",children:d})]},u))})]})}const Sw=l=>l.id;function ww(){const l=Ne(),i=l.assistants.filter(d=>d.pinned&&!d.hidden&&bi(d,l.query)),c=ux(i,Sw),u=pb(i.length);return s.jsxs("aside",{className:"side",children:[s.jsxs("div",{className:"side-top",children:[s.jsxs("div",{className:"search",children:[s.jsx(Z,{name:"search",size:15}),s.jsx("input",{value:l.query,placeholder:"搜索助手",onChange:d=>zx(d.target.value)})]}),s.jsx("button",{className:"ib",title:"创建专属助手",onClick:Ex,children:s.jsx(Z,{name:"plus",size:18})})]}),s.jsxs("div",{className:"side-scroll",children:[s.jsx("div",{className:`pins${u.cls}`,children:c.map(d=>s.jsx("div",{className:`srow${d.state==="still"?"":` ${d.state}`}`,children:s.jsx("div",{className:"srowclip",children:s.jsx(mb,{a:d.item,sel:d.item.id===l.sel,size:u.size})})},d.key))}),s.jsx(gb,{size:42,markSel:!0})]}),s.jsx("div",{className:"side-foot",children:s.jsxs("button",{className:"frow",onClick:ef,children:[s.jsx(Z,{name:"gear",size:18}),s.jsx("span",{className:"sp",children:"设置"})]})})]})}function Tw(){"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").then(l=>{const i=c=>{c&&c.addEventListener("statechange",()=>{c.state==="installed"&&navigator.serviceWorker.controller&&vk()})};i(l.installing),l.addEventListener("updatefound",()=>i(l.installing))}).catch(()=>{})})}async function Ew(){var u;if(!("serviceWorker"in navigator)){location.reload();return}let l=!1;const i=()=>{l||(l=!0,location.reload())};navigator.serviceWorker.addEventListener("controllerchange",i,{once:!0});const c=await navigator.serviceWorker.getRegistration();(u=c==null?void 0:c.waiting)==null||u.postMessage("skip-waiting"),setTimeout(i,1200)}function Cw(l){return l.replace(/^无法连接 Hob:/,"")}function zw(){const l=Ne(),[i,c]=w.useState(()=>window.innerWidth<768),u=Un(l.mobile==="chat"&&!!l.sel,240),d=Un(l.page==="settings",180),f=Un(l.sheet,180);w.useLayoutEffect(()=>{fx(l,i)},[l.phase,l.page,l.mobile,l.sheet,l.detail,l.filePreview,l.theme,i]),w.useEffect(()=>{Z1()},[]);const g=l.settings.settings.general.avatarBackground===!1;if(w.useLayoutEffect(()=>{document.documentElement.classList.toggle("av-plain",g)},[g]),w.useEffect(()=>{const h=()=>c(window.innerWidth<768);return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]),w.useEffect(()=>{const h=setInterval(()=>xk(),3e4);return()=>clearInterval(h)},[]),w.useEffect(()=>{const h=l.assistants.reduce((v,b)=>v+b.unread,0);document.title=h>0?`(${h}) Hob`:"Hob"},[l.assistants]),w.useEffect(()=>{if(!l.notice)return;const h=setTimeout(()=>gk(),6e3);return()=>clearTimeout(h)},[l.notice]),l.phase==="login")return s.jsx(yS,{});if(l.phase==="error")return s.jsx("div",{className:"boot",children:s.jsxs("div",{className:"boot-card",children:[s.jsx("div",{className:"t",children:"无法连接 Hob"}),s.jsx("div",{className:"d",children:"请检查网络,或确认 Hob 服务已启动。"}),s.jsx("button",{className:"btn solid",onClick:()=>location.reload(),children:"重试"}),l.error?s.jsx("div",{className:"raw",children:Cw(l.error)}):null]})});if(l.phase==="loading")return s.jsx("div",{className:"boot",children:s.jsxs("div",{className:"boot-loading",children:[s.jsx(vt,{sprite:"hob",size:92,motion:"think"}),s.jsx("span",{className:"activity-shimmer",children:"正在连接 Hob…"})]})});const p=l.notice?s.jsx("div",{className:"toast",children:l.notice}):l.updateReady?s.jsx("button",{className:"upd",onClick:()=>void Ew(),children:"有新版本,点击更新"}):null;return d.mounted?s.jsxs(s.Fragment,{children:[s.jsx(GS,{narrow:i,leaving:d.leaving}),s.jsx(vd,{}),s.jsx(gd,{}),p]}):i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mapp",children:[s.jsx("div",{className:`mpane list${l.mobile==="chat"?" back":""}`,children:s.jsx(LS,{})}),u.mounted?s.jsx("div",{className:`mpane chat${u.leaving?" out":""}`,children:s.jsx(QN,{})}):null,f.mounted?s.jsx($S,{leaving:f.leaving}):null]}),s.jsx(Tv,{}),s.jsx(vd,{}),s.jsx(gd,{}),p]}):s.jsxs("div",{className:"app",children:[s.jsx(ww,{}),s.jsx(XN,{}),s.jsx("div",{className:`panelwrap${l.detail?" detail":l.collapsed?" off":""}`,children:l.detail?s.jsx(vd,{embedded:!0}):s.jsx(fb,{})}),s.jsx(gd,{}),s.jsx(Tv,{}),l.offline?s.jsx("div",{className:"toast",children:l.offline}):null,p]})}function jd(l,i){var u,d,f;if(!i)return[];const c=[];return l.page==="settings"?(c.push("settings"),l.section&&c.push("section"),l.sub&&c.push("sub")):(l.mobile==="chat"&&l.sel&&c.push("chat"),l.sheet&&c.push("sheet")),(((u=l.detail)==null?void 0:u.kind)==="jobs"||((d=l.detail)==null?void 0:d.kind)==="job"&&l.worklog)&&c.push("jobs"),((f=l.detail)==null?void 0:f.kind)==="job"&&c.push("job"),l.filePreview&&c.push("file"),c}const Aw={file:uc,job:wx,jobs:hi,sheet:Cd,chat:()=>Ax("list"),sub:pn,section:()=>us(null),settings:Ed};function Ow(l=()=>window.innerWidth<768){let i=0,c=0,u=!1;history.replaceState({hobDepth:0},"");const d=()=>{if(u)return;const f=jd(ia(),l()).length;for(;i<f;)history.pushState({hobDepth:++i},"");i>f&&(c++,history.go(f-i),i=f)};window.addEventListener("popstate",f=>{var p;if(c>0){c--;return}const g=Number(((p=f.state)==null?void 0:p.hobDepth)??0);i=g,u=!0;for(let h=0;h<10;h++){const v=jd(ia(),l()).at(-1);if(!v||jd(ia(),l()).length<=g)break;Aw[v]()}u=!1,d()}),gx(d),d()}Oj.createRoot(document.getElementById("root")).render(s.jsx(zw,{}));Ow();document.addEventListener("gesturestart",l=>l.preventDefault());Tw();