hob-bot 0.0.0-stage → 1.0.2

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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -2
  3. package/README.zh-CN.md +112 -0
  4. package/bin/hob.mjs +7 -0
  5. package/dist/web/assets/index-D88l35PH.css +1 -0
  6. package/dist/web/assets/index-DUs8nN3E.js +218 -0
  7. package/dist/web/favicon.ico +0 -0
  8. package/dist/web/fonts/inter-latin.woff2 +0 -0
  9. package/dist/web/fonts/jetbrains-mono-latin.woff2 +0 -0
  10. package/dist/web/icons/apple-touch-icon-180.png +0 -0
  11. package/dist/web/icons/favicon-32.png +0 -0
  12. package/dist/web/icons/icon-192.png +0 -0
  13. package/dist/web/icons/icon-512.png +0 -0
  14. package/dist/web/icons/icon-maskable-512.png +0 -0
  15. package/dist/web/index.html +32 -0
  16. package/dist/web/manifest.webmanifest +16 -0
  17. package/dist/web/sw.js +131 -0
  18. package/package.json +62 -4
  19. package/server/src/actions.ts +230 -0
  20. package/server/src/boot.ts +85 -0
  21. package/server/src/bus.ts +21 -0
  22. package/server/src/config.ts +123 -0
  23. package/server/src/cron-text.ts +49 -0
  24. package/server/src/delegations.ts +113 -0
  25. package/server/src/files.ts +142 -0
  26. package/server/src/http.ts +802 -0
  27. package/server/src/ids.ts +19 -0
  28. package/server/src/image.ts +218 -0
  29. package/server/src/imports.ts +302 -0
  30. package/server/src/jobs.ts +730 -0
  31. package/server/src/main.ts +69 -0
  32. package/server/src/memory.ts +272 -0
  33. package/server/src/models.ts +358 -0
  34. package/server/src/overview.ts +116 -0
  35. package/server/src/pages.ts +54 -0
  36. package/server/src/password.ts +23 -0
  37. package/server/src/pi.ts +273 -0
  38. package/server/src/prompt.ts +227 -0
  39. package/server/src/providers.ts +532 -0
  40. package/server/src/push.ts +285 -0
  41. package/server/src/router-tools.ts +549 -0
  42. package/server/src/router.ts +841 -0
  43. package/server/src/routines.ts +129 -0
  44. package/server/src/runtime.ts +104 -0
  45. package/server/src/search.ts +91 -0
  46. package/server/src/secrets.ts +46 -0
  47. package/server/src/settings.ts +452 -0
  48. package/server/src/skills.ts +150 -0
  49. package/server/src/store.ts +324 -0
  50. package/server/src/text.ts +14 -0
  51. package/server/src/time.ts +42 -0
  52. package/server/src/transcript.ts +272 -0
  53. package/server/src/worker-tools.ts +129 -0
  54. package/shared/command.ts +42 -0
  55. package/shared/files.ts +141 -0
  56. package/shared/media.ts +17 -0
  57. package/shared/model-note.ts +32 -0
  58. package/shared/page-shell.ts +108 -0
  59. package/shared/search.ts +19 -0
  60. package/shared/skills.ts +37 -0
  61. package/shared/sprites.ts +422 -0
  62. package/shared/thinking.ts +118 -0
  63. package/shared/types.ts +631 -0
  64. package/vendor/lore-pi-extension/README.md +28 -0
  65. package/vendor/lore-pi-extension/api.ts +140 -0
  66. package/vendor/lore-pi-extension/formatters.ts +204 -0
  67. package/vendor/lore-pi-extension/hooks.ts +195 -0
  68. package/vendor/lore-pi-extension/index.ts +25 -0
  69. package/vendor/lore-pi-extension/package.json +23 -0
  70. package/vendor/lore-pi-extension/skills.ts +447 -0
  71. package/vendor/lore-pi-extension/tools.ts +344 -0
  72. package/vendor/lore-pi-extension/uri.ts +67 -0
  73. package/vendor/lore-pi-extension/vendor/skill-workcopy/index.d.mts +266 -0
  74. package/vendor/lore-pi-extension/vendor/skill-workcopy/index.mjs +1328 -0
  75. package/vendor/lore-pi-extension/vendor/skill-workcopy/skills-sync.d.mts +33 -0
  76. package/vendor/lore-pi-extension/vendor/skill-workcopy/skills-sync.mjs +202 -0
@@ -0,0 +1,218 @@
1
+ var sj=Object.defineProperty;var ij=(l,i,r)=>i in l?sj(l,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[i]=r;var Ye=(l,i,r)=>ij(l,typeof i!="symbol"?i+"":i,r);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(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"&&o(g)}).observe(document,{childList:!0,subtree:!0});function r(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 o(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();var Fo={exports:{}},ii={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Bg;function cj(){if(Bg)return ii;Bg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,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:o,key:g,ref:d!==void 0?d:null,props:f}}return ii.Fragment=i,ii.jsx=r,ii.jsxs=r,ii}var Lg;function rj(){return Lg||(Lg=1,Fo.exports=cj()),Fo.exports}var s=rj(),Wo={exports:{}},ci={},Po={exports:{}},ed={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var qg;function uj(){return qg||(qg=1,(function(l){function i(F,de){var ue=F.length;F.push(de);e:for(;0<ue;){var Re=ue-1>>>1,je=F[Re];if(0<d(je,de))F[Re]=de,F[ue]=je,ue=Re;else break e}}function r(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var de=F[0],ue=F.pop();if(ue!==de){F[0]=ue;e:for(var Re=0,je=F.length,zt=je>>>1;Re<zt;){var Yt=2*(Re+1)-1,Gt=F[Yt],z=Yt+1,X=F[z];if(0>d(Gt,ue))z<je&&0>d(X,Gt)?(F[Re]=X,F[z]=ue,Re=z):(F[Re]=Gt,F[Yt]=ue,Re=Yt);else if(z<je&&0>d(X,ue))F[Re]=X,F[z]=ue,Re=z;else break e}}return de}function d(F,de){var ue=F.sortIndex-de.sortIndex;return ue!==0?ue:F.id-de.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 m=[],x=[],y=1,k=null,S=3,E=!1,j=!1,v=!1,N=!1,A=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function ee(F){for(var de=r(x);de!==null;){if(de.callback===null)o(x);else if(de.startTime<=F)o(x),de.sortIndex=de.expirationTime,i(m,de);else break;de=r(x)}}function ne(F){if(v=!1,ee(F),!j)if(r(m)!==null)j=!0,K||(K=!0,Pe());else{var de=r(x);de!==null&&Me(ne,de.startTime-F)}}var K=!1,q=-1,L=5,me=-1;function Oe(){return N?!0:!(l.unstable_now()-me<L)}function Ke(){if(N=!1,K){var F=l.unstable_now();me=F;var de=!0;try{e:{j=!1,v&&(v=!1,O(q),q=-1),E=!0;var ue=S;try{t:{for(ee(F),k=r(m);k!==null&&!(k.expirationTime>F&&Oe());){var Re=k.callback;if(typeof Re=="function"){k.callback=null,S=k.priorityLevel;var je=Re(k.expirationTime<=F);if(F=l.unstable_now(),typeof je=="function"){k.callback=je,ee(F),de=!0;break t}k===r(m)&&o(m),ee(F)}else o(m);k=r(m)}if(k!==null)de=!0;else{var zt=r(x);zt!==null&&Me(ne,zt.startTime-F),de=!1}}break e}finally{k=null,S=ue,E=!1}de=void 0}}finally{de?Pe():K=!1}}}var Pe;if(typeof V=="function")Pe=function(){V(Ke)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,Qe=oe.port2;oe.port1.onmessage=Ke,Pe=function(){Qe.postMessage(null)}}else Pe=function(){A(Ke,0)};function Me(F,de){q=A(function(){F(l.unstable_now())},de)}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 de=3;break;default:de=S}var ue=S;S=de;try{return F()}finally{S=ue}},l.unstable_requestPaint=function(){N=!0},l.unstable_runWithPriority=function(F,de){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ue=S;S=F;try{return de()}finally{S=ue}},l.unstable_scheduleCallback=function(F,de,ue){var Re=l.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Re+ue:Re):ue=Re,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=ue+je,F={id:y++,callback:de,priorityLevel:F,startTime:ue,expirationTime:je,sortIndex:-1},ue>Re?(F.sortIndex=ue,i(x,F),r(m)===null&&F===r(x)&&(v?(O(q),q=-1):v=!0,Me(ne,ue-Re))):(F.sortIndex=je,i(m,F),j||E||(j=!0,K||(K=!0,Pe()))),F},l.unstable_shouldYield=Oe,l.unstable_wrapCallback=function(F){var de=S;return function(){var ue=S;S=de;try{return F.apply(this,arguments)}finally{S=ue}}}})(ed)),ed}var $g;function oj(){return $g||($g=1,Po.exports=uj()),Po.exports}var td={exports:{}},ve={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Yg;function dj(){if(Yg)return ve;Yg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=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"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),E=Symbol.iterator;function j(z){return z===null||typeof z!="object"?null:(z=E&&z[E]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,A={};function O(z,X,Z){this.props=z,this.context=X,this.refs=A,this.updater=Z||v}O.prototype.isReactComponent={},O.prototype.setState=function(z,X){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,X,"setState")},O.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function V(){}V.prototype=O.prototype;function ee(z,X,Z){this.props=z,this.context=X,this.refs=A,this.updater=Z||v}var ne=ee.prototype=new V;ne.constructor=ee,N(ne,O.prototype),ne.isPureReactComponent=!0;var K=Array.isArray;function q(){}var L={H:null,A:null,T:null,S:null},me=Object.prototype.hasOwnProperty;function Oe(z,X,Z){var P=Z.ref;return{$$typeof:l,type:z,key:X,ref:P!==void 0?P:null,props:Z}}function Ke(z,X){return Oe(z.type,X,z.props)}function Pe(z){return typeof z=="object"&&z!==null&&z.$$typeof===l}function oe(z){var X={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return X[Z]})}var Qe=/\/+/g;function Me(z,X){return typeof z=="object"&&z!==null&&z.key!=null?oe(""+z.key):X.toString(36)}function F(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(q,q):(z.status="pending",z.then(function(X){z.status==="pending"&&(z.status="fulfilled",z.value=X)},function(X){z.status==="pending"&&(z.status="rejected",z.reason=X)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function de(z,X,Z,P,ge){var Ce=typeof z;(Ce==="undefined"||Ce==="boolean")&&(z=null);var ze=!1;if(z===null)ze=!0;else switch(Ce){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(z.$$typeof){case l:case i:ze=!0;break;case y:return ze=z._init,de(ze(z._payload),X,Z,P,ge)}}if(ze)return ge=ge(z),ze=P===""?"."+Me(z,0):P,K(ge)?(Z="",ze!=null&&(Z=ze.replace(Qe,"$&/")+"/"),de(ge,X,Z,"",function(ie){return ie})):ge!=null&&(Pe(ge)&&(ge=Ke(ge,Z+(ge.key==null||z&&z.key===ge.key?"":(""+ge.key).replace(Qe,"$&/")+"/")+ze)),X.push(ge)),1;ze=0;var U=P===""?".":P+":";if(K(z))for(var I=0;I<z.length;I++)P=z[I],Ce=U+Me(P,I),ze+=de(P,X,Z,Ce,ge);else if(I=j(z),typeof I=="function")for(z=I.call(z),I=0;!(P=z.next()).done;)P=P.value,Ce=U+Me(P,I++),ze+=de(P,X,Z,Ce,ge);else if(Ce==="object"){if(typeof z.then=="function")return de(F(z),X,Z,P,ge);throw X=String(z),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ze}function ue(z,X,Z){if(z==null)return z;var P=[],ge=0;return de(z,P,"","",function(Ce){return X.call(Z,Ce,ge++)}),P}function Re(z){if(z._status===-1){var X=z._result,Z=X();Z.then(function(P){(z._status===0||z._status===-1)&&(z._status=1,z._result=P,Z.status===void 0&&(Z.status="fulfilled",Z.value=P))},function(P){(z._status===0||z._status===-1)&&(z._status=2,z._result=P,Z.status===void 0&&(Z.status="rejected",Z.reason=P))}),z._status===-1&&(z._status=0,z._result=Z)}if(z._status===1)return z._result.default;throw z._result}var je=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)};function zt(z){var X=L.T,Z={};Z.types=X!==null?X.types:null,L.T=Z;try{var P=z(),ge=L.S;ge!==null&&ge(Z,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(q,je)}catch(Ce){je(Ce)}finally{X!==null&&Z.types!==null&&(X.types=Z.types),L.T=X}}function Yt(z){var X=L.T;if(X!==null){var Z=X.types;Z===null?X.types=[z]:Z.indexOf(z)===-1&&Z.push(z)}else zt(Yt.bind(null,z))}var Gt={map:ue,forEach:function(z,X,Z){ue(z,function(){X.apply(this,arguments)},Z)},count:function(z){var X=0;return ue(z,function(){X++}),X},toArray:function(z){return ue(z,function(X){return X})||[]},only:function(z){if(!Pe(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ve.Activity=k,ve.Children=Gt,ve.Component=O,ve.Fragment=r,ve.Profiler=d,ve.PureComponent=ee,ve.StrictMode=o,ve.Suspense=m,ve.ViewTransition=S,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ve.__COMPILER_RUNTIME={__proto__:null,c:function(z){return L.H.useMemoCache(z)}},ve.addTransitionType=Yt,ve.cache=function(z){return function(){return z.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(z,X,Z){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var P=N({},z.props),ge=z.key;if(X!=null)for(Ce in X.key!==void 0&&(ge=""+X.key),X)!me.call(X,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&X.ref===void 0||(P[Ce]=X[Ce]);var Ce=arguments.length-2;if(Ce===1)P.children=Z;else if(1<Ce){for(var ze=Array(Ce),U=0;U<Ce;U++)ze[U]=arguments[U+2];P.children=ze}return Oe(z.type,ge,P)},ve.createContext=function(z){return z={$$typeof:g,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:f,_context:z},z},ve.createElement=function(z,X,Z){var P,ge={},Ce=null;if(X!=null)for(P in X.key!==void 0&&(Ce=""+X.key),X)me.call(X,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ge[P]=X[P]);var ze=arguments.length-2;if(ze===1)ge.children=Z;else if(1<ze){for(var U=Array(ze),I=0;I<ze;I++)U[I]=arguments[I+2];ge.children=U}if(z&&z.defaultProps)for(P in ze=z.defaultProps,ze)ge[P]===void 0&&(ge[P]=ze[P]);return Oe(z,Ce,ge)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(z){return{$$typeof:p,render:z}},ve.isValidElement=Pe,ve.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:Re}},ve.memo=function(z,X){return{$$typeof:x,type:z,compare:X===void 0?null:X}},ve.startTransition=zt,ve.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ve.use=function(z){return L.H.use(z)},ve.useActionState=function(z,X,Z){return L.H.useActionState(z,X,Z)},ve.useCallback=function(z,X){return L.H.useCallback(z,X)},ve.useContext=function(z){return L.H.useContext(z)},ve.useDebugValue=function(){},ve.useDeferredValue=function(z,X){return L.H.useDeferredValue(z,X)},ve.useEffect=function(z,X){return L.H.useEffect(z,X)},ve.useEffectEvent=function(z){return L.H.useEffectEvent(z)},ve.useId=function(){return L.H.useId()},ve.useImperativeHandle=function(z,X,Z){return L.H.useImperativeHandle(z,X,Z)},ve.useInsertionEffect=function(z,X){return L.H.useInsertionEffect(z,X)},ve.useLayoutEffect=function(z,X){return L.H.useLayoutEffect(z,X)},ve.useMemo=function(z,X){return L.H.useMemo(z,X)},ve.useOptimistic=function(z,X){return L.H.useOptimistic(z,X)},ve.useReducer=function(z,X,Z){return L.H.useReducer(z,X,Z)},ve.useRef=function(z){return L.H.useRef(z)},ve.useState=function(z){return L.H.useState(z)},ve.useSyncExternalStore=function(z,X,Z){return L.H.useSyncExternalStore(z,X,Z)},ve.useTransition=function(){return L.H.useTransition()},ve.version="19.3.1",ve}var Gg;function Md(){return Gg||(Gg=1,td.exports=dj()),td.exports}var nd={exports:{}},St={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Xg;function fj(){if(Xg)return St;Xg=1;var l=Md();function i(y){var k="https://react.dev/errors/"+y;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 #"+y+"; visit "+k+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),g=Symbol.for("react.optimistic_key");function p(y,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:y,containerInfo:k,implementation:S}}var m=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,k){if(y==="font")return"";if(typeof k=="string")return k==="use-credentials"?k:""}return St.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,St.browser=function(y){return{$$typeof:f,_reason:y}},St.createPortal=function(y,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(y,k,null,S)},St.flushSync=function(y){var k=m.T,S=o.p;try{if(m.T=null,o.p=2,y)return y()}finally{m.T=k,o.p=S,o.d.f()}},St.preconnect=function(y,k){typeof y=="string"&&(k?(k=k.crossOrigin,k=typeof k=="string"?k==="use-credentials"?k:"":void 0):k=null,o.d.C(y,k))},St.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},St.preinit=function(y,k){if(typeof y=="string"&&k&&typeof k.as=="string"){var S=k.as,E=x(S,k.crossOrigin),j=typeof k.integrity=="string"?k.integrity:void 0,v=typeof k.fetchPriority=="string"?k.fetchPriority:void 0;S==="style"?o.d.S(y,typeof k.precedence=="string"?k.precedence:void 0,{crossOrigin:E,integrity:j,fetchPriority:v}):S==="script"&&o.d.X(y,{crossOrigin:E,integrity:j,fetchPriority:v,nonce:typeof k.nonce=="string"?k.nonce:void 0})}},St.preinitModule=function(y,k){if(typeof y=="string")if(typeof k=="object"&&k!==null){if(k.as==null||k.as==="script"){var S=x(k.as,k.crossOrigin);o.d.M(y,{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&&o.d.M(y)},St.preload=function(y,k){if(typeof y=="string"&&typeof k=="object"&&k!==null&&typeof k.as=="string"){var S=k.as,E=x(S,k.crossOrigin);o.d.L(y,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})}},St.preloadModule=function(y,k){if(typeof y=="string")if(k){var S=x(k.as,k.crossOrigin);o.d.m(y,{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 o.d.m(y)},St.requestFormReset=function(y){o.d.r(y)},St.unstable_batchedUpdates=function(y,k){return y(k)},St.useFormState=function(y,k,S){return m.H.useFormState(y,k,S)},St.useFormStatus=function(){return m.H.useHostTransitionStatus()},St.version="19.3.1",St}var Qg;function Vv(){if(Qg)return nd.exports;Qg=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(),nd.exports=fj(),nd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Vg;function hj(){if(Vg)return ci;Vg=1;var l=oj(),i=Md(),r=Vv();function o(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 m(e){if(f(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,a=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(a=c.return,a!==null){n=a;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return m(c),e;if(u===a)return m(c),t;u=u.sibling}throw Error(o(188))}if(n.return!==a.return)n=c,a=u;else{for(var h=!1,b=c.child;b;){if(b===n){h=!0,n=c,a=u;break}if(b===a){h=!0,a=c,n=u;break}b=b.sibling}if(!h){for(b=u.child;b;){if(b===n){h=!0,n=u,a=c;break}if(b===a){h=!0,a=u,n=c;break}b=b.sibling}if(!h)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function k(e,t,n,a,c,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,c,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&k(e.child,t,n,a,c,u))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 j(e){var t=[null,null],n=S(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(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)&&v(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(o(559))}}var A=null,O=null;function V(e,t,n){return e===n?!0:e===t?(A=e,!0):!1}function ee(e,t,n){return e===n?(O=e,!1):e===t?(O!==null&&(A=e),!0):!1}function ne(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 K(e,t,n){for(var a=0,c=e;c;c=n(c))a++;c=0;for(var u=t;u;u=n(u))c++;for(;0<a-c;)e=n(e),a--;for(;0<c-a;)t=n(t),c--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var q=Object.assign,L=Symbol.for("react.element"),me=Symbol.for("react.transitional.element"),Oe=Symbol.for("react.portal"),Ke=Symbol.for("react.fragment"),Pe=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),Qe=Symbol.for("react.consumer"),Me=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),Re=Symbol.for("react.memo"),je=Symbol.for("react.lazy"),zt=Symbol.for("react.activity"),Yt=Symbol.for("react.legacy_hidden"),Gt=Symbol.for("react.memo_cache_sentinel"),z=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),Z=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function Ce(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 Ke:return"Fragment";case oe:return"Profiler";case Pe:return"StrictMode";case de:return"Suspense";case ue:return"SuspenseList";case zt:return"Activity";case z:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Oe:return"Portal";case Me:return e.displayName||"Context";case Qe: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 Re:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var ze=Array.isArray,U=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},vt=[],wt=-1;function ft(e){return{current:e}}function et(e){0>wt||(e.current=vt[wt],vt[wt]=null,wt--)}function Je(e,t){wt++,vt[wt]=e.current,e.current=t}var Nn=ft(null),fs=ft(null),nl=ft(null),bi=ft(null);function yi(e,t){switch(Je(nl,t),Je(fs,e),Je(Nn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zp(t),e=Kp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}et(Nn),Je(Nn,e)}function da(){et(Nn),et(fs),et(nl)}function gr(e){var t=e.memoizedState;t!==null&&(Wa._currentValue=t.memoizedState,Je(bi,e)),t=Nn.current;var n=Kp(t,e.type);t!==n&&(Je(fs,e),Je(Nn,n))}function ji(e){fs.current===e&&(et(Nn),et(fs)),bi.current===e&&(et(bi),Wa._currentValue=ie)}var vr,mf;function ll(e){if(vr===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);vr=t&&t[1]||"",mf=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+vr+e+mf}var xr=!1;function br(e,t){if(!e||xr)return"";xr=!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 c=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),h=u[0],b=u[1];if(h&&b){var T=h.split(`
44
+ `),R=b.split(`
45
+ `);for(c=a=0;a<T.length&&!T[a].includes("DetermineComponentFrameRoot");)a++;for(;c<R.length&&!R[c].includes("DetermineComponentFrameRoot");)c++;if(a===T.length||c===R.length)for(a=T.length-1,c=R.length-1;1<=a&&0<=c&&T[a]!==R[c];)c--;for(;1<=a&&0<=c;a--,c--)if(T[a]!==R[c]){if(a!==1||c!==1)do if(a--,c--,0>c||T[a]!==R[c]){var B=`
46
+ `+T[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=c);break}}}finally{xr=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ll(n):""}function ub(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 br(e.type,!1);case 11:return br(e.type.render,!1);case 1:return br(e.type,!0);case 31:return ll("Activity");case 30:return ll("ViewTransition");default:return""}}function pf(e){try{var t="",n=null;do t+=ub(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var yr=Object.prototype.hasOwnProperty,jr=l.unstable_scheduleCallback,kr=l.unstable_cancelCallback,ob=l.unstable_shouldYield,db=l.unstable_requestPaint,Xt=l.unstable_now,fb=l.unstable_getCurrentPriorityLevel,gf=l.unstable_ImmediatePriority,vf=l.unstable_UserBlockingPriority,ki=l.unstable_NormalPriority,hb=l.unstable_LowPriority,xf=l.unstable_IdlePriority,mb=l.log,pb=l.unstable_setDisableYieldValue,hs=null,Qt=null;function al(e){if(typeof mb=="function"&&pb(e),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(hs,e)}catch{}}var Vt=Math.clz32?Math.clz32:xb,gb=Math.log,vb=Math.LN2;function xb(e){return e>>>=0,e===0?32:31-(gb(e)/vb|0)|0}var Ni=256,Si=262144,wi=4194304;function _l(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 Ti(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var c=0,u=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=a&134217727;return b!==0?(a=b&~u,a!==0?c=_l(a):(h&=b,h!==0?c=_l(h):n||(n=b&~e,n!==0&&(c=_l(n))))):(b=a&~u,b!==0?c=_l(b):h!==0?c=_l(h):n||(n=a&~e,n!==0&&(c=_l(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function ms(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bf(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-Vt(n),c=1<<a;t|=e[a],n&=~c}return t}function bb(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 yf(){var e=wi;return wi<<=1,(wi&62914560)===0&&(wi=4194304),e}function Nr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ps(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yb(e,t,n,a,c,u){var h=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 b=e.entanglements,T=e.expirationTimes,R=e.hiddenUpdates;for(n=h&~n;0<n;){var B=31-Vt(n),Y=1<<B;b[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&&jf(e,a,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(h&~t))}function jf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Vt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function kf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Vt(n),c=1<<a;c&t|e[a]&t&&(e[a]|=t),n&=~c}}function Nf(e,t){var n=t&-t;return n=(n&42)!==0?1:Sr(n),(n&(e.suspendedLanes|t))!==0?0:n}function Sr(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 wr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Sf(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Og(e.type))}function wf(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Bn=Math.random().toString(36).slice(2),xt="__reactFiber$"+Bn,Dt="__reactProps$"+Bn,fa="__reactContainer$"+Bn,Tf="__reactEvents$"+Bn,jb="__reactListeners$"+Bn,kb="__reactHandles$"+Bn,Ef="__reactResources$"+Bn,gs="__reactMarker$"+Bn,Ei="__reactLoad$"+Bn;function Ci(e){delete e[xt],delete e[Dt],delete e[jb],delete e[kb]}function Ml(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[fa]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dg(e);e!==null;){if(n=e[xt])return n;e=dg(e)}return t}e=n,n=e.parentNode}return null}function ha(e){if(e=e[xt]||e[fa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ma(e){var t=e[Ef];return t||(t=e[Ef]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[gs]=!0}function Cf(e){e[Ei]=void 0}var zf=new Set,Af={};function Rl(e,t){pa(e,t),pa(e+"Capture",t)}function pa(e,t){for(Af[e]=t,e=0;e<t.length;e++)zf.add(t[e])}var Nb=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]*$"),Of={},_f={};function Sb(e){return yr.call(_f,e)?!0:yr.call(Of,e)?!1:Nb.test(e)?_f[e]=!0:(Of[e]=!0,!1)}var _e=!1;function Mf(){var e=_e;return _e=!1,e}function zi(e,t,n){if(Sb(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 Ai(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 Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wb(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 c=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){n=""+h,u.call(this,h)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tr(e){if(!e._valueTracker){var t=Rf(e)?"checked":"value";e._valueTracker=wb(e,t,""+e[t])}}function Df(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Rf(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var Tb=/[\n"\\]/g;function nn(e){return e.replace(Tb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Er(e,t,n,a,c,u,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?h==="number"&&e.value==t?Cr(e,Zt(e.value)):Cr(e,Zt(t)):n!=null?Cr(e,Zt(n)):a!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Zt(b):e.removeAttribute("name")}function Uf(e,t,n,a,c,u,h,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Tr(e);return}n=n!=null?""+Zt(n):"",t=t!=null?""+Zt(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=b?e.checked:!!a,e.defaultChecked=!!a,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Tr(e)}function Cr(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ga(e,t,n,a){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,a&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Hf(e,t,n){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Zt(n):""}function Bf(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(o(92));if(ze(a)){if(1<a.length)throw Error(o(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Zt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Tr(e)}function va(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eb=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 Lf(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||Eb.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function qf(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(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]="",_e=!0);for(var c in t)a=t[c],t.hasOwnProperty(c)&&n[c]!==a&&(Lf(e,c,a),_e=!0)}else for(var u in t)t.hasOwnProperty(u)&&Lf(e,u,t[u])}function zr(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 Cb=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"]]),zb=/^[\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 Oi(e){return zb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sn(){}var Ar=null;function Or(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xa=null,ba=null;function $f(e){var t=ha(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Er(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="'+nn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var c=a[Dt]||null;if(!c)throw Error(o(90));Er(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Df(a)}break e;case"textarea":Hf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ga(e,!!n.multiple,t,!1)}}}var _r=!1;function Yf(e,t,n){if(_r)return e(t,n);_r=!0;try{var a=e(t);return a}finally{if(_r=!1,(xa!==null||ba!==null)&&(Oc(),xa&&(t=xa,e=ba,ba=xa=null,$f(t),e)))for(t=0;t<e.length;t++)$f(e[t])}}function xs(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Dt]||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(o(231,t,typeof n));return n}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mr=!1;if(qn)try{var bs={};Object.defineProperty(bs,"passive",{get:function(){Mr=!0}}),window.addEventListener("test",bs,bs),window.removeEventListener("test",bs,bs)}catch{Mr=!1}var sl=null,Rr=null,_i=null;function Gf(){if(_i)return _i;var e,t=Rr,n=t.length,a,c="value"in sl?sl.value:sl.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(a=1;a<=h&&t[n-a]===c[u-a];a++);return _i=c.slice(e,1<a?1-a:void 0)}function Mi(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 Ri(){return!0}function Xf(){return!1}function At(e){function t(n,a,c,u,h){this._reactName=n,this._targetInst=c,this.type=a,this.nativeEvent=u,this.target=h,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Ri:Xf,this.isPropagationStopped=Xf,this}return q(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=Ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ri)},persist:function(){},isPersistent:Ri}),t}var il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Di=At(il),ys=q({},il,{view:0,detail:0}),Ab=At(ys),Dr,Ur,js,Ui=q({},ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Br,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!==js&&(js&&e.type==="mousemove"?(Dr=e.screenX-js.screenX,Ur=e.screenY-js.screenY):Ur=Dr=0,js=e),Dr)},movementY:function(e){return"movementY"in e?e.movementY:Ur}}),Qf=At(Ui),Ob=q({},Ui,{dataTransfer:0}),_b=At(Ob),Mb=q({},ys,{relatedTarget:0}),Hr=At(Mb),Rb=q({},il,{animationName:0,elapsedTime:0,pseudoElement:0}),Db=At(Rb),Ub=q({},il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hb=At(Ub),Bb=q({},il,{data:0}),Vf=At(Bb),Lb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qb={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"},$b={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$b[e])?!!t[e]:!1}function Br(){return Yb}var Gb=q({},ys,{key:function(e){if(e.key){var t=Lb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Br,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xb=At(Gb),Qb=q({},Ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=At(Qb),Vb=q({},il,{submitter:0}),Zb=At(Vb),Kb=q({},ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Br}),Jb=At(Kb),Ib=q({},il,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fb=At(Ib),Wb=q({},Ui,{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}),Pb=At(Wb),e0=q({},il,{newState:0,oldState:0,source:0}),t0=At(e0),n0=[9,13,27,32],Lr=qn&&"CompositionEvent"in window,ks=null;qn&&"documentMode"in document&&(ks=document.documentMode);var l0=qn&&"TextEvent"in window&&!ks,Kf=qn&&(!Lr||ks&&8<ks&&11>=ks),Jf=" ",If=!1;function Ff(e,t){switch(e){case"keyup":return n0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ya=!1;function a0(e,t){switch(e){case"compositionend":return Wf(t);case"keypress":return t.which!==32?null:(If=!0,Jf);case"textInput":return e=t.data,e===Jf&&If?null:e;default:return null}}function s0(e,t){if(ya)return e==="compositionend"||!Lr&&Ff(e,t)?(e=Gf(),_i=Rr=sl=null,ya=!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 Kf&&t.locale!=="ko"?null:t.data;default:return null}}var i0={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 Pf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!i0[e.type]:t==="textarea"}function eh(e,t,n,a){xa?ba?ba.push(a):ba=[a]:xa=a,t=Hc(t,"onChange"),0<t.length&&(n=new Di("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ns=null,Ss=null;function c0(e){$p(e,0)}function Hi(e){var t=vs(e);if(Df(t))return e}function th(e,t){if(e==="change")return t}var nh=!1;if(qn){var qr;if(qn){var $r="oninput"in document;if(!$r){var lh=document.createElement("div");lh.setAttribute("oninput","return;"),$r=typeof lh.oninput=="function"}qr=$r}else qr=!1;nh=qr&&(!document.documentMode||9<document.documentMode)}function ah(){Ns&&(Ns.detachEvent("onpropertychange",sh),Ss=Ns=null)}function sh(e){if(e.propertyName==="value"&&Hi(Ss)){var t=[];eh(t,Ss,e,Or(e)),Yf(c0,t)}}function r0(e,t,n){e==="focusin"?(ah(),Ns=t,Ss=n,Ns.attachEvent("onpropertychange",sh)):e==="focusout"&&ah()}function u0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hi(Ss)}function o0(e,t){if(e==="click")return Hi(t)}function d0(e,t){if(e==="input"||e==="change")return Hi(t)}function f0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kt=typeof Object.is=="function"?Object.is:f0;function ws(e,t){if(Kt(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 c=n[a];if(!yr.call(t,c)||!Kt(e[c],t[c]))return!1}return!0}function Yr(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 ih(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ch(e,t){var n=ih(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=ih(n)}}function rh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yr(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=Yr(e.document)}return t}function Gr(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 h0=qn&&"documentMode"in document&&11>=document.documentMode,ja=null,Xr=null,Ts=null,Qr=!1;function oh(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||ja==null||ja!==Yr(a)||(a=ja,"selectionStart"in a&&Gr(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}),Ts&&ws(Ts,a)||(Ts=a,a=Hc(Xr,"onSelect"),0<a.length&&(t=new Di("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ja)))}function Dl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ka={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionrun:Dl("Transition","TransitionRun"),transitionstart:Dl("Transition","TransitionStart"),transitioncancel:Dl("Transition","TransitionCancel"),transitionend:Dl("Transition","TransitionEnd")},Vr={},dh={};qn&&(dh=document.createElement("div").style,"AnimationEvent"in window||(delete ka.animationend.animation,delete ka.animationiteration.animation,delete ka.animationstart.animation),"TransitionEvent"in window||delete ka.transitionend.transition);function Ul(e){if(Vr[e])return Vr[e];if(!ka[e])return e;var t=ka[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dh)return Vr[e]=t[n];return e}var fh=Ul("animationend"),hh=Ul("animationiteration"),mh=Ul("animationstart"),m0=Ul("transitionrun"),p0=Ul("transitionstart"),g0=Ul("transitioncancel"),ph=Ul("transitionend"),gh=new Map,Zr="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(" ");Zr.push("scrollEnd");function pn(e,t){gh.set(e,t),Rl(t,[e])}var v0=0;function $n(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=bn.identifierPrefix;var n=v0++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function vh(e){if(e==null||typeof e=="string")return e;var t=null,n=Ya;if(n!==null)for(var a=0;a<n.length;a++){var c=e[n[a]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Yn(e,t){return e=vh(e),t=vh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Bi=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)},ln=[],Na=0,Kr=0;function Li(){for(var e=Na,t=Kr=Na=0;t<e;){var n=ln[t];ln[t++]=null;var a=ln[t];ln[t++]=null;var c=ln[t];ln[t++]=null;var u=ln[t];if(ln[t++]=null,a!==null&&c!==null){var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}u!==0&&xh(n,c,u)}}function qi(e,t,n,a){ln[Na++]=e,ln[Na++]=t,ln[Na++]=n,ln[Na++]=a,Kr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Jr(e,t,n,a){return qi(e,t,n,a),$i(e)}function Hl(e,t){return qi(e,null,null,t),$i(e)}function xh(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Vt(n),e=u.hiddenUpdates,a=e[c],a===null?e[c]=[t]:a.push(t),t.lane=n|536870912),u):null}function $i(e){if(50<Ks)throw Ks=0,Ac=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Sa={};function x0(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 Ut(e,t,n,a){return new x0(e,t,n,a)}function Ir(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gn(e,t){var n=e.alternate;return n===null?(n=Ut(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 bh(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 Yi(e,t,n,a,c,u){var h=0;if(a=e,typeof a=="function")Ir(a)&&(h=1);else if(typeof a=="string")h=Vy(e,n,Nn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case zt:return e=Ut(31,n,t,c),e.elementType=zt,e.lanes=u,e;case Ke:return Bl(n.children,c,u,t);case Pe:h=8,c|=24;break;case oe:return e=Ut(12,n,t,c|2),e.elementType=oe,e.lanes=u,e;case de:return e=Ut(13,n,t,c),e.elementType=de,e.lanes=u,e;case ue:return e=Ut(19,n,t,c),e.elementType=ue,e.lanes=u,e;case Yt:case z:return e=c|32,e=Ut(30,n,t,e),e.elementType=z,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Me:h=10;break e;case Qe:h=9;break e;case F:h=11;break e;case Re:h=14;break e;case je:h=16,a=null;break e}h=29,n=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=Ut(h,n,t,c),t.elementType=e,t.type=a,t.lanes=u,t}function Bl(e,t,n,a){return e=Ut(7,e,a,t),e.lanes=n,e}function Fr(e,t,n){return e=Ut(6,e,null,t),e.lanes=n,e}function yh(e){var t=Ut(18,null,null,0);return t.stateNode=e,t}function Wr(e,t,n){return t=Ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jh=new WeakMap;function an(e,t){if(typeof e=="object"&&e!==null){var n=jh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:pf(t)},jh.set(e,t),t)}return{value:e,source:t,stack:pf(t)}}var wa=[],Ta=0,Gi=null,Es=0,sn=[],cn=0,cl=null,wn=1,Tn="";function Xn(e,t){wa[Ta++]=Es,wa[Ta++]=Gi,Gi=e,Es=t}function kh(e,t,n){sn[cn++]=wn,sn[cn++]=Tn,sn[cn++]=cl,cl=e;var a=wn;e=Tn;var c=32-Vt(a)-1;a&=~(1<<c),n+=1;var u=32-Vt(t)+c;if(30<u){var h=c-c%5;u=(a&(1<<h)-1).toString(32),a>>=h,c-=h,wn=1<<32-Vt(t)+c|n<<c|a,Tn=u+e}else wn=1<<u|n<<c|a,Tn=e}function Xi(e){e.return!==null&&(Xn(e,1),kh(e,1,0))}function Pr(e){for(;e===Gi;)Gi=wa[--Ta],wa[Ta]=null,Es=wa[--Ta],wa[Ta]=null;for(;e===cl;)cl=sn[--cn],sn[cn]=null,Tn=sn[--cn],sn[cn]=null,wn=sn[--cn],sn[cn]=null}function Nh(e,t){sn[cn++]=wn,sn[cn++]=Tn,sn[cn++]=cl,wn=t.id,Tn=t.overflow,cl=e}var mt=null,Ie=null,ke=!1,rl=null,rn=!1,eu=Error(o(519));function ul(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cs(an(t,e)),eu}function Sh(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[xt]=e,t[Dt]=a,n){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(n=0;n<Is.length;n++)Se(Is[n],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),Uf(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Bf(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||Qp(t.textContent,n)?(a.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),a.onScroll!=null&&Se("scroll",t),a.onScrollEnd!=null&&Se("scrollend",t),a.onClick!=null&&(t.onclick=Sn),t=!0):t=!1,t||ul(e,!0)}function Qi(e){for(mt=e.return;mt;)switch(mt.tag){case 5:case 31:case 13:rn=!1;return;case 27:case 3:rn=!0;return;default:mt=mt.return}}function Ea(e){if(e!==mt)return!1;if(!ke)return Qi(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")||Oo(e.type,e.memoizedProps)),n=!n),n&&Ie&&ul(e),Qi(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=og(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=og(e)}else t===27?(t=Ie,wl(e.type)?(e=qo,qo=null,Ie=e):Ie=t):Ie=mt?on(e.stateNode.nextSibling):null;return!0}function Ll(){Ie=mt=null,ke=!1}function tu(){var e=rl;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),rl=null),e}function Cs(e){rl===null?rl=[e]:rl.push(e)}var nu=ft(null),ql=null,Qn=null;function ol(e,t,n){Je(nu,t._currentValue),t._currentValue=n}function Vn(e){e._currentValue=nu.current,et(nu)}function Vi(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 lu(e,t,n,a){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var h=c.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=c;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=n,b=u.alternate,b!==null&&(b.lanes|=n),Vi(u.return,n,e),a||(h=null);break e}u=b.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(o(341));h.lanes|=n,u=h.alternate,u!==null&&(u.lanes|=n),Vi(h,n,e),h=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=n,h=c.alternate,h!==null&&(h.lanes|=n),Vi(c.return,n,e),h=c.child,h=h!==null?h.sibling:null):h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function $l(e,t,n,a){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(o(387));if(h=h.memoizedProps,h!==null){var b=c.type;Kt(c.pendingProps.value,h.value)||(e!==null?e.push(b):e=[b])}}else if(c===bi.current){if(h=c.alternate,h===null)throw Error(o(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Wa):e=[Wa])}c=c.return}return e!==null&&lu(t,e,n,a),t.flags|=262144,e!==null}function Zi(e){for(e=e.firstContext;e!==null;){if(!Kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yl(e){ql=e,Qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return wh(ql,e)}function Ki(e,t){return ql===null&&Yl(e),wh(e,t)}function wh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Qn===null){if(e===null)throw Error(o(308));Qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qn=Qn.next=t;return n}var b0=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()})}},y0=l.unstable_scheduleCallback,j0=l.unstable_NormalPriority,it={$$typeof:Me,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function au(){return{controller:new b0,data:new Map,refCount:0}}function zs(e){e.refCount--,e.refCount===0&&y0(j0,function(){e.controller.abort()})}function Th(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 As=null;function k0(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Os=null,su=0,Gl=0,Ca=null;function N0(e,t){if(Os===null){var n=Os=[];su=0,Gl=ko(),Ca={status:"pending",value:void 0,then:function(a){n.push(a)}}}return su++,t.then(Eh,Eh),t}function Eh(){if(--su===0&&(As=null,Os!==null)){Ca!==null&&(Ca.status="fulfilled");var e=Os;Os=null,Gl=0,Ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function S0(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(a.status="rejected",a.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),a}var Ch=U.S;U.S=function(e,t){if(yp=Xt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&N0(e,t),As!==null)for(var n=Va;n!==null;)Th(n,As),n=n.next;if(n=e.types,n!==null){for(var a=Va;a!==null;)Th(a,n),a=a.next;if(Gl!==0){a=As,a===null&&(a=As=[]);for(var c=0;c<n.length;c++){var u=n[c];a.indexOf(u)===-1&&a.push(u)}}}Ch!==null&&Ch(e,t)};var Xl=ft(null);function iu(){var e=Xl.current;return e!==null?e:Ve.pooledCache}function Ji(e,t){t===null?Je(Xl,Xl.current):Je(Xl,t.pool)}function zh(){var e=iu();return e===null?null:{parent:it._currentValue,pool:e}}var za=Error(o(460)),cu=Error(o(474)),Ii=Error(o(542)),Fi={then:function(){}};function Ah(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Oh(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,Mh(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(Sn,Sn);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=a}},function(a){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mh(e),e}throw Vl=t,za}}function Ql(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Vl=n,za):n}}var Vl=null;function _h(){if(Vl===null)throw Error(o(459));var e=Vl;return Vl=null,e}function Mh(e){if(e===za||e===Ii)throw Error(o(483))}var Aa=null,_s=0;function Wi(e){var t=_s;return _s+=1,Aa===null&&(Aa=[]),Oh(Aa,e,t)}function dl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pi(e,t){throw t.$$typeof===L?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Rh(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 c(M,C){return M=Gn(M,C),M.index=0,M.sibling=null,M}function u(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 h(M){return e&&M.alternate===null&&(M.flags|=134217730),M}function b(M,C,D,$){return C===null||C.tag!==6?(C=Fr(D,M.mode,$),C.return=M,C):(C=c(C,D),C.return=M,C)}function T(M,C,D,$){var te=D.type;return te===Ke?(M=B(M,C,D.props.children,$,D.key),dl(M,D),M):C!==null&&(C.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===je&&Ql(te)===C.type)?(C=c(C,D.props),dl(C,D),C.return=M,C):(C=Yi(D.type,D.key,D.props,null,M.mode,$),dl(C,D),C.return=M,C)}function R(M,C,D,$){return C===null||C.tag!==4||C.stateNode.containerInfo!==D.containerInfo||C.stateNode.implementation!==D.implementation?(C=Wr(D,M.mode,$),C.return=M,C):(C=c(C,D.children||[]),C.return=M,C)}function B(M,C,D,$,te){return C===null||C.tag!==7?(C=Bl(D,M.mode,$,te),C.return=M,C):(C=c(C,D),C.return=M,C)}function Y(M,C,D){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Fr(""+C,M.mode,D),C.return=M,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case me:return D=Yi(C.type,C.key,C.props,null,M.mode,D),dl(D,C),D.return=M,D;case Oe:return C=Wr(C,M.mode,D),C.return=M,C;case je:return C=Ql(C),Y(M,C,D)}if(ze(C)||P(C))return C=Bl(C,M.mode,D,null),C.return=M,C;if(typeof C.then=="function")return Y(M,Wi(C),D);if(C.$$typeof===Me)return Y(M,Ki(M,C),D);Pi(M,C)}return null}function _(M,C,D,$){var te=C!==null?C.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return te!==null?null:b(M,C,""+D,$);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case me:return D.key===te?T(M,C,D,$):null;case Oe:return D.key===te?R(M,C,D,$):null;case je:return D=Ql(D),_(M,C,D,$)}if(ze(D)||P(D))return te!==null?null:B(M,C,D,$,null);if(typeof D.then=="function")return _(M,C,Wi(D),$);if(D.$$typeof===Me)return _(M,C,Ki(M,D),$);Pi(M,D)}return null}function H(M,C,D,$,te){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return M=M.get(D)||null,b(C,M,""+$,te);if(typeof $=="object"&&$!==null){switch($.$$typeof){case me:return M=M.get($.key===null?D:$.key)||null,T(C,M,$,te);case Oe:return M=M.get($.key===null?D:$.key)||null,R(C,M,$,te);case je:return $=Ql($),H(M,C,D,$,te)}if(ze($)||P($))return M=M.get(D)||null,B(C,M,$,te,null);if(typeof $.then=="function")return H(M,C,D,Wi($),te);if($.$$typeof===Me)return H(M,C,D,Ki(C,$),te);Pi(C,$)}return null}function W(M,C,D,$){for(var te=null,Ee=null,re=C,pe=C=0,ut=null;re!==null&&pe<D.length;pe++){re.index>pe?(ut=re,re=null):ut=re.sibling;var Ae=_(M,re,D[pe],$);if(Ae===null){re===null&&(re=ut);break}e&&re&&Ae.alternate===null&&t(M,re),C=u(Ae,C,pe),Ee===null?te=Ae:Ee.sibling=Ae,Ee=Ae,re=ut}if(pe===D.length)return n(M,re),ke&&Xn(M,pe),te;if(re===null){for(;pe<D.length;pe++)re=Y(M,D[pe],$),re!==null&&(C=u(re,C,pe),Ee===null?te=re:Ee.sibling=re,Ee=re);return ke&&Xn(M,pe),te}for(re=a(re);pe<D.length;pe++)ut=H(re,M,pe,D[pe],$),ut!==null&&(e&&(Ae=ut.alternate,Ae!==null&&re.delete(Ae.key===null?pe:Ae.key)),C=u(ut,C,pe),Ee===null?te=ut:Ee.sibling=ut,Ee=ut);return e&&re.forEach(function(Al){return t(M,Al)}),ke&&Xn(M,pe),te}function ae(M,C,D,$){if(D==null)throw Error(o(151));for(var te=null,Ee=null,re=C,pe=C=0,ut=null,Ae=D.next();re!==null&&!Ae.done;pe++,Ae=D.next()){re.index>pe?(ut=re,re=null):ut=re.sibling;var Al=_(M,re,Ae.value,$);if(Al===null){re===null&&(re=ut);break}e&&re&&Al.alternate===null&&t(M,re),C=u(Al,C,pe),Ee===null?te=Al:Ee.sibling=Al,Ee=Al,re=ut}if(Ae.done)return n(M,re),ke&&Xn(M,pe),te;if(re===null){for(;!Ae.done;pe++,Ae=D.next())Ae=Y(M,Ae.value,$),Ae!==null&&(C=u(Ae,C,pe),Ee===null?te=Ae:Ee.sibling=Ae,Ee=Ae);return ke&&Xn(M,pe),te}for(re=a(re);!Ae.done;pe++,Ae=D.next())Ae=H(re,M,pe,Ae.value,$),Ae!==null&&(e&&(ut=Ae.alternate,ut!==null&&re.delete(ut.key===null?pe:ut.key)),C=u(Ae,C,pe),Ee===null?te=Ae:Ee.sibling=Ae,Ee=Ae);return e&&re.forEach(function(aj){return t(M,aj)}),ke&&Xn(M,pe),te}function be(M,C,D,$){if(typeof D=="object"&&D!==null&&D.type===Ke&&D.key===null&&D.props.ref===void 0&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case me:e:{for(var te=D.key;C!==null;){if(C.key===te){if(te=D.type,te===Ke){if(C.tag===7){n(M,C.sibling),$=c(C,D.props.children),dl($,D),$.return=M,M=$;break e}}else if(C.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===je&&Ql(te)===C.type){n(M,C.sibling),$=c(C,D.props),dl($,D),$.return=M,M=$;break e}n(M,C);break}else t(M,C);C=C.sibling}D.type===Ke?($=Bl(D.props.children,M.mode,$,D.key),dl($,D),$.return=M,M=$):($=Yi(D.type,D.key,D.props,null,M.mode,$),dl($,D),$.return=M,M=$)}return h(M);case Oe:e:{for(te=D.key;C!==null;){if(C.key===te)if(C.tag===4&&C.stateNode.containerInfo===D.containerInfo&&C.stateNode.implementation===D.implementation){n(M,C.sibling),$=c(C,D.children||[]),$.return=M,M=$;break e}else{n(M,C);break}else t(M,C);C=C.sibling}$=Wr(D,M.mode,$),$.return=M,M=$}return h(M);case je:return D=Ql(D),be(M,C,D,$)}if(ze(D))return W(M,C,D,$);if(P(D)){if(te=P(D),typeof te!="function")throw Error(o(150));return D=te.call(D),ae(M,C,D,$)}if(typeof D.then=="function")return be(M,C,Wi(D),$);if(D.$$typeof===Me)return be(M,C,Ki(M,D),$);Pi(M,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,C!==null&&C.tag===6?(n(M,C.sibling),$=c(C,D),$.return=M,M=$):(n(M,C),$=Fr(D,M.mode,$),$.return=M,M=$),h(M)):n(M,C)}return function(M,C,D,$){try{_s=0;var te=be(M,C,D,$);return Aa=null,te}catch(re){if(re===za||re===Ii)throw re;var Ee=Ut(29,re,null,M.mode);return Ee.lanes=$,Ee.return=M,Ee}finally{}}}var Zl=Rh(!0),Dh=Rh(!1),fl=!1;function ru(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uu(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,(De&2)!==0){var c=a.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),a.pending=t,t=$i(e),xh(e,null,n),t}return qi(e,a,t,n),$i(e)}function Ms(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,kf(e,n)}}function ou(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=h:u=u.next=h,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:u,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 du=!1;function Rs(){if(du){var e=Ca;if(e!==null)throw e}}function Ds(e,t,n,a){du=!1;var c=e.updateQueue;fl=!1;var u=c.firstBaseUpdate,h=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var T=b,R=T.next;T.next=null,h===null?u=R:h.next=R,h=T;var B=e.alternate;B!==null&&(B=B.updateQueue,b=B.lastBaseUpdate,b!==h&&(b===null?B.firstBaseUpdate=R:b.next=R,B.lastBaseUpdate=T))}if(u!==null){var Y=c.baseState;h=0,B=R=T=null,b=u;do{var _=b.lane&-536870913,H=_!==b.lane;if(H?(Te&_)===_:(a&_)===_){_!==0&&_===Gl&&(du=!0),B!==null&&(B=B.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var W=e,ae=b;_=t;var be=n;switch(ae.tag){case 1:if(W=ae.payload,typeof W=="function"){Y=W.call(be,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(be,Y,_):W,_==null)break e;Y=q({},Y,_);break e;case 2:fl=!0}}_=b.callback,_!==null&&(e.flags|=64,H&&(e.flags|=8192),H=c.callbacks,H===null?c.callbacks=[_]:H.push(_))}else H={lane:_,tag:b.tag,payload:b.payload,callback:b.callback,next:null},B===null?(R=B=H,T=Y):B=B.next=H,h|=_;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;H=b,b=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);B===null&&(T=Y),c.baseState=T,c.firstBaseUpdate=R,c.lastBaseUpdate=B,u===null&&(c.shared.lanes=0),jl|=h,e.lanes=h,e.memoizedState=Y}}function Uh(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Hh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Uh(n[e],t)}var pl=ft(null),ec=ft(0);function Bh(e,t){e=Fn,Je(ec,e),Je(pl,t),Fn=e|t.baseLanes}function fu(){Je(ec,Fn),Je(pl,pl.current)}function hu(){Fn=ec.current,et(pl),et(ec)}var yt=ft(null),Tt=null;function gl(e){var t=e.alternate;Je(jt,jt.current&1),Je(yt,e),Tt===null&&(t===null||pl.current!==null||t.memoizedState!==null)&&(Tt=e)}function mu(e){Je(jt,jt.current),Je(yt,e),Tt===null&&(Tt=e)}function Lh(e){e.tag===22?(Je(jt,jt.current),Je(yt,e),Tt===null&&(Tt=e)):vl()}function vl(){Je(jt,jt.current),Je(yt,yt.current)}function Jt(e){et(yt),Tt===e&&(Tt=null),et(jt)}var jt=ft(0);function Us(e,t){Je(yt,yt.current),Je(jt,t)}function pu(e){et(jt),et(yt),Tt===e&&(Tt=null)}function tc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bo(n)||Lo(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,xe=null,$e=null,ct=null,nc=!1,Oa=!1,Kl=!1,lc=0,Hs=0,_a=null,w0=0;function lt(){throw Error(o(321))}function gu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Kt(e[n],t[n]))return!1;return!0}function vu(e,t,n,a,c,u){return Zn=u,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?km:Nm,Kl=!1,u=n(a,c),Kl=!1,Oa&&(u=$h(t,n,a,c)),qh(e),u}function qh(e){U.H=oc;var t=$e!==null&&$e.next!==null;if(Zn=0,ct=$e=xe=null,nc=!1,Hs=0,_a=null,t)throw Error(o(300));e===null||rt||(e=e.dependencies,e!==null&&Zi(e)&&(rt=!0))}function $h(e,t,n,a){xe=e;var c=0;do{if(Oa&&(_a=null),Hs=0,Oa=!1,25<=c)throw Error(o(301));if(c+=1,ct=$e=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}U.H=M0,u=t(n,a)}while(Oa);return u}function T0(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Bs(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(xe.flags|=1024),t}function xu(){var e=lc!==0;return lc=0,e}function bu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function yu(e){if(nc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nc=!1}Zn=0,ct=$e=xe=null,Oa=!1,Hs=lc=0,_a=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?xe.memoizedState=ct=e:ct=ct.next=e,ct}function st(){if($e===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=ct===null?xe.memoizedState:ct.next;if(t!==null)ct=t,$e=e;else{if(e===null)throw xe.alternate===null?Error(o(467)):Error(o(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},ct===null?xe.memoizedState=ct=e:ct=ct.next=e}return ct}function ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bs(e){var t=Hs;return Hs+=1,_a===null&&(_a=[]),e=Oh(_a,e,t),t=xe,(ct===null?t.memoizedState:ct.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?km:Nm),e}function sc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bs(e);if(e.$$typeof===X)return;if(e.$$typeof===Me)return bt(e)}throw Error(o(438,String(e)))}function ju(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ac(),xe.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]=Gt;return t.index++,n}function Kn(e,t){return typeof t=="function"?t(e):t}function ic(e){var t=st();return ku(t,$e,e)}function ku(e,t,n){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=n;var c=e.baseQueue,u=a.pending;if(u!==null){if(c!==null){var h=c.next;c.next=u.next,u.next=h}t.baseQueue=c=u,a.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var b=h=null,T=null,R=t,B=!1;do{var Y=R.lane&-536870913;if(Y!==R.lane?(Te&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===Gl&&(B=!0);else if((Zn&_)===_){R=R.next,_===Gl&&(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?(b=T=Y,h=u):T=T.next=Y,xe.lanes|=_,jl|=_;Y=R.action,Kl&&n(u,Y),u=R.hasEagerState?R.eagerState:n(u,Y)}else _={lane:Y,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(b=T=_,h=u):T=T.next=_,xe.lanes|=Y,jl|=Y;R=R.next}while(R!==null&&R!==t);if(T===null?h=u:T.next=b,!Kt(u,e.memoizedState)&&(rt=!0,B&&(n=Ca,n!==null)))throw n;e.memoizedState=u,e.baseState=h,e.baseQueue=T,a.lastRenderedState=u}return c===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Nu(e){var t=st(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var h=c=c.next;do u=e(u,h.action),h=h.next;while(h!==c);Kt(u,t.memoizedState)||(rt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function Yh(e,t,n){var a=xe,c=st(),u=ke;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var h=!Kt(($e||c).memoizedState,n);if(h&&(c.memoizedState=n,rt=!0),c=c.queue,Tu(Qh.bind(null,a,c,e),[e]),e=c.getSnapshot!==t||h||ct!==null&&(ct.memoizedState.tag&1)!==0,Ma(e?9:8,{destroy:void 0},Xh.bind(null,a,c,n,t),null),e){if(a.flags|=2048,Ve===null)throw Error(o(349));u||(Zn&127)!==0||Gh(a,t,n)}return n}function Gh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=ac(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xh(e,t,n,a){t.value=n,t.getSnapshot=a,Vh(t)&&Zh(e)}function Qh(e,t,n){return n(function(){Vh(t)&&Zh(e)})}function Vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kt(e,n)}catch{return!0}}function Zh(e){var t=Hl(e,2);t!==null&&qt(t,e,2)}function Su(e){var t=Ot();if(typeof e=="function"){var n=e;if(e=n(),Kl){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 Kh(e,t,n,a){return e.baseState=n,ku(e,$e,typeof a=="function"?a:Kn)}function E0(e,t,n,a,c){if(uc(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){u.listeners.push(h)}};U.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,Jh(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Jh(e,t){var n=t.action,a=t.payload,c=e.state;if(t.isTransition){var u=U.T,h={};h.types=u!==null?u.types:null,U.T=h;try{var b=n(c,a),T=U.S;T!==null&&T(h,b),Ih(e,t,b)}catch(R){wu(e,t,R)}finally{u!==null&&h.types!==null&&(u.types=h.types),U.T=u}}else try{u=n(c,a),Ih(e,t,u)}catch(R){wu(e,t,R)}}function Ih(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Fh(e,t,a)},function(a){return wu(e,t,a)}):Fh(e,t,n)}function Fh(e,t,n){t.status="fulfilled",t.value=n,Wh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jh(e,n)))}function wu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Wh(t),t=t.next;while(t!==a)}e.action=null}function Wh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ph(e,t){return t}function em(e,t){if(ke){var n=Ve.formState;if(n!==null){e:{var a=xe;if(ke){if(Ie){t:{for(var c=Ie,u=rn;c.nodeType!==8;){if(!u){c=null;break t}if(c=on(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ie=on(c.nextSibling),a=c.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:Ph,lastRenderedState:t},n.queue=a,n=bm.bind(null,xe,a),a.dispatch=n,a=Su(!1),u=Ou.bind(null,xe,!1,a.queue),a=Ot(),c={state:t,dispatch:null,action:e,pending:null},a.queue=c,n=E0.bind(null,xe,c,u,n),c.dispatch=n,a.memoizedState=e,[t,n,!1]}function tm(e){var t=st();return nm(t,$e,e)}function nm(e,t,n){if(t=ku(e,t,Ph)[0],e=ic(Kn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Bs(t)}catch(h){throw h===za?Ii:h}else a=t;t=st();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Ma(9,{destroy:void 0},C0.bind(null,c,n),null)),[a,u,e]}function C0(e,t){e.action=t}function lm(e){var t=st(),n=$e;if(n!==null)return nm(t,n,e);st(),t=t.memoizedState,n=st();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ma(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=ac(),xe.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 am(){return st().memoizedState}function cc(e,t,n,a){var c=Ot();xe.flags|=e,c.memoizedState=Ma(1|t,{destroy:void 0},n,a===void 0?null:a)}function rc(e,t,n,a){var c=st();a=a===void 0?null:a;var u=c.memoizedState.inst;$e!==null&&a!==null&&gu(a,$e.memoizedState.deps)?c.memoizedState=Ma(t,u,n,a):(xe.flags|=e,c.memoizedState=Ma(1|t,u,n,a))}function sm(e,t){cc(8390656,8,e,t)}function Tu(e,t){rc(2048,8,e,t)}function z0(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=ac(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function im(e){var t=st().memoizedState;return z0({ref:t,nextImpl:e}),function(){if((De&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function cm(e,t){return rc(4,2,e,t)}function rm(e,t){return rc(4,4,e,t)}function um(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 om(e,t,n){n=n!=null?n.concat([e]):null,rc(4,4,um.bind(null,t,e),n)}function Eu(){}function dm(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&gu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function fm(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&gu(t,a[1]))return a[0];if(a=e(),Kl){al(!0);try{e()}finally{al(!1)}}return n.memoizedState=[a,t],a}function Cu(e,t,n){return n===void 0||(Zn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=kp(),xe.lanes|=e,jl|=e,n)}function hm(e,t,n,a){return Kt(n,t)?n:pl.current!==null?(e=Cu(e,n,a),Kt(e,t)||(rt=!0),e):(Zn&106)===0||(Zn&1073741824)!==0&&(Te&261930)===0?(rt=!0,e.memoizedState=n):(e=kp(),xe.lanes|=e,jl|=e,t)}function mm(e,t,n,a,c){var u=I.p;I.p=u!==0&&8>u?u:8;var h=U.T,b={};b.types=h!==null?h.types:null,U.T=b,Ou(e,!1,t,n);try{var T=c(),R=U.S;if(R!==null&&R(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=S0(T,a);Ls(e,t,B,Pt(e))}else Ls(e,t,a,Pt(e))}catch(Y){Ls(e,t,{then:function(){},status:"rejected",reason:Y},Pt())}finally{I.p=u,h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}function A0(){}function zu(e,t,n,a){if(e.tag!==5)throw Error(o(476));var c=pm(e).queue;mm(e,c,t,ie,n===null?A0:function(){return gm(e),n(a)})}function pm(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 gm(e){var t=pm(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},Pt())}function Au(){return bt(Wa)}function vm(){return st().memoizedState}function xm(){return st().memoizedState}function O0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pt();e=hl(n);var a=ml(t,e,n);a!==null&&(qt(a,t,n),Ms(a,t,n)),t={cache:au()},e.payload=t;return}t=t.return}}function _0(e,t,n){var a=Pt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?ym(t,n):(n=Jr(e,t,n,a),n!==null&&(qt(n,e,a),jm(n,t,a)))}function bm(e,t,n){var a=Pt();Ls(e,t,n,a)}function Ls(e,t,n,a){var c={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))ym(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var h=t.lastRenderedState,b=u(h,n);if(c.hasEagerState=!0,c.eagerState=b,Kt(b,h))return qi(e,t,c,0),Ve===null&&Li(),!1}catch{}finally{}if(n=Jr(e,t,c,a),n!==null)return qt(n,e,a),jm(n,t,a),!0}return!1}function Ou(e,t,n,a){if(a={lane:2,revertLane:ko(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(o(479))}else t=Jr(e,n,a,2),t!==null&&qt(t,e,2)}function uc(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function ym(e,t){Oa=nc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,kf(e,n)}}var oc={readContext:bt,use:sc,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},km={readContext:bt,use:sc,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:sm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,cc(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cc(4194308,4,e,t)},useInsertionEffect:function(e,t){cc(4,2,e,t)},useMemo:function(e,t){var n=Ot();t=t===void 0?null:t;var a=e();if(Kl){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 c=n(t);if(Kl){al(!0);try{n(t)}finally{al(!1)}}}else c=t;return a.memoizedState=a.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},a.queue=e,e=e.dispatch=_0.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Su(e);var t=e.queue,n=bm.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Eu,useDeferredValue:function(e,t){var n=Ot();return Cu(n,e,t)},useTransition:function(){var e=Su(!1);return e=mm.bind(null,xe,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=xe,c=Ot();if(ke){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ve===null)throw Error(o(349));(Te&127)!==0||Gh(a,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,sm(Qh.bind(null,a,u,e),[e]),a.flags|=2048,Ma(9,{destroy:void 0},Xh.bind(null,a,u,n,t),null),n},useId:function(){var e=Ot(),t=Ve.identifierPrefix;if(ke){var n=Tn,a=wn;n=(a&~(1<<32-Vt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=lc++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=w0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Au,useFormState:em,useActionState:em,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=Ou.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:ju,useCacheRefresh:function(){return Ot().memoizedState=O0.bind(null,xe)},useEffectEvent:function(e){var t=Ot(),n={impl:e};return t.memoizedState=n,function(){if((De&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Nm={readContext:bt,use:sc,useCallback:dm,useContext:bt,useEffect:Tu,useImperativeHandle:om,useInsertionEffect:cm,useLayoutEffect:rm,useMemo:fm,useReducer:ic,useRef:am,useState:function(){return ic(Kn)},useDebugValue:Eu,useDeferredValue:function(e,t){var n=st();return hm(n,$e.memoizedState,e,t)},useTransition:function(){var e=ic(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Bs(e),t]},useSyncExternalStore:Yh,useId:vm,useHostTransitionStatus:Au,useFormState:tm,useActionState:tm,useOptimistic:function(e,t){var n=st();return Kh(n,$e,e,t)},useMemoCache:ju,useCacheRefresh:xm,useEffectEvent:im},M0={readContext:bt,use:sc,useCallback:dm,useContext:bt,useEffect:Tu,useImperativeHandle:om,useInsertionEffect:cm,useLayoutEffect:rm,useMemo:fm,useReducer:Nu,useRef:am,useState:function(){return Nu(Kn)},useDebugValue:Eu,useDeferredValue:function(e,t){var n=st();return $e===null?Cu(n,e,t):hm(n,$e.memoizedState,e,t)},useTransition:function(){var e=Nu(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Bs(e),t]},useSyncExternalStore:Yh,useId:vm,useHostTransitionStatus:Au,useFormState:lm,useActionState:lm,useOptimistic:function(e,t){var n=st();return $e!==null?Kh(n,$e,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ju,useCacheRefresh:xm,useEffectEvent:im};function _u(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:q({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Mu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Pt(),c=hl(a);c.payload=t,n!=null&&(c.callback=n),t=ml(e,c,a),t!==null&&(qt(t,e,a),Ms(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Pt(),c=hl(a);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=ml(e,c,a),t!==null&&(qt(t,e,a),Ms(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pt(),a=hl(n);a.tag=2,t!=null&&(a.callback=t),t=ml(e,a,n),t!==null&&(qt(t,e,n),Ms(t,e,n))}};function Sm(e,t,n,a,c,u,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,h):t.prototype&&t.prototype.isPureReactComponent?!ws(n,a)||!ws(c,u):!0}function wm(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&&Mu.enqueueReplaceState(t,t.state,null)}function Jl(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=q({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Tm(e){Bi(e)}function Em(e){console.error(e)}function Cm(e){Bi(e)}function dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function zm(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ru(e,t,n){return n=hl(n),n.tag=3,n.payload={element:null},n.callback=function(){dc(e,t)},n}function Am(e){return e=hl(e),e.tag=3,e}function Om(e,t,n,a){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=a.value;e.payload=function(){return c(u)},e.callback=function(){zm(t,n,a)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){zm(t,n,a),typeof c!="function"&&(kl===null?kl=new Set([this]):kl.add(this));var b=a.stack;this.componentDidCatch(a.value,{componentStack:b!==null?b:""})})}function R0(e,t,n,a,c){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&$l(t,n,c,!0),n=yt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Tt===null?_c():n.alternate===null&&at===0&&(at=3),n.flags&=-257,n.flags|=65536,n.lanes=c,a===Fi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),bo(e,a,c)),!1;case 22:return n.flags|=65536,a===Fi?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)),bo(e,a,c)),!1}throw Error(o(435,n.tag))}return bo(e,a,c),_c(),!1}if(ke)return t=yt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,a!==eu&&(e=Error(o(422),{cause:a}),Cs(an(e,n)))):(a!==eu&&(t=Error(o(423),{cause:a}),Cs(an(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,a=an(a,n),c=Ru(e.stateNode,a,c),ou(e,c),at!==4&&(at=2)),!1;var u=Error(o(520),{cause:a});if(u=an(u,n),Zs===null?Zs=[u]:Zs.push(u),at!==4&&(at=2),t===null)return!0;a=an(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Ru(n.stateNode,a,e),ou(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(kl===null||!kl.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Am(c),Om(c,e,n,a),ou(n,c),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Du=Error(o(461)),rt=!1;function ot(e,t,n,a){t.child=e===null?Dh(t,null,n,a):Zl(t,e.child,n,a)}function _m(e,t,n,a,c){n=n.render;var u=t.ref;if("ref"in a){var h={};for(var b in a)b!=="ref"&&(h[b]=a[b])}else h=a;return Yl(t),a=vu(e,t,n,h,u,c),b=xu(),e!==null&&!rt?(bu(e,t,c),Jn(e,t,c)):(ke&&b&&Xi(t),t.flags|=1,ot(e,t,a,c),t.child)}function Mm(e,t,n,a,c){if(e===null){var u=n.type;return typeof u=="function"&&!Ir(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Rm(e,t,u,a,c)):(e=Yi(n.type,null,a,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Gu(e,c)){var h=u.memoizedProps;if(n=n.compare,n=n!==null?n:ws,n(h,a)&&e.ref===t.ref)return Jn(e,t,c)}return t.flags|=1,e=Gn(u,a),e.ref=t.ref,e.return=t,t.child=e}function Rm(e,t,n,a,c){if(e!==null){var u=e.memoizedProps;if(ws(u,a)&&e.ref===t.ref)if(rt=!1,t.pendingProps=a=u,Gu(e,c))(e.flags&131072)!==0&&(rt=!0);else return t.lanes=e.lanes,Jn(e,t,c)}return Uu(e,t,n,a,c)}function Dm(e,t,n,a){var c=a.children,u=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(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,c=0;a!==null;)c=c|a.lanes|a.childLanes,a=a.sibling;a=c&~u}else a=0,t.child=null;return Um(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ji(t,u!==null?u.cachePool:null),u!==null?Bh(t,u):fu(),Lh(t);else return a=t.lanes=536870912,Um(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(Ji(t,u.cachePool),Bh(t,u),vl(),t.memoizedState=null):(e!==null&&Ji(t,null),fu(),vl());return ot(e,t,c,n),t.child}function qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Um(e,t,n,a,c){var u=iu();return u=u===null?null:{parent:it._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Ji(t,null),fu(),Lh(t),e!==null&&$l(e,t,a,!0),t.childLanes=c,null}function fc(e,t){return t=hc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return Zl(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function D0(e,t,n){var a=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=fc(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},qs(null,e);if(mu(t),(e=Ie)?(e=ug(e,rn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,mt=t,Ie=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return fc(t,a)}var u=e.memoizedState;if(u!==null){var h=u.dehydrated;if(mu(t),c)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(rt||$l(e,t,n,!1),c=(n&e.childLanes)!==0,rt||c){if(pl.current===null){if(a=Ve,a!==null&&(h=Nf(a,n),h!==0&&h!==u.retryLane))throw u.retryLane=h,Hl(e,h),qt(a,e,h),Du;_c()}t=Hm(e,t,n)}else e=u.treeContext,Ie=on(h.nextSibling),mt=t,ke=!0,rl=null,rn=!1,e!==null&&Nh(t,e),t=fc(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 Ra(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(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uu(e,t,n,a,c){return Yl(t),n=vu(e,t,n,a,void 0,c),a=xu(),e!==null&&!rt?(bu(e,t,c),Jn(e,t,c)):(ke&&a&&Xi(t),t.flags|=1,ot(e,t,n,c),t.child)}function Bm(e,t,n,a,c,u){return Yl(t),t.updateQueue=null,n=$h(t,a,n,c),qh(e),a=xu(),e!==null&&!rt?(bu(e,t,u),Jn(e,t,u)):(ke&&a&&Xi(t),t.flags|=1,ot(e,t,n,u),t.child)}function Lm(e,t,n,a,c){if(Yl(t),t.stateNode===null){var u=Sa,h=n.contextType;typeof h=="object"&&h!==null&&(u=bt(h)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Mu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},ru(t),h=n.contextType,u.context=typeof h=="object"&&h!==null?bt(h):Sa,u.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(_u(t,n,h,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(h=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&Mu.enqueueReplaceState(u,u.state,null),Ds(t,a,u,c),Rs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=Jl(n,b);u.props=T;var R=u.context,B=n.contextType;h=Sa,typeof B=="object"&&B!==null&&(h=bt(B));var Y=n.getDerivedStateFromProps;B=typeof Y=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,B||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||R!==h)&&wm(t,u,a,h),fl=!1;var _=t.memoizedState;u.state=_,Ds(t,a,u,c),Rs(),R=t.memoizedState,b||_!==R||fl?(typeof Y=="function"&&(_u(t,n,Y,a),R=t.memoizedState),(T=fl||Sm(t,n,T,a,_,R,h))?(B||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),u.props=a,u.state=R,u.context=h,a=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,uu(e,t),h=t.memoizedProps,B=Jl(n,h),u.props=B,Y=t.pendingProps,_=u.context,R=n.contextType,T=Sa,typeof R=="object"&&R!==null&&(T=bt(R)),b=n.getDerivedStateFromProps,(R=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(h!==Y||_!==T)&&wm(t,u,a,T),fl=!1,_=t.memoizedState,u.state=_,Ds(t,a,u,c),Rs();var H=t.memoizedState;h!==Y||_!==H||fl||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof b=="function"&&(_u(t,n,b,a),H=t.memoizedState),(B=fl||Sm(t,n,B,a,_,H,T)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(R||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,H,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,H,T)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=H),u.props=a,u.state=H,u.context=T,a=B):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Ra(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Zl(t,e.child,null,c),t.child=Zl(t,null,n,c)):ot(e,t,n,c),t.memoizedState=u.state,e=t.child):e=Jn(e,t,c),e}function qm(e,t,n,a){return Ll(),t.flags|=256,ot(e,t,n,a),t.child}var Hu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bu(e){return{baseLanes:e,cachePool:zh()}}function Lu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Wt),e}function $m(e,t,n){var a=t.pendingProps,c=!1,u=(t.flags&128)!==0,h;if((h=u)||(h=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(c?gl(t):vl(),(e=Ie)?(e=ug(e,rn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,mt=t,Ie=null)):e=null,e===null)throw ul(t);return Lo(e)?t.lanes=32:t.lanes=536870912,null}return u=a.children,a=a.fallback,c?(vl(),c=t.mode,u=hc({mode:"hidden",children:u},c),a=Bl(a,c,n,null),u.return=t,a.return=t,u.sibling=a,t.child=u,a=t.child,a.memoizedState=Bu(n),a.childLanes=Lu(e,h,n),t.memoizedState=Hu,qs(null,a)):(gl(t),qu(t,u))}var b=e.memoizedState;if(b!==null){var T=b.dehydrated;if(T!==null)return U0(e,t,u,h,a,T,b,n)}return c?(vl(),c=a.fallback,u=t.mode,b=e.child,T=b.sibling,a=Gn(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&1206910976,T!==null?c=Gn(T,c):(c=Bl(c,u,n,null),c.flags|=2),c.return=t,a.return=t,a.sibling=c,t.child=a,qs(null,a),a=t.child,c=e.child.memoizedState,c===null?c=Bu(n):(u=c.cachePool,u!==null?(b=it._currentValue,u=u.parent!==b?{parent:b,pool:b}:u):u=zh(),c={baseLanes:c.baseLanes|n,cachePool:u}),a.memoizedState=c,a.childLanes=Lu(e,h,n),t.memoizedState=Hu,qs(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&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function qu(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=Ut(22,e,null,t),e.lanes=0,e}function mc(e,t,n){return Zl(t,e.child,null,n),e=qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function U0(e,t,n,a,c,u,h,b){if(n)return t.flags&256?(gl(t),t.flags&=-257,mc(e,t,b)):t.memoizedState!==null?(vl(),t.child=e.child,t.flags|=128,null):(vl(),u=c.fallback,h=t.mode,c=hc({mode:"visible",children:c.children},h),u=Bl(u,h,b,null),u.flags|=2,c.return=t,u.return=t,c.sibling=u,t.child=c,Zl(t,e.child,null,b),c=t.child,c.memoizedState=Bu(b),c.childLanes=Lu(e,a,b),t.memoizedState=Hu,qs(null,c));if(gl(t),Lo(u)){if(a=u.nextSibling&&u.nextSibling.dataset,a)var T=a.dgst;return a=T,a!==""&&(c=Error(o(419)),c.stack="",c.digest=a,Cs({value:c,source:null,stack:null})),mc(e,t,b)}if(rt||$l(e,t,b,!1),a=(b&e.childLanes)!==0,rt||a){if(pl.current!==null)return mc(e,t,b);if(a=Ve,a!==null&&(c=Nf(a,b),c!==0&&c!==h.retryLane))throw h.retryLane=c,Hl(e,c),qt(a,e,c),Du;return Bo(u)||_c(),mc(e,t,b)}return Bo(u)?(t.flags|=192,t.child=e.child,null):(e=h.treeContext,Ie=on(u.nextSibling),mt=t,ke=!0,rl=null,rn=!1,e!==null&&Nh(t,e),t=qu(t,c.children),t.flags|=134221824,t)}function Ym(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Vi(e.return,t,n)}function Gm(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&tc(n)===null&&(t=e),e=e.sibling}return t}function pc(e,t,n,a,c,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:c,treeForkCount:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=a,h.tail=n,h.tailMode=c,h.treeForkCount=u)}function $u(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 Yu(e,t,n){var a=t.pendingProps,c=a.revealOrder,u=a.tail;a=a.children;var h=jt.current;if(t.flags&128)return Us(t,h),null;var b=(h&2)!==0;if(b?(h=h&1|2,t.flags|=128):h&=1,Us(t,h),c==="backwards"&&e!==null?($u(e),ot(e,t,a,n),$u(e)):ot(e,t,a,n),a=ke?Es:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ym(e,n,t);else if(e.tag===19)Ym(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(c){case"backwards":n=Gm(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null,$u(t)),pc(t,!0,c,null,u,a);break;case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&tc(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}pc(t,!0,n,null,u,a);break;case"together":pc(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=Gm(t.child),n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),pc(t,!1,c,n,u,a)}return t.child}function Xm(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($l(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(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 Gu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zi(e)))}function H0(e,t,n){switch(t.tag){case 3:yi(t,t.stateNode.containerInfo),ol(t,it,e.memoizedState.cache),Ll();break;case 27:case 5:gr(t);break;case 4:yi(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,mu(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return gl(t),t.flags|=128,null;a=$l(e,t,n,!1);var c=t.child.childLanes;return a||(n&c)!==0?$m(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 Yu(e,t,n);if(c=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||($l(e,t,n,!1),a=(n&t.childLanes)!==0),c){if(a)return Yu(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Us(t,jt.current),a)break;return null;case 22:return t.lanes=0,Dm(e,t,n,t.pendingProps);case 24:ol(t,it,e.memoizedState.cache)}return Jn(e,t,n)}function Qm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rt=!0;else{if(!Gu(e,n)&&(t.flags&128)===0)return rt=!1,H0(e,t,n);rt=(e.flags&131072)!==0}else rt=!1,ke&&(t.flags&1048576)!==0&&kh(t,Es,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Ql(t.elementType),t.type=e,typeof e=="function")Ir(e)?(a=Jl(e,a),t.tag=1,t=Lm(null,t,e,a,n)):(t.tag=0,t=Uu(null,t,e,a,n));else{if(e!=null){var c=e.$$typeof;if(c===F){t.tag=11,t=_m(null,t,e,a,n);break e}else if(c===Re){t.tag=14,t=Mm(null,t,e,a,n);break e}else if(c===Me){t.tag=10,t.type=e,t=Xm(null,t,n);break e}}throw t=Ce(e)||e,Error(o(306,t,""))}}return t;case 0:return Uu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,c=Jl(a,t.pendingProps),Lm(e,t,a,c,n);case 3:e:{if(yi(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;c=u.element,uu(e,t),Ds(t,a,null,n);var h=t.memoizedState;if(a=h.cache,ol(t,it,a),a!==u.cache&&lu(t,[it],n,!0),Rs(),a=h.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==c){c=an(Error(o(424)),t),Cs(c),t=qm(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=on(e.firstChild),mt=t,ke=!0,rl=null,rn=!0,n=Dh(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Ll(),a===c){t=Jn(e,t,n);break e}ot(e,t,a,n)}t=t.child}return t;case 26:return Ra(e,t),e===null?(n=gg(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(t.stateNode=Jp(t.type,t.pendingProps,nl.current,t)):t.memoizedState=gg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return gr(t),e===null&&ke&&(a=t.stateNode=fg(t.type,t.pendingProps,nl.current),mt=t,rn=!0,c=Ie,wl(t.type)?(qo=c,Ie=on(a.firstChild)):Ie=c),ot(e,t,t.pendingProps.children,n),Ra(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((c=a=Ie)&&(a=Oy(a,t.type,t.pendingProps,rn),a!==null?(t.stateNode=a,mt=t,Ie=on(a.firstChild),rn=!1,c=!0):c=!1),c||ul(t)),gr(t),c=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,a=u.children,Oo(c,u)?a=null:h!==null&&Oo(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=vu(e,t,T0,null,null,n),Wa._currentValue=c),Ra(e,t),ot(e,t,a,n),t.child;case 6:return e===null&&ke&&((e=n=Ie)&&(n=_y(n,t.pendingProps,rn),n!==null?(t.stateNode=n,mt=t,Ie=null,e=!0):e=!1),e||ul(t)),null;case 13:return $m(e,t,n);case 4:return yi(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Zl(t,null,a,n):ot(e,t,a,n),t.child;case 11:return _m(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Ra(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 Xm(e,t,n);case 9:return c=t.type._context,a=t.pendingProps.children,Yl(t),c=bt(c),a=a(c),t.flags|=1,ot(e,t,a,n),t.child;case 14:return Mm(e,t,t.type,t.pendingProps,n);case 15:return Rm(e,t,t.type,t.pendingProps,n);case 19:return Yu(e,t,n);case 31:return D0(e,t,n);case 22:return Dm(e,t,n,t.pendingProps);case 24:return Yl(t),a=bt(it),e===null?(c=iu(),c===null&&(c=Ve,u=au(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:a,cache:c},ru(t),ol(t,it,c)):((e.lanes&n)!==0&&(uu(e,t),Ds(t,null,null,n),Rs()),c=e.memoizedState,u=t.memoizedState,c.parent!==a?(c={parent:a,cache:a},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ol(t,it,a)):(a=u.cache,ol(t,it,a),a!==c.cache&&lu(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&&Xi(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Ra(e,t),ot(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function In(e){e.flags|=4}function Xu(e,t,n,a,c){var u;if((u=(e.mode&32)!==0)&&(u=n===null?yg(t,a):yg(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),u){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Tp())e.flags|=8192;else throw Vl=Fi,cu}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jg(t))if(Tp())e.flags|=8192;else throw Vl=Fi,cu}function gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yf():536870912,e.lanes|=t,La|=t)}function $s(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 c=e.child;c!==null;)n|=c.lanes|c.childLanes,a|=c.subtreeFlags&1206910976,a|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function B0(e,t,n){var a=t.pendingProps;switch(Pr(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),da(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ea(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tu())),Fe(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(In(t),u!==null?(Fe(t),Vm(t,u)):(Fe(t),Xu(t,c,null,a,n))):u?u!==e.memoizedState?(In(t),Fe(t),Vm(t,u)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&In(t),Fe(t),Xu(t,c,e,a,n)),null;case 27:if(ji(t),n=nl.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Fe(t),t.subtreeFlags&=-33554433,null}e=Nn.current,Ea(t)?Sh(t):(e=fg(c,a,n),t.stateNode=e,In(t))}return Fe(t),t.subtreeFlags&=-33554433,null;case 5:if(ji(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Fe(t),t.subtreeFlags&=-33554433,null}if(u=Nn.current,Ea(t))Sh(t);else{var h=Ws(nl.current);switch(u){case 1:u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=h.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?h.createElement("select",{is:a.is}):h.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?h.createElement(c,{is:a.is}):h.createElement(c)}}u[xt]=t,u[Dt]=a;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)u.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=u;e:switch(Nt(u,c,a),c){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,Xu(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(o(166));if(e=nl.current,Ea(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,c=mt,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Qp(e.nodeValue,n)),e||ul(t,!0)}else e=Ws(e).createTextNode(a),e[xt]=t,t.stateNode=e}return Fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ea(t),n!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[xt]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else n=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Fe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ea(t),a!==null&&a.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[xt]=t}else Ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),c=!1}else c=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,c=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(c=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==c&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gc(t,t.updateQueue),Fe(t),null);case 4:return da(),e===null&&To(t.stateNode.containerInfo),t.flags|=67108864,Fe(t),null;case 10:return Vn(t.type),Fe(t),null;case 19:if(pu(t),a=t.memoizedState,a===null)return Fe(t),null;if(c=(t.flags&128)!==0,u=a.rendering,u===null)if(c)$s(a,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=tc(e),u!==null){for(t.flags|=128,$s(a,!1),e=u.updateQueue,t.updateQueue=e,gc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bh(n,e),n=n.sibling;return Us(t,jt.current&1|2),ke&&Xn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Xt()>Cc&&(t.flags|=128,c=!0,$s(a,!1),t.lanes=4194304)}else{if(!c)if(e=tc(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,gc(t,e),$s(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!u.alternate&&!ke)return Fe(t),null}else 2*Xt()-a.renderingStartTime>Cc&&n!==536870912&&(t.flags|=128,c=!0,$s(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}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=Xt(),e.sibling=null,u=jt.current,u=c?u&1|2:u&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||ke?Us(t,u):(n=u,Je(yt,t),Je(jt,n),Tt===null&&(Tt=t)),ke&&Xn(t,a.treeForkCount),e}return Fe(t),null;case 22:case 23:return Jt(t),hu(),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&&gc(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(Xl),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(o(156,t.tag))}function L0(e,t){switch(Pr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(it),da(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ji(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(o(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pu(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 da(),null;case 10:return Vn(t.type),null;case 22:case 23:return Jt(t),hu(),e!==null&&et(Xl),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 Zm(e,t){switch(Pr(t),t.tag){case 3:Vn(it),da();break;case 26:case 27:case 5:ji(t);break;case 4:da();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:pu(t);break;case 10:Vn(t.type);break;case 22:case 23:Jt(t),hu(),e!==null&&et(Xl);break;case 24:Vn(it)}}function Ys(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var c=a.next;n=c;do{if((n.tag&e)===e){a=void 0;var u=n.create,h=n.inst;a=u(),h.destroy=a}n=n.next}while(n!==c)}}catch(b){Le(t,t.return,b)}}function xl(e,t,n){try{var a=t.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var u=c.next;a=u;do{if((a.tag&e)===e){var h=a.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,c=t;var T=n,R=b;try{R()}catch(B){Le(c,T,B)}}}a=a.next}while(a!==u)}}catch(B){Le(t,t.return,B)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hh(t,n)}catch(a){Le(e,e.return,a)}}}function Jm(e,t,n){n.props=Jl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Le(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 c=e.stateNode,u=$n(e.memoizedProps,c);(c.ref===null||c.ref.name!==u)&&(c.ref=ng(u)),a=c.ref;break;case 7:if(e.stateNode===null){var h=new en(e);k(e.child,!1,zy,h,void 0,void 0),e.stateNode=h}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(b){Le(e,t,b)}}function kt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(c){Le(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Le(e,t,c)}else n.current=null}function vc(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++)rg(e.stateNode,t[n])}function Im(e){for(var t=e.return;t!==null&&(Vu(t)&&rg(e.stateNode,t.stateNode),!Qu(t));)t=t.return}function Gs(e){for(var t=e.return;t!==null&&(Vu(t)&&Ay(e.stateNode,t.stateNode),!Qu(t));)t=t.return}function Qu(e){return e.tag===5||e.tag===3||e.tag===27}function Vu(e){return e&&e.tag===7&&e.stateNode!==null}function Zu(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(c){Le(e,e.return,c)}}function Ku(e,t,n){try{var a=e.stateNode;dy(a,e.type,n,t),a[Dt]=t}catch(c){Le(e,e.return,c)}}function Fm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wl(e.type)||e.tag===4}function Ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fm(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 Iu(e,t,n,a){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(c,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(c),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sn)),vc(e,a),_e=!0;else if(c!==4&&(c===27&&(vc(e,a),a=null,wl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Iu(e,t,n,a),e=e.sibling;e!==null;)Iu(e,t,n,a),e=e.sibling}function xc(e,t,n,a){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?n.insertBefore(c,t):n.appendChild(c),vc(e,a),_e=!0;else if(c!==4&&(c===27&&(vc(e,a),a=null,wl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(xc(e,t,n,a),e=e.sibling;e!==null;)xc(e,t,n,a),e=e.sibling}function Wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Nt(t,a,n),t[xt]=e,t[Dt]=n}catch(u){Le(e,e.return,u)}}var bc=!1,It=null;function Pm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(bc=!0)}var Cn=null;function ep(){var e=Cn;return Cn=null,e}var Ht=0;function Da(e,t,n,a,c){return Ht=0,tp(e.child,t,n,a,c)}function tp(e,t,n,a,c){for(var u=!1;e!==null;){if(e.tag===5){var h=e.stateNode;if(a!==null){var b=Ro(h);a.push(b),b.view&&(u=!0)}else u||Ro(h).view&&(u=!0);bc=!0,eg(h,Ht===0?t:t+"_"+Ht,n),Ht++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||tp(e.child,t,n,a,c)&&(u=!0));e=e.sibling}return u}function zn(e,t){for(;e!==null;)e.tag===5?tg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||zn(e.child,t)),e=e.sibling}function yc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(yc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var n=t.name;t=Yn(t.default,t.share),t!=="none"&&(Da(e,n,t,null,!1)||zn(e.child,!1))}e=e.sibling}}function Fu(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,c=$n(a,n),u=Yn(a.default,n.paired?a.share:a.enter);u!=="none"?Da(e,c,u,null,!1)?(yc(e),n.paired||t||Ga(e,a.onEnter)):zn(e.child,!1):yc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fu(e,t),e=e.sibling;else yc(e)}function Wu(e){if(It!==null&&It.size!==0){var t=It;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 c=t.get(a);if(c!==void 0){var u=Yn(n.default,n.share);if(u!=="none"&&(Da(e,a,u,null,!1)?(u=e.stateNode,c.paired=u,u.paired=c,Ga(e,n.onShare)):zn(e.child,!1)),t.delete(a),t.size===0)break}}}Wu(e)}e=e.sibling}}}function Pu(e){if(e.tag===30){var t=e.memoizedProps,n=$n(t,e.stateNode),a=It!==null?It.get(n):void 0,c=Yn(t.default,a!==void 0?t.share:t.exit);c!=="none"&&(Da(e,n,c,null,!1)?a!==void 0?(c=e.stateNode,a.paired=c,c.paired=a,It.delete(n),Ga(e,t.onShare)):Ga(e,t.onExit):zn(e.child,!1)),It!==null&&Wu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Pu(e),e=e.sibling;else It!==null&&Wu(e)}function np(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=$n(t,e.stateNode);t=Yn(t.default,t.update),e.flags&=-5,t!=="none"&&Da(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&np(e);e=e.sibling}}function eo(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))}eo(e)}e=e.sibling}}function jc(e){if(e.tag===30)e.stateNode.paired=null,zn(e.child,!1),eo(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jc(e),e=e.sibling;else eo(e)}function lp(e){for(e=e.child;e!==null;)e.tag===30?zn(e.child,!1):(e.subtreeFlags&33554432)!==0&&lp(e),e=e.sibling}function to(e,t,n,a,c,u,h){for(var b=!1;t!==null;){if(t.tag===5){var T=t.stateNode;if(u!==null&&Ht<u.length){var R=u[Ht],B=Ro(T);(R.view||B.view)&&(b=!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&&eg(T,Ht===0?n:n+"_"+Ht,c),b&&(e.flags&4)!==0||(Cn===null&&(Cn=[]),Cn.push(T,Ht===0?a:a+"_"+Ht,t.memoizedProps)),Ht++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&h?e.flags|=t.flags&32:to(e,t.child,n,a,c,u,h)&&(b=!0));t=t.sibling}return b}function ap(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,c=$n(n,a),u=Yn(n.default,n.update),h;h=e.memoizedState,e.memoizedState=null,a=e;var b=e.child;Ht=0,c=to(a,b,c,c,u,h,!1),(e.flags&4)!==0&&c&&Ga(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&ap(e);e=e.sibling}}var pt=!1,Ue=!1,An=!1,no=!1,sp=typeof WeakSet=="function"?WeakSet:Set,gt=null,On=!1,Xs=!1,kc=!1,lo=!1;function q0(e,t,n){if(e=e.containerInfo,zo=Pa,e=uh(e),Gr(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var u=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var b=0,T=-1,R=-1,B=0,Y=0,_=e,H=null;t:for(;;){for(var W;_!==a||u!==0&&_.nodeType!==3||(T=b+u),_!==h||c!==0&&_.nodeType!==3||(R=b+c),_.nodeType===3&&(b+=_.nodeValue.length),(W=_.firstChild)!==null;)H=_,_=W;for(;;){if(_===e)break t;if(H===a&&++B===u&&(T=b),H===h&&++Y===c&&(R=b),(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(Ao={focusedElem:e,selectionRange:a},Pa=!1,n=(n&335544064)===n,gt=t,t=n?9270:1024;gt!==null;){if(e=gt,n&&(a=e.deletions,a!==null))for(u=0;u<a.length;u++)n&&Pu(a[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&Pm(e),Nc(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&Pu(a),Nc(n);continue}else if(a!==null&&a.memoizedState!==null){n&&Pm(e),Nc(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,gt=a):(n&&np(e),Nc(n))}}It=null}function Nc(e){for(;gt!==null;){var t=gt,n=e,a=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&a!==null){n=void 0,c=a.memoizedProps,a=a.memoizedState;var u=t.stateNode;try{var h=Jl(t.type,c);n=u.getSnapshotBeforeUpdate(h,a),u.__reactInternalSnapshotBeforeUpdate=n}catch(b){Le(t,t.return,b)}}break;case 3:if((c&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)Ho(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ho(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=$n(a.memoizedProps,a.stateNode),c=t.memoizedProps,c=Yn(c.default,c.update),c!=="none"&&Da(a,n,c,a.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(o(163))}if(a=t.sibling,a!==null){a.return=t.return,gt=a;break}gt=t.return}}function ip(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:_n(e,n),a&4&&Ys(5,n);break;case 1:if(_n(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Le(n,n.return,h)}else{var c=Jl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Le(n,n.return,h)}}a&64&&Km(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{Hh(e,t)}catch(h){Le(n,n.return,h)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:_n(e,n),t===null&&a&4&&Zu(n),a&512&&En(n,n.return);break;case 12:_n(e,n);break;case 31:_n(e,n),a&4&&op(e,n);break;case 13:_n(e,n),a&4&&dp(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=W0.bind(null,n),My(e,n))));break;case 22:if(a=n.memoizedState!==null||pt,!a){var u=t!==null&&t.memoizedState!==null||Ue;t=pt,c=Ue,pt=a,(Ue=u)&&!c?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),xn(e,n,a)):_n(e,n),pt=t,Ue=c}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 ao(e,t){for(e=e.child;e!==null;)cp(e,t),e=e.sibling}function cp(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 c=e.stateNode,u=e.memoizedProps.style,h=u!=null&&u.hasOwnProperty("display")?u.display:null;c.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(T){Le(e,e.return,T)}so(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,_e=!0}catch(T){Le(e,e.return,T)}break;case 18:try{var b=e.stateNode;t?Pp(b,!0):Pp(e.stateNode,!1)}catch(T){Le(e,e.return,T)}break;case 22:case 23:e.memoizedState===null&&ao(e,t);break;default:ao(e,t)}}function so(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:cp(n,a);break e;case 22:n.memoizedState===null&&so(n,a);break e;default:so(n,a)}}e=e.sibling}}function rp(e){var t=e.alternate;t!==null&&(e.alternate=null,rp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ci(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,Bt=!1;function gn(e,t,n){for(n=n.child;n!==null;)up(e,t,n),n=n.sibling}function up(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(hs,n)}catch{}switch(n.tag){case 26:Ue||kt(n,t),gn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ue&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ue||kt(n,t),Gs(n);var a=We,c=Bt;wl(n.type)&&(We=n.stateNode,Bt=!1),gn(e,t,n),hg(n.stateNode,n.type,n.memoizedProps),We=a,Bt=c;break;case 5:Ue||kt(n,t),Gs(n);case 6:if(n.tag===6&&Gs(n),a=We,c=Bt,We=null,gn(e,t,n),We=a,Bt=c,We!==null)if(Bt)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(n.stateNode),_e=!0}catch(u){Le(n,t,u)}else try{We.removeChild(n.stateNode),_e=!0}catch(u){Le(n,t,u)}break;case 18:We!==null&&(Bt?(e=We,Wp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),es(e)):Wp(We,n.stateNode));break;case 4:a=We,c=Bt,We=n.stateNode.containerInfo,Bt=!0,gn(e,t,n),We=a,Bt=c;break;case 0:case 11:case 14:case 15:xl(2,n,t),Ue||xl(4,n,t),gn(e,t,n);break;case 1:Ue||(kt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Jm(n,t,a)),gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:Ue=(a=Ue)||n.memoizedState!==null,gn(e,t,n),Ue=a;break;case 30:kt(n,t),gn(e,t,n);break;case 7:Ue||kt(n,t),gn(e,t,n);break;default:gn(e,t,n)}}function op(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{es(e)}catch(n){Le(t,t.return,n)}}}function dp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{es(e)}catch(n){Le(t,t.return,n)}}function $0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sp),t;default:throw Error(o(435,e.tag))}}function Sc(e,t){var n=$0(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var c=P0.bind(null,e,a);a.then(c,c)}})}function _t(e,t,n){var a=t.deletions;if(a!==null)for(var c=0;c<a.length;c++){var u=a[c],h=e,b=t,T=b;e:for(;T!==null;){switch(T.tag){case 27:if(wl(T.type)){We=T.stateNode,Bt=!1;break e}break;case 5:We=T.stateNode,Bt=!1;break e;case 3:case 4:We=T.stateNode.containerInfo,Bt=!0;break e}T=T.return}if(We===null)throw Error(o(160));up(h,b,u),We=null,Bt=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fp(t,e,n),t=t.sibling}var vn=null;function fp(e,t,n){var a=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var u=0;u<a.length;u++){var h=a[u];h.ref.impl=h.nextImpl}_t(t,e,n),Mt(e),c&4&&(xl(3,e,e.return),Ys(3,e),xl(5,e,e.return));break;case 1:_t(t,e,n),Mt(e),c&512&&(Ue||a===null||kt(a,a.return)),c&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(u=vn,_t(t,e,n),Mt(e),c&512&&(Ue||a===null||kt(a,a.return)),c&4)if(c=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(pt)e.stateNode=Jp(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,c=u.ownerDocument||u;t:switch(t){case"title":a=c.getElementsByTagName("title")[0],(!a||a[gs]||a[xt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=c.createElement(t),c.head.insertBefore(a,c.querySelector("head > title"))),Nt(a,t,n),a[xt]=e,ht(a),t=a;break e;case"link":if(u=bg("link","href",c).get(t+(n.href||""))){for(h=0;h<u.length;h++)if(a=u[h],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)){u.splice(h,1);break t}}a=c.createElement(t),Nt(a,t,n),c.head.appendChild(a);break;case"meta":if(u=bg("meta","content",c).get(t+(n.content||""))){for(h=0;h<u.length;h++)if(a=u[h],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)){u.splice(h,1);break t}}a=c.createElement(t),Nt(a,t,n),c.head.appendChild(a);break;default:throw Error(o(468,t))}a[xt]=e,ht(a),t=a}e.stateNode=t}else pt||Xo(u,e.type,e.stateNode);else e.stateNode=xg(u,n,e.memoizedProps);else c!==n?(c===null?(t=a.stateNode,t===null||Ue||t.parentNode.removeChild(t)):c.count--,n===null?pt||Xo(u,e.type,e.stateNode):xg(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ku(e,e.memoizedProps,a.memoizedProps);break;case 27:_t(t,e,n),Mt(e),c&512&&(Ue||a===null||kt(a,a.return)),a!==null&&c&4&&Ku(e,e.memoizedProps,a.memoizedProps);break;case 5:if(u=An,An=!1,_t(t,e,n),An=u,Mt(e),c&512&&(Ue||a===null||kt(a,a.return)),e.flags&32){t=e.stateNode;try{va(t,""),_e=!0}catch(B){Le(e,e.return,B)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,Ku(e,t,a!==null?a.memoizedProps:t)),c&1024&&(no=!0);break;case 6:if(_t(t,e,n),Mt(e),c&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,_e=!0}catch(B){Le(e,e.return,B)}}break;case 3:if(_e=!1,Lc=null,u=vn,vn=Ps(t.containerInfo),_t(t,e,n),vn=u,Mt(e),c&4&&a!==null&&a.memoizedState.isDehydrated)try{es(t.containerInfo)}catch(B){Le(e,e.return,B)}no&&(no=!1,hp(e)),_e=!1;break;case 4:c=An,An=pt,a=Mf(),u=vn,vn=Ps(e.stateNode.containerInfo),_t(t,e,n),Mt(e),vn=u,_e&&Xs&&(kc=!0),_e=a,An=c;break;case 12:_t(t,e,n),Mt(e);break;case 31:_t(t,e,n),Mt(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sc(e,t)));break;case 13:_t(t,e,n),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ec=Xt()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sc(e,t)));break;case 22:u=e.memoizedState!==null,h=a!==null&&a.memoizedState!==null;var b=pt,T=Ue,R=An;pt=b||u,An=R||u,Ue=T||h,_t(t,e,n),Ue=T,An=R,pt=b,Mt(e),c&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||a===null||h||pt||Ue||(t=h||Ue,n=pt,a=Ue,pt=u||pt,Ue=t,bl(e,2),pt=n,Ue=a),!u&&An||ao(e,u)),c&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Sc(e,n))));break;case 19:_t(t,e,n),Mt(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Sc(e,t)));break;case 30:c&512&&(Ue||a===null||kt(a,a.return)),c=Mf(),u=Xs,h=(n&335544064)===n,b=e.memoizedProps,Xs=h&&Yn(b.default,b.update)!=="none",_t(t,e,n),Mt(e),h&&a!==null&&_e&&(e.flags|=4),Xs=u,_e=c;break;case 21:break;case 7:c&512&&(Ue||a===null||kt(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(Fm(a)){n=a;break}a=a.return}a=null;for(var c=e.return;c!==null;){if(Vu(c)){var u=c.stateNode;a===null?a=[u]:a.push(u)}if(Qu(c))break;c=c.return}var h=a;if(n==null)throw Error(o(160));switch(n.tag){case 27:var b=n.stateNode,T=Ju(e);xc(e,T,b,h);break;case 5:var R=n.stateNode;n.flags&32&&(va(R,""),n.flags&=-33);var B=Ju(e);xc(e,B,R,h);break;case 3:case 4:var Y=n.stateNode.containerInfo,_=Ju(e);Iu(e,_,Y,h);break;default:throw Error(o(161))}}catch(H){Le(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Pa=!0,t.reset(),Pa=!1),e=e.sibling}}function Ua(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)mp(t,e),t=t.sibling;else ap(t)}function mp(e,t){var n=e.alternate;if(n===null)Fu(e,!1);else switch(e.tag){case 3:if(lo=On=!1,ep(),Ua(t,e),!On&&!kc){if(e=Cn,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var c=e[a+1];tg(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("+c+")"})}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"})),lo=!0}Cn=null;break;case 5:Ua(t,e);break;case 4:a=On,On=!1,Ua(t,e),On&&(kc=!0),On=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Fu(e,!1):Ua(t,e));break;case 30:a=On,c=ep(),On=!1,Ua(t,e),On&&(e.flags|=4);var u=e.memoizedProps,h=e.stateNode;t=$n(u,h),h=$n(n.memoizedProps,h);var b=Yn(u.default,u.update);b==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,Ht=0,t=to(e,n,t,h,b,u,!0),Ht!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Ga(e,e.memoizedProps.onUpdate),Cn=c):c!==null&&(c.push.apply(c,Cn),Cn=c),On=(e.flags&32)!==0?!0:a;break;default:Ua(t,e)}}function _n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ip(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:kt(n,n.return);var c=n.stateNode;typeof c.componentWillUnmount=="function"&&Jm(n,n.return,c),bl(n,a);break;case 27:(a&2)!==0&&hg(n.stateNode,n.type,n.memoizedProps);case 5:kt(n,n.return),n.tag!==5&&n.tag!==27||Gs(n),bl(n,a);break;case 6:Gs(n);break;case 26:kt(n,n.return),c=n.stateNode,n.memoizedState!==null||c===null||Ue||c.parentNode.removeChild(c),bl(n,a);break;case 22:n.memoizedState===null&&bl(n,a);break;case 30:kt(n,n.return),bl(n,a);break;case 7:kt(n,n.return);default:bl(n,a)}e=e.sibling}}function xn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,c=e,u=t,h=u.flags,b=(n&1)!==0;switch(u.tag){case 0:case 11:case 15:xn(c,u,n),Ys(4,u);break;case 1:if(xn(c,u,n),a=u,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Le(a,a.return,B)}if(a=u,c=a.updateQueue,c!==null){var T=a.stateNode;try{var R=c.shared.hiddenCallbacks;if(R!==null)for(c.shared.hiddenCallbacks=null,c=0;c<R.length;c++)Uh(R[c],T)}catch(B){Le(a,a.return,B)}}b&&h&64&&Km(u),En(u,u.return);break;case 27:(n&2)!==0&&Wm(u);case 5:u.tag!==5&&u.tag!==27||Im(u),xn(c,u,n),b&&a===null&&h&4&&Zu(u),En(u,u.return);break;case 6:Im(u);break;case 26:T=u.stateNode,u.memoizedState!==null||T===null||pt||Xo(Ps(T.ownerDocument),u.type,T),xn(c,u,n),b&&a===null&&h&4&&Zu(u),En(u,u.return);break;case 12:xn(c,u,n);break;case 31:xn(c,u,n),b&&h&4&&op(c,u);break;case 13:xn(c,u,n),b&&h&4&&dp(c,u);break;case 22:u.memoizedState===null&&xn(c,u,n),En(u,u.return);break;case 30:xn(c,u,n),En(u,u.return);break;case 7:En(u,u.return);default:xn(c,u,n)}t=t.sibling}}function io(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&&zs(n))}function co(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&zs(e))}function un(e,t,n,a){var c=(n&335544064)===n;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)pp(e,t,n,a),t=t.sibling;else c&&lp(t)}function pp(e,t,n,a){var c=(n&335544064)===n;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&jc(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:un(e,t,n,a),u&2048&&Ys(9,t);break;case 1:un(e,t,n,a);break;case 3:un(e,t,n,a),c&&lo&&(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="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&zs(u)));break;case 12:if(u&2048){un(e,t,n,a),u=t.stateNode;try{var h=t.memoizedProps,b=h.id,T=h.onPostCommit;typeof T=="function"&&T(b,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(R){Le(t,t.return,R)}}else un(e,t,n,a);break;case 31:un(e,t,n,a);break;case 13:un(e,t,n,a);break;case 23:break;case 22:h=t.stateNode,b=t.alternate,t.memoizedState!==null?(c&&b!==null&&b.memoizedState===null&&jc(b),h._visibility&2?un(e,t,n,a):Qs(e,t)):(c&&b!==null&&b.memoizedState!==null&&jc(t),h._visibility&2?un(e,t,n,a):(h._visibility|=2,Ha(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),u&2048&&io(b,t);break;case 24:un(e,t,n,a),u&2048&&co(t.alternate,t);break;case 30:c&&(u=t.alternate,u!==null&&(zn(u.child,!0),zn(t.child,!0))),un(e,t,n,a);break;default:un(e,t,n,a)}}function Ha(e,t,n,a,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,h=t,b=n,T=a,R=h.flags;switch(h.tag){case 0:case 11:case 15:Ha(u,h,b,T,c),Ys(8,h);break;case 23:break;case 22:var B=h.stateNode;h.memoizedState!==null?B._visibility&2?Ha(u,h,b,T,c):Qs(u,h):(B._visibility|=2,Ha(u,h,b,T,c)),c&&R&2048&&io(h.alternate,h);break;case 24:Ha(u,h,b,T,c),c&&R&2048&&co(h.alternate,h);break;default:Ha(u,h,b,T,c)}t=t.sibling}}function Qs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,c=a.flags;switch(a.tag){case 22:Qs(n,a),c&2048&&io(a.alternate,a);break;case 24:Qs(n,a),c&2048&&co(a.alternate,a);break;default:Qs(n,a)}t=t.sibling}}var Il=8192;function Fl(e,t,n){if(e.subtreeFlags&Il)for(e=e.child;e!==null;)gp(e,t,n),e=e.sibling}function gp(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Il&&(e.memoizedState!==null?Zy(n,vn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Ng(n,e)));break;case 5:Fl(e,t,n),e.flags&Il&&(e=e.stateNode,(t&335544128)===t&&Ng(n,e));break;case 3:case 4:var a=vn;vn=Ps(e.stateNode.containerInfo),Fl(e,t,n),vn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Il,Il=16777216,Fl(e,t,n),Il=a):Fl(e,t,n));break;case 30:if((e.flags&Il)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var c=e.stateNode;c.paired=null,It===null&&(It=new Map),It.set(a,c)}Fl(e,t,n);break;default:Fl(e,t,n)}}function vp(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 Vs(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,bp(a,e)}vp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xp(e),e=e.sibling}function xp(e){switch(e.tag){case 0:case 11:case 15:Vs(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Vs(e);break;case 12:Vs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wc(e)):Vs(e);break;default:Vs(e)}}function wc(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,bp(a,e)}vp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),wc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,wc(t));break;default:wc(t)}e=e.sibling}}function bp(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:zs(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,gt=a;else e:for(n=e;gt!==null;){a=gt;var c=a.sibling,u=a.return;if(rp(a),a===n){gt=null;break e}if(c!==null){c.return=u,gt=c;break e}gt=u}}}var Y0={getCacheForType:function(e){var t=bt(it),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return bt(it).controller.signal}},G0=typeof WeakMap=="function"?WeakMap:Map,De=0,Ve=null,Ne=null,Te=0,Be=0,Ft=null,yl=!1,Ba=!1,ro=!1,Fn=0,at=0,jl=0,Wl=0,Tc=0,Wt=0,La=0,Zs=null,Lt=null,uo=!1,Ec=0,yp=0,Cc=1/0,zc=null,kl=null,tt=0,bn=null,Pl=null,Mn=0,oo=0,fo=null,jp=null,qa=null,$a=null,Ya=null,Ks=0,Ac=null;function Pt(){return(De&2)!==0&&Te!==0?Te&-Te:U.T!==null?ko():Sf()}function kp(){if(Wt===0)if((Te&536870912)===0||ke){var e=Si;Si<<=1,(Si&3932160)===0&&(Si=262144),Wt=e}else Wt=536870912;return e=yt.current,e!==null&&(e.flags|=32),Wt}function Ga(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=ng($n(e.memoizedProps,n))),$a===null&&($a=[]),$a.push(t.bind(null,a))}}function qt(e,t,n){(e===Ve&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(Xa(e,0),Nl(e,Te,Wt,!1)),ps(e,n),((De&2)===0||e!==Ve)&&(e===Ve&&((De&2)===0&&(Wl|=n),at===4&&Nl(e,Te,Wt,!1)),Rn(e))}function Np(e,t,n){if((De&6)!==0)throw Error(o(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ms(e,t),c=a?V0(e,t):mo(e,t,!0),u=a;do{if(c===0){Ba&&!a&&Nl(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!X0(n)){c=mo(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var b=e;c=Zs;var T=b.current.memoizedState.isDehydrated;if(T&&(Xa(b,h).flags|=256),h=mo(b,h,!1),h!==2&&h!==6){if(ro&&!T){b.errorRecoveryDisabledLanes|=u,Wl|=u,c=4;break e}u=Lt,Lt=c,u!==null&&(Lt===null?Lt=u:Lt.push.apply(Lt,u))}c=h}if(u=!1,c!==2)continue}}if(c===1){Xa(e,0),Nl(e,t,0,!0);break}e:{switch(a=e,u=c,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Nl(a,t,Wt,!yl);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Ec+300-Xt(),10<c)){if(Nl(a,t,Wt,!yl),Ti(a,0,!0)!==0)break e;Mn=t,a.timeoutHandle=Mo(Sp.bind(null,a,n,Lt,zc,uo,t,Wt,Wl,La,yl,u,"Throttled",-0,0),c);break e}Sp(a,n,Lt,zc,uo,t,Wt,Wl,La,yl,u,null,-0,0)}}break}while(!0);Rn(e)}function Sp(e,t,n,a,c,u,h,b,T,R,B,Y,_,H){e.timeoutHandle=-1;var W=t.subtreeFlags,ae=(u&335544064)===u;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},It=null,gp(t,u,Y),ae&&(W=Y,ae=e.containerInfo,ae=(ae.nodeType===9?ae:ae.ownerDocument).__reactViewTransition,ae!=null&&(W.count++,W.waitingForViewTransition=!0,W=ni.bind(W),ae.finished.then(W,W))),W=(u&62914560)===u?Ec-Xt():(u&4194048)===u?yp-Xt():0,W=Ky(Y,W),W!==null)){Mn=u,e.cancelPendingCommit=W(_p.bind(null,e,t,u,n,a,c,h,b,T,R,B,Y,null,_,H)),Nl(e,u,h,!R);return}_p(e,t,u,n,a,c,h,b,T,R,B,Y)}function X0(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 c=n[a],u=c.getSnapshot;c=c.value;try{if(!Kt(u(),c))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=bf(e,t),t&=~Tc,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var c=t;0<c;){var u=31-Vt(c),h=1<<u;a[u]=-1,c&=~h}n!==0&&jf(e,n,t)}function Oc(){return(De&6)===0?(Js(0),!1):!0}function ho(){if(Ne!==null){if(Be===0)var e=Ne.return;else e=Ne,Qn=ql=null,yu(e),Aa=null,_s=0,e=Ne;for(;e!==null;)Zm(e.alternate,e),e=e.return;Ne=null}}function Xa(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,my(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Mn=0,ho(),Ve=e,Ne=n=Gn(e.current,null),Te=t,Be=0,Ft=null,yl=!1,Ba=ms(e,t),ro=!1,La=Wt=Tc=Wl=jl=at=0,Lt=Zs=null,uo=!1,Fn=bf(e,t),Li(),n}function wp(e,t){xe=null,U.H=oc,t===za||t===Ii?(t=_h(),Be=3):t===cu?(t=_h(),Be=4):Be=t===Du?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,Ne===null&&(at=1,dc(e,an(t,e.current)))}function Tp(){var e=yt.current;return e===null?!0:(Te&4194048)===Te?Tt===null:(Te&62914560)===Te||(Te&536870912)!==0?e===Tt:!1}function Ep(){var e=U.H;return U.H=oc,e===null?oc:e}function Cp(){var e=U.A;return U.A=Y0,e}function _c(){at=4,yl||(Te&4194048)!==Te&&yt.current!==null||(Ba=!0),(jl&134217727)===0&&(Wl&134217727)===0||Ve===null||Nl(Ve,Te,Wt,!1)}function mo(e,t,n){var a=De;De|=2;var c=Ep(),u=Cp();(Ve!==e||Te!==t)&&(zc=null,Xa(e,t)),t=!1;var h=at;e:do try{if(Be!==0&&Ne!==null){var b=Ne,T=Ft;switch(Be){case 8:ho(),h=6;break e;case 3:case 2:case 9:case 6:yt.current===null&&(t=!0);var R=Be;if(Be=0,Ft=null,Qa(e,b,T,R),n&&Ba){h=0;break e}break;default:R=Be,Be=0,Ft=null,Qa(e,b,T,R)}}Q0(),h=at;break}catch(B){wp(e,B)}while(!0);return t&&e.shellSuspendCounter++,Qn=ql=null,De=a,U.H=c,U.A=u,Ne===null&&(Ve=null,Te=0,Li()),h}function Q0(){for(;Ne!==null;)zp(Ne)}function V0(e,t){var n=De;De|=2;var a=Ep(),c=Cp();Ve!==e||Te!==t?(zc=null,Cc=Xt()+500,Xa(e,t)):Ba=ms(e,t);e:do try{if(Be!==0&&Ne!==null){t=Ne;var u=Ft;t:switch(Be){case 1:Be=0,Ft=null,Qa(e,t,u,1);break;case 2:case 9:if(Ah(u)){Be=0,Ft=null,Ap(t);break}t=function(){Be!==2&&Be!==9||Ve!==e||(Be=7),Rn(e)},u.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Ah(u)?(Be=0,Ft=null,Ap(t)):(Be=0,Ft=null,Qa(e,t,u,7));break;case 5:var h=null;switch(Ne.tag){case 26:h=Ne.memoizedState;case 5:case 27:var b=Ne;if(h?jg(h):b.stateNode.complete){Be=0,Ft=null;var T=b.sibling;if(T!==null)Ne=T;else{var R=b.return;R!==null?(Ne=R,Mc(R)):Ne=null}break t}}Be=0,Ft=null,Qa(e,t,u,5);break;case 6:Be=0,Ft=null,Qa(e,t,u,6);break;case 8:ho(),at=6;break e;default:throw Error(o(462))}}Z0();break}catch(B){wp(e,B)}while(!0);return Qn=ql=null,U.H=a,U.A=c,De=n,Ne!==null?0:(Ve=null,Te=0,Li(),at)}function Z0(){for(;Ne!==null&&!ob();)zp(Ne)}function zp(e){var t=Qm(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,t===null?Mc(e):Ne=t}function Ap(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bm(n,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:yu(t);var a=t;a===mt&&(ke?(Qi(a),a.tag===5&&a.stateNode!=null&&(Ie=a.stateNode)):(Qi(a),ke=!0));default:Zm(n,t),t=Ne=bh(t,Fn),t=Qm(n,t,Fn)}e.memoizedProps=e.pendingProps,t===null?Mc(e):Ne=t}function Qa(e,t,n,a){Qn=ql=null,yu(t),Aa=null,_s=0;var c=t.return;try{if(R0(e,c,t,n,Te)){at=1,dc(e,an(n,e.current)),Ne=null;return}}catch(u){if(c!==null)throw Ne=c,u;at=1,dc(e,an(n,e.current)),Ne=null;return}t.flags&32768?(ke||a===1?e=!0:Ba||(Te&536870912)!==0?e=!1:(yl=e=!0,(a===2||a===9||a===3||a===6)&&(a=yt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Op(t,e)):Mc(t)}function Mc(e){var t=e;do{if((t.flags&32768)!==0){Op(t,yl);return}e=t.return;var n=B0(t.alternate,t,Fn);if(n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);at===0&&(at=5)}function Op(e,t){do{var n=L0(e.alternate,e);if(n!==null){n.flags&=32767,Ne=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=n}while(e!==null);at=6,Ne=null}function _p(e,t,n,a,c,u,h,b,T,R,B,Y){e.cancelPendingCommit=null;do Rc();while(tt!==0);if((De&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Ve&&(Ne=Ve=null,Te=0),Pl=t,bn=e,Mn=n,fo=c,jp=a,K0(e,t,n,h,b,T,Y)}}function K0(e,t,n,a,c,u,h){var b=t.lanes|t.childLanes;if(oo=b,b|=Kr,yb(e,n,b,a,c,u),$a=null,(n&335544064)===n?(Ya=k0(e),a=10262):(Ya=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,ey(ki,function(){return xo(),null})):(e.callbackNode=null,e.callbackPriority=0),bc=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null,c=I.p,I.p=2,u=De,De|=4;try{q0(e,t,n)}finally{De=u,I.p=c,U.T=a}}tt=1,bc?qa=yy(h,e.containerInfo,Ya,po,go,I0,vo,xo,J0):(po(),go(),vo())}function J0(e){if(tt!==0){var t=bn.onRecoverableError;t(e,{componentStack:null})}}function I0(){tt===3&&(tt=0,mp(Pl,bn),tt=4)}function po(){if(tt===1){tt=0;var e=bn,t=Pl,n=Mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var c=I.p;I.p=2;var u=De;De|=4;try{Xs=kc=!1,fp(t,e,n),n=Ao;var h=uh(e.containerInfo),b=n.focusedElem,T=n.selectionRange;if(h!==b&&b&&b.ownerDocument&&rh(b.ownerDocument.documentElement,b)){if(T!==null&&Gr(b)){var R=T.start,B=T.end;if(B===void 0&&(B=R),"selectionStart"in b)b.selectionStart=R,b.selectionEnd=Math.min(B,b.value.length);else{var Y=b.ownerDocument||document,_=Y&&Y.defaultView||window;if(_.getSelection){var H=_.getSelection(),W=b.textContent.length,ae=Math.min(T.start,W),be=T.end===void 0?ae:Math.min(T.end,W);!H.extend&&ae>be&&(h=be,be=ae,ae=h);var M=ch(b,ae),C=ch(b,be);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>be?(H.addRange(D),H.extend(C.node,C.offset)):(D.setEnd(C.node,C.offset),H.addRange(D))}}}}for(Y=[],H=b;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<Y.length;b++){var $=Y[b];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Pa=!!zo,Ao=zo=null}finally{De=u,I.p=c,U.T=a}}e.current=t,tt=2}}function go(){if(tt===2){tt=0;var e=bn,t=Pl,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 c=De;De|=4;try{ip(e,t.alternate,t)}finally{De=c,I.p=a,U.T=n}}tt=3}}function vo(){if(tt===4||tt===3){tt=0;var e=qa;qa=null,db();var t=bn,n=Pl,a=Mn,c=jp,u=(a&335544064)===a?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?tt=5:(tt=0,Pl=bn=null,Mp(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(kl=null),wr(a),n=n.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(hs,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=U.T,u=I.p,I.p=2,U.T=null;try{for(var h=t.onRecoverableError,b=0;b<c.length;b++){var T=c[b];h(T.value,{componentStack:T.stack})}}finally{U.T=n,I.p=u}}if(c=$a,h=Ya,Ya=null,c!==null&&($a=null,h===null&&(h=[]),e!==null))for(T=0;T<c.length;T++)n=(0,c[T])(h),n!==void 0&&e.finished.finally(n);(Mn&3)!==0&&Rc(),Rn(t),u=t.pendingLanes,(a&261930)!==0&&(u&42)!==0?t===Ac?Ks++:(Ks=0,Ac=t):(Ks=0,Ac=null),Js(0)}}function Mp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,zs(t)))}function Rc(){return qa!==null&&(qa.skipTransition(),qa=null),po(),go(),vo(),xo()}function xo(){if(tt!==5)return!1;var e=bn,t=oo;oo=0;var n=wr(Mn),a=U.T,c=I.p;try{I.p=32>n?32:n,U.T=null,n=fo,fo=null;var u=bn,h=Mn;if(tt=0,Pl=bn=null,Mn=0,(De&6)!==0)throw Error(o(331));var b=De;if(De|=4,xp(u.current),pp(u,u.current,h,n),De=b,Js(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(hs,u)}catch{}return!0}finally{I.p=c,U.T=a,Mp(e,t)}}function Rp(e,t,n){t=an(n,t),t=Ru(e.stateNode,t,2),e=ml(e,t,2),e!==null&&(ps(e,2),Rn(e))}function Le(e,t,n){if(e.tag===3)Rp(e,e,n);else for(;t!==null;){if(t.tag===3){Rp(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=an(n,e),n=Am(2),a=ml(t,n,2),a!==null&&(Om(n,a,t,e),ps(a,2),Rn(a));break}}t=t.return}}function bo(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new G0;var c=new Set;a.set(t,c)}else c=a.get(t),c===void 0&&(c=new Set,a.set(t,c));c.has(n)||(ro=!0,c.add(n),e=F0.bind(null,e,t,n),t.then(e,e))}function F0(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ve===e&&(Te&n)===n&&((at===4||at===3&&(Te&62914560)===Te&&300>Xt()-Ec)&&(De&2)===0?Xa(e,0):Tc|=n,La===Te&&(La=0)),Rn(e)}function Dp(e,t){t===0&&(t=yf()),e=Hl(e,t),e!==null&&(ps(e,t),Rn(e))}function W0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dp(e,n)}function P0(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Dp(e,n)}function ey(e,t){return jr(e,t)}var Va=null,Za=null,yo=!1,Dc=!1,jo=!1,Sl=0;function Rn(e){e!==Za&&e.next===null&&(Za===null?Va=Za=e:Za=Za.next=e),Dc=!0,yo||(yo=!0,ny())}function Js(e,t){if(!jo&&Dc){jo=!0;do for(var n=!1,a=Va;a!==null;){if(e!==0){var c=a.pendingLanes;if(c===0)var u=0;else{var h=a.suspendedLanes,b=a.pingedLanes;u=(1<<31-Vt(42|e)+1)-1,u&=c&~(h&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Lp(a,u))}else u=Te,u=Ti(a,a===Ve?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||ms(a,u)||(n=!0,Lp(a,u));a=a.next}while(n);jo=!1}}function ty(){Up()}function Up(){Dc=yo=!1;var e=0;Sl!==0&&hy()&&(e=Sl);for(var t=Xt(),n=null,a=Va;a!==null;){var c=a.next,u=Hp(a,t);u===0?(a.next=null,n===null?Va=c:n.next=c,c===null&&(Za=n)):(n=a,(e!==0||(u&3)!==0)&&(Dc=!0)),a=c}tt!==0&&tt!==5||Js(e),Sl!==0&&(Sl=0)}function Hp(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var h=31-Vt(u),b=1<<h,T=c[h];T===-1?((b&n)===0||(b&a)!==0)&&(c[h]=bb(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Ve,n=Te,n=Ti(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&kr(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ms(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&kr(a),wr(n)){case 2:case 8:n=vf;break;case 32:n=ki;break;case 268435456:n=xf;break;default:n=ki}return a=Bp.bind(null,e),n=jr(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&kr(a),e.callbackPriority=2,e.callbackNode=null,2}function Bp(e,t){if(tt!==0&&tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Rc()&&e.callbackNode!==n)return null;var a=Te;return a=Ti(e,e===Ve?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Np(e,a,t),Hp(e,Xt()),e.callbackNode!=null&&e.callbackNode===n?Bp.bind(null,e):null)}function Lp(e,t){if(Rc())return null;Np(e,t,!0)}function ny(){py(function(){(De&6)!==0?jr(gf,ty):Up()})}function ko(){if(Sl===0){var e=Gl;e===0&&(e=Ni,Ni<<=1,(Ni&261888)===0&&(Ni=256)),Sl=e}return Sl}function qp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Oi(e)}function ly(e,t,n,a,c){if(t==="submit"&&n&&n.stateNode===c){var u=qp((c[Dt]||null).action),h=a.submitter;h&&(t=(t=h[Dt]||null)?qp(t.formAction):h.getAttribute("formAction"),t!==null&&(u=t,h=null));var b=new Di("action","action",null,a,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Sl!==0){var T=new FormData(c,h);zu(n,{pending:!0,data:T,method:c.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=new FormData(c,h),zu(n,{pending:!0,data:T,method:c.method,action:u},u,T))},currentTarget:c}]})}}for(var No=0;No<Zr.length;No++){var So=Zr[No],ay=So.toLowerCase(),sy=So[0].toUpperCase()+So.slice(1);pn(ay,"on"+sy)}pn(fh,"onAnimationEnd"),pn(hh,"onAnimationIteration"),pn(mh,"onAnimationStart"),pn("dblclick","onDoubleClick"),pn("focusin","onFocus"),pn("focusout","onBlur"),pn(m0,"onTransitionRun"),pn(p0,"onTransitionStart"),pn(g0,"onTransitionCancel"),pn(ph,"onTransitionEnd"),pa("onMouseEnter",["mouseout","mouseover"]),pa("onMouseLeave",["mouseout","mouseover"]),pa("onPointerEnter",["pointerout","pointerover"]),pa("onPointerLeave",["pointerout","pointerover"]),Rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="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(" "),iy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Is));function $p(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],c=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var h=a.length-1;0<=h;h--){var b=a[h],T=b.instance,R=b.currentTarget;if(b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=R;try{u(c)}catch(B){Bi(B)}c.currentTarget=null,u=T}else for(h=0;h<a.length;h++){if(b=a[h],T=b.instance,R=b.currentTarget,b=b.listener,T!==u&&c.isPropagationStopped())break e;u=b,c.currentTarget=R;try{u(c)}catch(B){Bi(B)}c.currentTarget=null,u=T}}}}function Se(e,t){var n=t[Tf];n===void 0&&(n=t[Tf]=new Set);var a=e+"__bubble";n.has(a)||(Yp(t,e,2,!1),n.add(a))}function wo(e,t,n){var a=0;t&&(a|=4),Yp(n,e,a,t)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function To(e){if(!e[Uc]){e[Uc]=!0,zf.forEach(function(n){n!=="selectionchange"&&(iy.has(n)||wo(n,!1,e),wo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uc]||(t[Uc]=!0,wo("selectionchange",!1,t))}}function Yp(e,t,n,a){switch(Og(t)){case 2:var c=Wy;break;case 8:c=Py;break;default:c=Vo}n=c.bind(null,t,n,e),c=void 0,!Mr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),a?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Eo(e,t,n,a,c){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var h=a.tag;if(h===3||h===4){var b=a.stateNode.containerInfo;if(b===c)break;if(h===4)for(h=a.return;h!==null;){var T=h.tag;if((T===3||T===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;b!==null;){if(h=Ml(b),h===null)return;if(T=h.tag,T===5||T===6||T===26||T===27){a=u=h;continue e}b=b.parentNode}}a=a.return}Yf(function(){var R=u,B=Or(n),Y=[];e:{var _=gh.get(e);if(_!==void 0){var H=Di,W=e;switch(e){case"keypress":if(Mi(n)===0)break e;case"keydown":case"keyup":H=Xb;break;case"focusin":W="focus",H=Hr;break;case"focusout":W="blur",H=Hr;break;case"beforeblur":case"afterblur":H=Hr;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=Qf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=_b;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Jb;break;case fh:case hh:case mh:H=Db;break;case ph:H=Fb;break;case"scroll":case"scrollend":H=Ab;break;case"wheel":H=Pb;break;case"copy":case"cut":case"paste":H=Hb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Zf;break;case"submit":H=Zb;break;case"toggle":case"beforetoggle":H=t0}var ae=(t&4)!==0,be=!ae&&(e==="scroll"||e==="scrollend"),M=ae?_!==null?_+"Capture":null:_;ae=[];for(var C=R,D;C!==null;){var $=C;if(D=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||D===null||M===null||($=xs(C,M),$!=null&&ae.push(Fs(C,$,D))),be)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!==Ar&&(W=n.relatedTarget||n.fromElement)&&(Ml(W)||W[fa]))break e;(_||H)&&(W=B.window===B?B:(H=B.ownerDocument)?H.defaultView||H.parentWindow:window,_?(H=n.relatedTarget||n.toElement,_=R,H=H?Ml(H):null,H!==null&&(be=f(H),ae=H.tag,H!==be||ae!==5&&ae!==27&&ae!==6)&&(H=null)):(_=null,H=R),_!==H&&(ae=Qf,$="onMouseLeave",M="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ae=Zf,$="onPointerLeave",M="onPointerEnter",C="pointer"),be=_==null?W:vs(_),D=H==null?W:vs(H),W=new ae($,C+"leave",_,n,B),W.target=be,W.relatedTarget=D,$=null,Ml(B)===R&&(ae=new ae(M,C+"enter",H,n,B),ae.target=D,ae.relatedTarget=be,$=ae),be=$,ae=_&&H?K(_,H,cy):null,_!==null&&Gp(Y,W,_,ae,!1),H!==null&&be!==null&&Gp(Y,be,H,ae,!0)))}e:{if(_=R?vs(R):window,H=_.nodeName&&_.nodeName.toLowerCase(),H==="select"||H==="input"&&_.type==="file")var te=th;else if(Pf(_))if(nh)te=d0;else{te=u0;var Ee=r0}else H=_.nodeName,!H||H.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?R&&zr(R.elementType)&&(te=th):te=o0;if(te&&(te=te(e,R))){eh(Y,te,n,B);break e}Ee&&Ee(e,_,R)}switch(Ee=R?vs(R):window,e){case"focusin":(Pf(Ee)||Ee.contentEditable==="true")&&(ja=Ee,Xr=R,Ts=null);break;case"focusout":Ts=Xr=ja=null;break;case"mousedown":Qr=!0;break;case"contextmenu":case"mouseup":case"dragend":Qr=!1,oh(Y,n,B);break;case"selectionchange":if(h0)break;case"keydown":case"keyup":oh(Y,n,B)}var re;if(Lr)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 ya?Ff(e,n)&&(pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(pe="onCompositionStart");pe&&(Kf&&n.locale!=="ko"&&(ya||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&ya&&(re=Gf()):(sl=B,Rr="value"in sl?sl.value:sl.textContent,ya=!0)),Ee=Hc(R,pe),0<Ee.length&&(pe=new Vf(pe,e,null,n,B),Y.push({event:pe,listeners:Ee}),re?pe.data=re:(re=Wf(n),re!==null&&(pe.data=re)))),(re=l0?a0(e,n):s0(e,n))&&(pe=Hc(R,"onBeforeInput"),0<pe.length&&(Ee=new Vf("onBeforeInput","beforeinput",null,n,B),Y.push({event:Ee,listeners:pe}),Ee.data=re)),ly(Y,e,R,n,B)}$p(Y,t)})}function Fs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hc(e,t){for(var n=t+"Capture",a=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=xs(e,n),c!=null&&a.unshift(Fs(e,c,u)),c=xs(e,t),c!=null&&a.push(Fs(e,c,u))),e.tag===3)return a;e=e.return}return[]}function cy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gp(e,t,n,a,c){for(var u=t._reactName,h=[];n!==null&&n!==a;){var b=n,T=b.alternate,R=b.stateNode;if(b=b.tag,T!==null&&T===a)break;b!==5&&b!==26&&b!==27||R===null||(T=R,c?(R=xs(n,u),R!=null&&h.unshift(Fs(n,R,T))):c||(R=xs(n,u),R!=null&&h.push(Fs(n,R,T)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var ry=/\r\n?/g,uy=/\u0000|\uFFFD/g;function Xp(e){return(typeof e=="string"?e:""+e).replace(ry,`
49
+ `).replace(uy,"")}function Qp(e,t){return t=Xp(t),Xp(e)===t}function qe(e,t,n,a,c,u){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||va(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&va(e,""+a);else return;break;case"className":Ai(e,"class",a);break;case"tabIndex":Ai(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ai(e,n,a);break;case"style":qf(e,a,u);return;case"data":if(t!=="object"){Ai(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=Oi(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 u=="function"&&(n==="formAction"?(t!=="input"&&qe(e,t,"name",c.name,c,null),qe(e,t,"formEncType",c.formEncType,c,null),qe(e,t,"formMethod",c.formMethod,c,null),qe(e,t,"formTarget",c.formTarget,c,null)):(qe(e,t,"encType",c.encType,c,null),qe(e,t,"method",c.method,c,null),qe(e,t,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Oi(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Sn);return;case"onScroll":a!=null&&Se("scroll",e);return;case"onScrollEnd":a!=null&&Se("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__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=Oi(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":Se("beforetoggle",e),Se("toggle",e),zi(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":zi(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=Cb.get(n)||n,zi(e,n,a);else return}_e=!0}function Co(e,t,n,a,c,u){switch(n){case"style":qf(e,a,u);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(c.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")va(e,a);else if(typeof a=="number"||typeof a=="bigint")va(e,""+a);else return;break;case"onScroll":a!=null&&Se("scroll",e);return;case"onScrollEnd":a!=null&&Se("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(!Af.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),u=n.slice(2,c?n.length-7:void 0),t=e[Dt]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(u,t,c),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(u,a,c);break e}_e=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):zi(e,n,a)}return}_e=!0}function Nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var a=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var h=n[u];if(h!=null)switch(u){case"src":a=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:qe(e,t,u,h,n,null)}}c&&qe(e,t,"srcSet",n.srcSet,n,null),a&&qe(e,t,"src",n.src,n,null);return;case"input":Se("invalid",e);var b=u=h=c=null,T=null,R=null;for(a in n)if(n.hasOwnProperty(a)){var B=n[a];if(B!=null)switch(a){case"name":c=B;break;case"type":h=B;break;case"checked":T=B;break;case"defaultChecked":R=B;break;case"value":u=B;break;case"defaultValue":b=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:qe(e,t,a,B,n,null)}}Uf(e,u,b,T,R,h,c,!1);return;case"select":Se("invalid",e),a=h=u=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":u=b;break;case"defaultValue":h=b;break;case"multiple":a=b;default:qe(e,t,c,b,n,null)}t=u,n=h,e.multiple=!!a,t!=null?ga(e,!!a,t,!1):n!=null&&ga(e,!!a,n,!0);return;case"textarea":Se("invalid",e),u=c=a=null;for(h in n)if(n.hasOwnProperty(h)&&(b=n[h],b!=null))switch(h){case"value":a=b;break;case"defaultValue":c=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(o(91));break;default:qe(e,t,h,b,n,null)}Bf(e,a,c,u);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:qe(e,t,T,a,n,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(a=0;a<Is.length;a++)Se(Is[a],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("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(o(137,t));default:qe(e,t,R,a,n,null)}return;default:if(zr(t)){for(B in n)n.hasOwnProperty(B)&&(a=n[B],a!==void 0&&Co(e,t,B,a,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(a=n[b],a!=null&&qe(e,t,b,a,n,null))}var oy={};function dy(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 c=null,u=null,h=null,b=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)||qe(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&&(_e=!0),u=H;break;case"name":H!==Y&&(_e=!0),c=H;break;case"checked":H!==Y&&(_e=!0),R=H;break;case"defaultChecked":H!==Y&&(_e=!0),B=H;break;case"value":H!==Y&&(_e=!0),h=H;break;case"defaultValue":H!==Y&&(_e=!0),b=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(137,t));break;default:H!==Y&&qe(e,t,_,H,a,Y)}}Er(e,h,b,T,R,B,u,c);return;case"select":H=h=b=_=null;for(u in n)if(T=n[u],n.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":H=T;default:a.hasOwnProperty(u)||qe(e,t,u,null,a,T)}for(c in a)if(u=a[c],T=n[c],a.hasOwnProperty(c)&&(u!=null||T!=null))switch(c){case"value":u!==T&&(_e=!0),_=u;break;case"defaultValue":u!==T&&(_e=!0),b=u;break;case"multiple":u!==T&&(_e=!0),h=u;default:u!==T&&qe(e,t,c,u,a,T)}t=b,n=h,a=H,_!=null?ga(e,!!n,_,!1):!!a!=!!n&&(t!=null?ga(e,!!n,t,!0):ga(e,!!n,n?[]:"",!1));return;case"textarea":H=_=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!a.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:qe(e,t,b,null,a,c)}for(h in a)if(c=a[h],u=n[h],a.hasOwnProperty(h)&&(c!=null||u!=null))switch(h){case"value":c!==u&&(_e=!0),_=c;break;case"defaultValue":c!==u&&(_e=!0),H=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==u&&qe(e,t,h,c,a,u)}Hf(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:qe(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&&(_e=!0),e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:qe(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)&&qe(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(o(137,t));break;default:qe(e,t,R,_,a,H)}return;default:if(zr(t)){for(var be in n)_=n[be],n.hasOwnProperty(be)&&_!==void 0&&!a.hasOwnProperty(be)&&Co(e,t,be,void 0,a,_);for(B in a)_=a[B],H=n[B],!a.hasOwnProperty(B)||_===H||_===void 0&&H===void 0||Co(e,t,B,_,a,H);return}}for(var M in n)_=n[M],n.hasOwnProperty(M)&&_!=null&&!a.hasOwnProperty(M)&&qe(e,t,M,null,a,_);for(Y in a)_=a[Y],H=n[Y],!a.hasOwnProperty(Y)||_===H||_==null&&H==null||qe(e,t,Y,_,a,H)}function Vp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var c=n[a],u=c.transferSize,h=c.initiatorType,b=c.duration;if(u&&b&&Vp(h)){for(h=0,b=c.responseEnd,a+=1;a<n.length;a++){var T=n[a],R=T.startTime;if(R>b)break;var B=T.transferSize,Y=T.initiatorType;B&&Vp(Y)&&(T=T.responseEnd,h+=B*(T<b?1:(b-R)/(T-R)))}if(--a,t+=8*(u+h)/(c.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 zo=null,Ao=null;function Ws(e){return e.nodeType===9?e:e.ownerDocument}function Zp(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 Kp(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 Jp(e,t,n,a){return n=Ws(n).createElement(e),n[xt]=a,n[Dt]=t,Nt(n,e,t),ht(n),n}function Oo(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 _o=null;function hy(){var e=window.event;return e&&e.type==="popstate"?e===_o?!1:(_o=e,!0):(_o=null,!1)}var Mo=typeof setTimeout=="function"?setTimeout:void 0,my=typeof clearTimeout=="function"?clearTimeout:void 0,Ip=typeof Promise=="function"?Promise:void 0,Fp=typeof requestAnimationFrame=="function"?requestAnimationFrame:Mo,py=typeof queueMicrotask=="function"?queueMicrotask:typeof Ip<"u"?function(e){return Ip.resolve(null).then(e).catch(gy)}:Mo;function gy(e){setTimeout(function(){throw e})}function wl(e){return e==="head"}function Wp(e,t){var n=t,a=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(c),es(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")$o(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,$o(n);for(var u=n.firstChild;u;){var h=u.nextSibling,b=u.nodeName;u[gs]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=h}}else n==="body"&&$o(e.ownerDocument.body);n=c}while(n);es(t)}function Pp(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 eg(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 c=a=0;c<t.length;c++){var u=t[c];0<u.width&&0<u.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function tg(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 vy(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 Ro(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return vy(t,n,e)}function xy(e){return e.documentElement.clientHeight}function by(e){this.addEventListener("load",e),this.addEventListener("error",e)}function yy(e,t,n,a,c,u,h,b,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"&&(xy(R),R.fonts.status==="loading"&&ae.push(R.fonts.ready)),W=ae.length,e!==null)for(var be=e.suspenseyImages,M=0,C=0;C<be.length;C++){var D=be[C];if(!D.complete){var $=D.getBoundingClientRect();if(0<$.bottom&&0<$.right&&$.top<_.innerHeight&&$.left<_.innerWidth){if(M+=kg(D),M>qc){ae.length=W;break}D=new Promise(by.bind(D)),ae.push(D)}}}if(0<ae.length)return _=Promise.race([Promise.all(ae),new Promise(function(te){return setTimeout(te,500)})]).then(c,c),(H?Promise.allSettled([H.finished,_]):_).then(u,u);if(c(),H)return H.finished.then(u,u);u()},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,be=ae.pseudoElement;if(be!=null&&be.startsWith("::view-transition")){Y.push(W),W=ae.getKeyframes();for(var M=be=void 0,C=!0,D=0;D<W.length;D++){var $=W[D],te=$.width;if(be===void 0)be=te;else if(be!==te){C=!1;break}if(te=$.height,M===void 0)M=te;else if(M!==te){C=!1;break}delete $.width,delete $.height,$.transform==="none"&&delete $.transform}C&&be!==void 0&&M!==void 0&&(ae.setKeyframes(W),C=getComputedStyle(ae.target,ae.pseudoElement),C.width!==be||C.height!==M)&&(C=W[0],C.width=be,C.height=M,C=W[W.length-1],C.width=be,C.height=M,ae.setKeyframes(W))}}h()},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(),c(),h()}}),B.finished.finally(function(){for(var _=0;_<Y.length;_++)Y[_].cancel();R.__reactViewTransition===B&&(R.__reactViewTransition=null),b()}),B}catch{return a(),c(),h(),null}}function ea(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ea.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:q({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ea.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],c=0;c<n.length;c++){var u=n[c].effect;u!==null&&u.target===e&&u.pseudoElement===t&&a.push(n[c])}return a},ea.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ng(e){return{name:e,group:new ea("group",e),imagePair:new ea("image-pair",e),old:new ea("old",e),new:new ea("new",e)}}function en(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}en.prototype.addEventListener=function(e,t,n){var a=null,c=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(ag(u,e,t,n)===-1){var h=this,b=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(b=function(T){h.removeEventListener(e,t,n),typeof t=="function"?t.call(this,T):t.handleEvent(T)}),a!==null&&(c=h.removeEventListener.bind(h,e,t,n),a.addEventListener("abort",c,{once:!0}),c=a.removeEventListener.bind(a,"abort",c)),a=Ka(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:b,cleanup:c}),k(this._fragmentFiber.child,!1,jy,e,b,a)}this._eventListeners=u}};function jy(e,t,n,a){return N(e).addEventListener(t,n,a),!1}en.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=ag(a,e,t,n),t!==-1)){var c=a[t];n=c.attachedListener;var u=c.cleanup;c=Ka(c.optionsOrUseCapture),k(this._fragmentFiber.child,!1,ky,e,n,c),a.splice(t,1),u!==null&&u()}};function ky(e,t,n,a){return N(e).removeEventListener(t,n,a),!1}function Ka(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function lg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function ag(e,t,n,a){if(e.length===0)return-1;a=lg(a);for(var c=0;c<e.length;c++){var u=e[c];if(u.type===t&&u.listener===n&&lg(u.optionsOrUseCapture)===a)return c}return-1}en.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 c=0;c<n.length;c++){var u=n[c];a.addEventListener(u.type,u.attachedListener,Ka(u.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(c=0;c<n.length;c++)u=n[c],a.removeEventListener(u.type,u.attachedListener,Ka(u.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},en.prototype.focus=function(e){k(this._fragmentFiber.child,!0,sg,e,void 0,void 0)};function sg(e,t){return e.tag===6?!1:(e=N(e),Ry(e,t))}en.prototype.focusLast=function(e){var t=[];k(this._fragmentFiber.child,!0,Do,t,void 0,void 0);for(var n=t.length-1;0<=n&&!sg(t[n],e);n--);};function Do(e,t){return t.push(e),!1}en.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=N(e),e=Ws(e).activeElement,e!==null&&k(this._fragmentFiber.child,!1,Ny,e,void 0,void 0))};function Ny(e,t){return e.tag===6?!1:(e=N(e),e===t||e.contains(t)?(t.blur(),!0):!1)}en.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),k(this._fragmentFiber.child,!1,Sy,e,void 0,void 0)};function Sy(e,t){return e.tag===6||(e=N(e),t.observe(e)),!1}en.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),k(this._fragmentFiber.child,!1,wy,e,void 0,void 0);for(var n=t=0;n<yn.length;n++){var a=yn[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):yn[t++]=a}yn.length=t}};function wy(e,t){return e.tag===6||(e=N(e),t.unobserve(e)),!1}var yn=[],Uo=!1;function Ty(e,t,n){yn.push({fragmentInstance:e,observer:t,instance:n}),Uo||(Uo=!0,Dy(function(){Uo=!1;var a=yn;yn=[];for(var c=0;c<a.length;c++){var u=a[c];u.observer.unobserve(u.instance)}}))}en.prototype.getClientRects=function(){var e=[];return k(this._fragmentFiber.child,!1,Ey,e,void 0,void 0),e};function Ey(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}en.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:N(t).getRootNode(e)},en.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];k(this._fragmentFiber.child,!1,Do,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 c=a=n.compareDocumentPosition(e);return n===e?c=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=j(t)[1],n===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=N(n).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=N(n[0]),c=N(n[n.length-1]);var u=E(this._fragmentFiber)?t.parentElement:a;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var h=t.compareDocumentPosition(e),b=c.compareDocumentPosition(e),T=h&Node.DOCUMENT_POSITION_CONTAINED_BY||b&Node.DOCUMENT_POSITION_CONTAINED_BY;return b=a&&u&&h&Node.DOCUMENT_POSITION_FOLLOWING&&b&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||u&&c===e||T||b?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!u&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:h,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Cy(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Cy(e,t,n,a,c){var u=Ml(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){n=!0;break e}u=u.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=c.ownerDocument,c===u||c===u.documentElement||c===u.body;e:{for(u=t,t=S(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===n)&&(t=K(n,u,ne),t===null?t=!1:(k(t,!0,V,u,n),u=A,A=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===a)&&(t=K(a,u,ne),t===null?t=!1:(k(t,!0,ee,u,a),u=A,O=A=null,t=u!==null)),t):!1}function ig(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)}en.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];k(this._fragmentFiber.child,!1,Do,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=j(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),ig(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 c=t[a];c.tag===6?(c=N(c),ig(c,n)):N(c).scrollIntoView(e),a+=n?-1:1}};function zy(e,t){return e=N(e),cg(e,t),!1}function cg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function rg(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];e.addEventListener(c.type,c.attachedListener,Ka(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){for(var h=0,b=0;b<yn.length;b++){var T=yn[b];(T.fragmentInstance!==t||T.observer!==u||T.instance!==e)&&(yn[h++]=T)}yn.length=h,u.observe(e)}),cg(e,t))}function Ay(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];e.removeEventListener(c.type,c.attachedListener,Ka(c.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?Ty(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Ho(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":Ho(n),Ci(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Oy(e,t,n,a){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[gs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=on(e.nextSibling),e===null)break}return null}function _y(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=on(e.nextSibling),e===null))return null;return e}function ug(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=on(e.nextSibling),e===null))return null;return e}function Bo(e){return e.data==="$?"||e.data==="$~"}function Lo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function My(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 on(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 qo=null;function og(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return on(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function dg(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 Ry(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 Dy(e){Fp(function(){Fp(function(t){return e(t)})})}function fg(e,t,n){switch(t=Ws(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function hg(e,t,n){for(var a in n){var c=n[a];n.hasOwnProperty(a)&&c!=null&&qe(e,t,a,null,oy,c)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Sn&&(e.onclick=null),Ci(e)}function $o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ci(e)}var dn=new Map,mg=new Set;function Ps(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:Uy,r:Hy,D:By,C:Ly,L:qy,m:$y,X:Gy,S:Yy,M:Xy};function Uy(){var e=Wn.f(),t=Oc();return e||t}function Hy(e){var t=ha(e);t!==null&&t.tag===5&&t.type==="form"?gm(t):Wn.r(e)}var Ja=typeof document>"u"?null:document;function pg(e,t,n){var a=Ja;if(a&&typeof t=="string"&&t){var c=nn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),mg.has(c)||(mg.add(c),e={rel:e,crossOrigin:n,href:t},a.querySelector(c)===null&&(t=a.createElement("link"),Nt(t,"link",e),ht(t),a.head.appendChild(t)))}}function By(e){Wn.D(e),pg("dns-prefetch",e,null)}function Ly(e,t){Wn.C(e,t),pg("preconnect",e,t)}function qy(e,t,n){Wn.L(e,t,n);var a=Ja;if(a&&e&&t){var c='link[rel="preload"][as="'+nn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+nn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+nn(n.imageSizes)+'"]')):c+='[href="'+nn(e)+'"]';var u=c;switch(t){case"style":u=Ia(e);break;case"script":u=Fa(e)}if(!(dn.has(u)||(e=q({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),dn.set(u,e),a.querySelector(c)!==null||t==="style"&&a.querySelector(ei(u))||t==="script"&&a.querySelector(ti(u))))){var h=a.createElement("link");Nt(h,"link",e),t==="style"&&(h[Ei]=!0,h.onload=h.onerror=function(){Cf(h)}),ht(h),a.head.appendChild(h)}}}function $y(e,t){Wn.m(e,t);var n=Ja;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+nn(a)+'"][href="'+nn(e)+'"]',u=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Fa(e)}if(!dn.has(u)&&(e=q({rel:"modulepreload",href:e},t),dn.set(u,e),n.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ti(u)))return}a=n.createElement("link"),Nt(a,"link",e),ht(a),n.head.appendChild(a)}}}function Yy(e,t,n){Wn.S(e,t,n);var a=Ja;if(a&&e){var c=ma(a).hoistableStyles,u=Ia(e);t=t||"default";var h=c.get(u);if(!h){var b={loading:0,preload:null};if(h=a.querySelector(ei(u)))b.loading=5;else{e=q({rel:"stylesheet",href:e,"data-precedence":t},n),(n=dn.get(u))&&Yo(e,n);var T=h=a.createElement("link");ht(T),Nt(T,"link",e),T._p=new Promise(function(R,B){T.onload=R,T.onerror=B}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Bc(h,t,a)}h={type:"stylesheet",instance:h,count:1,state:b},c.set(u,h)}}}function Gy(e,t){Wn.X(e,t);var n=Ja;if(n&&e){var a=ma(n).hoistableScripts,c=Fa(e),u=a.get(c);u||(u=n.querySelector(ti(c)),u||(e=q({src:e,async:!0},t),(t=dn.get(c))&&Go(e,t),u=n.createElement("script"),ht(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function Xy(e,t){Wn.M(e,t);var n=Ja;if(n&&e){var a=ma(n).hoistableScripts,c=Fa(e),u=a.get(c);u||(u=n.querySelector(ti(c)),u||(e=q({src:e,async:!0,type:"module"},t),(t=dn.get(c))&&Go(e,t),u=n.createElement("script"),ht(u),Nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function gg(e,t,n,a){var c=(c=nl.current)?Ps(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Ia(n.href),t=ma(c).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=Ia(n.href);var u=ma(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(ei(e)))?u._p||(h.instance=u,h.state.loading=5):(u=dn.get(e),u||(u={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},dn.set(e,u)),Qy(c,e,u,h.state))),t&&a===null)throw Error(o(528,""));return h}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Fa(n),t=ma(c).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(o(444,e))}}function Ia(e){return'href="'+nn(e)+'"'}function ei(e){return'link[rel="stylesheet"]['+e+"]"}function vg(e){return q({},e,{"data-precedence":e.precedence,precedence:null})}function Qy(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ei]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Ei]=!0,t.onload=t.onerror=Cf.bind(null,t),Nt(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 Fa(e){return'[src="'+nn(e)+'"]'}function ti(e){return"script[async]"+e}function xg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+nn(n.href)+'"]');if(a)return t.instance=a,ht(a),a;var c=q({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ht(a),Nt(a,"style",c),Bc(a,n.precedence,e),t.instance=a;case"stylesheet":c=Ia(n.href);var u=e.querySelector(ei(c));if(u)return t.state.loading|=4,t.instance=u,ht(u),u;a=vg(n),(c=dn.get(c))&&Yo(a,c),u=(e.ownerDocument||e).createElement("link"),ht(u);var h=u;return h._p=new Promise(function(b,T){h.onload=b,h.onerror=T}),Nt(u,"link",a),t.state.loading|=4,Bc(u,n.precedence,e),t.instance=u;case"script":return u=Fa(n.src),(c=e.querySelector(ti(u)))?(t.instance=c,ht(c),c):(a=n,(c=dn.get(u))&&(a=q({},n),Go(a,c)),e=e.ownerDocument||e,c=e.createElement("script"),ht(c),Nt(c,"link",a),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Bc(a,n.precedence,e));return t.instance}function Bc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=a.length?a[a.length-1]:null,u=c,h=0;h<a.length;h++){var b=a[h];if(b.dataset.precedence===t)u=b;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Yo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Go(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Lc=null;function bg(e,t,n){if(Lc===null){var a=new Map,c=Lc=new Map;c.set(n,a)}else c=Lc,a=c.get(n),a||(a=new Map,c.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[gs]||u[xt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var h=u.getAttribute(t)||"";h=e+h;var b=a.get(h);b?b.push(u):a.set(h,[u])}}return a}function Xo(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Vy(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 yg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function jg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ng(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=kg(t),e.suspenseyImages.push(t)),e=Jy.bind(e),t.decode().then(e,e))}function Zy(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 c=Ia(a.href),u=t.querySelector(ei(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ni.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,ht(u);return}u=t.ownerDocument||t,a=vg(a),(c=dn.get(c))&&Yo(a,c),u=u.createElement("link"),ht(u);var h=u;h._p=new Promise(function(b,T){h.onload=b,h.onerror=T}),Nt(u,"link",a),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ni.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var qc=0;function Ky(e,t){return e.stylesheets&&e.count===0&&Yc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&qc===0&&(qc=62500*fy());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yc(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>qc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(c)}}:null}function Sg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Yc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ni(){this.count--,Sg(this)}function Jy(){this.imgCount--,Sg(this)}var $c=null;function Yc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$c=new Map,t.forEach(Iy,e),$c=null,ni.call(e))}function Iy(e,t){if(!(t.state.loading&4)){var n=$c.get(e);if(n)var a=n.get(null);else{n=new Map,$c.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var h=c[u];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),a=h)}a&&n.set(null,a)}c=t.instance,h=c.getAttribute("data-precedence"),u=n.get(h)||a,u===a&&n.set(null,c),n.set(h,c),this.count++,a=ni.bind(this),c.addEventListener("load",a),c.addEventListener("error",a),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Wa={$$typeof:Me,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function Fy(e,t,n,a,c,u,h,b,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=Nr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nr(0),this.hiddenUpdates=Nr(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.transitionTypes=null,this.incompleteTransitions=new Map}function wg(e,t,n,a,c,u,h,b,T,R,B,Y){return e=new Fy(e,t,n,h,T,R,B,Y,b),t=1,u===!0&&(t|=24),u=Ut(3,null,null,t),e.current=u,u.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},ru(u),e}function Tg(e){return e?(e=Sa,e):Sa}function Eg(e,t,n,a,c,u){c=Tg(c),a.context===null?a.context=c:a.pendingContext=c,a=hl(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=ml(e,a,t),n!==null&&(qt(n,e,t),Ms(n,e,t))}function Cg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qo(e,t){Cg(e,t),(e=e.alternate)&&Cg(e,t)}function zg(e){if(e.tag===13||e.tag===31){var t=Hl(e,67108864);t!==null&&qt(t,e,67108864),Qo(e,67108864)}}function Ag(e){if(e.tag===13||e.tag===31){var t=Pt();t=Sr(t);var n=Hl(e,t);n!==null&&qt(n,e,t),Qo(e,t)}}var Pa=!0;function Wy(e,t,n,a){var c=U.T;U.T=null;var u=I.p;try{I.p=2,Vo(e,t,n,a)}finally{I.p=u,U.T=c}}function Py(e,t,n,a){var c=U.T;U.T=null;var u=I.p;try{I.p=8,Vo(e,t,n,a)}finally{I.p=u,U.T=c}}function Vo(e,t,n,a){if(Pa){var c=Zo(a);if(c===null)Eo(e,t,a,Gc,n),_g(e,a);else if(tj(c,e,t,n,a))a.stopPropagation();else if(_g(e,a),t&4&&-1<ej.indexOf(e)){for(;c!==null;){var u=ha(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=_l(u.pendingLanes);if(h!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;h;){var T=1<<31-Vt(h);b.entanglements[1]|=T,h&=~T}Rn(u),(De&6)===0&&(Cc=Xt()+500,Js(0))}}break;case 31:case 13:b=Hl(u,2),b!==null&&qt(b,u,2),Oc(),Qo(u,2)}if(u=Zo(a),u===null&&Eo(e,t,a,Gc,n),u===c)break;c=u}c!==null&&a.stopPropagation()}else Eo(e,t,a,null,n)}}function Zo(e){return e=Or(e),Ko(e)}var Gc=null;function Ko(e){if(Gc=null,e=Ml(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 Gc=e,null}function Og(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(fb()){case gf:return 2;case vf:return 8;case ki:case hb:return 32;case xf:return 268435456;default:return 32}default:return 32}}var Jo=!1,Tl=null,El=null,Cl=null,li=new Map,ai=new Map,zl=[],ej="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 _g(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":li.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(t.pointerId)}}function si(e,t,n,a,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[c]},t!==null&&(t=ha(t),t!==null&&zg(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function tj(e,t,n,a,c){switch(t){case"focusin":return Tl=si(Tl,e,t,n,a,c),!0;case"dragenter":return El=si(El,e,t,n,a,c),!0;case"mouseover":return Cl=si(Cl,e,t,n,a,c),!0;case"pointerover":var u=c.pointerId;return li.set(u,si(li.get(u)||null,e,t,n,a,c)),!0;case"gotpointercapture":return u=c.pointerId,ai.set(u,si(ai.get(u)||null,e,t,n,a,c)),!0}return!1}function Mg(e){var t=Ml(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,wf(e.priority,function(){Ag(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,wf(e.priority,function(){Ag(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 Xc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zo(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Ar=a,n.target.dispatchEvent(a),Ar=null}else return t=ha(n),t!==null&&zg(t),e.blockedOn=n,!1;t.shift()}return!0}function Rg(e,t,n){Xc(e)&&n.delete(t)}function nj(){Jo=!1,Tl!==null&&Xc(Tl)&&(Tl=null),El!==null&&Xc(El)&&(El=null),Cl!==null&&Xc(Cl)&&(Cl=null),li.forEach(Rg),ai.forEach(Rg)}function Qc(e,t){e.blockedOn===t&&(e.blockedOn=null,Jo||(Jo=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,nj)))}var Vc=null;function Dg(e){Vc!==e&&(Vc=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Vc===e&&(Vc=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],c=e[t+2];if(typeof a!="function"){if(Ko(a||n)===null)continue;break}var u=ha(n);u!==null&&(e.splice(t,3),t-=3,zu(u,{pending:!0,data:c,method:n.method,action:a},a,c))}}))}function es(e){function t(T){return Qc(T,e)}Tl!==null&&Qc(Tl,e),El!==null&&Qc(El,e),Cl!==null&&Qc(Cl,e),li.forEach(t),ai.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);)Mg(n),n.blockedOn===null&&zl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var c=n[a],u=n[a+1],h=c[Dt]||null;if(typeof u=="function")h||Dg(n);else if(h){var b=null;if(u&&u.hasAttribute("formAction")){if(c=u,h=u[Dt]||null)b=h.formAction;else if(Ko(c)!==null)continue}else b=h.action;typeof b=="function"?n[a+1]=b:(n.splice(a,3),a-=3),Dg(n)}}}function Ug(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,c=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),c!==null&&(c(),c=null)}}}function Io(e){this._internalRoot=e}Zc.prototype.render=Io.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,a=Pt();Eg(n,a,e,t,null,null)},Zc.prototype.unmount=Io.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Eg(e.current,2,null,e,null,null),Oc(),t[fa]=null}};function Zc(e){this._internalRoot=e}Zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sf();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&&Mg(e)}};var Hg=i.version;if(Hg!=="19.3.1")throw Error(o(527,Hg,"19.3.1"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var lj={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{hs=Kc.inject(lj),Qt=Kc}catch{}}return ci.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,a="",c=Tm,u=Em,h=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=wg(e,1,!1,null,null,n,a,null,c,u,h,Ug),e[fa]=t.current,To(e),new Io(t)},ci.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var a=!1,c="",u=Tm,h=Em,b=Cm,T=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=wg(e,1,!0,t,n??null,a,c,T,u,h,b,Ug),t.context=Tg(null),n=t.current,a=Pt(),a=Sr(a),c=hl(a),c.callback=null,ml(n,c,a),n=a,t.current.lanes=n,ps(t,n),Rn(t),e[fa]=t.current,To(e),new Zc(t)},ci.version="19.3.1",ci}var Zg;function mj(){if(Zg)return Wo.exports;Zg=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(),Wo.exports=hj(),Wo.exports}var pj=mj(),w=Md();const gj=["searxng","exa","tavily","brave","serper","jina","firecrawl","perplexity","youcom","ollama"];function Zv(){return gj.map(l=>({name:l,enabled:!1}))}class Ze extends Error{constructor(r,o){super(o);Ye(this,"status");this.status=r}}async function se(l,i){let r;try{r=await fetch(l,{credentials:"same-origin",...i})}catch(d){throw new Ze(0,`无法连接 Hob:${d instanceof Error?d.message:String(d)}`)}if(!r.ok){let d=`${r.status} ${r.statusText}`;try{const f=await r.json();f!=null&&f.error&&(d=f.error)}catch{}throw new Ze(r.status,d)}if(r.status===204)return;const o=await r.text();return o?JSON.parse(o):void 0}function nt(l,i="POST"){return{method:i,headers:{"content-type":"application/json"},body:JSON.stringify(l)}}const vj=["assistant","assistant_removed","item","delta","job","delegation","job_step","activity","approval","draft","routine","routine_removed","profile"],xj={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,r)=>se(`/api/skills/import/${l}`,nt({ids:i,overwrite:r})),deleteSkill:l=>se(`/api/skills/${encodeURIComponent(l)}`,{method:"DELETE"}),search:()=>se("/api/search"),putSearch:(l,i,r)=>se("/api/search",nt({revision:l,providers:i,keys:r},"PUT")),testSearch:(l,i,r)=>se("/api/search/test",nt({name:l,baseUrl:i,apiKey:r})),imageKey:()=>se("/api/image"),putImage:(l,i,r)=>se("/api/image",nt({revision:l,image:i,...r?{apiKey:r}:{}},"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 r=i.toString();return se(`/api/jobs${r?`?${r}`:""}`)},upload:async l=>{var o;const i=new FormData;i.append("file",l);const r=await se("/api/uploads",{method:"POST",body:i});if(!((o=r.file)!=null&&o.path))throw new Error("上传响应缺少文件路径");return r.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(r=>r.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:r},o)=>{const d=new EventSource(`/api/events${o?`?clientId=${encodeURIComponent(o)}`:""}`);let f=!1;const g=p=>{try{l(JSON.parse(p.data))}catch{}};d.onmessage=g;for(const p of vj)d.addEventListener(p,g);return d.onerror=()=>{f=!0,r(d.readyState===EventSource.CLOSED?"实时连接已断开":"实时连接中断,正在重连")},d.onopen=()=>{f&&(f=!1,i())},()=>d.close()}},bj=60;function yj(l,i){return l.at===i.at?0:l.at<i.at?-1:1}function Kv(l,i,r=bj){const o=Array.isArray(i)?i:[i];if(!o.length)return l;const d=l.slice(),f=new Map;d.forEach((g,p)=>f.set(g.id,p));for(const g of o){const p=f.get(g.id);p===void 0?(f.set(g.id,d.length),d.push(g)):d[p]=g}return d.sort(yj),d.length>r?d.slice(-r):d}function jj(l,i,r){const o=l.findIndex(g=>g.id===i);if(o<0)return l;const d=l[o];if(d.kind!=="assistant")return l;const f=l.slice();return f[o]={...d,text:d.text+r},f}function Jv(l){const i=l[l.length-1];return(i==null?void 0:i.kind)==="assistant"&&!!i.streaming}function kj(l,i){return l.state==="writing"&&!i.seen&&!i.closed&&i.inChat&&l.assistantId===i.assistantId}function Nj(l,i){return l.filter(r=>r.assistantId===i&&r.state==="writing")}const Sj=900,ss=new Map;function Iv(l){for(const i of l)ss.has(i)||ss.set(i,window.setTimeout(()=>ss.delete(i),Sj))}function wj(l){return ss.has(l)}function Tj(){for(const l of ss.values())window.clearTimeout(l);ss.clear()}function Un(l,i=180){const[r,o]=w.useState(l);return w.useEffect(()=>{if(l){o(!0);return}const d=window.setTimeout(()=>o(!1),i);return()=>window.clearTimeout(d)},[l,i]),{mounted:r,leaving:r&&!l}}function Fv(l,i,r="",o=200){const[d,f]=w.useState([]),[g,p]=w.useState([]),m=w.useRef(null),x=w.useRef(r),y=w.useRef([]),k=w.useRef([]);return w.useEffect(()=>{const E=l.map(i);if(m.current===null||x.current!==r){m.current=new Set(E),x.current=r,y.current=l;return}const j=E.filter(N=>!m.current.has(N)),v=y.current.filter(N=>!E.includes(i(N)));if(m.current=new Set(E),y.current=l,j.length&&(f(N=>[...N,...j]),k.current.push(window.setTimeout(()=>f(N=>N.filter(A=>!j.includes(A))),1e3))),v.length){const N=v.map(A=>({item:A,key:i(A),state:"leave"}));p(A=>[...A,...N]),k.current.push(window.setTimeout(()=>p(A=>A.filter(O=>!N.some(V=>V.key===O.key))),o))}},[l,i,r,o]),w.useEffect(()=>{const E=k.current;return()=>{for(const j of E)window.clearTimeout(j)}},[]),[...l.map(E=>{const j=i(E);return{item:E,key:j,state:d.includes(j)?"enter":"still"}}),...g]}const lr=["off","minimal","low","medium","high","xhigh","max"],Pc={off:"关闭",minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"很高",max:"最高"},Ej=40;function Cj(l,i){return i?/gpt/i.test(l)?lr.slice(0,6):[...lr]:["off"]}function zj(l,i){return i==="google-generative-ai"||i==="google-vertex"?"high":l}function Aj(l,i,r,o){if(!i)return{levels:["off"],chars:{},map:{}};const d=Cj(l,i),f=[],g={},p={};for(const m of lr){const x=r==null?void 0:r[m];if(!(x!==void 0?x!==null:d.includes(m))){p[m]=null;continue}f.push(m);const k=typeof x=="string"?x.trim():"";g[m]=k,k?p[m]=k:(m==="xhigh"||m==="max")&&(p[m]=zj(m,o))}return{levels:f,chars:g,map:p}}function Oj(l){if(!l||typeof l!="object"||Array.isArray(l))return;const i=l,r={};let o=!1;for(const d of lr){if(!(d in i))continue;o=!0;const f=i[d];if(f===null){r[d]=null;continue}const g=typeof f=="string"?f.trim():"";r[d]=g.length<=Ej?g:""}if(o)return r.off===null&&(r.off=""),r}const Wv={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"}},$t=(()=>{let l=0;return i=>`${i}${++l}`})();function J(l,i,r=0){const o=new Date;return o.setDate(o.getDate()-l),o.setHours(i,r,0,0),o.toISOString()}function Ge(l){return new Date(Date.now()-l*6e4).toISOString()}function he(l){return JSON.parse(JSON.stringify(l))}const _j=[{at:Ge(6),verb:"$",text:"npm run typecheck"},{at:Ge(5),verb:"读",text:"protocol/src/projection.ts"},{at:Ge(4),verb:"读",text:"client/src/runtime/store.ts"},{at:Ge(3),verb:"跑",text:"npm test -w protocol"},{at:Ge(2),verb:"读",text:"client/src/chat/Transcript.tsx"},{at:Ge(1),verb:"读",text:"client/src/chat/ToolRow.tsx"}];function Mj(l){const i=l==="s1"||l==="s6",r=l==="s4",o=i||l==="mlist",d=!o&&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,me,Oe,Ke,Pe,oe,Qe,Me,F)=>({id:L,assistantId:me,title:Oe,detail:Ke,options:Pe,status:oe?"answered":"pending",chosen:oe?Qe:void 0,source:"router",ruleText:F,createdAt:Me,answeredAt:oe?Me:void 0}),m={"ap-publish":g("ap-publish","page","发到公众号吗?",void 0,he([{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:"暂不创建"}],!o,"A",J(0,10,15))},x={id:"d-bird",assistantId:"hob",status:r?"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:r?void 0:"bird",createdAt:J(0,10,17)},y={id:"t-0931",assistantId:"hob",title:"排查页面卡顿",instruction:"排查页面卡顿的原因,不要修改代码。",status:"running",createdAt:Ge(6),startedAt:Ge(6),stats:{reads:14,commands:3,edits:0},cwd:"/srv/example/site",activity:he(_j)},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:Ge(58),startedAt:Ge(58),endedAt:Ge(51),stats:{reads:6,commands:2,edits:0},summary:"新增 312 张,重复跳过 87 张,占用 4.2GB。",activity:[{at:Ge(57),verb:"读",text:"/mnt/nas/photos"},{at:Ge(55),verb:"跑",text:"rsync -a --ignore-existing /sdcard/DCIM /mnt/nas/photos/"},{at:Ge(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:[]}],j=(L,me,Oe,Ke)=>({kind:"assistant",id:L,at:me,text:Oe,routine:Ke}),N=[j("i-h1",J(0,8,0),`早上好。昨晚交代的两件事均已完成:
50
+
51
+ - 写作已将周报初稿存入草稿箱
52
+ - 服务器凌晨 3 点清理了 2.1GB 旧日志`),{kind:"user",id:"i-h3",at:J(0,10,5),text:"页面为什么这么卡?排查一下原因,不要修改代码。"},j("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 条即可,不要包含融资新闻。"},j("i-h8",J(0,10,17),"草稿如下,需要修改请直接说明:"),{kind:"draft",id:"i-h9",at:J(0,10,17),draftId:"d-bird"});const A=r?N.filter(L=>!["i-h2","i-h3","i-h4","i-h5"].includes(L.id)):N,O=[j("i-p1",J(1,17,5),"周报初稿已完成,存放在草稿箱。"),{kind:"user",id:"i-p2",at:J(1,17,6),text:l==="mchat"?"好,周一发布。":"标题再短一些。"},j("i-p3",J(1,17,8),l==="mchat"?"好的,周一发布时我会再提醒你。":"已改为《这周:Hob 立项》。"),j("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:"已记入写作的规则 · 发布公众号无需确认"},j("i-p8",J(0,7,44),"已发布。[查看文章](https://mp.weixin.qq.com/)"),{kind:"user",id:"i-p9",at:J(0,10,20),text:"以后周报也由你负责,周五下午提供初稿。"},j("i-p10",J(0,10,20),"好的。每周五 17:00 撰写初稿,存入草稿箱,完成后通知你。"),{kind:"note",id:"i-p11",at:J(0,10,21),icon:"routine",text:"新增定时任务 · 周报初稿 · 每周五 17:00"});const V=[{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 条记忆`},j("i-b1",J(1,9,0),"昨天 5 条,没有特别要紧的。[看全部 5 条](https://example.com/)",{id:"r-daily",name:"每日简报"}),j("i-b2",J(0,9,0),"今天 6 条,挑选 2 条重点:",{id:"r-daily",name:"每日简报"}),j("i-b3",J(0,9,0),`1. DeepSeek 公开 Super-agent 设计:路由只分派,任务隔离执行。
53
+ 2. xAI 的 Grok Bot:常驻 Bot 加定时任务,结果直接回到对话。
54
+
55
+ [看全部 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 加定时任务…"}},j("i-b5",J(0,9,12),"它的 Bot 有一台云电脑,能直接操作网页;Bot 之间也能互相发消息。定时任务、审批、助手创建,我们均已具备。"),{kind:"user",id:"i-b6",at:J(0,9,14),text:"以后不需要包含融资新闻。"},j("i-b7",J(0,9,14),"好的,已记录。"),{kind:"note",id:"i-b8",at:J(0,9,14),icon:"memory",text:"记忆已更新 · 不包含融资新闻"}],ee=(L,me,Oe,Ke)=>[j(`${L}-1`,J(1,20,0),me),{kind:"user",id:`${L}-2`,at:J(1,20,2),text:Oe},j(`${L}-3`,J(1,20,3),Ke)],ne={hob:A,page:O,bird:V,server:[...ee("i-s","凌晨清理日志的任务已完成,清理 2.1GB,服务均正常运行。","好的,以后每月清理一次。","已记录:每月 1 号凌晨 3 点清理一次。"),{kind:"job",id:"i-s4",at:J(1,3,5),jobId:"t-0927"}],house:ee("i-ho","相册备份已完成,新增 312 张,占用 4.2GB。","硬盘还剩多少?","剩余 1.8TB,可用约半年。"),coin:ee("i-c","10 月账单已整理完成,比上月减少 12%。","哪一类支出较多?","餐饮和打车,比上月增加 800。"),book:ee("i-bk","本周读书笔记已整理完成,共三条。","发给我看看。","已放入文件中。"),leaf:ee("i-lf","本周三次训练已记录。","下周增加到四次。","好的,下周安排四次。")},K={},q={"t-0931":y,"t-0927":k,"t-0929":S};if(l.startsWith("d-")){const L=l==="d-waiting"||l==="d-mobile"?"waiting":l==="d-done"?"done":"running",me={id:"dg-demo",from:"hob",to:"server",text:"检查服务器磁盘和服务状态,清理前先确认,不要影响正在运行的服务。",createdAt:Ge(6),status:L,jobIds:["t-delegated"],approvalIds:[]};K[me.id]=me,q["t-delegated"]={...y,id:"t-delegated",assistantId:"server",delegationId:me.id,title:"检查服务器状态",status:L==="waiting"?"waiting":L},L==="waiting"&&(m["ap-delegation"]={id:"ap-delegation",assistantId:"server",title:"清理旧日志吗?",detail:"将清理七天前的日志。",options:[{key:"A",label:"清理旧日志"},{key:"B",label:"暂不清理"}],status:"pending",source:"job",jobId:"t-delegated",createdAt:Ge(2)}),ne.hob=[{kind:"user",id:"d-user",at:Ge(7),text:"检查一下服务器的磁盘和服务状态。"},{kind:"delegation",id:"d-card",at:Ge(6),delegationId:me.id}],ne.server=[{kind:"user",id:"d-forward",at:Ge(6),text:me.text,from:{assistantId:"hob",name:"Hob",delegationId:me.id}},{kind:"job",id:"d-job",at:Ge(5),jobId:"t-delegated"},...L==="waiting"?[{kind:"question",id:"d-question",at:Ge(2),approvalId:"ap-delegation"}]:[]]}if(l.startsWith("h-")){const L=f.find(me=>me.id==="server");L&&(L.dutyLong="维护服务器、监控服务状态和磁盘空间;代理配置由其他助手负责。"),K["dg-returned"]={id:"dg-returned",from:"hob",to:"server",text:"检查代理节点为什么无法连接。",createdAt:Ge(4),status:"returned",reply:"退回:代理配置不属于服务器维护职责。",jobIds:[]},ne.hob=[{kind:"user",id:"h-forward",at:Ge(8),text:"检查代理节点为什么无法连接。",from:{assistantId:"server",name:"服务器",delegationId:"hb-demo"}},{kind:"delegation",id:"h-card",at:Ge(4),delegationId:"dg-returned"}],ne.server=[{kind:"user",id:"h-user",at:Ge(9),text:"检查代理节点为什么无法连接。"},{kind:"note",id:"h-note",at:Ge(8),icon:"info",text:"已交回 Hob:代理配置不属于我的职责。",handbackId:"hb-demo"},{kind:"user",id:"h-delegation-forward",at:Ge(4),text:"检查代理节点为什么无法连接。",from:{assistantId:"hob",name:"Hob",delegationId:"dg-returned"}}]}return{assistants:f,items:ne,jobs:q,delegations:K,approvals:m,drafts:{"d-bird":x},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:Ge(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"?"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},...Zv().filter(L=>L.name!=="searxng"&&L.name!=="exa")],work:{maxJobs:2,jobStallMinutes:15,routerStallMinutes:6},push:{email:""}}}}}const Rj={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:[]},Kg={keyConfigured:!0},Dj=[{id:"anthropic",name:"Anthropic"},{id:"openai",name:"OpenAI"},{id:"google",name:"Google"},{id:"deepseek",name:"DeepSeek"},{id:"openrouter",name:"OpenRouter"}],Uj={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 ld(l,i){return(l.kind==="custom"?l.models.map(o=>{var d;return{id:o.id,name:((d=o.name)==null?void 0:d.trim())||o.id,reasoning:o.reasoning===!0}}):Uj[l.id]??[]).map(o=>{const d=`${l.id}/${o.id}`,f=i==null?void 0:i[d],g=Aj(o.id,o.reasoning,f,l.kind==="custom"?l.api:void 0);return{ref:d,id:o.id,name:o.name,reasoning:o.reasoning,levels:g.levels.map(p=>({level:p,text:g.chars[p]??""})),custom:f!==void 0}})}const Hj="/Users/me/.pi/agent",Bj="/Users/me/.lore",Lj=[{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:"登录授权类凭据无法导入。"}],qj={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 $j(l="s1"){const i=Mj(l),r=new Set,o=j=>r.forEach(v=>v(j)),d=j=>i.assistants.find(v=>v.id===j),f=new Set(["anthropic","my-proxy"]),g=()=>({providers:i.settings.settings.providers.map(j=>({...j,keyConfigured:f.has(j.id)})),builtin:he(Dj),settings:he(i.settings),models:Object.fromEntries(i.settings.settings.providers.map(j=>[j.id,ld(j,i.settings.settings.models.thinking)]))}),p={revision:i.settings.revision,provider:"local",providerExplicit:!1,lore:{configured:!1,baseUrl:null,source:"none",tokenConfigured:!1}},m=[{endpoint:"https://push.example/mock-iphone",label:"iPhone",createdAt:new Date(Date.now()-3*864e5).toISOString()}],x=()=>({publicKey:"BOmockVapidPublicKeyForPreviewOnly",email:i.settings.settings.push.email,devices:he(m)}),y=j=>{const v=[];return j.activity.forEach((N,A)=>{if(N.verb==="$")return;const O=N.verb==="读"?"read":N.verb==="跑"?"bash":N.verb==="改"?"edit":N.verb==="说"?"report":"ls";v.push({id:`mock-${j.id}-${A}`,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}
56
+ `,durationMs:120})}),j.id==="t-0931"&&v.push({id:"mock-search",kind:"tool",at:j.createdAt,name:"web_search",title:"联网搜索:浏览器页面性能优化",args:{query:"浏览器页面性能优化"},output:"演示结果:网页性能优化指南。",durationMs:120}),v};function k(j,v){const N=d(j);N&&(Object.assign(N,v),o({type:"assistant",assistant:he(N)}))}function S(j,v){var O;const N=(O=i.items)[j]??(O[j]=[]),A=N.findIndex(V=>V.id===v.id);A>=0?N[A]=v:N.push(v),o({type:"item",assistantId:j,item:v})}function E(j,v){k(j,{last:{text:v,at:new Date().toISOString()}})}return{me:async()=>{},login:async()=>{},logout:async()=>{},bootstrap:async()=>({assistants:he(i.assistants),jobs:he(Object.values(i.jobs)),delegations:he(Object.values(i.delegations)),routines:he(i.routines),approvals:he(Object.values(i.approvals).filter(j=>j.status==="pending")),settings:he(i.settings)}),settings:async()=>he(i.settings),models:async()=>({...he(Rj),roster:he(i.settings.settings.models.roster)}),providers:async()=>g(),putThinking:async j=>{const v=i.settings.settings.providers.find(ee=>j.ref.startsWith(`${ee.id}/`)),N=v?ld(v,i.settings.settings.models.thinking).find(ee=>ee.ref===j.ref):void 0;if(!v||!N)throw new Ze(400,`模型 ${j.ref} 不在已配置的服务商里。`);const A={...i.settings.settings.models.thinking??{}},O=j.levels===null?void 0:Oj(j.levels);O?A[j.ref]=O:delete A[j.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(A).length?{thinking:A}:{}}}};const V=ld(v,i.settings.settings.models.thinking).find(ee=>ee.ref===j.ref);return{settings:he(i.settings),thinking:V}},putProvider:async(j,v)=>{const N=v,A={...N,id:j};delete A.key;const O=i.settings.settings.providers.filter(V=>V.id!==j);return i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:[...O,A]}},N.key&&f.add(j),g()},deleteProvider:async j=>(i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:i.settings.settings.providers.filter(v=>v.id!==j)}},f.delete(j),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:Hj,items:Lj.map(j=>({...j,exists:j.exists||i.settings.settings.providers.some(v=>v.id===j.id)}))}),importProviders:async j=>{const v=j.map(A=>qj[A]).filter(A=>A!==void 0);if(!v.length)throw new Ze(400,"没有可导入的服务商:请选择状态为可导入的项目。");const N=i.settings.settings.providers.filter(A=>!v.some(O=>O.id===A.id));i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,providers:[...N,...v]}};for(const A of v)f.add(A.id);return g()},testProvider:async()=>{},imageKey:async()=>he(Kg),putImage:async(j,v,N)=>{if(j!==i.settings.revision)throw new Ze(409,"设置已在别处修改,已刷新");return i.settings={revision:i.settings.revision+1,settings:{...i.settings.settings,image:v}},{settings:he(i.settings),keyConfigured:!!N||Kg.keyConfigured}},skills:async()=>{var N;const j=((N=i.settings.settings.skills)==null?void 0:N.disabled)??[],v=(A,O,V,ee,ne=!1)=>({id:A,name:A,description:V,source:O,content:ee,enabled:!j.includes(`${O}:${A}`),overridden:ne});return{skills:[v("weekly-report","hob","按固定结构整理本周进展、风险和下周计划,生成可直接发出的周报。",`# 周报
57
+
58
+ 1. 汇总本周完成的事项
59
+ 2. 列出风险和需要的支持
60
+ 3. 写下周计划`),v("research","hob","查阅可靠来源,交叉核对后整理结论,并为每条结论注明出处。",`# 研究
61
+
62
+ 查阅可靠来源,整理结论并注明出处。`),v("server-checkup","hob","检查主机的磁盘、内存、服务状态和最近的错误日志,给出处理建议。",`# 主机巡检
63
+
64
+ 逐台检查磁盘、内存、服务与日志。`),v("browser","common","在浏览器中打开页面、操作并截图,验证改动是否生效。",`# 浏览器
65
+
66
+ 通过浏览器检查和验证页面。`),v("pdf","common","读取、拆分、合并 PDF,提取其中的表格和文字。",`# PDF
67
+
68
+ 处理 PDF 文件。`),v("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(j,v)=>({imported:v,skipped:[],errors:[]}),deleteSkill:async()=>{},search:async()=>({providers:i.settings.settings.search.map(j=>({...j,keyConfigured:j.name==="exa"||j.name==="tavily"}))}),putSearch:async(j,v)=>{if(j!==i.settings.revision)throw new Ze(409,"设置已在别处修改,已刷新");return i.settings={revision:j+1,settings:{...i.settings.settings,search:v}},he(i.settings)},testSearch:async()=>({ok:!1,error:"演示模式不连接搜索服务商。"}),imageTest:async()=>({ok:!1,error:"演示模式不连接图像生成接口;正式运行时会实际生成图片。"}),putSettings:async(j,v)=>{var A;if(j!==i.settings.revision)throw new Ze(409,"设置已在别处修改,已刷新");const N=v.models??{};return i.settings={revision:i.settings.revision+1,settings:{general:{...i.settings.settings.general,...v.general??{},aboutYou:{...i.settings.settings.general.aboutYou,...((A=v.general)==null?void 0:A.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:v.skills??i.settings.settings.skills,work:{...i.settings.settings.work,...v.work??{}},push:{...i.settings.settings.push,...v.push??{}}}},he(i.settings)},changePassword:async j=>{if(j!=="test")throw new Ze(403,"旧密码不正确")},about:async()=>({version:"0.1.0",home:"/var/lib/hob"}),memory:async()=>he({...p,revision:i.settings.revision}),putMemory:async(j,v)=>{if(j!==i.settings.revision)throw new Ze(409,"设置已在别处修改,已刷新");if(v==="lore"&&!p.lore.configured)throw new Ze(400,"Lore 尚未配置:请先填写服务地址和 Token 并测试连接");return p.provider=v,p.providerExplicit=!0,i.settings.revision+=1,p.revision=i.settings.revision,he(p)},putLore:async j=>{const v=j.baseUrl.trim().replace(/\/+$/,"");if(!v)throw new Ze(400,"Lore 服务地址不能为空");const N=p.lore.baseUrl===v;return p.lore={configured:N?p.lore.tokenConfigured:!!j.token,baseUrl:v,source:"config",tokenConfigured:N?p.lore.tokenConfigured:!!j.token},he({...p,revision:i.settings.revision})},loreTest:async j=>{const v=(j.baseUrl??p.lore.baseUrl??"").trim().replace(/\/+$/,"");return v?v.startsWith("http://")&&!/^http:\/\/(localhost|127\.0\.0\.1|192\.168\.|10\.)/.test(v)?{ok:!1,reason:"insecure_http"}:!j.token&&!p.lore.tokenConfigured?{ok:!1,reason:"missing_token"}:{ok:!0,baseUrl:v}:{ok:!1,reason:"invalid_url"}},loreImport:async()=>({source:Bj,found:!0,baseUrl:"https://api.loremem.com",tokenPresent:!0}),importLore:async()=>(p.lore={configured:!0,baseUrl:"https://api.loremem.com",source:"config",tokenConfigured:!0},he({...p,revision:i.settings.revision})),items:async j=>({items:he(i.items[j]??[]),approvals:he(Object.values(i.approvals)),jobs:he(Object.values(i.jobs)),drafts:he(Object.values(i.drafts)),delegations:he(Object.values(i.delegations)),hasMore:!1}),profile:async j=>{const v=d(j);if(!v)throw new Error(`没有这个助手:${j}`);return{assistant:he(v),rules:he(i.rules[j]??[]),routines:he(i.routines.filter(A=>A.assistantId===j)),worklog:he(i.worklog[j]??[])}},sendMessage:async(j,v)=>{const N=new Date().toISOString(),A={kind:"user",id:$t("mock-u"),at:N,text:v.text,quote:v.quote,files:v.files&&v.files.length?v.files:void 0};return S(j,A),E(j,v.text),k(j,{busy:!0}),setTimeout(()=>{S(j,{kind:"assistant",id:$t("mock-a"),at:new Date().toISOString(),text:"收到。"}),E(j,"收到。"),k(j,{busy:!1})},320),{item:A}},stopAssistant:async j=>k(j,{busy:!1}),markRead:async j=>k(j,{unread:0}),patchAssistant:async(j,v)=>{var N;if(!d(j))throw new Ze(404,"助手不存在。");if(v.rule){const A=(N=i.rules)[j]??(N[j]=[]),O=v.rule.id===void 0?void 0:A.find(K=>K.id===v.rule.id);if(v.rule.id!==void 0&&!O)throw new Ze(404,"规则不存在。");const V=v.rule.text===void 0?(O==null?void 0:O.text)??"":v.rule.text.trim();if(!V||V.length>1e3)throw new Ze(400,"规则内容不能为空或超过 1000 字。");if(A.some(K=>K.id!==v.rule.id&&K.text===V))throw new Ze(400,"规则内容已存在。");const ee=v.rule.mode??(O==null?void 0:O.mode);if(ee!=="ask"&&ee!=="allow")throw new Ze(400,"规则模式无效。");const ne={id:(O==null?void 0:O.id)??$t("r-"),text:V,mode:ee,changedAt:new Date().toISOString()};return O?Object.assign(O,ne):A.push(ne),o({type:"profile",assistantId:j}),{rule:he(ne)}}k(j,v)},mergeAssistant:async j=>{var K,q;const v=d(j),N=i.assistants.find(L=>L.primary);if(!v)throw new Ze(404,"助手不存在");if(v.primary||!N)throw new Ze(400,"主助手不能并回自己");if(Object.values(i.jobs).filter(L=>L.assistantId===j&&(L.status==="running"||L.status==="queued"||L.status==="waiting")).length)throw new Ze(409,"请等任务结束后再并回");const O=i.routines.filter(L=>L.assistantId===j);for(const L of O)L.assistantId=N.id,o({type:"routine",routine:he(L)});const V=(K=i.rules)[q=N.id]??(K[q]=[]);let ee=0;for(const L of i.rules[j]??[])V.some(me=>me.text===L.text)||(V.push({...L,id:$t("rule")}),ee+=1);i.rules[j]=[];const ne=v.instructions.trim();ne&&(N.instructions=[N.instructions.trim(),`来自「${v.name}」:`,ne].filter(Boolean).join(`
69
+ `),o({type:"assistant",assistant:he(N)})),S(N.id,{kind:"note",id:$t("mock-n"),at:new Date().toISOString(),icon:"split",text:`已并回「${v.name}」:转来 ${O.length} 个定时任务、${ee} 条规则`}),i.assistants=i.assistants.filter(L=>L.id!==j),o({type:"assistant_removed",id:j}),o({type:"profile",assistantId:N.id})},deleteRule:async(j,v)=>{i.rules[j]=(i.rules[j]??[]).filter(N=>N.id!==v),o({type:"profile",assistantId:j})},answerApproval:async(j,v)=>{var O,V,ee,ne;const N=i.approvals[j];if(!N||N.status==="answered")return;N.status="answered",v.key?N.chosen=v.key:N.answerText=(v.text??"").trim(),N.answeredAt=new Date().toISOString();const A=N.options.find(K=>K.key===v.key);A!=null&&A.always&&N.ruleText&&(((O=i.rules)[V=N.assistantId]??(O[V]=[])).push({id:$t("rule"),text:N.ruleText,mode:"allow",changedAt:N.answeredAt}),S(N.assistantId,{kind:"note",id:$t("mock-n"),at:N.answeredAt,icon:"rule",text:`已记入${((ee=d(N.assistantId))==null?void 0:ee.name)??""}的规则 · ${N.ruleText}无需确认`}),o({type:"profile",assistantId:N.assistantId})),o({type:"approval",approval:he(N)});for(const K of Object.values(i.delegations))((K.approvalIds??[]).includes(N.id)||N.jobId&&K.jobIds.includes(N.jobId))&&(K.status="running",N.jobId&&((ne=i.jobs[N.jobId])==null?void 0:ne.status)==="waiting"&&(i.jobs[N.jobId].status="running",o({type:"job",job:he(i.jobs[N.jobId])})),o({type:"delegation",delegation:he(K)}))},retryDelegation:async j=>{const v=i.delegations[j];if(!v||v.status!=="interrupted")throw new Ze(400,"只有已中断的委派可以重新转交");const N={...v,id:$t("dg-"),status:"running",createdAt:new Date().toISOString(),jobIds:[],approvalIds:[],reportedAt:void 0,endedAt:void 0};i.delegations[N.id]=N,o({type:"delegation",delegation:he(N)}),S("hob",{kind:"delegation",id:$t("item-"),at:N.createdAt,delegationId:N.id}),S(N.to,{kind:"user",id:$t("item-"),at:N.createdAt,text:N.text,from:{assistantId:"hob",name:"Hob",delegationId:N.id}})},createDraft:async j=>{const v=i.drafts[j];v&&(v.status="created",v.createdAssistantId="bird",o({type:"draft",draft:he(v)}),S(v.assistantId,{kind:"note",id:$t("mock-n"),at:new Date().toISOString(),icon:"split",text:`专属助手已创建 · ${v.name}`}))},dismissDraft:async j=>{const v=i.drafts[j];v&&(v.status="dismissed",o({type:"draft",draft:he(v)}))},createRoutine:async j=>{const v={...j,id:$t("r"),createdAt:new Date().toISOString(),runs:[]};return i.routines.push(v),o({type:"routine",routine:he(v)}),he(v)},patchRoutine:async(j,v)=>{const N=i.routines.find(A=>A.id===j);N&&(Object.assign(N,v),o({type:"routine",routine:he(N)}))},deleteRoutine:async j=>{i.routines=i.routines.filter(v=>v.id!==j),o({type:"routine_removed",id:j})},runRoutine:async j=>{const v=i.routines.find(V=>V.id===j);if(!v)return;const N=new Date().toISOString(),A={id:$t("t-"),assistantId:v.assistantId,title:`${v.name}(立即运行)`,instruction:v.instruction,status:"running",createdAt:N,startedAt:N,stats:{reads:0,commands:0,edits:0},routineId:v.id,activity:[{at:N,verb:"$",text:`立即运行 ${v.name}`}]};i.jobs[A.id]=A;const O={jobId:A.id,at:N,status:"running"};v.runs=[O,...v.runs].slice(0,20),S(v.assistantId,{kind:"job",id:$t("mock-j"),at:N,jobId:A.id}),o({type:"job",job:he(A)}),o({type:"routine",routine:he(v)}),E(v.assistantId,`运行定时任务:${v.name}`)},replyJob:async(j,v)=>{const N=i.jobs[j];N&&(N.activity=[...N.activity,{at:new Date().toISOString(),verb:"说",text:v}],o({type:"activity",jobId:j,line:N.activity[N.activity.length-1],stats:he(N.stats)}))},transcript:async j=>{const v=i.jobs[j];if(!v)throw new Error(`没有这个任务:${j}`);return{job:he(v),steps:y(v)}},jobs:async(j={})=>{let v=Object.values(i.jobs).sort((O,V)=>V.createdAt.localeCompare(O.createdAt));if(j.assistantId&&(v=v.filter(O=>O.assistantId===j.assistantId)),j.status&&(v=v.filter(O=>O.status===j.status)),j.before){const O=v.findIndex(V=>V.id===j.before);O!==-1&&(v=v.slice(O+1))}const N=j.limit??30;return{jobs:he(v.slice(0,N)),hasMore:v.length>N}},stopJob:async j=>{const v=i.jobs[j];v&&(v.status="stopped",v.endedAt=new Date().toISOString(),o({type:"job",job:he(v)}))},upload:async j=>`mock://uploads/${encodeURIComponent(j.name)}`,fileUrl:(j,v)=>`data:text/plain;charset=utf-8,${encodeURIComponent(`mock 模式没有真实文件。
70
+
71
+ ${j}`)}`,fileMeta:async j=>{const v=j.split("/").pop()??j,N=v.lastIndexOf("."),A=N>0?v.slice(N).toLowerCase():"",O=A===".md"?"markdown":A===".csv"?"csv":A===".html"?"html":A===".json"?"json":"text";return{path:j,name:v,size:2048,modifiedAt:new Date().toISOString(),mime:"text/plain; charset=utf-8",kind:O,text:!0}},jobFiles:async j=>{if(!i.jobs[j])throw new Ze(404,"任务不存在");return{files:[],hasMore:!1}},push:async()=>x(),subscribePush:async(j,v)=>{const N=m.filter(A=>A.endpoint!==j.endpoint);return m.splice(0,m.length,...N,{endpoint:j.endpoint,label:v.trim()||"本机",createdAt:new Date().toISOString()}),x()},unsubscribePush:async j=>{const v=m.findIndex(N=>N.endpoint===j);return v>=0&&m.splice(v,1),x()},testPush:async()=>({sent:1,removed:0}),visibility:async()=>{},events:j=>(r.add(j.onEvent),()=>{r.delete(j.onEvent)})}}function Yj(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 Gj(l){const i=l.replace(/-/g,"+").replace(/_/g,"/"),r=i.padEnd(Math.ceil(i.length/4)*4,"="),o=atob(r),d=new Uint8Array(o.length);for(let f=0;f<o.length;f+=1)d[f]=o.charCodeAt(f);return d}function Rd(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window&&"Notification"in window}function Xj(l){var d,f;const i=l.toJSON(),r=((d=i.keys)==null?void 0:d.p256dh)??"",o=((f=i.keys)==null?void 0:f.auth)??"";return!i.endpoint||!r||!o?null:{endpoint:i.endpoint,keys:{p256dh:r,auth:o}}}async function Dd(){if(!Rd())return null;const l=await navigator.serviceWorker.getRegistration();return await(l==null?void 0:l.pushManager.getSubscription())??null}async function Qj(l){if(!Rd())return{error:"这个浏览器不支持推送"};let i=Notification.permission;if(i==="default")try{i=await Notification.requestPermission()}catch{return{error:"浏览器拒绝授予通知权限"}}if(i!=="granted")return{error:"浏览器未授予通知权限"};const r=await navigator.serviceWorker.getRegistration();if(!r)return{error:"离线页面尚未就绪,请刷新后重试"};let o=await r.pushManager.getSubscription();if(!o)try{o=await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Gj(l).buffer})}catch(f){return{error:`浏览器订阅推送失败:${f instanceof Error?f.message:String(f)}`}}const d=Xj(o);return d?{subscription:d}:{error:"浏览器返回的订阅信息不完整"}}function Vj(l,i){const r=l.findIndex(d=>d.id===i.id);if(r<0)return[...l,i];const o=l.slice();return o[r]=i,o}function Zj(l,i){const r=new Set(i.map(d=>d.id)),o=i.slice();for(const d of l)r.has(d.id)||o.push(d);return o}function Kj(l){var d;const i=[];let r=[];const o=()=>{if(!r.length)return;const f=r.join(`
72
+
73
+ `);return r=[],f};for(const f of l){if(f.kind==="thinking"){const p=(d=f.text)==null?void 0:d.trim();p&&r.push(p);continue}if(f.kind==="text"&&f.from==="user"){i.push(f);continue}const g=o();i.push(g?{...f,thinking:g}:f)}return{rows:i,thinking:o()??null}}const Jg=400,Jj=2e5,Ig=3;function Ij(l,i){const r=l===""?[]:l.split(`
74
+ `),o=i===""?[]:i.split(`
75
+ `);let d=0;for(;d<r.length&&d<o.length&&r[d]===o[d];)d+=1;let f=r.length,g=o.length;for(;f>d&&g>d&&r[f-1]===o[g-1];)f-=1,g-=1;const p=Math.min(d,Ig),m=Math.min(r.length-f,Ig),x=r.slice(d-p,d).map(y=>({sign:" ",text:y}));return x.push(...Fj(r.slice(d,f),o.slice(d,g))),x.push(...r.slice(f,f+m).map(y=>({sign:" ",text:y}))),x.length<=Jg?x:[...x.slice(0,Jg),{sign:" ",text:"…"}]}function Fj(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>Jj)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 r=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)r[g][p]=l[g]===i[p]?r[g+1][p+1]+1:Math.max(r[g+1][p],r[g][p+1]);const o=[];let d=0,f=0;for(;d<l.length&&f<i.length;)l[d]===i[f]?(o.push({sign:" ",text:l[d]}),d+=1,f+=1):r[d+1][f]>=r[d][f+1]?(o.push({sign:"-",text:l[d]}),d+=1):(o.push({sign:"+",text:i[f]}),f+=1);for(;d<l.length;)o.push({sign:"-",text:l[d++]});for(;f<i.length;)o.push({sign:"+",text:i[f++]});return o}const Wj=new Set(["排队中","进行中","待确认","已完成","受阻","失败","已停止"]);function Pv(l){var r;const i=(r=l.statusReason)==null?void 0:r.trim();if(!(!i||Wj.has(i)))return i}function Pj(l){return l.split(/`/).map((i,r)=>({text:i,mono:r%2===1})).filter(i=>i.text.length>0)}function e1(l,i){const r=l==="dark"||l==="system"&&i;return{dark:r,color:r?"#1b1b1d":"#f6f6f4"}}function t1(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 ex(l,i){var d;const r=document.documentElement;r.style.setProperty("--status-background",`var(--${t1(l,i)})`);const o=getComputedStyle(r).backgroundColor;(d=document.querySelector('meta[name="theme-color"]'))==null||d.setAttribute("content",o)}const n1={general:{theme:"system",timezone:"UTC",aboutYou:{name:"",language:"",notes:""}},providers:[],models:{roster:[],conversation:{ref:"",thinking:"low"},work:{ref:"",thinking:"high"}},image:{source:"off"},search:Zv(),work:{maxJobs:2,jobStallMinutes:15,routerStallMinutes:6},push:{email:""}},la=new URLSearchParams(location.search),rs=la.get("mock")==="1",l1=["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"],ad=la.get("scene"),Ud=ad&&l1.includes(ad)?ad:"s1",le=rs?$j(Ud):xj,Hd="hob.theme",tx=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;let Fg=!1;function Wg(l){return l==="assistant"||l==="now"?{kind:l}:l.startsWith("routine:")?{kind:"routine",id:l.slice(8)}:{kind:"now"}}function nx(){const l=localStorage.getItem(Hd);return l==="light"||l==="dark"||l==="system"?l:null}const lx=la.get("dark")==="1";function a1(){const l=Wv[rs?Ud:"s1"],i={phase:"loading",error:null,notice:null,offline:null,assistants:[],jobs:{},delegations:{},routines:[],approvals:{},drafts:{},settings:{revision:0,settings:n1},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:nx()??"system",query:"",quote:null,text:"",files:[],nonce:0,mobile:"list",sheet:!1,search:!1,menu:null,tick:0,updateReady:!1,loggingIn:!1};rs&&(i.sel=l.sel,i.panel=Wg(l.panel),i.collapsed=l.collapsed,i.mobile=l.mobile,i.theme=l.dark?"dark":"light");const r=la.get("a");r&&(i.sel=r);const o=la.get("panel");return o&&(i.panel=Wg(o)),la.get("collapsed")==="1"&&(i.collapsed=!0),lx&&(i.theme="dark"),i}let ce=a1();function s1(){return rs?Wv[Ud].mobile==="chat":!!la.get("a")||window.innerWidth>=768}rs||lx||nx();const gd=new Set;function G(l){ce={...ce,...typeof l=="function"?l(ce):l},gd.forEach(i=>i())}function i1(l){return gd.add(l),()=>gd.delete(l)}const ar=()=>ce;function we(){return w.useSyncExternalStore(i1,ar,ar)}function fe(l){return l instanceof Ze||l instanceof Error?l.message:String(l)}function jn(l){const i={};for(const r of l)i[r.id]=r;return i}function Pg(l,i){const r=l.findIndex(d=>d.id===i.id);if(r<0)return[...l,i];const o=l.slice();return o[r]=i,o}function c1(l,i){var o;const r=i.models??{};return{general:{...l.general,...i.general??{},aboutYou:{...l.general.aboutYou,...((o=i.general)==null?void 0:o.aboutYou)??{}}},models:{roster:r.roster??l.models.roster,conversation:r.conversation??l.models.conversation,work:r.work??l.models.work,thinkingChoice:r.thinkingChoice??l.models.thinkingChoice,...r.thinking??l.models.thinking?{thinking:r.thinking??l.models.thinking}:{}},image:l.image,search:l.search,providers:l.providers,work:{...l.work,...i.work??{}},push:{...l.push,...i.push??{}}}}let ev=Promise.resolve();function Bd(l){const i=ev.then(()=>r1(typeof l=="function"?l(ce.settings.settings):l));return ev=i.then(()=>{},()=>{}),i}async function r1(l){var o;const i=ce.settings,r={revision:i.revision,settings:c1(i.settings,l)};G({settings:r,theme:r.settings.general.theme}),(o=l.general)!=null&&o.theme&&na(l.general.theme);try{const d=await le.putSettings(i.revision,l);return G({settings:d,theme:d.settings.general.theme}),na(d.settings.general.theme),localStorage.setItem(Hd,d.settings.general.theme),!0}catch(d){if(d instanceof Ze&&d.status===409){try{const f=await le.settings();G({settings:f,theme:f.settings.general.theme}),na(f.settings.general.theme)}catch{G({settings:i})}return G({notice:"设置已在别处修改,已刷新"}),!1}return G({settings:i,theme:i.settings.general.theme,notice:`保存失败:${fe(d)}`}),na(i.settings.general.theme),!1}}async function u1(l,i){try{return await le.changePassword(l,i),null}catch(r){return fe(r)}}async function o1(){try{return await le.about()}catch(l){return G({notice:`无法读取版本信息:${fe(l)}`}),null}}async function Ld(){try{return await le.models()}catch(l){return G({notice:`无法读取模型列表:${fe(l)}`}),null}}async function qd(l){return G({settings:l.settings}),l}async function d1(){try{return{ok:!0,view:await le.providers()}}catch(l){return{ok:!1,error:fe(l)}}}async function tv(l,i){try{return{ok:!0,view:await qd(await le.putProvider(l,i))}}catch(r){return{ok:!1,error:fe(r)}}}async function f1(l,i){try{const r=await le.putThinking({ref:l,levels:i});return G({settings:r.settings}),{ok:!0,settings:r.settings,thinking:r.thinking}}catch(r){return{ok:!1,error:fe(r)}}}async function h1(l){try{return{ok:!0,view:await qd(await le.deleteProvider(l))}}catch(i){return{ok:!1,error:fe(i)}}}async function nv(l){try{return await le.testProvider(l),null}catch(i){return fe(i)}}async function m1(l){try{return{ok:!0,models:(await le.discoverProvider(l)).models}}catch(i){return{ok:!1,error:fe(i)}}}async function p1(){try{return{ok:!0,view:await le.providersImport()}}catch(l){return{ok:!1,error:fe(l)}}}async function g1(l){try{return{ok:!0,view:await qd(await le.importProviders(l))}}catch(i){return{ok:!1,error:fe(i)}}}const v1=()=>le.skills(),x1=l=>le.skillsImport(l),b1=(l,i,r)=>le.importSkills(l,i,r),y1=l=>le.deleteSkill(l),j1=()=>le.search(),k1=(l,i,r)=>le.testSearch(l,i,r);async function N1(l,i){try{const r=await le.putSearch(ce.settings.revision,l,i);return G({settings:r}),null}catch(r){return r instanceof Ze&&r.status===409&&G({settings:await le.settings()}),fe(r)}}async function S1(){try{return await le.imageKey()}catch(l){return G({notice:`无法读取图像生成设置:${fe(l)}`}),null}}async function lv(l,i){try{const r=await le.putImage(ce.settings.revision,l,i);return G({settings:r.settings}),{ok:!0,keyConfigured:r.keyConfigured}}catch(r){if(r instanceof Ze&&r.status===409){try{G({settings:await le.settings()})}catch{}return{ok:!1,error:"设置已在别处修改,已刷新,请重新保存",conflict:!0}}return{ok:!1,error:fe(r),conflict:!1}}}async function av(l){try{return await le.imageTest(l)}catch(i){return{ok:!1,error:`生成测试图片的请求失败:${fe(i)}`}}}async function sd(){try{return{ok:!0,config:await le.memory()}}catch(l){return{ok:!1,error:`无法读取记忆设置:${fe(l)}`}}}async function sv(l,i){try{const r=await le.putMemory(l,i);return G(o=>({settings:{...o.settings,revision:Math.max(o.settings.revision,r.revision)}})),{ok:!0,config:r}}catch(r){return{ok:!1,error:fe(r)}}}async function w1(l){try{return{ok:!0,config:await le.putLore(l)}}catch(i){return{ok:!1,error:fe(i)}}}async function iv(l){try{return{ok:!0,result:await le.loreTest(l)}}catch(i){return{ok:!1,error:`测试请求失败:${fe(i)}`}}}async function T1(){try{return{ok:!0,view:await le.loreImport()}}catch(l){return{ok:!1,error:fe(l)}}}async function E1(){try{return{ok:!0,config:await le.importLore()}}catch(l){return{ok:!1,error:fe(l)}}}async function or(){try{return{ok:!0,view:await le.push()}}catch(l){return{ok:!1,error:`无法读取推送设置:${fe(l)}`}}}async function C1(){const l=await or();if(!l.ok)return l;try{const i=await Qj(l.view.publicKey);return"error"in i?{ok:!1,error:i.error}:{ok:!0,view:await le.subscribePush(i.subscription,Yj(navigator.userAgent))}}catch(i){return{ok:!1,error:`订阅推送失败:${fe(i)}`}}}async function z1(){try{const l=await Dd();if(l)try{await l.unsubscribe()}catch{}return ax((l==null?void 0:l.endpoint)??await A1())}catch(l){return{ok:!1,error:`关闭推送失败:${fe(l)}`}}}async function A1(){var i;const l=await or();return l.ok?((i=l.view.devices[0])==null?void 0:i.endpoint)??"":""}async function ax(l){if(!l)return or();try{return{ok:!0,view:await le.unsubscribePush(l)}}catch(i){return{ok:!1,error:`删除设备失败:${fe(i)}`}}}async function O1(){const l=await Dd();try{return{ok:!0,sent:(await le.testPush(l==null?void 0:l.endpoint)).sent}}catch(i){return{ok:!1,error:fe(i)}}}const sx=window.matchMedia("(prefers-color-scheme: dark)");function na(l){const{dark:i}=e1(l,sx.matches);document.documentElement.classList.toggle("dark",i),document.documentElement.style.colorScheme=i?"dark":"light",ex(ce,window.innerWidth<768)}sx.addEventListener("change",()=>na(ce.theme));let cv=!1,rv=null;async function _1(){if(!cv){if(cv=!0,na(ce.theme),rs){await sr();return}try{await le.me()}catch(l){if(l instanceof Ze&&l.status===401){G({phase:"login"});return}G({phase:"error",error:fe(l)});return}await sr()}}async function M1(l){if(!ce.loggingIn){G({loggingIn:!0,error:null});try{await le.login(l)}catch(i){G({loggingIn:!1,error:i instanceof Ze&&i.status===401?"密码不正确":`登录失败:${fe(i)}`});return}G({loggingIn:!1,phase:"loading"}),await sr()}}async function sr(){var l,i;try{const r=await le.bootstrap();G({phase:"ready",error:null,offline:null,assistants:r.assistants,jobs:jn(r.jobs),delegations:jn(r.delegations??[]),routines:r.routines,approvals:jn(r.approvals),settings:r.settings,theme:r.settings.settings.general.theme}),na(r.settings.settings.general.theme),localStorage.setItem(Hd,r.settings.settings.general.theme),rv||(rv=le.events({onEvent:cx,onReconnect:()=>{G({offline:null}),sr()},onDown:d=>G({offline:d})},tx),D1());const o=ce.sel&&r.assistants.some(d=>d.id===ce.sel)?ce.sel:((l=r.assistants.find(d=>d.primary))==null?void 0:l.id)??((i=r.assistants[0])==null?void 0:i.id)??null;o&&await tn(o,!0,s1())}catch(r){G({phase:"error",error:fe(r)})}}const ix=new Set;function cx(l){var i;switch(l.type){case"page-live":{const r=!ce.livePages[l.callId];G(o=>({livePages:{...o.livePages,[l.callId]:l},...kj(l,{seen:!r,closed:ix.has(l.callId),assistantId:o.sel,inChat:o.page==="main"&&(o.mobile==="chat"||!window.matchMedia("(max-width: 767px)").matches)})?{filePreview:{path:"",full:!1,liveId:l.callId}}:{}}));break}case"assistant":{const r=l.assistant;G(o=>({assistants:Pg(o.assistants,r),profiles:o.profiles[r.id]?{...o.profiles,[r.id]:{...o.profiles[r.id],assistant:r}}:o.profiles}));break}case"assistant_removed":G(r=>{var o;return{assistants:r.assistants.filter(d=>d.id!==l.id),sel:r.sel===l.id?((o=r.assistants.find(d=>d.primary))==null?void 0:o.id)??null:r.sel}});break;case"item":{const r=ce.items[l.assistantId];if(!r)break;r.some(o=>o.id===l.item.id)||Iv([l.item.id]),G(o=>({items:{...o.items,[l.assistantId]:Kv(r,l.item)}}));break}case"delta":{const r=ce.items[l.assistantId];if(!r)break;const o=jj(r,l.itemId,l.text);o!==r&&G(d=>({items:{...d.items,[l.assistantId]:o}}));break}case"job":G(r=>({jobs:{...r.jobs,[l.job.id]:l.job}})),R1(l.job.status)&&((i=ce.detail)==null?void 0:i.kind)==="job"&&ce.detail.id===l.job.id&&ce.steps[l.job.id]&&dx(l.job.id);break;case"delegation":G(r=>({delegations:{...r.delegations,[l.delegation.id]:l.delegation}}));break;case"job_step":{const r=ce.steps[l.jobId];if(!r)break;G(o=>({steps:{...o.steps,[l.jobId]:Vj(r,l.step)}}));break}case"activity":{const r=ce.jobs[l.jobId];if(!r)break;G(o=>({jobs:{...o.jobs,[l.jobId]:{...r,stats:l.stats,activity:[...r.activity,l.line].slice(-200)}}}));break}case"approval":G(r=>({approvals:{...r.approvals,[l.approval.id]:l.approval}}));break;case"draft":G(r=>({drafts:{...r.drafts,[l.draft.id]:l.draft}}));break;case"routine":G(r=>({routines:Pg(r.routines,l.routine)}));break;case"routine_removed":G(r=>({routines:r.routines.filter(o=>o.id!==l.id),panel:r.panel.kind==="routine"&&r.panel.id===l.id?{kind:"now"}:r.panel}));break;case"profile":rx(l.assistantId);break}}function R1(l){return l==="done"||l==="stuck"||l==="failed"||l==="stopped"}function uv(){le.visibility(tx,document.visibilityState==="visible").catch(()=>{})}function D1(){Fg||(Fg=!0,document.addEventListener("visibilitychange",uv),uv())}async function tn(l,i=!1,r=!0,o=!1){G(f=>({sel:l,...f.sel!==l&&!o?{detail:null,worklog:null}:{},...r?{mobile:"chat",sheet:!1,search:!1}:{},quote:null,...i?{}:{panel:{kind:"now"}}}));const d=ce.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([U1(l),rx(l)])}async function U1(l){const i=new Set(Object.keys(ce.livePages));try{const r=await le.items(l);Tj();const o=new Set((r.pageLive??[]).map(d=>d.callId));G(d=>{var p;const f=Object.fromEntries(Object.entries(d.livePages).filter(([m,x])=>x.assistantId!==l||x.state==="done"||!i.has(m)||o.has(m))),g=((p=d.filePreview)==null?void 0:p.liveId)&&!f[d.filePreview.liveId];return{livePages:f,...g?{filePreview:null}:{}}});for(const d of r.pageLive??[])cx({type:"page-live",...d});G(d=>({items:{...d.items,[l]:r.items},itemGen:{...d.itemGen,[l]:(d.itemGen[l]??0)+1},jobs:{...d.jobs,...jn(r.jobs)},approvals:{...d.approvals,...jn(r.approvals)},drafts:{...d.drafts,...jn(r.drafts)},delegations:{...d.delegations,...jn(r.delegations??[])}}))}catch(r){G({notice:`无法加载对话:${fe(r)}`})}}async function rx(l){try{const i=await le.profile(l);G(r=>({profiles:{...r.profiles,[l]:i}}))}catch(i){G({notice:`无法加载档案:${fe(i)}`})}}function $d(l){G({text:l})}function ir(l){G({quote:l,nonce:ce.nonce+1})}function H1(l){G(i=>({files:[...i.files,...l]}))}function B1(l){G(i=>({files:i.files.filter(r=>r!==l)}))}async function L1(l){for(const i of Array.from(l))try{const r=await le.upload(i);H1([r])}catch(r){G({notice:`上传失败:${fe(r)}`})}}async function ov(){const l=ce.sel,i=ce.text.trim();if(!l||!i)return;const r={text:i,quote:ce.quote??void 0,files:ce.files.length?ce.files:void 0};G({text:"",quote:null,files:[],nonce:ce.nonce+1});try{const o=await le.sendMessage(l,r);o!=null&&o.item&&(Iv([o.item.id]),G(d=>({items:{...d.items,[l]:Kv(d.items[l]??[],o.item)}})))}catch(o){G({notice:`发送失败:${fe(o)}`,text:i,quote:r.quote??null,files:r.files??[]})}}async function dv(l,i){const r=ce.approvals[l];if(r){G(o=>({approvals:{...o.approvals,[l]:{...r,status:"answered",...i.key?{chosen:i.key}:{answerText:(i.text??"").trim()}}}}));try{await le.answerApproval(l,i)}catch(o){G({approvals:{...ce.approvals,[l]:r},notice:`提交失败:${fe(o)}`})}}}async function q1(l){try{await le.createDraft(l)}catch(i){G({notice:`创建助手失败:${fe(i)}`})}}async function $1(l){try{await le.mergeAssistant(l);const i=ce.assistants.find(r=>r.primary);ce.sel===l&&i&&await tn(i.id,!0)}catch(i){G({notice:`并回失败:${fe(i)}`})}}async function Y1(l){try{await le.retryDelegation(l)}catch(i){G({notice:`重新转交失败:${fe(i)}`})}}async function fv(l,i,r){await ux(l,i,r?"forward":"handback")}async function Yd(l,i,r){await ux(l,i,r?"forward":"delegation")}async function ux(l,i,r){(ce.sel!==l||!ce.items[l])&&await tn(l);const o=d=>{var f;return r==="forward"?d.kind==="user"&&((f=d.from)==null?void 0:f.delegationId)===i:r==="handback"?d.kind==="note"&&d.handbackId===i:d.kind==="delegation"&&d.delegationId===i};try{let d=ce.items[l]??[];for(;!d.some(o)&&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,...jn(f.jobs)},approvals:{...g.approvals,...jn(f.approvals)},delegations:{...g.delegations,...jn(f.delegations??[])}})),!f.hasMore))break}if(!d.some(o)){G({notice:"未找到对应的转交消息"});return}requestAnimationFrame(()=>requestAnimationFrame(()=>{var f;return(f=document.getElementById(`${r}-${i}`))==null?void 0:f.scrollIntoView({block:"center",behavior:"smooth"})}))}catch(d){G({notice:`无法定位转交消息:${fe(d)}`})}}async function vd(l,i){try{await le.replyJob(l,i)}catch(r){G({notice:`发送失败:${fe(r)}`})}}async function ox(l){try{await le.stopJob(l)}catch(i){G({notice:`停止失败:${fe(i)}`})}}async function ts(l,i){const r=ce.routines.find(o=>o.id===l);if(r){G(o=>({routines:o.routines.map(d=>d.id===l?{...d,...i}:d)}));try{await le.patchRoutine(l,i)}catch(o){G({routines:ce.routines.map(d=>d.id===l?r:d),notice:`保存失败:${fe(o)}`})}}}async function G1(l){const i=new Set(ce.routines.map(d=>d.id));let r;try{r=await le.createRoutine(l)}catch(d){G({notice:`创建失败:${fe(d)}`});return}const o=r!=null&&r.id?r:ce.routines.find(d=>!i.has(d.id));o&&Xd(o.id)}async function X1(l){try{await le.deleteRoutine(l)}catch(i){G({notice:`删除失败:${fe(i)}`})}}async function Q1(l){try{await le.runRoutine(l)}catch(i){G({notice:`运行失败:${fe(i)}`})}}async function xd(l,i){const r=ce.assistants.find(d=>d.id===l),o=ce.profiles[l];if(!r)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=`保存失败:${fe(d)}`;return G(g=>({assistants:g.assistants.map(p=>p.id===l?r:p),profiles:o?{...g.profiles,[l]:o}:g.profiles,notice:f})),f}}async function V1(l,i,r){try{const o=await le.patchAssistant(l,{rule:{text:i,mode:r}});if(!(o!=null&&o.rule))throw new Error("保存响应缺少规则。");const d=o.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(o){return`保存失败:${fe(o)}`}}async function Z1(l,i){try{return await le.patchAssistant(l,{rule:i}),G(r=>{const o=r.profiles[l];return o?{profiles:{...r.profiles,[l]:{...o,rules:o.rules.map(d=>d.id===i.id?{...d,...i,changedAt:new Date().toISOString()}:d)}}}:{}}),null}catch(r){return`保存失败:${fe(r)}`}}async function K1(l,i){const r=ce.profiles[l];if(r){G(o=>({profiles:{...o.profiles,[l]:{...r,rules:r.rules.filter(d=>d.id!==i)}}}));try{await le.deleteRule(l,i)}catch(o){G({profiles:{...ce.profiles,[l]:r},notice:`删除失败:${fe(o)}`})}}}async function dx(l){try{const{job:i,steps:r}=await le.transcript(l);G(o=>({jobs:{...o.jobs,[i.id]:i},steps:{...o.steps,[i.id]:o.steps[i.id]?Zj(o.steps[i.id],r):r}}))}catch(i){G({notice:`无法加载任务过程:${fe(i)}`})}}function aa(l){G(i=>{var r;return{detail:{kind:"job",id:l},worklog:((r=i.detail)==null?void 0:r.kind)==="jobs"?i.worklog:null}}),dx(l)}function Gd(l=null){G({detail:{kind:"jobs"}}),bd({assistantId:l,status:null})}function Jc(){G({detail:null})}function J1(){G(l=>({detail:l.worklog?{kind:"jobs"}:null}))}async function bd(l={}){const i=l.assistantId??null,r=l.status??null;G({worklog:{jobs:[],assistantId:i,status:r,hasMore:!1,loading:!0}});try{const o=await le.jobs({...i?{assistantId:i}:{},...r?{status:r}:{},limit:30});fx(o,i,r)}catch(o){G({worklog:null,notice:`无法加载任务记录:${fe(o)}`})}}async function I1(){const l=ce.worklog;if(!l||!l.hasMore||l.loading)return;const i=l.jobs[l.jobs.length-1];G({worklog:{...l,loading:!0}});try{const r=await le.jobs({...l.assistantId?{assistantId:l.assistantId}:{},...l.status?{status:l.status}:{},...i?{before:i.id}:{},limit:30});fx(r,l.assistantId,l.status)}catch(r){G(o=>({worklog:o.worklog?{...o.worklog,loading:!1}:null,notice:`无法加载更多:${fe(r)}`}))}}function fx(l,i,r){G(o=>{var g;const d=new Set((((g=o.worklog)==null?void 0:g.jobs)??[]).map(p=>p.id));return{worklog:{jobs:o.worklog&&o.worklog.assistantId===i&&o.worklog.status===r?[...o.worklog.jobs,...l.jobs.filter(p=>!d.has(p.id))]:l.jobs,assistantId:i,status:r,hasMore:l.hasMore,loading:!1},jobs:{...o.jobs,...jn(l.jobs)}}})}function sa(){G({nonce:ce.nonce+1,mobile:"chat",sheet:!1})}function hx(){const l=ce.assistants.find(i=>i.primary);l&&(tn(l.id),G({text:"我想创建一个专属助手,负责:",nonce:ce.nonce+1,mobile:"chat",sheet:!1}))}async function F1(l,i){(ce.sel!==l||!ce.items[l])&&await tn(l),requestAnimationFrame(()=>{var r;(r=document.getElementById(`job-${i}`))==null||r.scrollIntoView({block:"center",behavior:"smooth"})})}function Xd(l){G({panel:{kind:"routine",id:l},collapsed:!1,sheet:!0})}function W1(){G({panel:{kind:"newRoutine"},collapsed:!1,sheet:!0})}function mx(){G({panel:{kind:"assistant"},collapsed:!1,sheet:!0})}function hv(l,i,r){G({menu:{id:l,x:i,y:r}})}function id(){ce.menu&&G({menu:null})}function Qd(){G({page:"settings",section:null,sub:null,sheet:!1,search:!1})}function mv(){G({page:"main"})}function hi(l){G({section:l,sub:null})}function tl(l){G({sub:l})}function kn(){G({sub:null})}function Vd(){G({panel:{kind:"now"},sheet:!1})}function P1(){G({collapsed:!0,sheet:!1})}function ek(){G({collapsed:!1,panel:{kind:"now"}})}function px(l){G({query:l})}function tk(l){G({mobile:l,sheet:!1,search:!1})}function nk(){G({sheet:!0})}function pv(){G({sheet:!1})}function gv(l){G({search:l,query:l?ce.query:""})}function lk(){G({notice:null})}function Zd(l){G({notice:l})}function ak(){G({updateReady:!0})}function sk(){G({tick:ce.tick+1})}function hn(l,i){return le.fileUrl(l,i)}function gx(l){return le.fileMeta(l)}async function ik(l){try{return await le.jobFiles(l)}catch(i){return G({notice:`无法加载产出文件:${fe(i)}`}),null}}function ds(l,i){G({filePreview:{path:l,full:!1,...i?{title:i}:{}}})}function ck(l){G({filePreview:{path:"",full:!1,liveId:l}})}function yd(){var l;(l=ce.filePreview)!=null&&l.liveId&&ix.add(ce.filePreview.liveId),G({filePreview:null})}function rk(){G(l=>l.filePreview?{filePreview:{...l.filePreview,full:!l.filePreview.full}}:{})}const uk=500,vv=10;function vx(l){const i=w.useRef(null),r=w.useRef(null),o=w.useRef(!1),d=()=>{i.current!==null&&window.clearTimeout(i.current),i.current=null,r.current=null};return w.useEffect(()=>d,[]),{handlers:{onContextMenu(g){g.preventDefault(),d(),hv(l.id,g.clientX,g.clientY)},onPointerDown(g){g.pointerType==="touch"&&(d(),o.current=!1,r.current={x:g.clientX,y:g.clientY},i.current=window.setTimeout(()=>{i.current=null;const p=r.current;p&&(o.current=!0,window.setTimeout(()=>o.current=!1,1e3),hv(l.id,p.x,p.y))},uk))},onPointerMove(g){const p=r.current;p&&(Math.abs(g.clientX-p.x)>vv||Math.abs(g.clientY-p.y)>vv)&&d()},onPointerUp:d,onPointerCancel:d},takeHeld(){return o.current?(o.current=!1,!0):!1}}}function xv(){const l=we(),i=l.menu,r=w.useRef(null);if(w.useEffect(()=>{if(!i)return;const m=y=>{r.current&&!r.current.contains(y.target)&&id()},x=y=>{y.key==="Escape"&&id()};return document.addEventListener("pointerdown",m,!0),window.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",m,!0),window.removeEventListener("keydown",x)}},[i]),!i)return null;const o=l.assistants.find(m=>m.id===i.id);if(!o)return null;const d=m=>{id(),m()},f=o.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:r,style:{left:g,top:p,transformOrigin:`${i.x-g}px ${i.y-p}px`},onContextMenu:m=>m.preventDefault(),children:[o.primary?null:s.jsx("button",{onClick:()=>d(()=>void xd(o.id,{pinned:!o.pinned})),children:o.pinned?"取消置顶":"放在顶部"}),o.primary?null:s.jsx("button",{onClick:()=>d(()=>void xd(o.id,{hidden:!o.hidden})),children:o.hidden?"放回列表":"收起这个助手"}),s.jsx("button",{onClick:()=>d(()=>{tn(o.id,!1,!1),mx()}),children:"助手设置"})]})}const ok={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 Q({name:l,size:i=16,w:r=1.7,className:o,style:d}){return s.jsx("svg",{className:`i${o?` ${o}`:""}`,width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",style:d,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:ok[l]}})}const ls=["......k.....",".....kok....",".....kook...","..k.koook...",".kokoooook..",".kooooooook.","kooyyyyyyook","koyyeyyeyyok","koyyeyyeyyok","koyyyyyyyyok",".kooyyyyook.","..kkkkkkkk.."],fn=16,bv="#40261a",us={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"}},Et=(l,i)=>[...Array(l).fill(""),...i],ia={hob:{label:"主助手",color:"orange",dx:2,pal:{},art:[]},page:{label:"写作/文档",color:"purple",dx:1,pal:{p:"#ff9db0",g:"#b9c0c8",h:"#ffc21a",b:"#f2c58f"},art:Et(5,["............kkkk","............kppk","............kppk","............kggk","............khhk","............khhk","............khhk","............khhk","............kbbk",".............kk."])},server:{label:"服务器/运维",color:"slate",dx:2,pal:{h:"#ffc21a",w:"#fff1b8"},art:Et(2,["......kkkk......",".....khhwwk.....","....khhhhwhk....","....khhhhhhk....","...kkkkkkkkkk..."])},bird:{label:"资讯/动态",color:"blue",dx:0,pal:{l:"#dff3ff",w:"#ffffff"},art:Et(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:Et(9,["............k...","...........krk..","..........krrrk.",".........krrrrrk","..........kwwwk.","..........kwdwk.","..........kkkkk."])},coin:{label:"钱/记账",color:"green",dx:0,pal:{h:"#ffc21a",w:"#fff1b8",d:"#d18f00"},art:Et(9,["...........kkk..","..........khhhk.",".........khwdhhk",".........khwdhhk",".........khhdhhk","..........khhhk.","...........kkk.."])},book:{label:"学习/读书",color:"red",dx:2,pal:{d:"#3a3f58",t:"#ffc21a"},art:Et(1,[".......kk.......",".....kkddkk.....","...kkddddddkk...",".kkddddddddddkk.","...kkddddddkk.t.","....kddddddk..t.","....kkkkkkkk..t.","..............t."])},leaf:{label:"健康/植物",color:"pink",dx:2,pal:{g:"#5ccf6b",s:"#3a9a4f"},art:Et(0,["....kk.....kk...","...kggk...kggk..","....kggkskggk...",".....kk.s.kk...."])},wifi:{label:"网络/路由器",color:"teal",dx:2,pal:{},art:Et(0,["......kkkkk.....",".....k.....k....",".......kkk......","......k...k....."])},calendar:{label:"日程/提醒",color:"purple",dx:0,pal:{r:"#ff4d4d",w:"#ffffff"},art:Et(8,["..........k...k.",".........kkkkkkk",".........krrrrrk",".........kkkkkkk",".........kwwwwwk",".........kwwkwwk",".........kwwwwwk",".........kkkkkkk"])},chef:{label:"做饭/饮食",color:"red",dx:2,pal:{w:"#ffffff",g:"#d9dde2"},art:Et(1,[".....kk..kk.....","....kwwkkwwk....","...kwwwwwwwwk...","...kwwwwwwwwk...","....kwwwwwwk....","....kggggggk....","....kkkkkkkk...."])},chart:{label:"股票/数据",color:"slate",dx:0,pal:{w:"#ffffff",g:"#f04848"},art:Et(9,[".........kkkkkkk",".........kwwwwgk",".........kwwgwgk",".........kwwgwgk",".........kgwgwgk",".........kgwgwgk",".........kkkkkkk"])},bag:{label:"旅行/出行",color:"blue",dx:0,pal:{b:"#e8833a",s:"#ffd59a"},art:Et(9,["...........kkk..","...........k.k..",".........kkkkkkk",".........kbsbsbk",".........kbsbsbk",".........kbsbsbk",".........kkkkkkk"])},paw:{label:"宠物",color:"purple",dx:0,pal:{c:"#ffb36b",p:"#ff8fa6"},art:Et(9,[".........k.....k",".........kck.kck",".........kccccck",".........kckckck",".........kccpcck","..........kkkkk."])},note:{label:"音乐",color:"pink",dx:1,pal:{},art:Et(2,["..............k.","..............kk","..............kk","..............k.","..............k.","............kkk.","............kkk."])},code:{label:"代码/开发",color:"green",dx:0,pal:{d:"#2b3240",g:"#6ef0a0"},art:Et(10,[".........kkkkkkk",".........kgddddk",".........kdgdddk",".........kgdggdk",".........kdddddk",".........kkkkkkk"])},gym:{label:"健身/运动",color:"blue",dx:2,pal:{r:"#ff3b5c"},art:Et(9,["...krrrrrrrrk...","..krrrrrrrrrrkr.","...............r"])}},dk=Object.keys(ia),fk=Object.keys(us);function xx(l){if(l==="custom")return{prop:"custom",color:"orange"};if(l.startsWith("custom:")){const f=l.slice(7);return Object.hasOwn(us,f)?{prop:"custom",color:f}:void 0}const[i,r,...o]=l.split(":");if(o.length||!Object.hasOwn(ia,i))return;const d=i;return r===void 0?{prop:d,color:ia[d].color}:Object.hasOwn(us,r)?{prop:d,color:r}:void 0}function cd(l){return l==="orange"?"custom":`custom:${l}`}const hk=/^#[0-9a-f]{6}$/;function mk(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:r,dx:o}=l;if(!Array.isArray(i)||i.length===0)return{ok:!1,error:"prop_art.art 要是非空的字符串数组"};if(i.length>fn)return{ok:!1,error:`prop_art.art 最多 ${fn} 行,收到 ${i.length} 行`};for(const m of i){if(typeof m!="string")return{ok:!1,error:"prop_art.art 的每行都要是字符串"};if([...m].length!==fn)return{ok:!1,error:`prop_art.art 每行要正好 ${fn} 个字符,这一行是 ${[...m].length} 个:「${m}」`}}if(!r||typeof r!="object"||Array.isArray(r))return{ok:!1,error:"prop_art.pal 要是对象:单个小写字母 → #rrggbb"};const d=Object.entries(r);if(d.length>6)return{ok:!1,error:`prop_art.pal 最多 6 种颜色,收到 ${d.length} 种`};for(const[m,x]of d){if(!/^[a-z]$/.test(m))return{ok:!1,error:`pal 的键要是单个小写字母,收到「${m}」`};if(m==="k")return{ok:!1,error:"pal 不能有 k:描边色是固定的,art 里直接用 k 就行"};if("oye".includes(m))return{ok:!1,error:`pal 不能用 ${m}:这是火苗自己的颜色`};if(typeof x!="string"||!hk.test(x))return{ok:!1,error:`pal[${m}] 要是 #rrggbb 格式的颜色,收到「${String(x)}」`}}const f=i.join("");for(const m of new Set([...f].filter(x=>x!==".")))if(m!=="k"&&!Object.hasOwn(r,m))return{ok:!1,error:`art 里的「${m}」没有在 pal 里定义颜色`};const g=[...f].filter(m=>m!==".").length;if(g<6)return{ok:!1,error:`至少要画 6 个像素,现在只有 ${g} 个`};if(o!==0&&o!==1&&o!==2)return{ok:!1,error:`prop_art.dx 要是 0、1 或 2,收到 ${String(o)}`};const p=fn-ls.length;for(let m=0;m<ls.length;m++)for(let x=0;x<ls[m].length;x++){if(ls[m][x]!=="e")continue;const y=i[p+m],k=y==null?void 0:y[o+x];if(k&&k!==".")return{ok:!1,error:`art 第 ${p+m+1} 行第 ${o+x+1} 列会盖住火苗的眼睛,把图案挪开(或调小 dx)`}}return{ok:!0,prop:{art:i,pal:r,dx:o}}}function rd(l,i){return i===ia[l].color?l:`${l}:${i}`}function pk(l,i){const r=xx(l)??{prop:"hob",color:"slate"},o=r.prop==="custom"&&i?mk(i):void 0,d=r.prop==="custom"?o!=null&&o.ok?o.prop:ia.hob:ia[r.prop],f=us[r.color],g=[...Array(fn-ls.length).fill(""),...ls].map((k,S)=>{const E=k?`${".".repeat(d.dx)}${k}`.padEnd(fn,"."):".".repeat(fn),j=d.art[S]??"";return[...E].map((v,N)=>j[N]&&j[N]!=="."?j[N]:v).join("")});let[p,m,x,y]=[fn,fn,0,0];return g.forEach((k,S)=>[...k].forEach((E,j)=>{E!=="."&&([p,m,x,y]=[Math.min(p,j),Math.min(m,S),Math.max(x,j+1),Math.max(y,S+1)])})),{rows:g,pal:{k:bv,e:bv,o:f.o,y:f.y,...d.pal},bg:f.bg,offset:[(p+x-fn)/2,(m+y-fn)/2]}}function gk({art:l}){const i=[];return l.rows.forEach((r,o)=>{for(let d=0;d<r.length;){const f=r[d];let g=d+1;for(;g<r.length&&r[g]===f;)g++;f!=="."&&l.pal[f]&&i.push({x:d,y:o,w:g-d,fill:l.pal[f]}),d=g}}),s.jsx("svg",{viewBox:`${l.offset[0]} ${l.offset[1]} 16 16`,shapeRendering:"crispEdges","aria-hidden":"true",children:i.map((r,o)=>s.jsx("rect",{x:r.x,y:r.y,width:r.w+.02,height:1.02,fill:r.fill},o))})}function Ct({sprite:l,prop:i,size:r,title:o,onClick:d}){const f=pk(l,i);return s.jsx("div",{className:"av",title:o,onClick:d,style:{width:r,height:r,background:f.bg},children:s.jsx(gk,{art:f})})}var vk=Vv();const xk={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"};function bk(l){const i=l.lastIndexOf(".");return i===-1?!1:l.slice(i).toLowerCase()in xk}function Kd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ua=Kd();function bx(l){ua=l}var mi={exec:()=>null};function He(l,i=""){let r=typeof l=="string"?l:l.source;const o={replace:(d,f)=>{let g=typeof f=="string"?f:f.source;return g=g.replace(Rt.caret,"$1"),r=r.replace(d,g),o},getRegex:()=>new RegExp(r,i)};return o}var Rt={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")},yk=/^(?:[ \t]*(?:\n|$))+/,jk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jd=/(?:[*+-]|\d{1,9}[.)])/,yx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jx=He(yx).replace(/bull/g,Jd).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(),Sk=He(yx).replace(/bull/g,Jd).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(),Id=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,wk=/^[^\n]+/,Fd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Tk=He(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Fd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ek=He(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jd).getRegex(),dr="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",Wd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ck=He("^ {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",Wd).replace("tag",dr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kx=He(Id).replace("hr",vi).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",dr).getRegex(),zk=He(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kx).getRegex(),Pd={blockquote:zk,code:jk,def:Tk,fences:kk,heading:Nk,hr:vi,html:Ck,lheading:jx,list:Ek,newline:yk,paragraph:kx,table:mi,text:wk},yv=He("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vi).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",dr).getRegex(),Ak={...Pd,lheading:Sk,table:yv,paragraph:He(Id).replace("hr",vi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yv).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",dr).getRegex()},Ok={...Pd,html:He(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wd).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:mi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:He(Id).replace("hr",vi).replace("heading",` *#{1,6} *[^
76
+ ]`).replace("lheading",jx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_k=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nx=/^( {2,}|\\)\n(?!\s*$)/,Rk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fr=/[\p{P}\p{S}]/u,ef=/[\s\p{P}\p{S}]/u,Sx=/[^\s\p{P}\p{S}]/u,Dk=He(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ef).getRegex(),wx=/(?!~)[\p{P}\p{S}]/u,Uk=/(?!~)[\s\p{P}\p{S}]/u,Hk=/(?:[^\s\p{P}\p{S}]|~)/u,Bk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Tx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Lk=He(Tx,"u").replace(/punct/g,fr).getRegex(),qk=He(Tx,"u").replace(/punct/g,wx).getRegex(),Ex="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$k=He(Ex,"gu").replace(/notPunctSpace/g,Sx).replace(/punctSpace/g,ef).replace(/punct/g,fr).getRegex(),Yk=He(Ex,"gu").replace(/notPunctSpace/g,Hk).replace(/punctSpace/g,Uk).replace(/punct/g,wx).getRegex(),Gk=He("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Sx).replace(/punctSpace/g,ef).replace(/punct/g,fr).getRegex(),Xk=He(/\\(punct)/,"gu").replace(/punct/g,fr).getRegex(),Qk=He(/^<(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(),Vk=He(Wd).replace("(?:-->|$)","-->").getRegex(),Zk=He("^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",Vk).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),cr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Kk=He(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",cr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Cx=He(/^!?\[(label)\]\[(ref)\]/).replace("label",cr).replace("ref",Fd).getRegex(),zx=He(/^!?\[(ref)\](?:\[\])?/).replace("ref",Fd).getRegex(),Jk=He("reflink|nolink(?!\\()","g").replace("reflink",Cx).replace("nolink",zx).getRegex(),tf={_backpedal:mi,anyPunctuation:Xk,autolink:Qk,blockSkip:Bk,br:Nx,code:Mk,del:mi,emStrongLDelim:Lk,emStrongRDelimAst:$k,emStrongRDelimUnd:Gk,escape:_k,link:Kk,nolink:zx,punctuation:Dk,reflink:Cx,reflinkSearch:Jk,tag:Zk,text:Rk,url:mi},Ik={...tf,link:He(/^!?\[(label)\]\((.*?)\)/).replace("label",cr).getRegex(),reflink:He(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",cr).getRegex()},jd={...tf,emStrongRDelimAst:Yk,emStrongLDelim:qk,url:He(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Fk={...jd,br:He(Nx).replace("{2,}","*").getRegex(),text:He(jd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ic={normal:Pd,gfm:Ak,pedantic:Ok},ri={normal:tf,gfm:jd,breaks:Fk,pedantic:Ik},Wk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jv=l=>Wk[l];function Dn(l,i){if(i){if(Rt.escapeTest.test(l))return l.replace(Rt.escapeReplace,jv)}else if(Rt.escapeTestNoEncode.test(l))return l.replace(Rt.escapeReplaceNoEncode,jv);return l}function kv(l){try{l=encodeURI(l).replace(Rt.percentDecode,"%")}catch{return null}return l}function Nv(l,i){var f;const r=l.replace(Rt.findPipe,(g,p,m)=>{let x=!1,y=p;for(;--y>=0&&m[y]==="\\";)x=!x;return x?"|":" |"}),o=r.split(Rt.splitPipe);let d=0;if(o[0].trim()||o.shift(),o.length>0&&!((f=o.at(-1))!=null&&f.trim())&&o.pop(),i)if(o.length>i)o.splice(i);else for(;o.length<i;)o.push("");for(;d<o.length;d++)o[d]=o[d].trim().replace(Rt.slashPipe,"|");return o}function ui(l,i,r){const o=l.length;if(o===0)return"";let d=0;for(;d<o&&l.charAt(o-d-1)===i;)d++;return l.slice(0,o-d)}function Pk(l,i){if(l.indexOf(i[1])===-1)return-1;let r=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===i[0])r++;else if(l[o]===i[1]&&(r--,r<0))return o;return r>0?-2:-1}function Sv(l,i,r,o,d){const f=i.href,g=i.title||null,p=l[1].replace(d.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:f,title:g,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,m}function eN(l,i,r){const o=l.match(r.other.indentCodeCompensation);if(o===null)return i;const d=o[1];return i.split(`
77
+ `).map(f=>{const g=f.match(r.other.beginningSpace);if(g===null)return f;const[p]=g;return p.length>=d.length?f.slice(d.length):f}).join(`
78
+ `)}var rr=class{constructor(l){Ye(this,"options");Ye(this,"rules");Ye(this,"lexer");this.options=l||ua}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 r=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ui(r,`
79
+ `)}}}fences(l){const i=this.rules.block.fences.exec(l);if(i){const r=i[0],o=eN(r,i[3]||"",this.rules);return{type:"code",raw:r,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:o}}}heading(l){const i=this.rules.block.heading.exec(l);if(i){let r=i[2].trim();if(this.rules.other.endingHash.test(r)){const o=ui(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){const i=this.rules.block.hr.exec(l);if(i)return{type:"hr",raw:ui(i[0],`
80
+ `)}}blockquote(l){const i=this.rules.block.blockquote.exec(l);if(i){let r=ui(i[0],`
81
+ `).split(`
82
+ `),o="",d="";const f=[];for(;r.length>0;){let g=!1;const p=[];let m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))p.push(r[m]),g=!0;else if(!g)p.push(r[m]);else break;r=r.slice(m);const x=p.join(`
83
+ `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
84
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
85
+ ${x}`:x,d=d?`${d}
86
+ ${y}`:y;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,f,!0),this.lexer.state.top=k,r.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,j=E.raw+`
87
+ `+r.join(`
88
+ `),v=this.blockquote(j);f[f.length-1]=v,o=o.substring(0,o.length-E.raw.length)+v.raw,d=d.substring(0,d.length-E.text.length)+v.text;break}else if((S==null?void 0:S.type)==="list"){const E=S,j=E.raw+`
89
+ `+r.join(`
90
+ `),v=this.list(j);f[f.length-1]=v,o=o.substring(0,o.length-S.raw.length)+v.raw,d=d.substring(0,d.length-E.raw.length)+v.raw,r=j.substring(f.at(-1).raw.length).split(`
91
+ `);continue}}return{type:"blockquote",raw:o,tokens:f,text:d}}}list(l){let i=this.rules.block.list.exec(l);if(i){let r=i[1].trim();const o=r.length>1,d={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const f=this.rules.other.listItemRegex(r);let g=!1;for(;l;){let m=!1,x="",y="";if(!(i=f.exec(l))||this.rules.block.hr.test(l))break;x=i[0],l=l.substring(x.length);let k=i[2].split(`
92
+ `,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),S=l.split(`
93
+ `,1)[0],E=!k.trim(),j=0;if(this.options.pedantic?(j=2,y=k.trimStart()):E?j=i[1].length+1:(j=i[2].search(this.rules.other.nonSpaceChar),j=j>4?1:j,y=k.slice(j),j+=i[1].length),E&&this.rules.other.blankLine.test(S)&&(x+=S+`
94
+ `,l=l.substring(S.length+1),m=!0),!m){const A=this.rules.other.nextBulletRegex(j),O=this.rules.other.hrRegex(j),V=this.rules.other.fencesBeginRegex(j),ee=this.rules.other.headingBeginRegex(j),ne=this.rules.other.htmlBeginRegex(j);for(;l;){const K=l.split(`
95
+ `,1)[0];let q;if(S=K,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),q=S):q=S.replace(this.rules.other.tabCharGlobal," "),V.test(S)||ee.test(S)||ne.test(S)||A.test(S)||O.test(S))break;if(q.search(this.rules.other.nonSpaceChar)>=j||!S.trim())y+=`
96
+ `+q.slice(j);else{if(E||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||V.test(k)||ee.test(k)||O.test(k))break;y+=`
97
+ `+S}!E&&!S.trim()&&(E=!0),x+=K+`
98
+ `,l=l.substring(K.length+1),k=q.slice(j)}}d.loose||(g?d.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(g=!0));let v=null,N;this.options.gfm&&(v=this.rules.other.listIsTask.exec(y),v&&(N=v[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:x,task:!!v,checked:N,loose:!1,text:y,tokens:[]}),d.raw+=x}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 m=0;m<d.items.length;m++)if(this.lexer.state.top=!1,d.items[m].tokens=this.lexer.blockTokens(d.items[m].text,[]),!d.loose){const x=d.items[m].tokens.filter(k=>k.type==="space"),y=x.length>0&&x.some(k=>this.rules.other.anyLine.test(k.raw));d.loose=y}if(d.loose)for(let m=0;m<d.items.length;m++)d.items[m].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 r=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=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:r,raw:i[0],href:o,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 r=Nv(i[1]),o=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(g=i[3])!=null&&g.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
99
+ `):[],f={type:"table",raw:i[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const p of o)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<r.length;p++)f.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:f.align[p]});for(const p of d)f.rows.push(Nv(p,f.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:f.align[x]})));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 r=i[1].charAt(i[1].length-1)===`
100
+ `?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:r,tokens:this.lexer.inline(r)}}}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 r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const f=ui(r.slice(0,-1),"\\");if((r.length-f.length)%2===0)return}else{const f=Pk(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 o=i[2],d="";if(this.options.pedantic){const f=this.rules.other.pedanticHrefTitle.exec(o);f&&(o=f[1],d=f[3])}else d=i[3]?i[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Sv(i,{href:o&&o.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 r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=i[o.toLowerCase()];if(!d){const f=r[0].charAt(0);return{type:"text",raw:f,text:f}}return Sv(r,d,r[0],this.lexer,this.rules)}}emStrong(l,i,r=""){let o=this.rules.inline.emStrongLDelim.exec(l);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const f=[...o[0]].length-1;let g,p,m=f,x=0;const y=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(y.lastIndex=0,i=i.slice(-1*l.length+f);(o=y.exec(i))!=null;){if(g=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!g)continue;if(p=[...g].length,o[3]||o[4]){m+=p;continue}else if((o[5]||o[6])&&f%3&&!((f+p)%3)){x+=p;continue}if(m-=p,m>0)continue;p=Math.min(p,p+m+x);const k=[...o[0]][0].length,S=l.slice(0,f+o.index+k+p);if(Math.min(f,p)%2){const j=S.slice(1,-1);return{type:"em",raw:S,text:j,tokens:this.lexer.inlineTokens(j)}}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 r=i[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),d=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&d&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:i[0],text:r}}}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 r,o;return i[2]==="@"?(r=i[1],o="mailto:"+r):(r=i[1],o=r),{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let i;if(i=this.rules.inline.url.exec(l)){let o,d;if(i[2]==="@")o=i[0],d="mailto:"+o;else{let f;do f=i[0],i[0]=((r=this.rules.inline._backpedal.exec(i[0]))==null?void 0:r[0])??"";while(f!==i[0]);o=i[0],i[1]==="www."?d="http://"+i[0]:d=i[0]}return{type:"link",raw:i[0],text:o,href:d,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(l){const i=this.rules.inline.text.exec(l);if(i){const r=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:r}}}},Pn=class kd{constructor(i){Ye(this,"tokens");Ye(this,"options");Ye(this,"state");Ye(this,"tokenizer");Ye(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||ua,this.options.tokenizer=this.options.tokenizer||new rr,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 r={other:Rt,block:Ic.normal,inline:ri.normal};this.options.pedantic?(r.block=Ic.pedantic,r.inline=ri.pedantic):this.options.gfm&&(r.block=Ic.gfm,this.options.breaks?r.inline=ri.breaks:r.inline=ri.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ic,inline:ri}}static lex(i,r){return new kd(r).lex(i)}static lexInline(i,r){return new kd(r).inlineTokens(i)}lex(i){i=i.replace(Rt.carriageReturn,`
101
+ `),this.blockTokens(i,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,r=[],o=!1){var d,f,g;for(this.options.pedantic&&(i=i.replace(Rt.tabCharGlobal," ").replace(Rt.spaceLine,""));i;){let p;if((f=(d=this.options.extensions)==null?void 0:d.block)!=null&&f.some(x=>(p=x.call({lexer:this},i,r))?(i=i.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.space(i)){i=i.substring(p.raw.length);const x=r.at(-1);p.raw.length===1&&x!==void 0?x.raw+=`
102
+ `:r.push(p);continue}if(p=this.tokenizer.code(i)){i=i.substring(p.raw.length);const x=r.at(-1);(x==null?void 0:x.type)==="paragraph"||(x==null?void 0:x.type)==="text"?(x.raw+=`
103
+ `+p.raw,x.text+=`
104
+ `+p.text,this.inlineQueue.at(-1).src=x.text):r.push(p);continue}if(p=this.tokenizer.fences(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.heading(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.hr(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.blockquote(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.list(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.html(i)){i=i.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.def(i)){i=i.substring(p.raw.length);const x=r.at(-1);(x==null?void 0:x.type)==="paragraph"||(x==null?void 0:x.type)==="text"?(x.raw+=`
105
+ `+p.raw,x.text+=`
106
+ `+p.raw,this.inlineQueue.at(-1).src=x.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),r.push(p);continue}if(p=this.tokenizer.lheading(i)){i=i.substring(p.raw.length),r.push(p);continue}let m=i;if((g=this.options.extensions)!=null&&g.startBlock){let x=1/0;const y=i.slice(1);let k;this.options.extensions.startBlock.forEach(S=>{k=S.call({lexer:this},y),typeof k=="number"&&k>=0&&(x=Math.min(x,k))}),x<1/0&&x>=0&&(m=i.substring(0,x+1))}if(this.state.top&&(p=this.tokenizer.paragraph(m))){const x=r.at(-1);o&&(x==null?void 0:x.type)==="paragraph"?(x.raw+=`
107
+ `+p.raw,x.text+=`
108
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=x.text):r.push(p),o=m.length!==i.length,i=i.substring(p.raw.length);continue}if(p=this.tokenizer.text(i)){i=i.substring(p.raw.length);const x=r.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=`
109
+ `+p.raw,x.text+=`
110
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=x.text):r.push(p);continue}if(i){const x="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return this.state.top=!0,r}inline(i,r=[]){return this.inlineQueue.push({src:i,tokens:r}),r}inlineTokens(i,r=[]){var p,m,x;let o=i,d=null;if(this.tokens.links){const y=Object.keys(this.tokens.links);if(y.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)y.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,d.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let f=!1,g="";for(;i;){f||(g=""),f=!1;let y;if((m=(p=this.options.extensions)==null?void 0:p.inline)!=null&&m.some(S=>(y=S.call({lexer:this},i,r))?(i=i.substring(y.raw.length),r.push(y),!0):!1))continue;if(y=this.tokenizer.escape(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.tag(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.link(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(y.raw.length);const S=r.at(-1);y.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):r.push(y);continue}if(y=this.tokenizer.emStrong(i,o,g)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.codespan(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.br(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.del(i)){i=i.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.autolink(i)){i=i.substring(y.raw.length),r.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(i))){i=i.substring(y.raw.length),r.push(y);continue}let k=i;if((x=this.options.extensions)!=null&&x.startInline){let S=1/0;const E=i.slice(1);let j;this.options.extensions.startInline.forEach(v=>{j=v.call({lexer:this},E),typeof j=="number"&&j>=0&&(S=Math.min(S,j))}),S<1/0&&S>=0&&(k=i.substring(0,S+1))}if(y=this.tokenizer.inlineText(k)){i=i.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(g=y.raw.slice(-1)),f=!0;const S=r.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):r.push(y);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 r}},ur=class{constructor(l){Ye(this,"options");Ye(this,"parser");this.options=l||ua}space(l){return""}code({text:l,lang:i,escaped:r}){var f;const o=(f=(i||"").match(Rt.notSpaceStart))==null?void 0:f[0],d=l.replace(Rt.endingNewline,"")+`
111
+ `;return o?'<pre><code class="language-'+Dn(o)+'">'+(r?d:Dn(d,!0))+`</code></pre>
112
+ `:"<pre><code>"+(r?d:Dn(d,!0))+`</code></pre>
113
+ `}blockquote({tokens:l}){return`<blockquote>
114
+ ${this.parser.parse(l)}</blockquote>
115
+ `}html({text:l}){return l}heading({tokens:l,depth:i}){return`<h${i}>${this.parser.parseInline(l)}</h${i}>
116
+ `}hr(l){return`<hr>
117
+ `}list(l){const i=l.ordered,r=l.start;let o="";for(let g=0;g<l.items.length;g++){const p=l.items[g];o+=this.listitem(p)}const d=i?"ol":"ul",f=i&&r!==1?' start="'+r+'"':"";return"<"+d+f+`>
118
+ `+o+"</"+d+`>
119
+ `}listitem(l){var r;let i="";if(l.task){const o=this.checkbox({checked:!!l.checked});l.loose?((r=l.tokens[0])==null?void 0:r.type)==="paragraph"?(l.tokens[0].text=o+" "+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=o+" "+Dn(l.tokens[0].tokens[0].text),l.tokens[0].tokens[0].escaped=!0)):l.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):i+=o+" "}return i+=this.parser.parse(l.tokens,!!l.loose),`<li>${i}</li>
120
+ `}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
121
+ `}table(l){let i="",r="";for(let d=0;d<l.header.length;d++)r+=this.tablecell(l.header[d]);i+=this.tablerow({text:r});let o="";for(let d=0;d<l.rows.length;d++){const f=l.rows[d];r="";for(let g=0;g<f.length;g++)r+=this.tablecell(f[g]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
122
+ <thead>
123
+ `+i+`</thead>
124
+ `+o+`</table>
125
+ `}tablerow({text:l}){return`<tr>
126
+ ${l}</tr>
127
+ `}tablecell(l){const i=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+i+`</${r}>
128
+ `}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:r}){const o=this.parser.parseInline(r),d=kv(l);if(d===null)return o;l=d;let f='<a href="'+l+'"';return i&&(f+=' title="'+Dn(i)+'"'),f+=">"+o+"</a>",f}image({href:l,title:i,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const d=kv(l);if(d===null)return Dn(r);l=d;let f=`<img src="${l}" alt="${r}"`;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)}},nf=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 Nd{constructor(i){Ye(this,"options");Ye(this,"renderer");Ye(this,"textRenderer");this.options=i||ua,this.options.renderer=this.options.renderer||new ur,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nf}static parse(i,r){return new Nd(r).parse(i)}static parseInline(i,r){return new Nd(r).parseInline(i)}parse(i,r=!0){var d,f;let o="";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 x=p,y=this.options.extensions.renderers[x.type].call({parser:this},x);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(x.type)){o+=y||"";continue}}const m=p;switch(m.type){case"space":{o+=this.renderer.space(m);continue}case"hr":{o+=this.renderer.hr(m);continue}case"heading":{o+=this.renderer.heading(m);continue}case"code":{o+=this.renderer.code(m);continue}case"table":{o+=this.renderer.table(m);continue}case"blockquote":{o+=this.renderer.blockquote(m);continue}case"list":{o+=this.renderer.list(m);continue}case"html":{o+=this.renderer.html(m);continue}case"paragraph":{o+=this.renderer.paragraph(m);continue}case"text":{let x=m,y=this.renderer.text(x);for(;g+1<i.length&&i[g+1].type==="text";)x=i[++g],y+=`
129
+ `+this.renderer.text(x);r?o+=this.renderer.paragraph({type:"paragraph",raw:y,text:y,tokens:[{type:"text",raw:y,text:y,escaped:!0}]}):o+=y;continue}default:{const x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return o}parseInline(i,r=this.renderer){var d,f;let o="";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 x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){o+=x||"";continue}}const m=p;switch(m.type){case"escape":{o+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.text(m);break}default:{const x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return o}},pd,er=(pd=class{constructor(l){Ye(this,"options");Ye(this,"block");this.options=l||ua}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}},Ye(pd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),pd),Ax=class{constructor(...l){Ye(this,"defaults",Kd());Ye(this,"options",this.setOptions);Ye(this,"parse",this.parseMarkdown(!0));Ye(this,"parseInline",this.parseMarkdown(!1));Ye(this,"Parser",el);Ye(this,"Renderer",ur);Ye(this,"TextRenderer",nf);Ye(this,"Lexer",Pn);Ye(this,"Tokenizer",rr);Ye(this,"Hooks",er);this.use(...l)}walkTokens(l,i){var o,d;let r=[];for(const f of l)switch(r=r.concat(i.call(this,f)),f.type){case"table":{const g=f;for(const p of g.header)r=r.concat(this.walkTokens(p.tokens,i));for(const p of g.rows)for(const m of p)r=r.concat(this.walkTokens(m.tokens,i));break}case"list":{const g=f;r=r.concat(this.walkTokens(g.items,i));break}default:{const g=f;(d=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&d[g.type]?this.defaults.extensions.childTokens[g.type].forEach(p=>{const m=g[p].flat(1/0);r=r.concat(this.walkTokens(m,i))}):g.tokens&&(r=r.concat(this.walkTokens(g.tokens,i)))}}return r}use(...l){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.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)}),o.extensions=i),r.renderer){const d=this.defaults.renderer||new ur(this.defaults);for(const f in r.renderer){if(!(f in d))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;const g=f,p=r.renderer[g],m=d[g];d[g]=(...x)=>{let y=p.apply(d,x);return y===!1&&(y=m.apply(d,x)),y||""}}o.renderer=d}if(r.tokenizer){const d=this.defaults.tokenizer||new rr(this.defaults);for(const f in r.tokenizer){if(!(f in d))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;const g=f,p=r.tokenizer[g],m=d[g];d[g]=(...x)=>{let y=p.apply(d,x);return y===!1&&(y=m.apply(d,x)),y}}o.tokenizer=d}if(r.hooks){const d=this.defaults.hooks||new er;for(const f in r.hooks){if(!(f in d))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;const g=f,p=r.hooks[g],m=d[g];er.passThroughHooks.has(f)?d[g]=x=>{if(this.defaults.async)return Promise.resolve(p.call(d,x)).then(k=>m.call(d,k));const y=p.call(d,x);return m.call(d,y)}:d[g]=(...x)=>{let y=p.apply(d,x);return y===!1&&(y=m.apply(d,x)),y}}o.hooks=d}if(r.walkTokens){const d=this.defaults.walkTokens,f=r.walkTokens;o.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,...o}}),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(r,o)=>{const d={...o},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 r>"u"||r===null)return g(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return g(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));f.hooks&&(f.hooks.options=f,f.hooks.block=l);const p=f.hooks?f.hooks.provideLexer():l?Pn.lex:Pn.lexInline,m=f.hooks?f.hooks.provideParser():l?el.parse:el.parseInline;if(f.async)return Promise.resolve(f.hooks?f.hooks.preprocess(r):r).then(x=>p(x,f)).then(x=>f.hooks?f.hooks.processAllTokens(x):x).then(x=>f.walkTokens?Promise.all(this.walkTokens(x,f.walkTokens)).then(()=>x):x).then(x=>m(x,f)).then(x=>f.hooks?f.hooks.postprocess(x):x).catch(g);try{f.hooks&&(r=f.hooks.preprocess(r));let x=p(r,f);f.hooks&&(x=f.hooks.processAllTokens(x)),f.walkTokens&&this.walkTokens(x,f.walkTokens);let y=m(x,f);return f.hooks&&(y=f.hooks.postprocess(y)),y}catch(x){return g(x)}}}onError(l,i){return r=>{if(r.message+=`
130
+ Please report this to https://github.com/markedjs/marked.`,l){const o="<p>An error occurred:</p><pre>"+Dn(r.message+"",!0)+"</pre>";return i?Promise.resolve(o):o}if(i)return Promise.reject(r);throw r}}},ca=new Ax;function Xe(l,i){return ca.parse(l,i)}Xe.options=Xe.setOptions=function(l){return ca.setOptions(l),Xe.defaults=ca.defaults,bx(Xe.defaults),Xe};Xe.getDefaults=Kd;Xe.defaults=ua;Xe.use=function(...l){return ca.use(...l),Xe.defaults=ca.defaults,bx(Xe.defaults),Xe};Xe.walkTokens=function(l,i){return ca.walkTokens(l,i)};Xe.parseInline=ca.parseInline;Xe.Parser=el;Xe.parser=el.parse;Xe.Renderer=ur;Xe.TextRenderer=nf;Xe.Lexer=Pn;Xe.lexer=Pn.lex;Xe.Tokenizer=rr;Xe.Hooks=er;Xe.parse=Xe;Xe.options;Xe.setOptions;Xe.use;Xe.walkTokens;Xe.parseInline;el.parse;Pn.lex;function tN(l){return l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const nN=new Ax({renderer:{html(l){return tN(l.text??"")}}}),lN=/^(https?:|mailto:|\/|#|\.)/i;function xi(l){return nN.parse(l,{async:!1,gfm:!0,breaks:!0}).replace(/<a href="([^"]*)"/g,(r,o)=>lN.test(o.trim())?`<a target="_blank" rel="noreferrer" href="${o}"`:"<a")}const Ox={};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 r of i.split(" "))Ox[r]=l;function lf(l){const i=l.split(/[\\/]/).pop()??"",r=i.lastIndexOf(".");return r>0?Ox[i.slice(r+1).toLowerCase()]??"file":"file"}async function _x(l){try{const i=navigator.clipboard;return i!=null&&i.writeText?(await i.writeText(l),!0):!1}catch{return!1}}const Mx=["日","一","二","三","四","五","六"];function oi(l){return`${String(l.getHours()).padStart(2,"0")}:${String(l.getMinutes()).padStart(2,"0")}`}function af(l,i){const r=new Date(l),o=new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),d=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime();return Math.round((o-d)/864e5)}function Ol(l,i=new Date){const r=new Date(l);if(Number.isNaN(r.getTime()))return"";const o=af(l,i);return o===0?`今天 ${oi(r)}`:o===1?`昨天 ${oi(r)}`:o===-1?`明天 ${oi(r)}`:`${r.getMonth()+1}月${r.getDate()}日 ${oi(r)}`}function tr(l,i=new Date){if(!l)return"";const r=new Date(l);if(Number.isNaN(r.getTime()))return"";const o=af(l,i);return o===0?oi(r):o===1?"昨天":`${r.getMonth()+1}月${r.getDate()}日`}function sf(l,i=Date.now()){const r=Math.max(0,Math.round((i-new Date(l).getTime())/6e4));if(r<1)return"刚刚";if(r<60)return`${r} 分钟`;const o=Math.floor(r/60),d=r%60;return d?`${o} 小时 ${d} 分钟`:`${o} 小时`}function hr(l){const i=Math.max(0,Math.round(l/1e3));if(i<60)return`${i} 秒`;const r=Math.floor(i/60);if(r<60){const o=i%60;return o?`${r} 分 ${o} 秒`:`${r} 分钟`}return`${Math.floor(r/60)} 小时 ${r%60} 分钟`}function wv(l){if(l<1e3)return String(l);const i=l/1e3;return`${i<10?i.toFixed(1):Math.round(i)}k`}function cf(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 aN(l,i=new Date){return af(l,i)===0}function sN(l,i){return l?new Date(i).getTime()-new Date(l).getTime()>300*1e3:!1}function rf(l){const i={kind:"raw",hour:9,minute:0,weekday:5,day:1,raw:l},r=l.trim().split(/\s+/);if(r.length!==5)return i;const[o,d,f,g,p]=r;if(!/^\d+$/.test(o)||!/^\d+$/.test(d)||g!=="*")return i;const m=Number(o),x=Number(d);return m>59||x>23?i:f==="*"&&p==="*"?{...i,kind:"daily",hour:x,minute:m}:f==="*"&&/^\d$/.test(p)?{...i,kind:"weekly",hour:x,minute:m,weekday:Number(p)}:/^\d{1,2}$/.test(f)&&p==="*"?{...i,kind:"monthly",hour:x,minute:m,day:Number(f)}:i}function iN(l){const i=String(l.minute).padStart(2,"0"),r=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} ${r} * * *`}function uf(l){const i=rf(l),r=`${String(i.hour).padStart(2,"0")}:${String(i.minute).padStart(2,"0")}`;return i.kind==="daily"?`每天 ${r}`:i.kind==="weekly"?`每周${Mx[i.weekday]??"?"} ${r}`:i.kind==="monthly"?`每月${i.day}日 ${r}`:l}function cN(l,i,r){const o=i-l.x,d=r-l.y;let f=l.direction;return f==="pending"&&Math.hypot(o,d)>8&&(o<-8&&Math.abs(o)>Math.abs(d)*1.5?f="horizontal":(Math.abs(d)>Math.abs(o)||o>8)&&(f="vertical")),{...l,direction:f,distance:f==="horizontal"?Math.max(0,-o):0}}function Tv(l){return l.direction==="horizontal"&&l.distance>48}function rN(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 uN(l,i){return i.type==="open"?i.id:i.type==="outside"&&i.inside?l:null}const oN={memory:"mem",rule:"rule",routine:"clock",split:"split",info:"info"};function Sd(l){return l.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`#>]/g,"").trim()}function dN(){const[l,i]=w.useState(()=>window.matchMedia("(hover: none)").matches);return w.useEffect(()=>{const r=window.matchMedia("(hover: none)"),o=()=>i(r.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),l}function wd({text:l,itemId:i,menu:r=!1,close:o}){const[d,f]=w.useState(!1),g=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(g.current),[]);const p=async()=>{if(!await _x(l)){Zd("复制失败:浏览器不允许写入剪贴板");return}if(r){o==null||o();return}f(!0),window.clearTimeout(g.current),g.current=window.setTimeout(()=>f(!1),1500)};return s.jsxs("div",{className:`tools${r?" menu":""}`,children:[s.jsxs("button",{title:"回复","aria-label":"回复",onClick:()=>{ir({itemId:i,text:Sd(l).slice(0,60)}),sa(),o==null||o()},children:[s.jsx(Q,{name:"reply",size:16}),r?"回复":null]}),s.jsxs("button",{className:d?"copied":"",title:d?"已复制":"复制","aria-label":d?"已复制":"复制",onClick:()=>void p(),children:[s.jsx(Q,{name:d?"check":"copy",size:16}),r?"复制":null]})]})}function Ev({anchor:l,text:i,itemId:r,close:o}){const[d,f]=w.useState(null),g=w.useRef(null);if(w.useLayoutEffect(()=>{const y=l.current,k=y==null?void 0:y.closest(".mmsgs, .msgs");y&&k&&f({bubble:y.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:m}=d,x=rN(p,m);return vk.createPortal(s.jsxs("div",{className:"message-popup",onPointerDown:y=>y.stopPropagation(),children:[s.jsx("div",{className:"message-shade",style:{left:m.left,top:m.top,width:m.width,height:m.height},onPointerDown:o}),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:x,children:s.jsx(wd,{text:i,itemId:r,menu:!0,close:o})})]}),document.body)}function fN(l,i){const r=l.currentTarget.closest(".col"),o=[...(r==null?void 0:r.querySelectorAll(".message-row[data-item-id]"))??[]].find(f=>f.dataset.itemId===i),d=o==null?void 0:o.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 nr={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 Cv(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:hr(i)}function hN({job:l,fresh:i}){const r=we(),[o,d]=w.useState(!1),[f,g]=w.useState(""),[p,m]=w.useState(!1),x=Un(o,200),y=nr[l.status],k=l.status==="done",S=l.status==="running",E=S||l.status==="waiting",j=l.status==="stuck"||l.status==="failed",v=Pv(l),N=r.assistants.find(O=>O.id===l.assistantId),A=w.useRef(l.status);return w.useEffect(()=>{if(A.current===l.status)return;A.current=l.status,m(!0);const O=window.setTimeout(()=>m(!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:()=>aa(l.id),onKeyDown:O=>{O.key==="Enter"&&aa(l.id)},children:[s.jsxs("div",{className:"tt",children:[N?s.jsx("span",{className:"jav",children:s.jsx(Ct,{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(Q,{name:"spin",size:14,w:2,className:`spin stspin${S?"":" off"}`}),S?null:s.jsx(Q,{name:y.icon,size:14,w:2,className:`stic${k?" pop":""}${p?" anim":""}`})]}),y.text,S?` · ${sf(l.startedAt??l.createdAt)}`:Cv(l)?` · 用时 ${Cv(l)}`:null]})]}),v?s.jsx("div",{className:`meta${j?" bad":""}`,children:v}):null,E||S?s.jsxs("div",{className:"acts",children:[E?s.jsxs("button",{className:`btn job-reply${o?" selected":""}`,"aria-pressed":o,onClick:O=>{O.stopPropagation(),d(V=>!V)},children:[s.jsx(Q,{name:"edit",size:14}),"补充要求"]}):null,S?s.jsxs("button",{className:"btn job-stop",onClick:O=>{O.stopPropagation(),ox(l.id)},children:[s.jsx(Q,{name:"stop",size:14}),"停止"]}):null]}):null,x.mounted?s.jsx("div",{className:`replywrap${x.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()&&(vd(l.id,f.trim()),g(""),d(!1)),O.key==="Escape"&&d(!1)}}),s.jsx("button",{className:"pbtn solid",onClick:()=>{f.trim()&&vd(l.id,f.trim()),g(""),d(!1)},children:"发送"})]})})}):null]})})}function zv({draft:l}){const i=we(),r=l.status==="created"&&l.createdAssistantId,o=r?i.assistants.find(g=>g.id===l.createdAssistantId):void 0,d=(o==null?void 0:o.prop)??l.prop,f=!!r&&!o;return s.jsxs("div",{className:"draft",children:[s.jsxs("div",{className:"top",children:[s.jsx(Ct,{sprite:(o==null?void 0:o.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${r?"":" open"}`,inert:!!r,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:r?"off":void 0,children:[s.jsx("button",{className:"btn solid",onClick:()=>void q1(l.id),children:"创建"}),s.jsx("button",{className:"btn",style:{background:"var(--bubble)"},onClick:()=>{$d("请修改草稿:"),sa()},children:"修改草稿"})]}),s.jsx("div",{className:r?void 0:"off",children:s.jsx("button",{className:"btn solid",disabled:f,onClick:()=>void tn(l.createdAssistantId),children:f?"已并回 Hob":"已创建 · 查看"})})]})]})}function mN({delegation:l,fresh:i}){const r=we(),[o,d]=w.useState(!1),f=r.assistants.find(x=>x.id===l.to),g=(f==null?void 0:f.name)??l.to,p={running:"进行中",waiting:"等你确认",done:"已完成",stuck:"受阻",interrupted:"已中断",returned:"已退回"},m=Object.values(r.approvals).filter(x=>x.status==="pending"&&((l.approvalIds??[]).includes(x.id)||!!(x.jobId&&l.jobIds.includes(x.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(Ct,{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(Q,{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${o?" expanded":""}`,onClick:()=>d(!o),title:o?"收起":"查看全文",children:l.text}),l.status==="returned"&&l.reply?s.jsx("div",{className:"note",children:l.reply}):null,l.jobIds.map(x=>{const y=r.jobs[x];return y?s.jsxs("button",{className:`delegation-job ${y.status}`,onClick:()=>aa(x),title:nr[y.status].text,children:[s.jsx(Q,{name:nr[y.status].icon,size:14,w:2,className:nr[y.status].cls}),s.jsx("span",{children:y.title}),s.jsx(Q,{name:"chev",size:14,className:"go"})]},x):null}),m.map(x=>s.jsx(Rx,{approval:x,fresh:!1},x.id)),s.jsxs("div",{className:"delegation-actions",children:[s.jsxs("button",{onClick:()=>void Yd(l.to,l.id,!0),children:["去「",g,"」看看 →"]}),l.status==="interrupted"?s.jsx("button",{onClick:()=>void Y1(l.id),children:"重新转交"}):null]})]})})}function Rx({approval:l,fresh:i}){var E;const r=l.options.find(j=>j.key===l.chosen),o=l.status==="answered"&&r?l.chosen:void 0,[d,f]=w.useState(null),[g,p]=w.useState(""),m=d??o,x=d!==null,y=l.status==="answered"?l.answerText:void 0,k=g.trim(),S=()=>{k&&dv(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:[y?s.jsxs("div",{className:"opt chosen",children:[s.jsx("span",{className:"key",children:s.jsx(Q,{name:"user",size:12})}),y,s.jsx("span",{className:"ck",children:s.jsx(Q,{name:"check",size:16})})]}):m&&!x?s.jsxs("div",{className:"opt chosen",children:[s.jsx("span",{className:"key",children:m}),(E=l.options.find(j=>j.key===m))==null?void 0:E.label,s.jsx("span",{className:"ck",children:s.jsx(Q,{name:"check",size:16})})]}):l.options.map(j=>{const v=j.key===m;return s.jsx("div",{className:`optrow${x&&!v?" away":""}`,children:s.jsx("div",{className:"optclip",children:s.jsxs("button",{className:`opt${v?" chosen":""}`,disabled:x,onClick:()=>{f(j.key),dv(l.id,{key:j.key})},children:[s.jsx("span",{className:"key",children:j.key}),j.label,v&&x?s.jsx("span",{className:"ck",children:s.jsx(Q,{name:"check",size:16})}):null]})})},j.key)}),y||x||m?null:s.jsxs("div",{className:"other",children:[s.jsx("input",{value:g,placeholder:"其他想法…",onChange:j=>p(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.nativeEvent.isComposing&&S()}}),k?s.jsx("button",{className:"ib other-send",title:"发送",onClick:S,children:s.jsx(Q,{name:"send",size:16})}):null]})]})]})}function pN({name:l,path:i,meta:r,fresh:o}){return s.jsxs("button",{className:`att filecard${o?" enter":""}`,onClick:()=>ds(i,l),children:[s.jsx("span",{className:"ico",children:s.jsx(Q,{name:lf(i),size:18})}),s.jsxs("span",{children:[s.jsx("span",{className:"n",style:{display:"block"},children:l}),r?s.jsx("span",{className:"m",children:r}):null]})]})}function gN({name:l,path:i,fresh:r}){return s.jsx("button",{className:`imgcard${r?" enter":""}`,onClick:()=>ds(i),title:l,children:s.jsx("img",{src:hn(i),alt:l,loading:"lazy"})})}function vN(l){const i=w.useRef(null);return w.useLayoutEffect(()=>{const r=i.current;if(!r||(r.style.maxWidth="",l===void 0))return;let o=!0;const d=()=>{if(!o)return;r.style.maxWidth="";const f=r.getBoundingClientRect();if(!f.width)return;let g=0;const p=document.createRange(),m=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(let y=m.nextNode();y;y=m.nextNode()){let k;if(y instanceof Element){if(getComputedStyle(y).display!=="inline")continue;k=y.getClientRects()}else p.selectNodeContents(y),k=p.getClientRects();for(const S of k)g=Math.max(g,S.right)}if(!g)return;const x=Math.ceil(g-f.left+parseFloat(getComputedStyle(r).paddingRight));x>=f.width-1||(r.style.maxWidth=`${x}px`,r.getBoundingClientRect().height>f.height+.5&&(r.style.maxWidth=""))};return d(),document.fonts.ready.then(d),()=>{o=!1}},[l]),i}function xN({item:l,inlineDraft:i,fresh:r,tools:o}){var k;const d=we(),f=r?" enter":"",g=vN(l.kind==="user"?l.text:void 0),p=o.touch?S=>S.preventDefault():void 0,m=o.distance?{transform:`translateX(-${Math.min(64,o.distance*.8)}px)`,transition:"none"}:void 0,x=Math.min(1,o.distance/48),y=o.distance>0?s.jsx("span",{className:`swipe-reply${o.ready?" ready":""}`,style:{opacity:x,transform:`scale(${x})`},children:s.jsx("span",{className:"swipe-reply-inner",children:s.jsx(Q,{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:o.start,onContextMenu:p,children:[y,s.jsxs("div",{className:`hov right msg${r?" enter-right":""}`,children:[s.jsxs("div",{className:"u",ref:g,style:m,children:[l.from?s.jsxs("button",{className:"forward-label",onClick:()=>void(l.from.assistantId==="hob"?Yd(l.from.assistantId,l.from.delegationId,!1):fv(l.from.assistantId,l.from.delegationId,!1)),children:[(()=>{const S=d.assistants.find(E=>E.id===l.from.assistantId);return S?s.jsx(Ct,{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=>fN(S,l.quote.itemId),children:l.quote.text}):null,l.text,(k=l.files)!=null&&k.length?l.files.map(S=>s.jsxs("button",{className:"ufile",onClick:()=>ds(S),children:[s.jsx(Q,{name:"doc",size:13}),S.split("/").pop()]},S)):null]}),s.jsx(wd,{text:l.text,itemId:l.id})]}),o.open?s.jsx(Ev,{anchor:g,text:l.text,itemId:l.id,close:o.close}):null]});if(l.kind==="assistant")return s.jsxs(s.Fragment,{children:[l.routine?s.jsxs("div",{className:`tag${r?" enter-fade":""}`,children:[s.jsx(Q,{name:"clock",size:13}),l.routine.name]}):null,s.jsxs("div",{className:"message-row","data-item-id":l.id,onPointerDown:o.start,onContextMenu:p,children:[y,s.jsxs("div",{className:`hov msg${f}`,children:[s.jsxs("div",{className:`b${i?" wide":""}`,ref:g,style:m,children:[s.jsx("div",{dangerouslySetInnerHTML:{__html:xi(l.text)+(l.streaming?'<span class="cur"></span>':"")}}),i?s.jsx(zv,{draft:i}):null]}),s.jsx(wd,{text:l.text,itemId:l.id})]}),o.open?s.jsx(Ev,{anchor:g,text:l.text,itemId:l.id,close:o.close}):null]})]});if(l.kind==="note")return s.jsxs("div",{className:`sys${r?" enter-fade":""}`,id:l.handbackId?`handback-${l.handbackId}`:void 0,children:[l.icon!=="split"?s.jsx(Q,{name:oN[l.icon],size:14}):null,l.handbackId?s.jsx("button",{onClick:()=>void fv("hob",l.handbackId,!0),children:l.text}):l.text]});if(l.kind==="question"){const S=d.approvals[l.approvalId];return S?s.jsx(Rx,{approval:S,fresh:r}):null}if(l.kind==="job"){const S=d.jobs[l.jobId];return S?s.jsx(hN,{job:S,fresh:r}):null}if(l.kind==="draft"){const S=d.drafts[l.draftId];return S?s.jsx("div",{className:`b wide${f}`,children:s.jsx(zv,{draft:S})}):null}if(l.kind==="delegation"){const S=d.delegations[l.delegationId];return S?s.jsx(mN,{delegation:S,fresh:r}):null}return bk(l.path)?s.jsx(gN,{path:l.path,name:l.name,fresh:r}):s.jsx(pN,{path:l.path,name:l.name,meta:l.meta,fresh:r})}function bN(l,i){return l?l.kind==="user"!=(i.kind==="user")||!!i.lead:!1}function Dx({items:l}){const i=we(),r=dN(),[o,d]=w.useReducer(uN,null),f=w.useRef(null),[g,p]=w.useState(null);w.useEffect(()=>{const x=()=>{f.current&&window.clearTimeout(f.current.timer),f.current=null,p(null)},y=j=>{d({type:"outside",inside:j.target instanceof Element&&!!j.target.closest(".tools.menu")})},k=j=>{var A;const v=f.current;if(!v||v.pointerId!==j.pointerId)return;if(v.swipe=cN(v.swipe,j.clientX,j.clientY),Math.hypot(j.clientX-v.swipe.x,j.clientY-v.swipe.y)>10&&window.clearTimeout(v.timer),v.swipe.direction==="vertical"){x();return}if(v.swipe.direction!=="horizontal")return;window.clearTimeout(v.timer);const N=Tv(v.swipe);if(N&&!v.ready&&((A=navigator.vibrate)==null||A.call(navigator,10)),v.ready=N,window.matchMedia("(prefers-reduced-motion: reduce)").matches){N&&(ir({itemId:v.id,text:Sd(v.text).slice(0,60)}),sa(),x());return}p({id:v.id,distance:v.swipe.distance,ready:N})},S=j=>{const v=f.current;!v||v.pointerId!==j.pointerId||(Tv(v.swipe)&&(ir({itemId:v.id,text:Sd(v.text).slice(0,60)}),sa()),x())},E=()=>{x(),d({type:"close"})};return document.addEventListener("pointerdown",y,!0),document.addEventListener("pointermove",k,!0),document.addEventListener("pointerup",S,!0),document.addEventListener("pointercancel",x,!0),document.addEventListener("scroll",E,!0),()=>{x(),document.removeEventListener("pointerdown",y,!0),document.removeEventListener("pointermove",k,!0),document.removeEventListener("pointerup",S,!0),document.removeEventListener("pointercancel",x,!0),document.removeEventListener("scroll",E,!0)}},[]);const m=[];l.length&&!aN(l[0].at)&&l[0].kind!=="note"&&m.push(s.jsx("div",{className:"div",children:Ol(l[0].at)},"first-div"));for(let x=0;x<l.length;x++){const y=l[x],k=l[x-1],S=l[x+1],E=wj(y.id),j=y.kind==="assistant"&&(S==null?void 0:S.kind)==="draft"?i.drafts[S.draftId]:void 0,v={open:r&&o===y.id,touch:r,distance:(g==null?void 0:g.id)===y.id?g.distance:0,ready:(g==null?void 0:g.id)===y.id&&g.ready,close:()=>d({type:"close"}),start:r?N=>{if(N.pointerType!=="touch"||y.kind!=="user"&&y.kind!=="assistant"||N.target.closest("a,button,input,textarea,select,[contenteditable],.draft"))return;f.current&&window.clearTimeout(f.current.timer);const{clientX:A,clientY:O,pointerId:V}=N,ee=window.setTimeout(()=>{f.current=null,d({type:"open",id:y.id})},500);f.current={timer:ee,pointerId:V,id:y.id,text:y.text,swipe:{x:A,y:O,direction:"pending",distance:0},ready:!1}}:void 0};j&&x++,m.push(s.jsxs(w.Fragment,{children:[sN(k==null?void 0:k.at,y.at)?s.jsx("div",{className:`div${E?" enter-fade":""}`,children:Ol(y.at)}):bN(k,y)?s.jsx("div",{className:"g"}):null,s.jsx(xN,{item:y,inlineDraft:j,fresh:E,tools:v})]},y.id))}for(const x of Nj(Object.values(i.livePages),i.sel))m.push(s.jsxs("button",{className:`att filecard${x.state==="failed"?" bad":""}`,onClick:()=>ck(x.callId),children:[s.jsx("span",{className:"ico",children:s.jsx(Q,{name:x.state==="writing"?"spin":"close",className:x.state==="writing"?"spin":"",size:18})}),s.jsxs("span",{children:[s.jsx("span",{className:"n",style:{display:"block"},children:x.title||"正在写页面…"}),s.jsx("span",{className:"m",children:x.state==="failed"?`生成失败:${x.error}`:"生成中"})]})]},x.callId));return s.jsx(s.Fragment,{children:m})}function Ux({leaving:l,gap:i}){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:"b thinking",title:"正在生成回复…",children:[s.jsx("span",{className:"dot"}),s.jsx("span",{className:"dot"}),s.jsx("span",{className:"dot"})]})})]})}function Hx(l,i,r){const o=w.useRef(!0),d=w.useRef({key:"",len:0});w.useEffect(()=>{const f=l.current;if(!f)return;const g=()=>{o.current=f.scrollHeight-f.scrollTop-f.clientHeight<80},p=new ResizeObserver(()=>{o.current&&(f.scrollTop=f.scrollHeight)});f.addEventListener("scroll",g);for(const m of Array.from(f.children))p.observe(m);return()=>{f.removeEventListener("scroll",g),p.disconnect()}},[l]),w.useLayoutEffect(()=>{const f=l.current;if(!f)return;const g=d.current;d.current={key:i,len:r},g.key!==i||r<g.len?(o.current=!0,f.scrollTop=f.scrollHeight):r>g.len&&o.current&&f.scrollTo({top:f.scrollHeight,behavior:"smooth"})},[l,i,r])}const yN=["查看这台电脑的磁盘和内存占用","每天早上 9 点给我一份科技新闻简报","把附件里的会议记录整理成要点"];function Bx({a:l}){const r=we().settings.settings.models,o=r.roster.length>0&&r.conversation.ref!=="";return s.jsxs("div",{className:"hello",children:[s.jsx(Ct,{sprite:l.sprite,prop:l.prop,size:56}),s.jsx("div",{className:"t",children:`我是${Lx(l.name,!1)}${l.primary?",你的主助手":""}`}),s.jsx("div",{className:"d",children:l.primary?"交给我的事,我会分派给后台任务执行,完成、受阻或需要你确认时再告诉你;也可以让我定时执行。同类工作多了,我会建议创建专属助手。":`负责${l.duty}。`}),o?l.primary?s.jsx("div",{className:"ex",children:yN.map(d=>s.jsx("button",{className:"btn",onClick:()=>{$d(d),sa()},children:d},d))}):null:s.jsxs("div",{className:"setup",children:[s.jsx("div",{children:"开始使用前,请先添加模型服务商并选择模型。"}),s.jsx("button",{className:"btn solid",onClick:()=>{Qd(),hi("providers")},children:"前往设置"})]})]})}function Lx(l,i=!0){const r=o=>!!(o&&/[A-Za-z0-9]/.test(o));return`${r(l[0])?" ":""}${l}${i&&r(l.at(-1))?" ":""}`}function qx(l,i){return`${l??""}|${i??0}`}function jN(){var m,x;const l=we(),i=l.assistants.find(y=>y.id===l.sel),r=l.sel?l.items[l.sel]??[]:[],o=!!(i&&l.sel&&((m=l.items[l.sel])==null?void 0:m.length)===0&&!i.busy),d=w.useRef(null),f=qx(l.sel,l.sel?l.itemGen[l.sel]:0),g=!!(i!=null&&i.busy)&&!Jv(r),p=Un(g,180);return Hx(d,f,r.length),s.jsxs("main",{className:"chat",children:[s.jsxs("div",{className:"head",children:[i?s.jsx(Ct,{sprite:i.sprite,prop:i.prop,size:24}):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:ek,children:s.jsx(Q,{name:"panel",size:18})}):null]}),s.jsx("div",{className:"msgs",ref:d,children:s.jsxs("div",{className:`col${o?" mid":""}`,children:[o&&i?s.jsx(Bx,{a:i}):s.jsx(Dx,{items:r}),p.mounted?s.jsx(Ux,{leaving:p.leaving,gap:((x=r.at(-1))==null?void 0:x.kind)==="user"}):null]})}),s.jsx($x,{})]})}function $x({variant:l="desktop"}){var p;const i=we(),r=i.assistants.find(m=>m.id===i.sel),o=w.useRef(null),d=i.text.trim().length>0,f=Un(i.quote!==null,180);w.useLayoutEffect(()=>{const m=o.current;if(!m)return;m.style.height="auto";const x=l==="mobile"?120:180;m.style.height=`${Math.min(m.scrollHeight,x)}px`},[i.text,i.nonce,l]),w.useEffect(()=>{var m;i.nonce&&((m=o.current)==null||m.focus())},[i.nonce]);const g=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:(p=i.quote)==null?void 0:p.text}),s.jsx("button",{className:"ib",style:{width:20,height:20},onClick:()=>ir(null),title:"取消引用",children:s.jsx(Q,{name:"close",size:13})})]}):null,i.files.length?s.jsx("div",{className:"comp-files",children:i.files.map(m=>s.jsxs("span",{className:"filechip",children:[s.jsx(Q,{name:"doc",size:12}),m.split("/").pop(),s.jsx("button",{onClick:()=>B1(m),title:"移除",children:s.jsx(Q,{name:"close",size:11})})]},m))}):null,s.jsxs("div",{className:"comp-main",children:[s.jsxs("label",{className:"pl",title:"加文件",children:[s.jsx(Q,{name:"plus",size:19}),s.jsx("input",{type:"file",multiple:!0,hidden:!0,onChange:m=>{const x=Array.from(m.target.files??[]);m.target.value="",x.length&&L1(x)}})]}),s.jsx("textarea",{ref:o,className:"ta",rows:1,value:i.text,placeholder:`给${Lx((r==null?void 0:r.name)??"")}发消息`,onChange:m=>$d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&!m.nativeEvent.isComposing&&(m.preventDefault(),ov())}}),s.jsx("button",{className:"sendbtn",title:"发送",disabled:!d,onClick:()=>void ov(),children:s.jsx(Q,{name:"send",size:17})})]})]});return l==="mobile"?s.jsx("div",{className:"mcomp-wrap",children:g}):s.jsx("div",{className:"compwrap",children:s.jsx("div",{className:"col",children:g})})}function kN(){var m,x;const l=we(),i=l.assistants.find(y=>y.id===l.sel),r=l.sel?l.items[l.sel]??[]:[],o=!!(i&&l.sel&&((m=l.items[l.sel])==null?void 0:m.length)===0&&!i.busy),d=w.useRef(null),f=!!(i!=null&&i.busy)&&!Jv(r),g=Un(f,180),p=qx(l.sel,l.sel?l.itemGen[l.sel]:0);return Hx(d,p,r.length),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mchat-head",children:[s.jsx("button",{className:"ib",style:{marginLeft:-8},title:"返回",onClick:()=>tk("list"),children:s.jsx(Q,{name:"left",size:22})}),i?s.jsx(Ct,{sprite:i.sprite,prop:i.prop,size:30}):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:nk,children:s.jsx(Q,{name:"more",size:20})})]}),s.jsx("div",{className:"mmsgs",ref:d,children:s.jsxs("div",{className:`col${o?" mid":""}`,children:[o&&i?s.jsx(Bx,{a:i}):s.jsx(Dx,{items:r}),g.mounted?s.jsx(Ux,{leaving:g.leaving,gap:((x=r.at(-1))==null?void 0:x.kind)==="user"}):null]})}),s.jsx($x,{variant:"mobile"})]})}const NN="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')});",SN="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'})});",wN="(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)})();",TN="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data: https:; media-src data: https:; font-src data:",EN=`: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}
131
+ :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}
132
+ *{box-sizing:border-box}
133
+ 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}
134
+ body{margin:0;padding:52px 24px 80px}
135
+ .page{max-width:760px;margin:0 auto}
136
+ .hd{margin-bottom:40px;padding-bottom:28px;border-bottom:1px solid var(--line)}
137
+ .hd h1{font-size:32px;line-height:1.25;letter-spacing:-.015em;margin:0 0 10px;font-weight:700}
138
+ .hd p{margin:0;color:var(--muted);font-size:17px;line-height:1.6}
139
+ h2{font-size:22px;line-height:1.35;letter-spacing:-.01em;margin:48px 0 14px;font-weight:700}
140
+ h3{font-size:16.5px;line-height:1.45;margin:28px 0 8px;font-weight:650}
141
+ main>h2:first-child,main>section:first-child>h2:first-child{margin-top:0}
142
+ p,ul,ol,table,pre,figure,blockquote,.note,.cards,.cols,.kpis,.steps{margin:0 0 18px}
143
+ ul,ol{padding-left:1.4em}li{margin:5px 0}li::marker{color:var(--faint)}
144
+ a{color:var(--accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,transparent)}
145
+ strong,b{font-weight:650}
146
+ .muted{color:var(--muted)}.accent{color:var(--accent)}.ok{color:var(--ok)}.warn{color:var(--warn)}.bad{color:var(--bad)}
147
+ code{font:.88em/1.5 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;background:var(--soft);padding:.12em .4em;border-radius:5px}
148
+ 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}
149
+ blockquote{border-left:3px solid var(--line);padding:2px 0 2px 16px;color:var(--muted)}
150
+ hr{border:0;border-top:1px solid var(--line);margin:36px 0}
151
+ table{width:100%;border-collapse:collapse;font-size:14.5px;line-height:1.6}
152
+ .tw{overflow-x:auto;margin:0 0 18px}.tw>table{margin:0}
153
+ th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}
154
+ th{font-size:13px;font-weight:600;color:var(--muted);border-bottom-width:1.5px;white-space:nowrap}
155
+ td{min-width:5.5em}
156
+ th:first-child,td:first-child{padding-left:0}th:last-child,td:last-child{padding-right:0}
157
+ .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
158
+ .card{background:var(--soft);border-radius:14px;padding:16px 18px}.card h3{margin:0 0 6px;font-size:15.5px}
159
+ .cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px 28px}
160
+ .cols>div>h3:first-child{margin-top:0}
161
+ .kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
162
+ .kpi{border:1px solid var(--line);border-radius:14px;padding:14px 16px 12px}
163
+ .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}
164
+ .steps{list-style:none;padding:0;counter-reset:s}
165
+ .steps>li{position:relative;margin:0;padding:1px 0 20px 44px;counter-increment:s}
166
+ .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}
167
+ .steps>li::after{content:"";position:absolute;left:13.5px;top:34px;bottom:6px;width:1px;background:var(--line)}
168
+ .steps>li:last-child{padding-bottom:0}.steps>li:last-child::after{display:none}.steps>li>b:first-child{display:block}
169
+ .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)}
170
+ .card>:last-child,.note>:last-child,.cols>div>:last-child,section>:last-child{margin-bottom:0}
171
+ .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}
172
+ .card .tag{background:var(--bg)}
173
+ .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)}
174
+ figure{margin:28px 0;overflow-x:auto}img,svg{max-width:100%;height:auto}figure>svg,figure>img{display:block;margin:0 auto}
175
+ figcaption{color:var(--muted);font-size:13.5px;margin-top:10px;text-align:center}
176
+ svg{color:var(--ink)}svg text{fill:var(--ink);font-family:inherit;font-size:13px}
177
+ 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}
178
+ svg .line{fill:none;stroke:var(--faint);stroke-width:1.5}svg text.muted{fill:var(--muted)}svg text.accent{fill:var(--accent)}
179
+ @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}}`,ud=l=>l.replace(/[&<>"]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[i]);function CN(){return zN("","","").replace("</body>",`<script>
180
+ (function(){
181
+ let latest, scheduled = false, follow = true;
182
+ addEventListener('scroll', function(){ follow = document.documentElement.scrollHeight - innerHeight - scrollY < 48; }, {passive:true});
183
+ addEventListener('message', function(e){
184
+ if(e.source !== parent || e.data?.type !== 'hob-page-live') return;
185
+ latest = e.data;
186
+ if(scheduled) return;
187
+ scheduled = true;
188
+ requestAnimationFrame(function(){
189
+ scheduled = false;
190
+ document.documentElement.classList.toggle('dark', !!latest.dark);
191
+ document.title = latest.title || '';
192
+ document.querySelector('.hd h1').textContent = latest.title || '';
193
+ document.querySelector('.hd p').textContent = latest.summary || '';
194
+ const main = document.querySelector('main');
195
+ const template = document.createElement('template');
196
+ template.innerHTML = (latest.html || '').replace(/<[^>]*$/, '');
197
+ template.content.querySelectorAll('script,iframe,object,embed').forEach(function(el){el.remove()});
198
+ template.content.querySelectorAll('*').forEach(function(el){
199
+ 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)});
200
+ });
201
+ main.innerHTML = template.innerHTML;
202
+ main.querySelectorAll('table').forEach(function(t){const w=document.createElement('div');w.className='tw';t.before(w);w.append(t)});
203
+ 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'});
204
+ if(follow) scrollTo(0, document.documentElement.scrollHeight);
205
+ });
206
+ });
207
+ })();<\/script></body>`)}function zN(l,i,r){return`<!doctype html>
208
+ <html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
209
+ <meta http-equiv="Content-Security-Policy" content="${TN}">
210
+ <title>${ud(l)}</title><script>${wN}${SN}<\/script><style>${EN}</style></head>
211
+ <body><div class="page"><header class="hd"><h1>${ud(l)}</h1><p>${ud(i)}</p></header>
212
+ <main>
213
+ ${r}
214
+ </main></div><script>${NN}<\/script></body></html>
215
+ `}function AN(l){const[i,...r]=l;return i?i.map((o,d)=>r.length>0&&r.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 ON=1024*1024;function od(){const l=we(),i=l.filePreview,r=Un(!!i,180),o=w.useRef(i);i&&(o.current=i),w.useEffect(()=>{if(!i)return;const f=g=>{g.key==="Escape"&&yd()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[i]);const d=i??o.current;return!r.mounted||!d?null:s.jsx("div",{className:`fpwrap${r.leaving?" leaving":""}`,onClick:yd,children:s.jsx("div",{className:`fp${d.full?" full":""}`,onClick:f=>f.stopPropagation(),children:d.liveId&&l.livePages[d.liveId]?s.jsx(_N,{page:l.livePages[d.liveId]}):s.jsx(MN,{path:d.path,title:d.title})})})}function _N({page:l}){const i=w.useRef(null),r=w.useRef(l);r.current=l;const[o,d]=w.useState(null),f=w.useMemo(()=>CN(),[]),g=()=>{var m,x;return(x=(m=i.current)==null?void 0:m.contentWindow)==null?void 0:x.postMessage({type:"hob-page-live",title:r.current.title,summary:r.current.summary,html:r.current.html,dark:document.documentElement.classList.contains("dark")},"*")};w.useEffect(()=>{g()},[l]),w.useEffect(()=>{const m=new MutationObserver(g);m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const x=y=>{var k,S,E;if(!(y.source!==((k=i.current)==null?void 0:k.contentWindow)||((S=y.data)==null?void 0:S.type)!=="hob-page-link"||!((E=navigator.userActivation)!=null&&E.isActive)))try{const j=new URL(y.data.url);["http:","https:"].includes(j.protocol)&&window.open(j.href,"_blank","noopener")}catch{}};return window.addEventListener("message",x),()=>{m.disconnect(),window.removeEventListener("message",x)}},[]),w.useEffect(()=>{let m=!0;return l.path&&gx(l.path).then(x=>{m&&d(x)}).catch(x=>Zd(`无法加载文件信息:${x instanceof Error?x.message:String(x)}`)),()=>{m=!1}},[l.path]);const p=l.state!=="done";return s.jsxs(s.Fragment,{children:[s.jsx(Yx,{name:l.title||"正在写页面…",meta:o,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)&&o?s.jsx(Gx,{meta:o}):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 MN({path:l,title:i}){const[r,o]=w.useState({state:"loading"});w.useEffect(()=>{let g=!0;return o({state:"loading"}),gx(l).then(p=>{g&&o({state:"ok",meta:p})}).catch(p=>{if(!g)return;const m=p instanceof Error?p.message:String(p),x=m.includes("只允许读 Hob 自己的文件");o({state:"error",outside:x,message:m})}),()=>{g=!1}},[l]);const d=r.state==="ok"?r.meta:null,f=i??(d==null?void 0:d.name)??l.split("/").pop()??l;return s.jsxs(s.Fragment,{children:[s.jsx(Yx,{name:f,meta:d,path:l}),s.jsx("div",{className:"fp-body",children:r.state==="loading"?s.jsx("div",{className:"fp-center dim",children:"正在读取文件信息…"}):r.state==="error"?s.jsx("div",{className:"fp-center",children:s.jsxs("div",{className:"fp-nofile",children:[s.jsx(Q,{name:"doc",size:22}),s.jsx("div",{children:r.outside?"这个文件不在 Hob 的数据目录里,无法预览":r.message}),s.jsx("button",{className:"pbtn",onClick:()=>void _x(l).then(g=>Zd(g?"路径已复制":"复制失败:浏览器不允许写入剪贴板")),children:"复制路径"})]})}):s.jsx(RN,{meta:r.meta})})]})}function Yx({name:l,meta:i,path:r,liveStatus:o,disabled:d}){return s.jsxs("div",{className:"fphead",children:[s.jsx("button",{className:"ib",title:"关闭",onClick:yd,children:s.jsx(Q,{name:"left",size:18})}),s.jsx(Q,{name:lf(r),size:18,className:"fp-file-icon"}),s.jsxs("div",{className:"fpt",children:[s.jsx("div",{className:"n",title:l,children:l}),o?s.jsx("div",{className:"m",children:o}):i?s.jsxs("div",{className:"m",children:[cf(i.size)," · ",Ol(i.modifiedAt)]}):null]}),d?s.jsx("button",{className:"ib fp-act",title:"下载",disabled:!0,children:s.jsx(Q,{name:"dl",size:17})}):s.jsx("a",{className:"ib fp-act",title:"下载",href:hn(r),download:l,children:s.jsx(Q,{name:"dl",size:17})}),s.jsx("button",{className:"ib fp-act",title:"在新窗口打开",disabled:d,onClick:()=>window.open(hn(r,{inline:!0}),"_blank","noopener"),children:s.jsx(Q,{name:"out",size:17})}),s.jsx("button",{className:"ib fp-act fp-wide-btn",title:"切换全宽",onClick:rk,children:s.jsx(Q,{name:"dbl",size:17})})]})}function Gx({meta:l}){const i=w.useRef(null);return w.useEffect(()=>{const r=o=>{var d,f,g;if(!(!l.page||o.source!==((d=i.current)==null?void 0:d.contentWindow)||((f=o.data)==null?void 0:f.type)!=="hob-page-link"||!((g=navigator.userActivation)!=null&&g.isActive)))try{const p=new URL(o.data.url);(p.protocol==="https:"||p.protocol==="http:")&&window.open(p.href,"_blank","noopener")}catch{}};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[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:hn(l.path,{inline:!0})+(l.page?document.documentElement.classList.contains("dark")?"#dark":"#light":""),title:l.name})]})}function RN({meta:l}){switch(l.kind){case"image":return s.jsx(Av,{path:l.path,name:l.name,svg:!1});case"svg":return s.jsx(Av,{path:l.path,name:l.name,svg:!0});case"pdf":return s.jsx("iframe",{className:"fp-frame",src:hn(l.path),title:l.name});case"audio":return s.jsx("div",{className:"fp-center",children:s.jsx("audio",{controls:!0,src:hn(l.path)})});case"video":return s.jsx("div",{className:"fp-center",children:s.jsx("video",{controls:!0,src:hn(l.path)})});case"html":return s.jsx(Gx,{meta:l});case"other":return s.jsx("div",{className:"fp-center",children:s.jsxs("div",{className:"fp-nofile",children:[s.jsx(Q,{name:"doc",size:22}),s.jsx("div",{children:"这种文件不在浏览器里预览,可以下载后打开。"}),s.jsx("a",{className:"pbtn solid",href:hn(l.path),download:l.name,children:"下载"})]})});default:return s.jsx(DN,{meta:l})}}function Av({path:l,name:i,svg:r}){const[o,d]=w.useState(!1),f=hn(l,r?{inline:!0}:void 0);return w.useEffect(()=>{if(!o)return;const g=p=>{p.key==="Escape"&&(p.stopImmediatePropagation(),d(!1))};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[o]),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})})}),o?s.jsx("div",{className:"lightbox",role:"dialog","aria-label":i,onClick:()=>d(!1),children:s.jsx("img",{src:f,alt:i})}):null]})}function DN({meta:l}){const[i,r]=w.useState(null),[o,d]=w.useState(null);if(w.useEffect(()=>{let g=!0;return r(null),d(null),(async()=>{try{const p=await fetch(hn(l.path,{truncate:!0}));if(!p.ok)throw new Error(`读取失败(${p.status})`);g&&r(await p.text())}catch(p){g&&d(p instanceof Error?p.message:String(p))}})(),()=>{g=!1}},[l.path]),o)return s.jsx("div",{className:"fp-center fp-nofile",children:o});if(i===null)return s.jsx("div",{className:"fp-center dim",children:"正在读取内容…"});const f=l.size>ON?s.jsxs("div",{className:"fp-note",children:["文件有 ",cf(l.size),",只显示前 1 MB,完整内容请下载。"]}):null;if(l.kind==="markdown")return s.jsxs(s.Fragment,{children:[f,s.jsx("div",{className:"fp-md",dangerouslySetInnerHTML:{__html:xi(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(Ov,{text:g})]})}return l.kind==="csv"?s.jsxs(s.Fragment,{children:[f,s.jsx(UN,{text:i,tsv:l.mime.includes("tab-separated")})]}):s.jsxs(s.Fragment,{children:[f,s.jsx(Ov,{text:i})]})}function Ov({text:l}){const[i,r]=w.useState(!0),o=w.useMemo(()=>l.split(`
216
+ `),[l]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"fp-codebar",children:[s.jsxs("span",{className:"dim",children:[o.length," 行"]}),s.jsx("button",{className:"pbtn",onClick:()=>r(!i),children:i?"不自动换行":"自动换行"})]}),s.jsx("div",{className:`fp-code mono${i?" wrap":""}`,children:o.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 UN({text:l,tsv:i}){const r=w.useMemo(()=>HN(l,i?" ":","),[l,i]),o=w.useMemo(()=>AN(r),[r]),d=r.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:[r.length," 行",r.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,m)=>s.jsx("th",{className:o[m]?"numeric":void 0,children:p},m))})}):null,s.jsx("tbody",{children:g.map((p,m)=>s.jsx("tr",{children:p.map((x,y)=>s.jsx("td",{className:o[y]?"numeric":void 0,children:x},y))},m))})]})})]})}function HN(l,i){const r=[];let o=[],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?(o.push(d),d=""):p===`
217
+ `?(o.push(d),r.push(o),o=[],d=""):p!=="\r"&&(d+=p)}return(d||o.length)&&(o.push(d),r.push(o)),r}const Xx={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"}},BN={off:"关",minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"很高",max:"最高"},LN=["running","waiting","queued","done","stuck","failed","stopped"],qN={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 di(l){return l.status==="running"||l.status==="queued"||l.status==="waiting"}function of({job:l}){const i=Xx[l.status];return s.jsxs("span",{className:`jt-st${i.bad?" bad":""}${l.status==="done"?" ok":""}${l.status==="running"?" live":""}`,children:[s.jsx(Q,{name:i.icon,size:13,className:`${i.spin?"spin ":""}${i.bad?"bad":""}`}),i.text]})}function dd({embedded:l=!1}){const i=we(),r=i.detail,o=Un(!!r,180),d=w.useRef(r);r&&(d.current=r),w.useEffect(()=>{if(!r)return;const p=m=>{m.key==="Escape"&&!i.filePreview&&Jc()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[r,i.filePreview]);const f=r??d.current;if(!o.mounted||!f)return null;const g=f.kind==="job"&&i.worklog;return s.jsx("div",{className:`${l?"jd-embedded":"jd-overlay"}${o.leaving?" leaving":""}`,onClick:l?void 0:Jc,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?J1:Jc,children:s.jsx(Q,{name:"left",size:18})}),s.jsx("span",{className:"t",children:f.kind==="jobs"?"任务记录":"任务"}),s.jsx("button",{className:"ib",title:"关闭",onClick:Jc,children:s.jsx(Q,{name:"close",size:17})})]}),f.kind==="jobs"?s.jsx(IN,{}):s.jsx($N,{id:f.id},f.id)]})})}function $N({id:l}){var N,A;const i=we(),r=i.jobs[l],o=i.steps[l],d=w.useRef(null),f=w.useRef(r?di(r):!0),[g,p]=w.useState(null);if(w.useEffect(()=>{Ld().then(O=>p((O==null?void 0:O.models)??null))},[]),w.useEffect(()=>{const O=d.current;if(!O)return;const V=()=>{f.current=O.scrollHeight-O.scrollTop-O.clientHeight<80};return O.addEventListener("scroll",V),()=>O.removeEventListener("scroll",V)},[]),w.useEffect(()=>{const O=d.current;O&&f.current&&(O.scrollTop=O.scrollHeight)},[o==null?void 0:o.length,(N=o==null?void 0:o[o.length-1])==null?void 0:N.id]),!r)return s.jsx("div",{className:"jdbody",children:s.jsx("div",{className:"empty",children:"无法读取这个任务。"})});const m=i.assistants.find(O=>O.id===r.assistantId),x=!di(r),y=r.model?((A=g==null?void 0:g.find(O=>O.ref===r.model))==null?void 0:A.name)??r.model:"",k=r.startedAt??r.createdAt,S=r.durationMs??(di(r)?Date.now()-new Date(k).getTime():void 0),E=r.usage,j=Pv(r),v=o===void 0?void 0:Kj(o);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"jdbody",ref:d,children:[s.jsx("div",{className:"jd-title",children:r.title}),s.jsxs("div",{className:"jd-meta",children:[s.jsx(of,{job:r}),m||r.assistantName?s.jsxs("span",{className:"jd-owner",children:[m?s.jsx(Ct,{sprite:m.sprite,prop:m.prop,size:16}):null,(m==null?void 0:m.name)??r.assistantName]}):null,s.jsx("span",{children:Ol(k)}),S!==void 0?s.jsxs("span",{children:["用时 ",hr(S)]}):null]}),r.model||E?s.jsxs("div",{className:"jd-meta dim",children:[r.model?s.jsx("span",{className:y===r.model?"mono":void 0,title:r.model,children:y}):null,r.thinking?s.jsxs("span",{children:["思考 ",BN[r.thinking]??r.thinking]}):null,r.modelReason?s.jsx("span",{children:r.modelReason}):null,E?s.jsxs("span",{children:["输入 ",wv(E.input)," · 输出 ",wv(E.output),E.cost>0?` · $${E.cost.toFixed(4)}`:""]}):null]}):null,j?s.jsx("div",{className:"jd-reason",children:j}):null,x?s.jsx(_v,{job:r}):null,s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("div",{className:"jd-instruction",children:r.instruction}),s.jsx("div",{className:"lbl",children:"执行过程"}),s.jsx("div",{className:"jd-timeline",children:v===void 0?s.jsx("div",{className:"empty",children:"正在读取执行过程…"}):v.rows.length||v.thinking?s.jsxs(s.Fragment,{children:[v.rows.map(O=>s.jsx(GN,{step:O,cwd:r.cwd},O.id)),v.thinking?s.jsx(XN,{text:v.thinking}):null]}):s.jsx("div",{className:"empty",children:"还没有执行步骤。"})}),s.jsx(JN,{job:r}),x?null:s.jsx(_v,{job:r})]}),di(r)?s.jsx(YN,{job:r}):null]})}function YN({job:l}){const[i,r]=w.useState(""),o=i.trim().length>0,d=()=>{o&&(vd(l.id,i.trim()),r(""))};return s.jsxs("div",{className:"jd-foot",children:[s.jsx("input",{value:i,placeholder:"补充说明或更正方向",onChange:f=>r(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.nativeEvent.isComposing&&d()}}),s.jsx("button",{className:"pbtn solid",disabled:!o,onClick:d,children:"发送"}),l.status==="running"?s.jsx("button",{className:"pbtn",onClick:()=>void ox(l.id),children:"停止"}):null]})}function GN({step:l,cwd:i}){const[r,o]=w.useState(!1),d=Un(r,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(Qx,{text:l.thinking,open:!1}):null,s.jsx("div",{className:"jd-text",dangerouslySetInnerHTML:{__html:xi(l.text??"")}})]});const f=l.title??l.name??"",g=Pj(f);return s.jsxs("div",{className:`jd-tool${l.isError?" bad":""}${r?" open":""}`,children:[s.jsxs("button",{className:"jd-tool-head",onClick:()=>o(p=>!p),children:[s.jsx("span",{className:"ico",children:l.running?s.jsx(Q,{name:"spin",size:14,className:"spin"}):s.jsx(Q,{name:qN[l.name??""]??(/^(lore|memory)_/.test(l.name??"")?"mem":"more"),size:14})}),s.jsx("span",{className:"tt",children:g.map((p,m)=>s.jsx("span",{className:p.mono?"mono":void 0,children:p.text},m))}),l.thinking?s.jsx("span",{className:"blb",title:"有思考过程",children:s.jsx(Q,{name:"bulb",size:13})}):null,s.jsx("span",{className:"tm",children:l.isError?"出错":l.durationMs&&l.durationMs>=1e3?hr(l.durationMs):""}),s.jsx(Q,{name:r?"down":"chev",size:13})]}),s.jsx("div",{className:`expand${r?" open":""}`,inert:!r,children:s.jsx("div",{children:d.mounted?s.jsx(VN,{step:l,cwd:i}):null})})]})}function Qx({text:l,open:i}){const[r,o]=w.useState(i);return s.jsxs("div",{className:"jd-think-in",children:[s.jsxs("button",{className:"jd-think-head",title:r?"收起思考过程":"展开思考过程",onClick:()=>o(d=>!d),children:[s.jsx("span",{className:"ico",children:s.jsx(Q,{name:"bulb",size:13})}),s.jsx("span",{className:"tt",children:"思考过程"}),s.jsx(Q,{name:r?"down":"chev",size:12})]}),r?s.jsx("div",{className:"jd-think-body",children:l}):null]})}function XN({text:l}){const[i,r]=w.useState(!1);return s.jsxs("div",{className:"jd-think",children:[s.jsxs("button",{onClick:()=>r(o=>!o),children:[s.jsx("span",{className:"ico",children:s.jsx(Q,{name:"bulb",size:14})}),s.jsx("span",{className:"tt",children:"思考中"}),s.jsx(Q,{name:i?"down":"chev",size:13})]}),i?s.jsx("div",{className:"jd-think-body",children:l}):null]})}function QN(l){var r;const i=(r=l.args)==null?void 0:r.edits;return Array.isArray(i)?i.map(o=>({oldText:String((o==null?void 0:o.oldText)??""),newText:String((o==null?void 0:o.newText)??"")})):[]}function Td({path:l,cwd:i}){if(!l)return null;const r=l.startsWith("/")?l:i?`${i.replace(/\/+$/,"")}/${l}`:null;return r?s.jsx("button",{className:"jd-kv mono jd-path",title:r,onClick:()=>ds(r),children:l}):s.jsx("div",{className:"jd-kv mono",children:l})}function VN({step:l,cwd:i}){const r=l.args??{},o=QN(l);return s.jsxs("div",{className:"jd-tool-body",children:[l.thinking?s.jsx(Qx,{text:l.thinking,open:!0}):null,o.length?s.jsxs(s.Fragment,{children:[s.jsx(Td,{path:String(r.path??""),cwd:i}),o.map((d,f)=>s.jsx(KN,{before:d.oldText,after:d.newText},f))]}):s.jsx(ZN,{step:l,args:r,cwd:i}),l.output?s.jsx(Ed,{text:l.output,className:"jd-out mono"}):null,l.outputPath?s.jsxs("button",{className:"jd-file",onClick:()=>ds(l.outputPath),children:[s.jsx(Q,{name:"doc",size:12}),"完整输出"]}):null]})}function ZN({step:l,args:i,cwd:r}){if(l.name==="bash")return s.jsx(Ed,{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(Td,{path:String(i.path??""),cwd:r}),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(Td,{path:String(i.path??""),cwd:r});const o=JSON.stringify(i,null,2);return o==="{}"?null:s.jsx(Ed,{text:o,className:"jd-arg mono",lines:6})}function KN({before:l,after:i}){const[r,o]=w.useState(!1),d=Ij(l,i),f=r?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:()=>o(!0),children:["展开全部 ",d.length," 行"]}):null]})}function Ed({text:l,className:i,lines:r=12}){const[o,d]=w.useState(!1),f=l.split(`
218
+ `).length;return s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:`${i}${o?" all":""}`,style:o?void 0:{maxHeight:`${r*1.6}em`},children:l}),f>r?s.jsx("button",{className:"jd-more",onClick:()=>d(!o),children:o?"收起":`展开全部 ${f} 行`}):null]})}function _v({job:l}){return l.summary?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"报告"}),s.jsx("div",{className:"jd-report",dangerouslySetInnerHTML:{__html:xi(l.summary)}})]}):null}function JN({job:l}){const[i,r]=w.useState(null);w.useEffect(()=>{let f=!0;return r(null),ik(l.id).then(g=>{f&&r((g==null?void 0:g.files)??[])}),()=>{f=!1}},[l.id]);const o=new Set,d=[];for(const f of l.files??[])o.has(f)||(o.add(f),d.push({path:f,rel:f.split("/").pop()??f}));for(const f of i??[])o.has(f.path)||(o.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:()=>ds(f.path),children:[s.jsx("span",{className:"ico",children:s.jsx(Q,{name:lf(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?` · ${cf(f.size)}`:""]})]})]},f.path))]}):null}function IN(){const l=we(),i=l.worklog,r=(i==null?void 0:i.assistantId)??null,o=(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:r??"",onChange:d=>void bd({assistantId:d.target.value||null,status:o}),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:o??"",onChange:d=>void bd({assistantId:r,status:d.target.value||null}),children:[s.jsx("option",{value:"",children:"全部状态"}),LN.map(d=>s.jsx("option",{value:d,children:Xx[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&&tn(f.assistantId,!1,!0,!0),aa(f.id)},children:[g?s.jsx(Ct,{sprite:g.sprite,prop:g.prop,size:26}):s.jsx("span",{style:{width:26}}),s.jsx("span",{className:"n",children:f.title}),s.jsx(of,{job:f}),s.jsx("span",{className:"tm",children:Ol(f.startedAt??f.createdAt)}),s.jsx("span",{className:"du",children:f.durationMs!==void 0?hr(f.durationMs):di(f)?sf(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 I1(),children:i.loading?"正在读取…":"加载更多"}):null]})}function FN(){const l=we(),[i,r]=w.useState(""),[o,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&&M1(i)};return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"card",children:[s.jsx(Ct,{sprite:"hob",size:56}),s.jsx("div",{className:"nm",children:"Hob"}),s.jsx("div",{className:"ds",children:"请输入密码"}),s.jsx("label",{className:`field${o?" shake":""}`,children:s.jsx("input",{type:"password",autoFocus:!0,value:i,placeholder:"密码",onChange:g=>r(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 WN=5,PN=24*3600*1e3;function pi(l,i){var o;const r=i.trim();return r?l.name.includes(r)||l.duty.includes(r)||(((o=l.last)==null?void 0:o.text)??"").includes(r):!0}function Mv(l,i){var r,o;return(((r=i.last)==null?void 0:r.at)??"").localeCompare(((o=l.last)==null?void 0:o.at)??"")}const Rv=l=>l.status==="running"||l.status==="queued"||l.status==="waiting";function Vx(l,i){return(i.startedAt??i.createdAt).localeCompare(l.startedAt??l.createdAt)}function Zx(l,i){return(i.endedAt??i.createdAt).localeCompare(l.endedAt??l.createdAt)}function Dv(l){const i=rf(l.schedules[0]??"");return i.kind==="raw"?1440:i.hour*60+i.minute}function eS(l,i=Date.now()){const r=l.query.trim().length>0,o=new Date(i-PN).toISOString(),d=Object.values(l.jobs),f=l.assistants.filter(E=>E.pinned&&!E.hidden&&pi(E,l.query)),g=l.assistants.filter(E=>!E.pinned&&!E.hidden&&pi(E,l.query)).sort(Mv),p=l.assistants.filter(E=>E.hidden&&pi(E,l.query)).sort(Mv),m=r?[]:Object.values(l.approvals).filter(E=>E.status==="pending").sort((E,j)=>j.createdAt.localeCompare(E.createdAt)),x=r?[]:d.filter(Rv).sort(Vx),y=r?[]:d.filter(E=>!Rv(E)&&(E.endedAt??E.createdAt)>o).sort(Zx).slice(0,WN),k=r?[]:l.routines.filter(E=>E.active).sort((E,j)=>Dv(E)-Dv(j)),S=!r&&!m.length&&!x.length&&!g.length&&!p.length&&!y.length&&!k.length;return{searching:r,pins:f,rows:g,hidden:p,asks:m,live:x,recent:y,routines:k,empty:S}}function Kx(l){let i=l.trim();for(;;){const o=i.replace(/^cd\s+(?:"[^"]*"|'[^']*'|[^\s;&|]+)\s*(?:&&|;)\s*/,"").replace(/^timeout\s+(?:-[ks]\s+\S+\s+|-\S+\s+)*\d+(?:\.\d+)?[smhd]?\s+/,"");if(o===i)break;i=o}const r=tS.exec(i);if(r){let o=r[2];const d=Uv(o);if(d){let[f,g]=d;const p=/^(?:ba)?sh\s+-l?c\s+/.exec(f),m=p?Uv(f.slice(p[0].length)):void 0;m&&(f=m[0]+m[1]),o=f+g}i=`${r[1]}: ${Kx(o)}`}return i||l.trim()}const tS=/^ssh\s+(?:-[BbcDEeFIiJLlmOoPpQRSWw]\s*\S+\s+|-[46AaCfGgKkMNnqsTtVvXxYy]+\s+)*([^\s'"-]\S*)\s+(.+)$/s;function Uv(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 as=["off","minimal","low","medium","high","xhigh","max"];function Jx(l){return(l==null?void 0:l.thinkingLevels)??["off"]}function gi(l,i){const r=Jx(l);if(!l||r.includes(i))return i;const o=as.indexOf(i);return[...r].reverse().find(d=>as.indexOf(d)<=o)??"off"}function nS(l,i){const r=i.trim().toLowerCase();return r?l.filter(o=>o.name.toLowerCase().includes(r)||o.ref.toLowerCase().includes(r)):l}function lS(l){const i=[];for(const r of l){let o=i.find(d=>d.provider===r.provider);o||(o={provider:r.provider,models:[]},i.push(o)),o.models.push(r)}return i}const Cd={queued:"排队中",running:"进行中",waiting:"待确认",done:"已完成",stuck:"受阻",failed:"失败",stopped:"已停止"},aS={读:"读取",跑:"运行",改:"修改",写:"写入",搜:"搜索"};function zd(l){return[aS[l.verb]??l.verb,l.verb==="跑"?Kx(l.text):l.text]}function Ix({mobile:l=!1}){var m;const i=we(),r=i.panel.kind,o=((m=i.assistants.find(x=>x.id===i.sel))==null?void 0:m.name)??"",d=r==="routine"?"定时任务":r==="newRoutine"?"新建定时任务":r==="now"?l?o:"":"助手设置",f=()=>r==="now"?pv():Vd(),g=w.useRef(!0);w.useEffect(()=>{g.current=!1},[]);const p=r==="routine"?`routine:${i.panel.id}`:r;return s.jsxs("aside",{className:"panel",children:[s.jsxs("div",{className:"phead",children:[r==="now"?l?s.jsx("button",{className:"ib",onClick:pv,title:"收起",children:s.jsx(Q,{name:"left",size:17})}):null:s.jsx("button",{className:"ib",onClick:f,title:"返回",children:s.jsx(Q,{name:"left",size:17})}),s.jsx("span",{className:"t",children:d}),r==="now"?s.jsx("button",{className:"ib",title:"助手设置",onClick:mx,children:s.jsx(Q,{name:"gear",size:17})}):null,l?null:s.jsx("button",{className:"ib",title:"收起右栏",onClick:P1,children:s.jsx(Q,{name:"dbl",size:17})})]}),s.jsx("div",{className:`pbody${g.current?"":r==="now"?" from-left":" from-right"}`,children:r==="routine"?s.jsx(rS,{id:i.panel.kind==="routine"?i.panel.id:""},i.panel.kind==="routine"?i.panel.id:""):r==="newRoutine"?s.jsx(cS,{}):r==="assistant"?s.jsx(mS,{},i.sel??"hob"):s.jsx(iS,{})},g.current?"first":p)]})}const sS=l=>l.id;function iS(){var j;const l=we(),i=Object.values(l.jobs),r=v=>v.assistantId===(l.sel??"hob"),o=v=>!!v&&(v.status==="running"||v.status==="queued"),d=i.filter(v=>r(v)&&o(v)).sort(Vx)[0],f=i.filter(v=>r(v)&&!o(v)).sort(Zx)[0],g=d??f,p=l.routines.filter(v=>v.assistantId===l.sel),m=Fv(p,sS,l.sel??""),x=((j=l.profiles[l.sel??"hob"])==null?void 0:j.worklog)??[],y=((g==null?void 0:g.activity)??[]).slice(-8),k=y.map(v=>`${v.at}|${v.verb}|${v.text}`),S=w.useRef(null);S.current===null&&(S.current=new Set(k));const E=new Set(k.filter(v=>!S.current.has(v)));return w.useEffect(()=>{for(const v of k)S.current.add(v)}),s.jsxs(s.Fragment,{children:[g?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:`screen jd-open${d?"":" idle"}`,title:"打开任务详情",onClick:()=>aa(g.id),children:[y.map((v,N)=>v.verb==="$"?s.jsxs("div",{className:E.has(k[N])?"new":void 0,children:[s.jsx("span",{className:"p",children:"$"})," ",v.text]},k[N]):s.jsxs("div",{className:E.has(k[N])?"new":void 0,children:[s.jsx("span",{className:"v",children:zd(v)[0]}),zd(v)[1]]},k[N])),d?s.jsx("div",{children:s.jsx("span",{className:"cur"})}):s.jsxs("div",{className:"end",children:["— ",Cd[g.status]," —"]})]}),s.jsxs("div",{className:"caprow",children:[s.jsx("button",{className:"cap jd-open",onClick:()=>aa(g.id),children:d?`进行中 · ${g.title}`:`上一个任务 · ${g.title} · ${Cd[g.status]}`}),s.jsx("button",{className:"more",onClick:()=>Gd(l.sel??"hob"),children:"任务记录"})]})]}):s.jsx("div",{className:"slot pslot",children:"分派的任务会显示在这里"}),l.sel==="hob"?Object.values(l.delegations).filter(v=>v.status==="running"||v.status==="waiting").map(v=>{const N=l.assistants.find(A=>A.id===v.to);return s.jsxs("button",{className:"delegation-panel",onClick:()=>void Yd("hob",v.id,!1),children:[s.jsx(Q,{name:v.status==="waiting"?"pause":"spin",size:14,className:v.status==="running"?"spin":""}),"交给「",(N==null?void 0:N.name)??v.to,"」 · ",v.status==="waiting"?"等你确认":"进行中"]},v.id)}):null,s.jsxs("div",{className:"sech",children:[s.jsx("span",{children:"定时任务"}),s.jsx("button",{className:"ib",style:{width:18,height:18},title:"新建定时任务",onClick:W1,children:s.jsx(Q,{name:"plus",size:16})})]}),m.length?m.map(v=>s.jsx("div",{className:`rtrow${v.state==="still"?"":` ${v.state}`}`,children:s.jsx("div",{className:"rtclip",children:s.jsxs("button",{className:`rt${v.item.active?"":" paused"}`,onClick:()=>Xd(v.key),children:[s.jsx(Q,{name:v.item.active?"clock":"pause",size:17}),s.jsxs("div",{children:[s.jsx("div",{className:"n",children:v.item.name}),s.jsx("div",{className:"s",children:v.item.active?uf(v.item.schedules[0]??""):"已暂停"})]})]})})},v.key)):s.jsx("div",{className:"empty",children:"这个助手还没有定时任务"}),x.length?s.jsxs("div",{className:"wlgroup",children:[s.jsx("div",{className:"sech",children:s.jsx("span",{children:"工作日志"})}),x.slice(0,6).map((v,N)=>s.jsxs("div",{className:"wl",children:[s.jsx("span",{className:"t",children:Ol(v.at)}),s.jsx("span",{children:v.text})]},`${v.at}-${N}`))]}):null]})}function Fx({value:l,onSave:i,onRemove:r}){const[o,d]=w.useState(!1),f=rf(l);if(!o)return s.jsxs("button",{className:"w",onClick:()=>d(!0),children:[s.jsx(Q,{name:"clock",size:15}),uf(l)]});const g=m=>{const x=f.kind==="raw"?{...f,kind:"daily"}:f;i(iN({...x,...m}))},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:m=>g({kind:m.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:m=>g({weekday:Number(m.target.value)}),children:Mx.map((m,x)=>s.jsxs("option",{value:x,children:["周",m]},x))}):null,f.kind==="monthly"?s.jsx("input",{type:"number",min:1,max:28,value:f.day,onChange:m=>g({day:Number(m.target.value)||1})}):null,f.kind==="raw"?s.jsx("input",{className:"rawcron",value:f.raw,onChange:m=>i(m.target.value)}):s.jsx("input",{type:"time",value:p,onChange:m=>{const[x,y]=m.target.value.split(":").map(Number);g({hour:x||0,minute:y||0})}}),r?s.jsx("button",{className:"pbtn",onClick:r,children:"删除"}):null,s.jsx("button",{className:"pbtn",onClick:()=>d(!1),children:"完成"})]})}function cS(){const l=we(),[i,r]=w.useState(""),[o,d]=w.useState(""),[f,g]=w.useState("0 9 * * *"),[p,m]=w.useState(!1),x=i.trim()!==""&&o.trim()!==""&&!p,y=async()=>{m(!0),await G1({assistantId:l.sel??"hob",name:i.trim(),instruction:o.trim(),schedules:[f],active:!0}),m(!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=>r(k.target.value)})}),s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("label",{className:"field",children:s.jsx("textarea",{rows:4,value:o,placeholder:"到点后交给后台任务执行的内容,写清楚需要什么结果",onChange:k=>d(k.target.value)})}),s.jsx("div",{className:"lbl",children:"执行时间"}),s.jsx("div",{className:"when",children:s.jsx(Fx,{value:f,onSave:g})}),s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"sp"}),s.jsx("button",{className:"pbtn",onClick:Vd,children:"取消"}),s.jsx("button",{className:"pbtn solid",disabled:!x,onClick:()=>void y(),children:"创建"})]})]})}function rS({id:l}){const i=we(),r=i.routines.find(o=>o.id===l);return r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:`tog${r.active?"":" off"}`,title:r.active?"暂停":"启用",onClick:()=>void ts(r.id,{active:!r.active})}),s.jsx("span",{style:{fontSize:14},children:"启用"}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void Q1(r.id),children:"立即运行"})]}),s.jsx("div",{className:"lbl",children:"名称"}),s.jsx("label",{className:"field",children:s.jsx("input",{defaultValue:r.name,onBlur:o=>{const d=o.target.value.trim();d&&d!==r.name&&ts(r.id,{name:d})}})}),s.jsx("div",{className:"lbl",children:"任务内容"}),s.jsx("label",{className:"field",children:s.jsx("textarea",{rows:4,defaultValue:r.instruction,onBlur:o=>{o.target.value!==r.instruction&&ts(r.id,{instruction:o.target.value})}})}),s.jsx("div",{className:"lbl",children:"执行时间"}),s.jsxs("div",{className:"when",children:[r.schedules.map((o,d)=>s.jsx(Fx,{value:o,onSave:f=>{const g=r.schedules.slice();g[d]=f,ts(r.id,{schedules:g})},onRemove:r.schedules.length>1?()=>void ts(r.id,{schedules:r.schedules.filter((f,g)=>g!==d)}):void 0},d)),s.jsxs("button",{className:"w",onClick:()=>void ts(r.id,{schedules:[...r.schedules,"0 9 * * *"]}),children:[s.jsx(Q,{name:"plus",size:14}),"添加执行时间"]})]}),s.jsx("div",{className:"lbl",children:"运行记录"}),r.runs.length?r.runs.map(o=>{const d=i.jobs[o.jobId],f=(d==null?void 0:d.status)??o.status,g=f==="running"||f==="queued",p=f==="failed"||f==="stuck";return s.jsxs("button",{className:`run${p?" bad":""}`,onClick:()=>void F1(r.assistantId,o.jobId),children:[s.jsx("span",{children:Ol(o.at)}),s.jsx(Q,{name:g?"spin":p?"close":"check",size:16,className:g?"spin":""})]},o.jobId)}):s.jsx("div",{className:"empty",children:"还没有运行记录"}),s.jsx("div",{style:{marginTop:18},children:s.jsx("button",{className:"pbtn",onClick:async()=>{window.confirm(`删除定时任务「${r.name}」?已有的运行记录会保留在对话里。`)&&(await X1(r.id),Vd())},children:"删除定时任务"})})]}):s.jsx("div",{className:"empty",children:"这个定时任务已不存在。"})}function mr(l){const[i,r]=w.useState(null),[o,d]=w.useState(!1);return w.useEffect(()=>{if(i!=="已保存")return;const g=setTimeout(()=>r(null),3e3);return()=>clearTimeout(g)},[i]),{save:async g=>{d(!0);const p=await xd(l,g);return d(!1),r(p??"已保存"),!p},busy:o,message:i,fail:g=>r(g)}}function pr({message:l}){return l?s.jsx("div",{role:"status",className:l==="已保存"?"okline":"badline",children:l}):null}function Fc({value:l,multiline:i,placeholder:r,save:o}){const[d,f]=w.useState(l);w.useEffect(()=>f(l),[l]);const g={value:d,placeholder:r,onChange:p=>f(p.target.value),onBlur:()=>{d!==l&&o(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 uS({aid:l}){const i=we(),r=mr(l),o=i.profiles[l],[d,f]=w.useState(null);w.useEffect(()=>{Ld().then(f)},[]);const g=i.settings.settings.models.roster;if(!o)return null;const p=o.assistant.models??{},m=i.settings.settings.models,x=N=>{var A;return((A=d==null?void 0:d.models.find(O=>O.ref===N))==null?void 0:A.name)??N},y=N=>g.find(A=>A.ref===N),k=N=>void r.save({models:N}),S=N=>A=>{var V;const O={...p};if(A){const ee=N==="conversation"?m.conversation.thinking:m.work.thinking;O[N]={ref:A,thinking:gi(d==null?void 0:d.models.find(ne=>ne.ref===A),((V=y(A))==null?void 0:V.thinking)??ee)}}else delete O[N];k(O)},E=p.allowed??[],j=N=>{const A={...p};N.length?A.allowed=N:delete A.allowed,k(A)},v=(N,A)=>{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[A])==null?void 0:O.ref)??"",onChange:V=>S(A)(V.target.value),children:[s.jsxs("option",{value:"",children:["跟随全局(",x(A==="conversation"?m.conversation.ref:m.work.ref),")"]}),g.map(V=>s.jsx("option",{value:V.ref,children:x(V.ref)},V.ref))]})})]})};return s.jsxs(s.Fragment,{children:[s.jsx(pr,{message:r.message}),v("对话模型","conversation"),v("默认任务模型","work"),s.jsx("div",{className:"lbl",children:"可分派的模型"}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:`pbtn${E.length?"":" solid"}`,onClick:()=>j([]),children:"全部"}),s.jsx("button",{className:`pbtn${E.length?" solid":""}`,onClick:()=>j(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 A=E.includes(N.ref);return s.jsx("button",{className:`chip${A?" on":""}`,onClick:()=>j(A?E.filter(O=>O!==N.ref):[...E,N.ref]),children:x(N.ref)},N.ref)})}):null]})}function oS({aid:l}){const i=we(),r=mr(l),o=i.profiles[l];if(!o)return null;const d=o.assistant.abilities??{exec:!0,write:!0,image:!0},f=i.settings.settings.image.source!=="off",g=m=>void r.save({abilities:{...d,...m}}),p=(m,x,y,k)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"ctl",children:[s.jsx("span",{style:{fontSize:14},children:m}),s.jsx("span",{className:"sp"}),s.jsx("button",{className:`tog${x?"":" off"}`,title:x?"关闭":"开启",onClick:y})]}),k?s.jsx("div",{className:"note",children:k}):null]});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl",children:"能力"}),s.jsx(pr,{message:r.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 dS({aid:l,sprite:i,prop:r,onDone:o}){const d=mr(l),f=xx(i)??{prop:"hob",color:"slate"},g=p=>{p!==i&&d.save({sprite:p})};return s.jsxs(s.Fragment,{children:[s.jsx(pr,{message:d.message}),s.jsxs("div",{className:"sprite-pick",children:[r?s.jsx("button",{className:f.prop==="custom"?"on":void 0,title:"自画道具",onClick:()=>g(cd(f.color)),children:s.jsx(Ct,{sprite:cd(f.color),prop:r,size:34})}):null,dk.map(p=>s.jsx("button",{className:p===f.prop?"on":void 0,title:ia[p].label,onClick:()=>g(rd(p,f.color)),children:s.jsx(Ct,{sprite:rd(p,f.color),size:34})},p))]}),s.jsxs("div",{className:"sprite-colors",children:[fk.map(p=>s.jsx("button",{className:p===f.color?"on":void 0,title:us[p].name,style:{background:us[p].o},onClick:()=>g(f.prop==="custom"?cd(p):rd(f.prop,p))},p)),s.jsx("button",{className:"pbtn",onClick:o,children:"完成"})]})]})}function fS({aid:l,rule:i}){const[r,o]=w.useState(!1),[d,f]=w.useState(i.text),[g,p]=w.useState(!1),[m,x]=w.useState(!1),[y,k]=w.useState(null),S=w.useRef(!1);w.useEffect(()=>{if(y!=="已保存")return;const v=setTimeout(()=>k(null),3e3);return()=>clearTimeout(v)},[y]);const E=async v=>{x(!0);const N=await Z1(l,{id:i.id,...v});x(!1),k(N??"已保存"),N||o(!1)},j=()=>{if(S.current){S.current=!1;return}const v=d.trim();if(v===i.text){o(!1);return}if(!v){k("规则内容不能为空。");return}E({text:v})};return s.jsxs("div",{className:"rule-wrap",children:[s.jsxs("div",{className:"rule",children:[r?s.jsx("input",{className:"rule-input",autoFocus:!0,value:d,maxLength:1e3,disabled:m,onChange:v=>f(v.target.value),onBlur:j,onKeyDown:v=>{v.key==="Enter"&&v.currentTarget.blur(),v.key==="Escape"&&(S.current=!0,f(i.text),o(!1))}}):s.jsx("button",{className:"rule-text",onClick:()=>{S.current=!1,f(i.text),o(!0)},disabled:m,title:"编辑规则",children:i.text}),s.jsxs("span",{className:"v",children:[s.jsx("button",{className:"rule-mode",disabled:m,onClick:()=>void E({mode:i.mode==="ask"?"allow":"ask"}),title:"切换确认方式",children:i.mode==="ask"?"需确认":"直接执行"}),s.jsx("button",{className:"del",title:"删除这条规则",disabled:m,onClick:()=>p(!0),children:s.jsx(Q,{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 K1(l,i.id),children:"确认删除"})]}):null,y?s.jsx("div",{className:y==="已保存"?"okline":"badline",role:"status",children:y}):null]})}function hS({aid:l}){const[i,r]=w.useState(!1),[o,d]=w.useState(""),[f,g]=w.useState("ask"),[p,m]=w.useState(!1),[x,y]=w.useState(null);w.useEffect(()=>{if(x!=="已保存")return;const E=setTimeout(()=>y(null),3e3);return()=>clearTimeout(E)},[x]);const k=()=>{r(!1),d(""),g("ask"),y(null)},S=async()=>{if(p||!o.trim())return;m(!0),y(null);const E=await V1(l,o.trim(),f);if(m(!1),E){y(E);return}d(""),g("ask"),r(!1),y("已保存")};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:o,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||!o.trim(),children:p?"正在保存…":"保存"})]})]}):s.jsx("button",{className:"rule-add",onClick:()=>{y(null),r(!0)},children:"+ 新增规则"}),x?s.jsx("div",{className:x==="已保存"?"okline":"badline",role:"status",children:x}):null]})}function mS(){const l=we(),i=l.sel??"hob",r=l.profiles[i],[o,d]=w.useState(!1),[f,g]=w.useState(!1),p=mr(i);if(!r)return s.jsx("div",{className:"empty",children:"正在读取档案…"});const m=r.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(Ct,{sprite:m.sprite,prop:m.prop,size:68,onClick:()=>d(x=>!x),title:"换头像"})}),o?s.jsx(dS,{aid:i,sprite:m.sprite,prop:m.prop,onDone:()=>d(!1)}):null,s.jsx(pr,{message:p.message}),s.jsx("div",{className:"lbl",children:"名字"}),s.jsx(Fc,{value:m.name,save:x=>x.trim()?p.save({name:x.trim()}):(p.fail("名字不能为空。"),Promise.resolve(!1))}),s.jsx("div",{className:"lbl",children:"职责简介"}),s.jsx(Fc,{value:m.duty,save:x=>p.save({duty:x})}),s.jsx("div",{className:"lbl",children:"详细职责"}),s.jsx(Fc,{multiline:!0,value:m.dutyLong??"",save:x=>p.save({dutyLong:x})}),s.jsx("div",{className:"lbl",children:"补充说明"}),s.jsx(Fc,{multiline:!0,value:m.instructions,placeholder:"这个助手特有的做法,如“周报先列要点再展开”",save:x=>p.save({instructions:x})})]}),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:[r.rules.length?r.rules.map(x=>s.jsx(fS,{aid:i,rule:x},x.id)):s.jsx("div",{className:"empty",children:"还没有需要执行前确认的规则"}),s.jsx(hS,{aid:i},i)]}),s.jsx(uS,{aid:i}),s.jsx(oS,{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${m.notify?"":" off"}`,title:m.notify?"关闭通知":"开启通知",disabled:p.busy,onClick:()=>void p.save({notify:!m.notify})})]}),s.jsx("div",{className:"note",children:"要在手机上接收推送,请先在 设置 → 通知 中开启本机推送。"}),m.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${m.pinned?"":" off"}`,title:m.pinned?"取消置顶":"放在顶部",disabled:p.busy,onClick:()=>void p.save({pinned:!m.pinned})})]})]}),m.primary?null:s.jsx("div",{className:"mergebar",children:s.jsx("button",{className:"pbtn",onClick:()=>void p.save({hidden:!m.hidden}),children:m.hidden?"放回列表":"收起这个助手"})})]}),m.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:["将「",m.name,"」并回 Hob?它的定时任务和执行前确认规则会转给 Hob,对话记录会保留归档,这个助手会从列表中移除。",s.jsxs("div",{className:"acts",children:[s.jsx("button",{className:"pbtn solid",onClick:()=>void $1(i),children:"确认并回"}),s.jsx("button",{className:"pbtn",onClick:()=>g(!1),children:"取消"})]})]}):s.jsx("button",{className:"pbtn danger",onClick:()=>g(!0),children:"并回 Hob"})})]})]})}function Wx({a:l,sel:i,size:r=52}){const o=vx(l);return s.jsxs("button",{className:`pin${i?" sel":""}`,...o.handlers,onClick:()=>{o.takeHeld()||tn(l.id)},children:[s.jsx(Ct,{sprite:l.sprite,prop:l.prop,size:r}),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 Px(l){return l===1?{cls:" n1",size:72}:l===2?{cls:" n2",size:62}:{cls:"",size:52}}function Hv({a:l,sel:i,size:r=42,onClick:o}){var f,g;const d=vx(l);return s.jsxs("button",{className:`row${i?" sel":""}`,...d.handlers,onClick:()=>{d.takeHeld()||(o?o():tn(l.id))},children:[s.jsx(Ct,{sprite:l.sprite,prop:l.prop,size:r}),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:tr((f=l.last)==null?void 0:f.at)})]}),s.jsx("div",{className:"pv",children:((g=l.last)==null?void 0:g.text)??l.duty})]})]})}function pS(l,i){const r=l.activity.at(-1);return[i==null?void 0:i.name,r?zd(r).join(" "):""].filter(Boolean).join(" · ")}function Bv(l,i){i&&tn(l.assistantId),aa(l.id)}function Lv({job:l,owner:i,time:r,text:o,size:d,onClick:f}){return s.jsxs("button",{className:"row job",onClick:f,children:[s.jsx(Ad,{owner:i,size:d}),s.jsx("span",{className:"nm",children:l.title}),s.jsx("span",{className:"tm",children:r}),s.jsx("span",{className:"pv",children:o}),s.jsx(of,{job:l})]})}function ns({title:l,more:i,children:r}){return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gt",children:[s.jsx("span",{children:l}),i]}),r]})}function Ad({owner:l,size:i}){return l?s.jsx(Ct,{sprite:l.sprite,prop:l.prop,size:i}):s.jsx("span",{style:{width:i,flex:"none"}})}function qv({title:l,text:i}){return s.jsx(ns,{title:l,children:s.jsx("div",{className:"slot",children:i})})}function eb({size:l=42,markSel:i=!1}){const r=we(),[o,d]=w.useState(!0),f=eS(r),g=m=>r.assistants.find(x=>x.id===m),p=!o||f.searching;return s.jsxs(s.Fragment,{children:[f.asks.length?s.jsx(ns,{title:"待确认",children:f.asks.map(m=>{var x;return s.jsxs("button",{className:"row",onClick:()=>void tn(m.assistantId),children:[s.jsx(Ad,{owner:g(m.assistantId),size:l}),s.jsxs("div",{className:"main",children:[s.jsxs("div",{className:"l1",children:[s.jsx("span",{className:"nm",children:m.title}),s.jsx("span",{className:"tm",children:tr(m.createdAt)})]}),s.jsxs("div",{className:"pv",children:[((x=g(m.assistantId))==null?void 0:x.name)??""," · 等待你的选择"]})]})]},m.id)})}):null,f.live.length?s.jsx(ns,{title:"进行中",children:f.live.map(m=>s.jsx(Lv,{job:m,owner:g(m.assistantId),time:sf(m.startedAt??m.createdAt),text:pS(m,g(m.assistantId)),size:l,onClick:()=>Bv(m,g(m.assistantId))},m.id))}):null,f.rows.length||f.hidden.length?s.jsxs(ns,{title:"日常",children:[f.rows.map(m=>s.jsx(Hv,{a:m,size:l,sel:i&&m.id===r.sel},m.id)),f.hidden.length&&!f.searching?s.jsxs("button",{className:"fold",onClick:()=>d(m=>!m),children:[s.jsx("span",{children:"收起的助手"}),s.jsxs("span",{children:[f.hidden.length,s.jsx(Q,{name:o?"chev":"down",size:13})]})]}):null,s.jsx("div",{className:`expand${p?" open":""}`,inert:!p,children:s.jsx("div",{children:f.hidden.map(m=>s.jsx(Hv,{a:m,size:l,sel:i&&m.id===r.sel},m.id))})})]}):null,f.recent.length?s.jsx(ns,{title:"最近任务",more:s.jsx("button",{className:"more",onClick:()=>Gd(),children:"全部"}),children:f.recent.map(m=>s.jsx(Lv,{job:m,owner:g(m.assistantId),time:tr(m.endedAt??m.createdAt),text:m.summary||m.statusReason||"",size:l,onClick:()=>Bv(m,g(m.assistantId))},m.id))}):null,f.routines.length?s.jsx(ns,{title:"定时任务",children:f.routines.map(m=>{const x=m.runs[0];return s.jsxs("button",{className:"row",onClick:()=>{tn(m.assistantId,!1,!1),Xd(m.id)},children:[s.jsx(Ad,{owner:g(m.assistantId),size:l}),s.jsxs("div",{className:"main",children:[s.jsxs("div",{className:"l1",children:[s.jsx("span",{className:"nm",children:m.name}),s.jsx("span",{className:"tm",children:uf(m.schedules[0]??"")})]}),s.jsx("div",{className:"pv",children:x?`上次运行 ${tr(x.at)} · ${Cd[x.status]}`:"尚未运行"})]})]},m.id)})}):null,f.empty?s.jsxs(s.Fragment,{children:[s.jsx(qv,{title:"最近任务",text:"分派的任务会显示在这里"}),s.jsx(qv,{title:"定时任务",text:"定时任务会显示在这里"})]}):null]})}function gS(){const l=we(),i=l.assistants.filter(o=>o.pinned&&!o.hidden&&pi(o,l.query)),r=Px(i.length);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mhead",children:[s.jsx("button",{className:"me",title:"设置",onClick:Qd,children:s.jsx(Q,{name:"user",size:17})}),s.jsx("span",{className:"sp"}),l.search?s.jsxs("div",{className:"msearch",children:[s.jsx(Q,{name:"search",size:15}),s.jsx("input",{autoFocus:!0,value:l.query,placeholder:"搜索助手",onChange:o=>px(o.target.value)}),s.jsx("button",{onClick:()=>gv(!1),title:"关闭搜索",children:s.jsx(Q,{name:"close",size:14})})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"ib",title:"搜索助手",onClick:()=>gv(!0),children:s.jsx(Q,{name:"search",size:19})}),s.jsx("button",{className:"ib",title:"创建专属助手",onClick:hx,children:s.jsx(Q,{name:"plus",size:21})}),s.jsx("button",{className:"ib",title:"写新消息",onClick:sa,children:s.jsx(Q,{name:"edit",size:19})})]})]}),s.jsx("div",{className:`mpins${r.cls}`,children:i.map(o=>s.jsx(Wx,{a:o,size:r.size},o.id))}),s.jsx("div",{className:"mlist",children:s.jsx(eb,{size:36})})]})}function vS({leaving:l}){return s.jsx("div",{className:`mfull${l?" leaving":""}`,children:s.jsx(Ix,{mobile:!0})})}const tb={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 df(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 $v(l,i){return tb[l].reduce((r,o)=>Math.abs(o.value-i)<Math.abs(r.value-i)?o:r).label}function nb(l){return`聪明 ${l.smart}% · 成本 ${l.cost}% · 速度 ${l.speed}%`}function ff(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 os({items:l,value:i,onChange:r,disabled:o}){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:()=>r(d.key),disabled:o,children:d.label},d.key))})}function ye({children:l}){return s.jsx("div",{className:"group",children:l})}function oa({saved:l,error:i,children:r}){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"}),r]})}function is(){const[l,i]=w.useState(null),[r,o]=w.useState(!1);return w.useEffect(()=>{if(l!=="已保存")return;const f=setTimeout(()=>i(null),3e3);return()=>clearTimeout(f)},[l]),{save:async f=>{o(!0);const g=await Bd(f);return o(!1),i(g?"已保存":ar().notice??"保存失败,请重试。"),g},busy:r,message:l}}function mn({message:l,toast:i=!1}){return l?s.jsx("span",{className:`${l==="已保存"?"okline":"badline"}${i?" savetoast":""}`,role:"status",children:l}):null}function cs({value:l,placeholder:i,multiline:r,onSave:o}){const[d,f]=w.useState(l),[g,p]=w.useState(!1);w.useEffect(()=>f(l),[l]);const m=async()=>{if(g||d===l)return;p(!0);const y=await o(d);p(!1),y||f(l)},x={value:d,placeholder:i,disabled:g,onChange:y=>f(y.target.value),onBlur:()=>void m(),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),y.currentTarget.blur())}};return s.jsx("div",{className:"field",children:r?s.jsx("textarea",{...x,rows:3}):s.jsx("input",{...x})})}const fd=[{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:"关于"}],xS=[{key:"system",label:"跟随系统"},{key:"light",label:"浅色"},{key:"dark",label:"深色"}];function bS(){var i;return((i=Intl.supportedValuesOf)==null?void 0:i.call(Intl,"timeZone"))??[]}function yS({narrow:l,leaving:i}){var f,g;const r=we(),o=r.section??(l?null:"general"),d=w.useRef(null);return w.useEffect(()=>{var p;(p=d.current)==null||p.scrollTo(0,0)},[o,r.sub]),l&&o===null?s.jsxs("div",{className:`setpage narrow${i?" leaving":""}`,children:[s.jsxs("div",{className:"sethead",children:[s.jsx("button",{className:"ib",title:"返回",onClick:mv,children:s.jsx(Q,{name:"left",size:17})}),s.jsx("span",{className:"t",children:"设置"})]}),s.jsx("div",{className:"setbody",children:fd.map(p=>s.jsxs("button",{className:"setitem",onClick:()=>hi(p.id),children:[s.jsx("span",{children:p.label}),s.jsx(Q,{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:r.sub?kn:()=>hi(null),children:s.jsx(Q,{name:"left",size:17})}),s.jsx("span",{className:"t",children:((f=r.sub)==null?void 0:f.title)??((g=fd.find(p=>p.id===o))==null?void 0:g.label)??"设置"})]}):s.jsxs("div",{className:"setnav",children:[s.jsx("div",{className:"setnavtitle",children:"设置"}),fd.map(p=>s.jsx("button",{className:`navrow${o===p.id?" sel":""}`,onClick:()=>hi(p.id),children:p.label},p.id)),s.jsx("span",{className:"sp"}),s.jsx("button",{className:"navrow",onClick:mv,children:"返回 Hob"})]}),s.jsx("div",{className:"setmain",ref:d,children:o==="providers"?s.jsx(TS,{}):o==="models"?s.jsx(MS,{}):o==="memory"?s.jsx(YS,{}):o==="image"?s.jsx(VS,{}):o==="search"?s.jsx(WS,{}):o==="skills"?s.jsx(JS,{}):o==="work"?s.jsx(HS,{}):o==="push"?s.jsx(BS,{}):o==="about"?s.jsx(ew,{}):s.jsx(jS,{})})]})}function jS(){const l=we(),i=l.settings.settings.general.aboutYou,r=is(),o=is(),d=is(),[f,g]=w.useState(null);return w.useEffect(()=>{if(!f)return;const p=setTimeout(()=>g(null),4e3);return()=>clearTimeout(p)},[f]),s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"通用",desc:"主题、时区、个人信息、登录密码。"}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"主题"}),s.jsx(os,{items:xS,value:l.theme,disabled:r.busy,onChange:p=>void r.save({general:{theme:p}})}),s.jsx(mn,{message:r.message})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"时区"}),s.jsx(kS,{value:l.settings.settings.general.timezone,onSave:p=>o.save({general:{timezone:p}})}),s.jsx(mn,{message:o.message}),s.jsx("div",{className:"note",children:"助手的「现在时间」和定时任务都按这个时区算。"})]}),s.jsxs(ye,{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:r.busy,onClick:()=>void r.save({general:{showPage:l.settings.settings.general.showPage===!1}})}),s.jsx(mn,{message:r.message}),s.jsx("div",{className:"note",children:"允许助手把适合可视化的内容展示为页面。"})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"个人信息"}),s.jsx("div",{className:"lbl sub",children:"称呼"}),s.jsx(cs,{placeholder:"如「王先生」",value:i.name,onSave:p=>d.save({general:{aboutYou:{name:p.trim()}}})}),s.jsx("div",{className:"lbl sub",children:"语言"}),s.jsx(cs,{placeholder:"如「中文」",value:i.language,onSave:p=>d.save({general:{aboutYou:{language:p.trim()}}})}),s.jsx("div",{className:"lbl sub",children:"其他"}),s.jsx(cs,{multiline:!0,placeholder:"如「不要看融资新闻」",value:i.notes,onSave:p=>d.save({general:{aboutYou:{notes:p}}})}),s.jsx(mn,{message:d.message}),s.jsx("div",{className:"note",children:"所有助手都会参考这些信息;未填写的项不使用。"})]}),s.jsx(ye,{children:s.jsxs("div",{className:"formcard",children:[s.jsx(NS,{onDone:g}),f?s.jsx("div",{className:"note",children:f}):null]})})]})}function kS({value:l,onSave:i}){const r=bS(),[o,d]=w.useState(l),[f,g]=w.useState(!1),[p,m]=w.useState(null),x=w.useRef(null);w.useEffect(()=>d(l),[l]),w.useEffect(()=>{if(!f)return;const S=E=>{var j;(j=x.current)!=null&&j.contains(E.target)||g(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const y=r.filter(S=>S.toLowerCase().includes(o.trim().toLowerCase())).slice(0,40),k=S=>{g(!1),m(null),d(S),S!==l&&i(S).then(E=>{E||d(l)})};return s.jsxs("div",{className:"tz",ref:x,children:[s.jsx("label",{className:"field",children:s.jsx("input",{value:o,placeholder:"搜索时区,如 Berlin",onFocus:()=>g(!0),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),S.currentTarget.blur())},onChange:S=>{d(S.target.value),g(!0)},onBlur:()=>{o.trim()!==l&&(r.includes(o.trim())?k(o.trim()):(d(l),m("时区无效,请从列表中选择。")))}})}),p?s.jsx("div",{className:"badline",role:"status",children:p}):null,f&&y.length?s.jsx("div",{className:"tzlist",children:y.map(S=>s.jsx("button",{className:S===l?"sel":"",onMouseDown:()=>k(S),children:S},S))}):null]})}function NS({onDone:l}){const[i,r]=w.useState(""),[o,d]=w.useState(""),[f,g]=w.useState(""),[p,m]=w.useState(!1),x=async()=>{if(p)return;if(!i||!o){l("请填写旧密码和新密码。");return}if(o!==f){l("两次输入的新密码不一致。");return}m(!0);const y=await u1(i,o);if(m(!1),y){l(`修改失败:${y}`);return}r(""),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:y=>r(y.target.value)})}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",placeholder:"新密码",value:o,onChange:y=>d(y.target.value)})}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",placeholder:"再次输入新密码",value:f,onChange:y=>g(y.target.value)})}),s.jsxs(oa,{saved:!1,error:null,children:[i||o||f?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",disabled:p||!(i||o||f),onClick:()=>{r(""),d(""),g(""),l("")},children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void x(),disabled:p||!i||!o||!f,children:p?"正在验证…":"保存"})]})]})}function lb({value:l,options:i,label:r,icon:o,onChange:d}){return s.jsxs("span",{className:"ctl",children:[o?s.jsx(Q,{name:o,size:14}):null,s.jsx("select",{className:"pick","aria-label":r,value:l,onChange:f=>d(f.target.value),children:i.map(f=>s.jsx("option",{value:f.value,children:f.text},f.value))})]})}function ab({value:l,model:i,onChange:r}){const o=Jx(i);return o.length===1?null:s.jsx(lb,{value:l,label:"思考强度",icon:"bulb",options:o.map(d=>({value:d,text:Pc[d]})),onChange:r})}function Yv({modelRef:l,info:i,disabled:r,onSaved:o}){const[d,f]=w.useState(!1),[g,p]=w.useState(null),[m,x]=w.useState(""),[y,k]=w.useState(!1),[S,E]=w.useState(null),[j,v]=w.useState(!1);w.useEffect(()=>{if(!j)return;const K=setTimeout(()=>v(!1),3e3);return()=>clearTimeout(K)},[j]);const N=g??i.levels,A=as.filter(K=>!N.some(q=>q.level===K)),O=g!==null,V=K=>{p(K.slice().sort((q,L)=>as.indexOf(q.level)-as.indexOf(L.level))),E(null),v(!1)},ee=async K=>{k(!0),E(null);const q=await f1(l,K);if(k(!1),!q.ok){p(null),E(q.error);return}p(null),v(!0),o(q.thinking,q.settings)},ne=(K=N)=>{const q={};for(const L of as){const me=K.find(Oe=>Oe.level===L);q[L]=me?me.text.trim():null}ee(q)};return s.jsxs("div",{className:"think-levels",children:[s.jsxs("button",{className:"thinkhead",onClick:()=>f(K=>!K),disabled:y,children:[s.jsx("span",{className:"lbl sub",children:"思考档"}),s.jsxs("span",{className:"note",children:[N.length," 档",i.custom?" · 有自定义":" · 默认"]}),s.jsx(Q,{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(K=>s.jsxs("div",{className:"thinkrow",children:[s.jsx("span",{className:"tname",children:Pc[K.level]}),s.jsx("input",{className:"ttext",value:K.text,placeholder:"默认",title:"留空就按服务商协议的默认值发",onChange:q=>V(N.map(L=>L.level===K.level?{...L,text:q.target.value}:L)),onBlur:()=>{O&&ne()},onKeyDown:q=>{q.key==="Enter"&&q.currentTarget.blur()},disabled:y||r}),K.level==="off"?s.jsx("span",{className:"rremove still",title:"关闭这一档不能删","aria-hidden":!0}):s.jsx("button",{className:"rremove",title:`删掉「${Pc[K.level]}」`,onClick:()=>ne(N.filter(q=>q.level!==K.level)),disabled:y||r,children:s.jsx(Q,{name:"close",size:13})})]},K.level))}),s.jsxs("div",{className:"ctl",style:{gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsxs("select",{className:"pick",value:m,onChange:K=>x(K.target.value),disabled:y||r||!A.length,"aria-label":"添加思考档",children:[s.jsx("option",{value:"",children:A.length?"选择档位":"七个档都用上了"}),A.map(K=>s.jsx("option",{value:K,children:Pc[K]},K))]}),s.jsx("button",{className:"pbtn",onClick:()=>{m&&(ne([...N,{level:m,text:""}]),x(""))},disabled:y||r||!m,children:"添加思考档"}),s.jsx("span",{className:"sp"}),i.custom?s.jsx("button",{className:"pbtn",onClick:()=>void ee(null),disabled:y||r,children:"恢复默认"}):null]}),s.jsx("div",{className:"note",children:"留空就按服务商协议的默认值发;填了才按你写的发(例如 DeepSeek 的「中」填 high)。 关闭这一档不能删,其余档删掉后不再出现在思考强度里。"}),S?s.jsx("div",{className:"badline",children:S}):null,j?s.jsx("div",{className:"okline",children:"已保存思考档"}):null]})})]})}function sb({info:l}){const i=ff(l.contextWindow);return s.jsxs("span",{className:"caps",children:[l.input.includes("image")?s.jsx("span",{title:"支持图片输入","aria-label":"支持图片输入",children:s.jsx(Q,{name:"image",size:14})}):null,l.reasoning?s.jsx("span",{title:"支持推理","aria-label":"支持推理",children:s.jsx(Q,{name:"bulb",size:14})}):null,s.jsx("span",{className:"ctx",title:`上下文 ${i}`,children:i})]})}const ib=[{key:"openai-completions",label:"OpenAI 兼容"},{key:"openai-responses",label:"OpenAI Responses 兼容"},{key:"anthropic-messages",label:"Anthropic 兼容"},{key:"google-generative-ai",label:"Google 兼容"}],SS=Object.fromEntries(ib.map(l=>[l.key,l.label])),Wc=128e3,hd=l=>l.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""),wS={literal:"包含 Key",env:"包含 Key",command:"需手动填写",none:"无 Key"};function TS(){const i=we().sub,[r,o]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),[m,x]=w.useState({}),y=(E,j)=>x(v=>({...v,[E]:j}));if(w.useEffect(()=>{d1().then(E=>E.ok?o(E.view):f(E.error))},[]),w.useEffect(()=>{i&&p(null)},[i]),w.useEffect(()=>{r&&x(E=>Object.fromEntries(Object.entries(E).filter(([j])=>r.providers.some(v=>v.id===j))))},[r]),d)return s.jsx("div",{className:"note",children:d});if(!r)return s.jsx("div",{className:"empty",children:"正在读取服务商…"});const k=(E,j)=>{j.startsWith("已导入")&&x({}),o(E),p(j),kn()},S=(E,j,v)=>{o(N=>N&&{...N,settings:v,models:{...N.models,[E]:(N.models[E]??[]).map(A=>A.ref===j.ref?j:A)}})};return(i==null?void 0:i.kind)==="provider"?s.jsx(CS,{id:i.id,view:r,onView:o,onSaved:k,onThinking:S,onConnection:y}):(i==null?void 0:i.kind)==="addProvider"?s.jsx(zS,{view:r,onSaved:k,onConnection:y}):(i==null?void 0:i.kind)==="importProviders"?s.jsx(AS,{onSaved:k}):s.jsx(ES,{view:r,notice:g,connectionStatus:m})}function ES({view:l,notice:i,connectionStatus:r}){const o=f=>{var g;return((g=l.builtin.find(p=>p.id===f))==null?void 0:g.name)??f},d=f=>f.kind==="builtin"?o(f.id):f.name;return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"服务商",desc:"模型服务商与 API Key。内置服务商只需填写 API Key;兼容接口需填写服务地址、协议与模型。API Key 只保存在本机,保存后不再显示。"}),s.jsxs(ye,{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&&r[f.id]!=="failed"?"note":"badline",children:f.keyConfigured?`${r[f.id]==="connected"?"已连接":r[f.id]==="failed"?"连接失败":"未验证"} · ${((g=l.models[f.id])==null?void 0:g.length)??0} 个模型`:"未填 Key"}),s.jsx(Q,{name:"chev",size:15,className:"rgo"})]},f.id)}),s.jsxs("button",{className:"maddrow",onClick:()=>tl({kind:"importProviders",title:"从本机导入"}),children:[s.jsx(Q,{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 CS({id:l,view:i,onView:r,onSaved:o,onThinking:d,onConnection:f}){const g=i.providers.find(m=>m.id===l);if(w.useEffect(()=>{g||kn()},[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(cb,{view:i,initial:p,onSaved:o,onView:r,onConnection:f,onThinking:(m,x)=>d(l,m,x),extra:s.jsx(OS,{view:i,provider:g,onDeleted:m=>{r(m),kn()}})})}function zS({view:l,onSaved:i,onConnection:r}){const[o,d]=w.useState(null),[f,g]=w.useState(null),p=l.builtin.filter(x=>!l.providers.some(y=>y.id===x.id));if(o===null)return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"服务商"}),s.jsx(dt,{title:"添加服务商",desc:"内置服务商只需填写 API Key;兼容接口需填写服务地址、协议与模型。"}),s.jsx(ye,{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(Q,{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(Q,{name:"chev",size:14})]}),s.jsx("span",{className:"mprev",children:"填写服务地址、协议与模型;模型列表可从接口获取。"})]})]})})]});if(o==="builtin"&&f===null)return s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:"subback",onClick:()=>d(null),children:[s.jsx(Q,{name:"left",size:15}),"添加服务商"]}),s.jsx(dt,{title:"选择内置服务商",desc:"选择服务商后填写 API Key。"}),s.jsx(ye,{children:s.jsx("div",{className:"mcard",children:p.length?p.map(x=>s.jsxs("button",{className:"mrow",onClick:()=>g(x.id),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:x.name}),s.jsx("span",{className:"sp"}),s.jsx(Q,{name:"chev",size:14})]}),s.jsx("span",{className:"mprev",children:"内置服务商"})]},x.id)):s.jsx("div",{className:"empty",children:"所有内置服务商均已添加。"})})})]});const m=o==="builtin"?{kind:"builtin",isNew:!0,id:f??"",key:""}:{kind:"custom",isNew:!0,id:"",name:"",api:"openai-completions",baseUrl:"",key:"",models:[]};return s.jsx(cb,{view:l,initial:m,onSaved:i,onConnection:r,onThinking:()=>{}})}function AS({onSaved:l}){const[i,r]=w.useState(null),[o,d]=w.useState(new Set),[f,g]=w.useState(!1),[p,m]=w.useState(null);w.useEffect(()=>{p1().then(k=>{if(!k.ok){m(k.error);return}r(k.view),d(new Set(k.view.items.filter(S=>S.selectable&&!S.exists).map(S=>S.id)))})},[]);const x=k=>d(S=>{const E=new Set(S);return E.has(k)?E.delete(k):E.add(k),E}),y=async()=>{if(f||!o.size)return;g(!0),m(null);const k=[...o],S=await g1(k);if(g(!1),!S.ok){m(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(ye,{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:o.has(k.id),disabled:!k.selectable||f,onChange:()=>x(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?` · ${SS[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:wS[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 y(),disabled:f||!o.size,children:f?"正在导入…":"导入所选"}),s.jsx("button",{className:"pbtn",onClick:kn,disabled:f,children:"取消"})]})]}),p?s.jsx("div",{className:"badline",children:p}):null]})}function OS({view:l,provider:i,onDeleted:r}){var S;const[o,d]=w.useState(!1),[f,g]=w.useState(null),[p,m]=w.useState(!1),x=["conversation","work"].filter(E=>l.settings.settings.models[E].ref.startsWith(`${i.id}/`)),y=i.kind==="builtin"?((S=l.builtin.find(E=>E.id===i.id))==null?void 0:S.name)??i.id:i.name,k=async()=>{if(o)return;d(!0),g(null);const E=await h1(i.id);if(d(!1),!E.ok){g(E.error);return}r(E.view)};return s.jsxs(ye,{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:["删除「",y,"」后,该服务商的模型将不可用。",x.length?`受影响的默认模型:${x.map(E=>E==="conversation"?"对话":"任务执行").join("、")}。`:"当前默认模型不受影响。"]}),s.jsx("button",{className:"pbtn",onClick:()=>m(!1),disabled:o,children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>void k(),disabled:o,children:"确认删除"})]}):s.jsx("button",{className:"mline danger",onClick:()=>m(!0),disabled:o,children:"删除服务商"})}),f?s.jsx("div",{className:"badline",children:f}):null]})}function cb({view:l,initial:i,onSaved:r,onView:o,onConnection:d,onThinking:f,extra:g}){var ge,Ce,ze;const p=we(),[m,x]=w.useState(i),[y,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[j,v]=w.useState([]),[N,A]=w.useState(i.isNew||!((ge=l.providers.find(U=>U.id===i.id))!=null&&ge.keyConfigured)),[O,V]=w.useState(null),[ee,ne]=w.useState(null),[K,q]=w.useState(null),[L,me]=w.useState(!1),Oe=new Set(l.providers.map(U=>U.id)),Ke=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[m.id])==null?void 0:I.find(ie=>ie.id===U)},oe=U=>x(I=>({...I,...U})),Qe=m.isNew||JSON.stringify(m)!==JSON.stringify(i),Me=m.kind==="builtin"?{kind:"builtin",id:m.id,...m.key.trim()?{apiKey:m.key.trim()}:{}}:{kind:"custom",...m.id?{id:m.id}:{},api:m.api,baseUrl:m.baseUrl.trim(),...m.key.trim()?{apiKey:m.key.trim()}:{}},F=JSON.stringify(Me),de=async()=>{if(L)return;me(!0),q(null),ne(null);const U=await nv(Me);if(me(!1),!Qe&&m.id&&d(m.id,U?"failed":"connected"),U){V(null),q(U);return}V(F),ne("连接成功")},ue=U=>{const I=`${m.id}/${U.id}`,ie=p.settings.settings.models,vt=ie.roster.some(ft=>ft.ref===I),wt=ie.conversation.ref===I||ie.work.ref===I;return s.jsxs("label",{className:"ctl",children:[s.jsx("input",{type:"checkbox",checked:vt,disabled:m.isNew||!Pe(U.id)||y||L||wt,onChange:()=>{const ft=vt?ie.roster.filter(et=>et.ref!==I):[...ie.roster,{ref:I,note:"",scores:df({id:U.id,name:U.name??U.id,reasoning:!!U.reasoning}),scoresConfirmed:!1}];k(!0),E(null),Bd({models:{roster:ft}}).then(et=>{k(!1),E(et?"已保存":"保存失败,请重试。")})}}),s.jsx("span",{children:wt?"默认模型已加入":"加入可用模型"})]})},Re=async()=>{if(m.kind!=="custom"||L)return;me(!0),q(null);const U=await m1({api:m.api,baseUrl:m.baseUrl.trim(),...m.key.trim()?{apiKey:m.key.trim()}:{},...m.id?{id:m.id}:{}});if(me(!1),!U.ok){q(U.error),v([]);return}v(U.models)},je=async U=>{if(m.kind!=="custom")return;if(m.isNew){oe({models:U});return}const I=l.providers.find(et=>et.id===m.id);if(!I||I.kind!=="custom")return;me(!0),q(null);const{id:ie,keyConfigured:vt,...wt}=I,ft=await tv(ie,{...wt,models:U});if(me(!1),!ft.ok){q(ft.error);return}oe({models:U}),o==null||o(ft.view),E("已保存")},zt=U=>{if(m.kind!=="custom")return;const I=m.models.some(ie=>ie.id===U.id);je(I?m.models.filter(ie=>ie.id!==U.id):[...m.models,{id:U.id,...U.name?{name:U.name}:{}}])},Yt=U=>{if(m.kind!=="custom")return;const I=U.trim();!I||m.models.some(ie=>ie.id===I)||je([...m.models,{id:I}])},Gt=(U,I)=>{m.kind==="custom"&&je(m.models.map(ie=>ie.id===U?{...ie,...I}:ie))},z=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 vt;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:[(vt=ie.input)!=null&&vt.includes("image")?s.jsx("span",{title:"支持图片输入","aria-label":"支持图片输入",children:s.jsx(Q,{name:"image",size:14})}):null,ie.reasoning?s.jsx("span",{title:"支持推理","aria-label":"支持推理",children:s.jsx(Q,{name:"bulb",size:14})}):null,ie.contextWindow?s.jsx("span",{className:"ctx",children:ff(ie.contextWindow)}):null]}),ue(ie),ie.reasoning?s.jsx(Yv,{modelRef:ie.ref,info:ie,disabled:L,onSaved:f}):s.jsx("div",{className:"note",children:"不推理,没有思考档。"})]})},ie.id)})}),s.jsx("div",{className:"note",children:"模型由服务商提供。会推理的模型可以改每个思考档发给服务商的字符。"})]}):null},X=async()=>{if(L)return;me(!0),q(null);const U=l.providers.find(wt=>wt.id===m.id),I=m.kind==="builtin"?{kind:"builtin",...m.key.trim()?{key:m.key.trim()}:{}}:{kind:"custom",name:m.name.trim(),api:m.api,baseUrl:m.baseUrl.trim(),models:m.models,...(U==null?void 0:U.kind)==="custom"&&U.extra?{extra:U.extra}:{},...m.key.trim()?{key:m.key.trim()}:{}},ie=m.kind==="custom"&&m.isNew?m.id.trim()||hd(m.name):m.id;if(!ie){me(!1),q("保存失败:请填写标识。模型引用使用该标识,只能包含小写字母、数字、点和短横线,例如 my-proxy。");return}if(m.isNew&&Oe.has(ie)){me(!1),q("该服务商标识已存在,请使用其他标识。");return}if(O!==F){ne("正在验证连接…");const wt=await nv(Me);if(ne(null),wt){me(!1),q(`测试连接失败:${wt}`);return}}const vt=await tv(ie,I);if(me(!1),!vt.ok){q(vt.error);return}d(ie,"connected"),r(vt.view,"已保存")},Z=m.kind==="builtin"?m.isNew?"添加内置服务商":Ke(m.id):m.isNew?"添加兼容接口":m.name||"兼容接口",P=m.kind==="builtin"?m.id:m.id||hd(m.name);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"服务商"}),s.jsx(dt,{title:Z,desc:P?s.jsx("span",{className:"mono",children:P}):null}),m.kind==="builtin"?s.jsxs(ye,{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:m.id,onChange:U=>oe({id:U.target.value}),disabled:!0,children:l.builtin.filter(U=>!m.isNew||!Oe.has(U.id)).map(U=>s.jsxs("option",{value:U.id,children:[U.name,Oe.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:m.key,placeholder:(Ce=l.providers.find(U=>U.id===m.id))!=null&&Ce.keyConfigured?"已保存,留空则沿用":"sk-…",onChange:U=>oe({key:U.target.value}),disabled:L})}):s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:"已保存"}),s.jsx("button",{className:"pbtn",onClick:()=>A(!0),children:"更换"})]}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:"pbtn",disabled:L,onClick:()=>void de(),children:"测试连接"}),s.jsx("span",{className:"note",children:"测试会请求模型,可能产生费用。"}),ee&&O===F?s.jsx("span",{className:"okline",children:ee}):null]}),s.jsx(Gv,{busy:L,error:K,dirty:Qe,onCancel:kn,onSave:()=>void X()})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(ye,{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:m.name,placeholder:"如「我的代理」",onChange:U=>oe({name:U.target.value}),disabled:L})}),m.isNew?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"lbl sub",children:"标识"}),s.jsx("div",{className:"field",children:s.jsx("input",{value:m.id,placeholder:hd(m.name)||"my-proxy",onChange:U=>oe({id:U.target.value}),disabled:L})}),s.jsx("div",{className:"note",children:"模型引用使用该标识,例如 my-proxy/gpt-x。留空则按名称自动生成。"})]}):s.jsxs("div",{className:"note mono",children:["标识:",m.id]}),s.jsx("div",{className:"lbl sub",children:"协议"}),s.jsx("div",{className:"ctl",children:s.jsx("select",{className:"pick grow",value:m.api,onChange:U=>oe({api:U.target.value}),disabled:L,children:ib.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:m.baseUrl,placeholder:"http://127.0.0.1:8080/v1",onChange:U=>oe({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:m.key,placeholder:(ze=l.providers.find(U=>U.id===m.id))!=null&&ze.keyConfigured?"已保存,留空则沿用":"sk-…",onChange:U=>oe({key:U.target.value}),disabled:L})}):s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:"已保存"}),s.jsx("button",{className:"pbtn",onClick:()=>A(!0),children:"更换"})]}),s.jsxs("div",{className:"ctl",style:{gap:8,flexWrap:"wrap"},children:[s.jsx("button",{className:"pbtn",disabled:L||!m.baseUrl.trim(),onClick:()=>void de(),children:"测试连接"}),ee&&O===F?s.jsx("span",{className:"okline",children:ee}):null,s.jsx("button",{className:"pbtn",onClick:()=>void Re(),disabled:L||!m.baseUrl.trim(),children:L?"正在获取…":"获取模型列表"}),s.jsx("span",{className:"note",children:"从接口获取模型列表,选择需要使用的模型。"})]}),s.jsx(Gv,{busy:L,error:K,dirty:Qe,onCancel:kn,onSave:()=>void X()})]})]}),j.length?s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"接口上的模型"}),s.jsx("div",{className:"chips",children:j.map(U=>{const I=m.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(ye,{children:[s.jsx("div",{className:"lbl",children:"模型"}),m.models.length?s.jsx("div",{className:"roster",children:m.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 Gt(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:()=>Gt(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??Wc,title:"上下文窗口(token)",onBlur:ie=>{const vt=Number(ie.target.value)||Wc;vt!==(U.contextWindow??Wc)&&Gt(U.id,{contextWindow:vt})},onKeyDown:ie=>{ie.key==="Enter"&&ie.currentTarget.blur()},disabled:L},`${U.id}:${U.contextWindow??Wc}`)]}),ue(U),U.reasoning?Pe(U.id)?s.jsx(Yv,{modelRef:`${m.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(m.models.filter(ie=>ie.id!==U.id)),children:s.jsx(Q,{name:"close",size:13})})]},U.id)})}):s.jsx("div",{className:"empty",children:"尚未添加模型。可获取模型列表后勾选,或手动填写模型 ID。"}),s.jsx(_S,{disabled:L,onAdd:Yt})]})]}),m.kind==="builtin"&&!m.isNew?s.jsx(ye,{children:z(m.id)}):null,S?s.jsx("div",{className:S==="已保存"?"okline":"badline",role:"status",children:S}):null,g]})}function _S({disabled:l,onAdd:i}){const[r,o]=w.useState(""),d=()=>{r.trim()&&(i(r),o(""))};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:r,placeholder:"手动填写模型 ID,如 gpt-4o-mini",onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&d()},disabled:l})}),s.jsx("button",{className:"pbtn",onClick:d,disabled:l||!r.trim(),children:"添加"})]})}function Gv({busy:l,error:i,dirty:r,onCancel:o,onSave:d}){return s.jsxs(oa,{saved:!1,error:i,children:[!i&&r?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",onClick:o,disabled:l,children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:d,disabled:l||!r,children:l?"正在验证…":"保存"})]})}function MS(){var o,d;const l=we(),[i,r]=w.useState(null);return w.useEffect(()=>{Ld().then(r)},[]),i?((o=l.sub)==null?void 0:o.kind)==="model"?s.jsx(DS,{view:i,modelRef:l.sub.ref}):((d=l.sub)==null?void 0:d.kind)==="addModels"?s.jsx(US,{view:i}):s.jsx(RS,{view:i}):s.jsx("div",{className:"empty",children:"正在读取模型列表…"})}function Od(l,i){return{scores:l.scores??df(i??{id:l.ref.split("/").at(-1)??l.ref,name:"",reasoning:!1}),unconfirmed:!l.scores||l.scoresConfirmed!==!0}}function rb({entry:l,info:i,update:r,collapsible:o=!1}){const d=Od(l,i),[f,g]=w.useState(!o||d.unconfirmed),[p,m]=w.useState(d.scores),[x,y]=w.useState(l.note),k=w.useRef(!1),S=w.useRef(p);S.current=p,w.useEffect(()=>{k.current||m(Od(l,i).scores)},[l.scores,i]),w.useEffect(()=>y(l.note),[l.note]);const E=N=>r({scores:N,scoresConfirmed:!0}),j=()=>{if(!k.current)return;k.current=!1;const N=l.scores,A=S.current;(!N||l.scoresConfirmed!==!0||N.smart!==A.smart||N.cost!==A.cost||N.speed!==A.speed)&&E(A)};if(!f)return s.jsxs("div",{className:"ctl",children:[s.jsx("span",{className:"note",children:nb(l.scores??p)}),s.jsx("button",{className:"pbtn",onClick:()=>g(!0),children:"修改"})]});const v={smart:"聪明程度",cost:"成本",speed:"速度"};return s.jsxs("div",{className:"group",children:[s.jsxs("div",{className:"note",children:["Hob 按用途选择分派任务的模型。",d.unconfirmed?"数值按模型名称推测,请确认。":""]}),Object.keys(v).map(N=>s.jsxs("div",{className:"score-row",children:[s.jsxs("div",{className:"score-head",children:[s.jsx("label",{htmlFor:`${l.ref}-${N}`,children:v[N]}),s.jsxs("span",{children:[$v(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:A=>{k.current=!0,m({...S.current,[N]:Number(A.target.value)})},onPointerUp:j,onTouchEnd:j,onKeyUp:j,onBlur:j}),s.jsx("div",{className:"score-ticks",children:tb[N].map(A=>s.jsx("button",{style:{left:`${A.value}%`},className:A.value===0?"first":A.value===100?"last":void 0,"aria-pressed":A.label===$v(N,p[N]),onClick:()=>{const O={...S.current,[N]:A.value};m(O),E(O)},children:A.label},A.value))})]},N)),s.jsx("div",{className:"field",children:s.jsx("input",{value:x,onChange:N=>y(N.target.value),onBlur:()=>{x!==l.note&&r({note:x})},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()},placeholder:"补充说明(选填),如「中文写作特别好」"})}),o?s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>g(!1),children:"收起"})}):null]})}function hf(){const i=we().settings.settings.models,r=is(),o=p=>void r.save({models:p});return{models:i,save:o,setRoster:p=>o({roster:p}),update:(p,m)=>void r.save(x=>({models:{roster:x.models.roster.map(y=>y.ref===p?{...y,...m}:y)}})),roles:p=>[i.conversation.ref===p?"对话":null,i.work.ref===p?"任务执行":null].filter(m=>m!==null),feedback:r}}function Hn({label:l="模型"}){return s.jsxs("button",{className:"subback",onClick:kn,children:[s.jsx(Q,{name:"left",size:15}),l]})}function RS({view:l}){const{models:i,save:r,roles:o,feedback:d}=hf(),f=new Map(l.models.map(m=>[m.ref,m])),g=m=>[...i.roster.length?[]:[{value:"",text:"未设置"}],...i.roster.filter(x=>f.has(x.ref)||x.ref===m).map(x=>{var y;return{value:x.ref,text:((y=f.get(x.ref))==null?void 0:y.name)??x.ref}})],p=(m,x,y)=>s.jsxs("div",{className:"mline",children:[s.jsx("span",{className:"k",children:x}),s.jsxs("span",{className:"vals",children:[s.jsx(lb,{value:i[m].ref,label:y,options:g(i[m].ref),onChange:k=>r({[m]:{ref:k,thinking:gi(f.get(k),i[m].thinking)}})}),s.jsx(ab,{value:gi(f.get(i[m].ref),i[m].thinking),model:f.get(i[m].ref),onChange:k=>r({[m]:{...i[m],thinking:k}})})]})]});return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"模型",desc:"可用模型来自「服务商」,默认模型从可用模型中选择。"}),s.jsx(mn,{message:d.message,toast:!0}),s.jsxs(ye,{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(os,{items:[{key:"auto",label:"助手按任务选择"},{key:"fixed",label:"固定使用默认档"}],value:i.thinkingChoice??"auto",disabled:d.busy,onChange:m=>r({thinkingChoice:m})}),s.jsx("div",{className:"note",children:"按任务选择时,助手会给简单的活用低档、复杂的活用高档;固定时一律使用上面设置的默认档。"})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"可用模型"}),s.jsxs("div",{className:"mcard",children:[i.roster.map(m=>{const x=f.get(m.ref),y=(x==null?void 0:x.name)??m.ref,k=Od(m,x);return s.jsxs("button",{className:`mrow${x?"":" gone"}`,onClick:()=>tl({kind:"model",ref:m.ref,title:y}),children:[s.jsxs("span",{className:"mtop",children:[s.jsx("span",{className:"mname",children:y}),s.jsx("span",{className:"sp"}),x?s.jsx(sb,{info:x}):s.jsx("span",{className:"mbad",children:"不可用"}),s.jsx(Q,{name:"chev",size:14})]}),s.jsxs("span",{className:"mprev",children:[o(m.ref).map(S=>s.jsx("span",{className:"mrole",children:S},S)),nb(k.scores),k.unconfirmed?s.jsx("span",{className:"model-use-warning",children:"请确认用途"}):null,x?null:" · 该模型的服务商已删除或未配置 Key"]})]},m.ref)}),s.jsxs("button",{className:"maddrow",onClick:()=>tl({kind:"addModels",title:"添加模型"}),children:[s.jsx(Q,{name:"plus",size:16}),"添加模型"]})]}),s.jsx("div",{className:"note",children:"助手分派任务时,按用途说明在可用模型中选择。"})]})]})}function DS({view:l,modelRef:i}){const{models:r,setRoster:o,update:d,roles:f,feedback:g}=hf(),[p,m]=w.useState(!1),x=r.roster.find(S=>S.ref===i);if(w.useEffect(()=>{x||kn()},[x]),!x)return null;const y=l.models.find(S=>S.ref===i),k=f(i);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{}),s.jsx(dt,{title:(y==null?void 0:y.name)??i,desc:s.jsx("span",{className:"mono",children:i})}),s.jsx(mn,{message:g.message,toast:!0}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"用途说明"}),s.jsx(rb,{entry:x,info:y,update:S=>d(i,S)})]}),y!=null&&y.reasoning?s.jsxs(ye,{children:[s.jsx("div",{className:"mcard",children:s.jsxs("div",{className:"mline",children:[s.jsx("span",{className:"k",children:"分派时的思考强度"}),s.jsx(ab,{value:gi(y,x.thinking??r.work.thinking),model:y,onChange:S=>d(i,{thinking:S})})]})}),s.jsx("div",{className:"note",children:"助手把任务分派给这个模型时使用。作为默认模型时,以「默认模型」中的设置为准。"})]}):null,s.jsxs(ye,{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:(y==null?void 0:y.provider)??"不可用"})]}),y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"kvrow",children:[s.jsxs("span",{className:"k kicon",children:[s.jsx(Q,{name:"image",size:14}),"图片输入"]}),s.jsx("span",{className:"v",children:y.input.includes("image")?"支持":"不支持"})]}),s.jsxs("div",{className:"kvrow",children:[s.jsxs("span",{className:"k kicon",children:[s.jsx(Q,{name:"bulb",size:14}),"推理"]}),s.jsx("span",{className:"v",children:y.reasoning?"支持":"不支持"})]}),s.jsxs("div",{className:"kvrow",children:[s.jsx("span",{className:"k",children:"上下文"}),s.jsx("span",{className:"v",children:ff(y.contextWindow)})]})]}):null]})]}),s.jsxs(ye,{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:()=>m(!1),children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>o(r.roster.filter(S=>S.ref!==i)),children:"确认移除"})]}):s.jsx("button",{className:"mline danger",disabled:k.length>0,onClick:()=>m(!0),children:"从可用模型中移除"})}),k.length?s.jsxs("div",{className:"note",children:["这是",k.join("和"),"的默认模型。要移除,请先在「默认模型」中更换。"]}):null]})]})}function US({view:l}){const{models:i,setRoster:r,roles:o,update:d,feedback:f}=hf(),[g,p]=w.useState(""),m=new Set(i.roster.map(v=>v.ref)),[x,y]=w.useState(()=>[...new Set(l.models.filter(v=>m.has(v.ref)).map(v=>v.provider))]),k=lS(nS(l.models,g)),S=g.trim().length>0,E=v=>y(N=>N.includes(v)?N.filter(A=>A!==v):[...N,v]),j=v=>r(m.has(v.ref)?i.roster.filter(N=>N.ref!==v.ref):[...i.roster,{ref:v.ref,scores:df(v),note:"",scoresConfirmed:!1,...v.reasoning?{thinking:gi(v,"medium")}:{}}]);return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{}),s.jsx(dt,{title:"添加模型",desc:"「服务商」提供的全部模型,打勾的已在可用模型中。"}),s.jsx(mn,{message:f.message,toast:!0}),l.models.length===0?s.jsxs(ye,{children:[s.jsx("div",{className:"empty",children:"尚无可用模型。请先在「服务商」中配置服务商并填写 API Key。"}),s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>hi("providers"),children:"配置服务商"})})]}):s.jsxs("div",{className:"mcard",children:[s.jsxs("label",{className:"mfind",children:[s.jsx(Q,{name:"search",size:15}),s.jsx("input",{value:g,placeholder:"搜索名称或引用,如 claude",onChange:v=>p(v.target.value)})]}),k.length===0?s.jsx("div",{className:"mempty",children:"没有匹配的模型。"}):k.map(v=>{const N=S||x.includes(v.provider),A=v.models.filter(O=>m.has(O.ref)).length;return s.jsxs(w.Fragment,{children:[s.jsxs("button",{className:"mgroup","aria-expanded":N,onClick:()=>E(v.provider),children:[s.jsx("span",{className:"n",children:v.provider}),s.jsx("span",{className:"c",children:A?`已加入 ${A} / ${v.models.length}`:v.models.length}),s.jsx(Q,{name:N?"down":"chev",size:14})]}),N?v.models.map(O=>{const V=m.has(O.ref),ee=o(O.ref).length>0,ne=i.roster.find(K=>K.ref===O.ref);return s.jsxs("div",{children:[s.jsxs("button",{className:`madd${V?" on":""}`,disabled:ee,title:ee?"默认模型不能在这里移除":V?"从可用模型中移除":"加入可用模型",onClick:()=>j(O),children:[s.jsx("span",{className:"mname",children:O.name}),s.jsx(sb,{info:O}),s.jsx(Q,{name:V?"check":"plus",size:16,className:"mtog"})]}),ne?s.jsx("div",{className:"model-use-inline",children:s.jsx(rb,{entry:ne,info:O,collapsible:!0,update:K=>d(O.ref,K)})}):null]},O.ref)}):null]},v.provider)})]})]})}function HS(){const i=we().settings.settings.work,r=is(),o=d=>r.save({work:d});return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"任务",desc:"任务并行数、无响应判定时间,以及全部任务的任务记录。"}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"最大并行任务数"}),s.jsx("div",{className:"ctl",children:s.jsx("select",{className:"pick",value:i.maxJobs,disabled:r.busy,onChange:d=>void o({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(mn,{message:r.message})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"无响应判定时间"}),s.jsx("div",{className:"lbl sub",children:"任务"}),s.jsxs("div",{className:"ctl",children:[s.jsx(cs,{value:String(i.jobStallMinutes),onSave:d=>o({jobStallMinutes:Number(d)})}),s.jsx("span",{className:"note",children:"分钟"})]}),s.jsx("div",{className:"lbl sub",children:"助手回复"}),s.jsxs("div",{className:"ctl",children:[s.jsx(cs,{value:String(i.routerStallMinutes),onSave:d=>o({routerStallMinutes:Number(d)})}),s.jsx("span",{className:"note",children:"分钟"})]}),s.jsx(mn,{message:r.message}),s.jsx("div",{className:"note",children:"修改后立即生效,无需重启。"})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"任务记录"}),s.jsx("div",{className:"ctl",children:s.jsx("button",{className:"pbtn",onClick:()=>Gd(),children:"查看全部任务"})}),s.jsx("div",{className:"note",children:"可查看每个任务的完整执行过程。"})]})]})}function BS(){const l=we(),i=is(),[r,o]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),[m,x]=w.useState(null),[y,k]=w.useState(!1),[S,E]=w.useState(null),[j,v]=w.useState(null),N=Rd(),A=()=>void Dd().then(q=>p((q==null?void 0:q.endpoint)??null));if(w.useEffect(()=>{or().then(q=>q.ok?o(q.view):f(q.error)),A()},[]),d)return s.jsx("div",{className:"note",children:d});if(!r)return s.jsx("div",{className:"empty",children:"正在读取推送设置…"});const O=typeof Notification<"u"&&Notification.permission==="denied",V=!!(g&&r.devices.some(q=>q.endpoint===g)),ee=async()=>{if(!y){k(!0),E(null),v(null);try{const q=V?await z1():await C1();if(!q.ok){E(q.error);return}o(q.view),A(),v(V?"此设备将不再接收推送":"此设备将接收推送")}finally{k(!1)}}},ne=async q=>{const L=await ax(q);if(!L.ok){E(L.error);return}o(L.view),x(null),A()},K=async()=>{if(!y){k(!0),E(null),v(null);try{const q=await O1();if(!q.ok){E(q.error);return}v(q.sent?"测试通知已发送":"未发送:这台设备尚未订阅")}finally{k(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"通知",desc:"本机推送与已订阅的设备。"}),s.jsxs(ye,{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${V?"":" off"}`,title:V?"关闭本机推送":"开启本机推送",onClick:()=>void ee(),disabled:y})]}):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(ye,{children:[s.jsx("div",{className:"lbl",children:"已订阅的设备"}),r.devices.length?r.devices.map(q=>s.jsxs("div",{className:"dev",children:[s.jsx("span",{className:"n",children:q.label}),s.jsx("span",{className:"tm",children:Ol(q.createdAt)}),s.jsx("span",{className:"sp"}),m===q.endpoint?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"note",children:"确认删除?"}),s.jsx("button",{className:"pbtn",onClick:()=>x(null),children:"取消"}),s.jsx("button",{className:"pbtn danger",onClick:()=>void ne(q.endpoint),children:"确认删除"})]}):s.jsx("button",{className:"del",title:"删除这台设备",onClick:()=>x(q.endpoint),children:"删除"})]},q.endpoint)):s.jsx("div",{className:"empty",children:"暂无已订阅的设备"}),s.jsxs("div",{className:"ctl",children:[s.jsx("button",{className:"pbtn",onClick:()=>void K(),disabled:y||!r.devices.length,children:"发送测试通知"}),j&&!S?s.jsx("span",{className:"okline",children:j}):null,S?s.jsx("span",{className:"badline",children:S}):null]})]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"推送服务联系邮箱(选填)"}),s.jsx(cs,{placeholder:"name@example.com",value:l.settings.settings.push.email,onSave:q=>i.save({push:{email:q.trim()}})}),s.jsx(mn,{message:i.message}),s.jsx("div",{className:"note",children:"推送服务使用此地址联系你;留空使用 hob@localhost。"})]})]})}const fi="https://api.loremem.com",LS={saas:"https://app.loremem.com/login"},qS=[{key:"saas",label:"Lore 云服务"},{key:"self",label:"自部署"}],$S=[{key:"local",label:"本地记忆"},{key:"lore",label:"Lore"},{key:"off",label:"关闭"}],Xv={invalid_url:"服务地址无效。",insecure_http:"公网地址必须使用 https,明文 http 仅允许本机或局域网地址。",missing_token:"缺少 API Token。",unauthorized:"API Token 被拒绝。",unreachable:"无法连接该地址。"},_d=l=>l.trim().replace(/\/+$/,"");function Qv(l){return l===null||_d(l)===fi?"saas":"self"}function YS(){const[l,i]=w.useState(null),[r,o]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState("saas"),[m,x]=w.useState(fi),[y,k]=w.useState(""),[S,E]=w.useState(!1),[j,v]=w.useState(!1),[N,A]=w.useState(null),[O,V]=w.useState(!1),[ee,ne]=w.useState(null),[K,q]=w.useState(!1),[L,me]=w.useState(null),[Oe,Ke]=w.useState(null),[Pe,oe]=w.useState(!1);w.useEffect(()=>{if(!K)return;const Z=setTimeout(()=>q(!1),3e3);return()=>clearTimeout(Z)},[K]);const Qe=Z=>{i(Z),o(null),f(null),p(Qv(Z.lore.baseUrl)),x(Z.lore.baseUrl??fi),k(""),E(!1),v(!1),A(null),ne(null),q(!1)};if(w.useEffect(()=>{sd().then(Z=>{Z.ok?Qe(Z.config):o(Z.error)})},[]),r)return s.jsx("div",{className:"note",children:r});if(!l)return s.jsx("div",{className:"empty",children:"正在读取记忆设置…"});const Me=d??l.provider,F=l.lore.tokenConfigured&&_d(m)===_d(l.lore.baseUrl??""),de=d==="lore"&&!S?l.lore.configured:j,ue=d!==null||S,Re=async Z=>{if(O)return;if(Z===l.provider){f(null);return}if(ne(null),q(!1),Z==="lore"&&!l.lore.configured){f("lore");return}V(!0);const P=await sv(l.revision,Z);if(V(!1),!P.ok){ne(P.error);return}Qe(P.config),q(!0)},je=Z=>{O||(Z(),E(!0),v(!1),A(null),ne(null),q(!1))},zt=Z=>je(()=>{p(Z),x(Z==="saas"?fi:Qv(l.lore.baseUrl)==="self"?l.lore.baseUrl??"":"")}),Yt=async()=>{if(O)return;V(!0),Ke(null),oe(!1);const Z=await T1();if(!Z.ok){V(!1),Ke(Z.error);return}if(me({source:Z.view.source,found:Z.view.found}),!Z.view.found){V(!1);return}const P=await E1();if(V(!1),!P.ok){Ke(P.error);return}Qe(P.config),f("lore"),oe(!0)},Gt=async()=>{if(O)return;V(!0),A(null);const Z={baseUrl:m.trim(),...y?{token:y}:{}},P=await iv(Z);if(V(!1),!P.ok){A({ok:!1,text:P.error});return}P.result.ok?(v(!0),A({ok:!0,text:"已连接"})):A({ok:!1,text:Xv[P.result.reason]})},z=async()=>{if(O||!ue)return;if(V(!0),ne(null),Me==="lore"&&!de){const ge=await iv({baseUrl:m.trim(),...y?{token:y}:{}});if(!ge.ok){V(!1),ne(ge.error);return}if(!ge.result.ok){V(!1),ne(Xv[ge.result.reason]);return}v(!0)}let Z=l;if(Me==="lore"&&S){const ge=await w1({baseUrl:m.trim(),...y?{token:y}:{}});if(!ge.ok){V(!1),ne(ge.error);return}Z=ge.config}const P=await sv(Z.revision,Me);if(V(!1),!P.ok){ne(P.error),/已刷新/.test(P.error)&&sd().then(ge=>ge.ok&&Qe(ge.config));return}Qe(P.config),q(!0)},X=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(ye,{children:[s.jsx("div",{className:"lbl",children:"提供者"}),s.jsx(os,{items:$S,value:Me,onChange:Z=>void Re(Z),disabled:O}),s.jsx("div",{className:"sline",children:X}),s.jsx(mn,{message:ee??(K?"已保存":null)})]}),Me==="lore"?s.jsxs(s.Fragment,{children:[s.jsx(ye,{children:s.jsxs("div",{className:"formcard",children:[s.jsx("div",{className:"lbl",children:"部署方式"}),s.jsx(os,{items:qS,value:g,onChange:zt,disabled:O}),s.jsx("div",{className:"lbl",children:"服务地址"}),g==="saas"?s.jsx("div",{className:"field ro",children:fi}):s.jsx("div",{className:"field",children:s.jsx("input",{value:m,placeholder:"http://192.168.1.10:18901",onChange:Z=>je(()=>x(Z.target.value)),disabled:O})}),s.jsxs("div",{className:"lblrow",children:[s.jsx("span",{className:"lbl",children:"Token"}),s.jsx("a",{className:"link",href:LS.saas,target:"_blank",rel:"noreferrer",children:"注册 / 登录 Lore"})]}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:y,placeholder:F?"已保存,留空则沿用":"lm_…",onChange:Z=>je(()=>k(Z.target.value)),disabled:O})}),s.jsxs("div",{className:"ctl",style:{gap:10,flexWrap:"wrap"},children:[s.jsx("button",{className:"pbtn",onClick:()=>void Gt(),disabled:O||m.trim()==="",children:"测试连接"}),N?s.jsx("span",{className:N.ok?"okline":"badline",children:N.text}):null]}),s.jsxs(oa,{saved:K&&!ue,error:ee,children:[!ee&&ue?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",onClick:()=>void sd().then(Z=>Z.ok?Qe(Z.config):o(Z.error)),disabled:O||!ue,children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void z(),disabled:O||!ue,children:O?"正在验证…":"保存"})]})]})}),s.jsxs(ye,{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 Yt(),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,Oe?s.jsx("div",{className:"badline",children:Oe}):null]})]}):null]})}const GS=[{key:"off",label:"关闭"},{key:"openai",label:"OpenAI 兼容接口"}],XS=["1024x1024","1536x1024","1024x1536","512x512"],QS=l=>l.trim().replace(/\/+$/,"");function VS(){const i=we().settings.settings.image,[r,o]=w.useState(i.source),[d,f]=w.useState(i.source==="openai"?i.baseUrl:""),[g,p]=w.useState(i.source==="openai"?i.model:""),[m,x]=w.useState(i.source==="openai"?i.size??"":""),[y,k]=w.useState(""),[S,E]=w.useState(!1),[j,v]=w.useState(null),[N,A]=w.useState(null),[O,V]=w.useState(!1),[ee,ne]=w.useState(null),[K,q]=w.useState(null);w.useEffect(()=>{if(!ee)return;const oe=setTimeout(()=>ne(null),3e3);return()=>clearTimeout(oe)},[ee]),w.useEffect(()=>{S1().then(oe=>{oe&&E(oe.keyConfigured)})},[]);const L=r==="openai"?{source:"openai",baseUrl:QS(d),model:g.trim(),...m?{size:m}:{}}:{source:"off"},me=JSON.stringify(L)!==JSON.stringify(i)||y.trim()!=="",Oe=JSON.stringify({form:L,apiKey:y.trim()});w.useEffect(()=>{v(null),A(null)},[Oe]);const Ke=async()=>{if(O)return;V(!0),v(null);const oe=await av({image:L,...y.trim()?{apiKey:y.trim()}:{}});V(!1),oe.ok?(A(Oe),v({ok:!0,text:"生成成功",path:oe.path})):(A(null),v({ok:!1,text:oe.error}))},Pe=async()=>{if(O||!me)return;if(V(!0),q(null),ne(null),L.source==="openai"&&N!==Oe){const Qe=await av({image:L,...y.trim()?{apiKey:y.trim()}:{}});if(!Qe.ok){V(!1),A(null),q(`测试连接失败:${Qe.error}`);return}A(Oe),v({ok:!0,text:"生成成功",path:Qe.path})}const oe=await lv(L,y.trim()||void 0);if(V(!1),!oe.ok){q(oe.error);return}L.source==="openai"&&(f(L.baseUrl),p(L.model)),k(""),E(oe.keyConfigured),v(null),ne("已保存")};return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"图像生成",desc:"选择图像生成方式:关闭,或使用 OpenAI 兼容接口。配置完成后,开启了图像生成能力的助手可以在任务中生成图片。"}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"生成方式"}),s.jsx(os,{items:GS,value:r,onChange:oe=>{v(null),q(null),ne(null),oe==="off"&&i.source!=="off"?(V(!0),lv({source:"off"}).then(Qe=>{if(V(!1),!Qe.ok){q(Qe.error);return}o("off"),k(""),ne("已保存")})):o(oe)},disabled:O})]}),r==="openai"?s.jsx(ye,{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:oe=>f(oe.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:oe=>p(oe.target.value),disabled:O})}),s.jsx("div",{className:"lbl",children:"默认尺寸"}),s.jsx("div",{className:"ctl",children:s.jsxs("select",{className:"pick grow",value:m,onChange:oe=>x(oe.target.value),disabled:O,children:[s.jsx("option",{value:"",children:"不指定,使用接口默认值"}),XS.map(oe=>s.jsx("option",{value:oe,children:oe},oe))]})}),s.jsx("div",{className:"lbl",children:"API Key"}),s.jsx("div",{className:"field",children:s.jsx("input",{type:"password",value:y,placeholder:S?"已保存,留空则沿用":"sk-…",onChange:oe=>k(oe.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 Ke(),disabled:O,children:O?"正在生成…":"生成测试图片"}),j?s.jsxs("div",{className:"testout",children:[s.jsx("span",{className:j.ok?"okline":"badline",children:j.text}),j.ok&&j.path?s.jsx("button",{className:"imgcard testshot",onClick:()=>window.open(hn(j.path),"_blank","noopener"),title:"查看原图",children:s.jsx("img",{src:hn(j.path),alt:"生成的图片"})}):null]}):null]}),s.jsxs(oa,{saved:ee!==null&&!me,error:K,children:[!K&&me?s.jsx("span",{className:"note",children:"未保存的修改"}):null,s.jsx("button",{className:"pbtn",disabled:O||!me,onClick:()=>{o(i.source),f(i.source==="openai"?i.baseUrl:""),p(i.source==="openai"?i.model:""),x(i.source==="openai"?i.size??"":""),k(""),v(null),A(null),q(null)},children:"取消"}),s.jsx("button",{className:"pbtn solid",onClick:()=>void Pe(),disabled:O||!me,children:O?"正在验证…":"保存"})]})]})}):s.jsx(mn,{message:K??ee})]})}const ZS={hob:"Hob 的技能",common:"通用技能 · ~/.agents/skills",lore:"Lore 技能"},KS=[{key:"claude",label:"Claude Code"},{key:"codex",label:"Codex"},{key:"pi",label:"pi"}],md=l=>`${l.source}:${l.id}`,ra=l=>l instanceof Error?l.message:String(l);function JS(){const l=we(),i=l.sub,[r,o]=w.useState(null),[d,f]=w.useState(null),[g,p]=w.useState(null),m=async()=>{try{o(await v1()),f(null)}catch(E){f(ra(E))}};w.useEffect(()=>{m()},[]),w.useEffect(()=>{i&&p(null)},[i]);const x=async E=>{var A;const j=`${E.source}:${E.name}`,v=((A=l.settings.settings.skills)==null?void 0:A.disabled)??[],N=E.enabled?[...v,j]:v.filter(O=>O!==j);await Bd({skills:{disabled:N}})?await m():f(ar().notice??"保存失败")},y=E=>{m(),p(E),kn()};if(!r)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(IS,{skill:r.skills.find(E=>md(E)===i.key),onDeleted:y});if((i==null?void 0:i.kind)==="importSkills")return s.jsx(FS,{onDone:y});const k=(E,j)=>E.length?E.map(v=>s.jsxs("div",{className:`rrow${v.enabled?"":" gone"}`,children:[s.jsxs("button",{className:"rmain rbtn",onClick:()=>tl({kind:"skill",key:md(v),title:v.name}),children:[s.jsxs("div",{className:"rname",children:[v.name,v.overridden?s.jsx("span",{className:"rtag",children:"被同名技能覆盖"}):null]}),s.jsx("div",{className:"rprov rclamp",children:v.description})]}),s.jsx("button",{className:`tog${v.enabled?"":" off"}`,"aria-label":`${v.name}启用`,"aria-pressed":v.enabled,onClick:()=>void x(v)})]},md(v))):s.jsx("div",{className:"rempty",children:j}),S=r.skills.filter(E=>E.source==="hob");return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"技能",desc:"技能是写好的做法说明,任务按需读取。同名时 Hob 的技能优先,其次是 Lore,最后是通用技能。"}),s.jsxs(ye,{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(Q,{name:"plus",size:16}),"从 Claude Code、Codex、pi 导入"]})]}),g?s.jsx("div",{className:"okline",children:g}):null]}),s.jsxs(ye,{children:[s.jsxs("div",{className:"lbl",children:["通用技能 ",s.jsx("span",{className:"lbl-aside",children:"~/.agents/skills"})]}),s.jsx("div",{className:"roster",children:k(r.skills.filter(E=>E.source==="common"),"目录中没有技能")})]}),s.jsxs(ye,{children:[s.jsxs("div",{className:"lbl",children:["Lore 技能",r.loreActive&&r.loreUrl?s.jsx("a",{className:"lbl-aside",href:r.loreUrl,target:"_blank",rel:"noreferrer",children:"在 Lore 控制台管理"}):null]}),r.loreActive?s.jsx("div",{className:"roster",children:k(r.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 IS({skill:l,onDeleted:i}){const[r,o]=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 y1(l.id),i(`已删除「${l.name}」`)}catch(f){o(ra(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:[ZS[l.source],l.overridden?" · 被优先级更高的同名技能覆盖":"",l.enabled?"":" · 已停用"]}),s.jsx("div",{className:"skill-doc fp-md",dangerouslySetInnerHTML:{__html:xi(l.content)}}),l.source==="hob"?s.jsx(oa,{saved:!1,error:r,children:s.jsx("button",{className:"pbtn danger",onClick:()=>void d(),children:"删除技能"})}):null]})}function FS({onDone:l}){const[i,r]=w.useState("claude"),[o,d]=w.useState(null),[f,g]=w.useState([]),[p,m]=w.useState(!1),[x,y]=w.useState(!1),[k,S]=w.useState(null);w.useEffect(()=>{let j=!0;return d(null),g([]),S(null),x1(i).then(v=>{j&&d(v)}).catch(v=>{j&&S(ra(v))}),()=>{j=!1}},[i]);const E=async()=>{y(!0),S(null);try{const j=await b1(i,f,p),v=[...j.skipped,...j.errors];v.length?S(v.join(";")):l(`已导入 ${j.imported.length} 个技能`)}catch(j){S(ra(j))}finally{y(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"技能"}),s.jsx(dt,{title:"导入技能",desc:"从其他工具的技能目录复制到 Hob,来源只读。"}),s.jsx(ye,{children:s.jsx(os,{items:KS,value:i,onChange:r,disabled:x})}),s.jsxs(ye,{children:[o===null?k?null:s.jsx("div",{className:"empty",children:"正在读取…"}):o.found?s.jsx("div",{className:"roster",children:o.skills.length?o.skills.map(j=>s.jsxs("label",{className:"rrow",children:[s.jsx("input",{type:"checkbox",className:"rcheck",checked:f.includes(j.id),disabled:x,onChange:v=>g(v.target.checked?[...f,j.id]:f.filter(N=>N!==j.id))}),s.jsxs("div",{className:"rmain",children:[s.jsxs("div",{className:"rname",children:[j.name,j.exists?s.jsx("span",{className:"rtag",children:"已存在"}):null]}),s.jsx("div",{className:"rprov rclamp",children:j.description})]})]},j.id)):s.jsx("div",{className:"rempty",children:"目录中没有技能"})}):s.jsx("div",{className:"empty",children:"未找到这个工具的技能目录。"}),o==null?void 0:o.skipped.map(j=>s.jsx("div",{className:"note",children:j},j))]}),o!=null&&o.skills.some(j=>j.exists)?s.jsxs("label",{className:"ctl skill-overwrite",children:[s.jsx("input",{type:"checkbox",className:"rcheck",checked:p,onChange:j=>m(j.target.checked)}),"覆盖已存在的同名技能"]}):null,s.jsxs(oa,{saved:!1,error:k,children:[s.jsx("button",{className:"pbtn",onClick:kn,disabled:x,children:"取消"}),s.jsx("button",{className:"pbtn solid",disabled:x||!f.length,onClick:()=>void E(),children:x?"正在导入…":f.length?`导入 ${f.length} 个`:"导入所选"})]})]})}const ta={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 WS(){const l=we(),i=l.sub,r=l.settings.settings.search,[o,d]=w.useState(null),[f,g]=w.useState(null),[p,m]=w.useState(!1),x=async()=>d(await j1());w.useEffect(()=>{x().catch(v=>g(ra(v)))},[]),w.useEffect(()=>{i&&g(null)},[i]);const y=v=>{var N;return((N=o==null?void 0:o.providers.find(A=>A.name===v))==null?void 0:N.keyConfigured)??!1},k=async(v,N)=>{m(!0);try{const A=await N1(v,N);return A?(g(A),A):(await x(),null)}catch(A){const O=ra(A);return g(O),O}finally{m(!1)}},S=r.filter(v=>v.enabled),E=(v,N)=>{const A=S.map(ee=>ee.name),O=A.indexOf(v),V=O+N;V<0||V>=A.length||([A[O],A[V]]=[A[V],A[O]],k([...A.map(ee=>r.find(ne=>ne.name===ee)),...r.filter(ee=>!ee.enabled)]))};if((i==null?void 0:i.kind)==="searchProvider"){const v=r.find(N=>N.name===i.name);return v?s.jsx(PS,{provider:v,configured:y(v.name),busy:p,save:(N,A)=>k(r.map(O=>O.name===N.name?N:O),A===void 0?void 0:{[N.name]:A})}):s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"联网搜索"}),s.jsx("div",{className:"note",children:"没有这个服务商。"})]})}const j=v=>y(v.name)?"已配置 Key":v.baseUrl?"已填服务地址":"未配置";return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"联网搜索",desc:"助手和任务通过这里的服务商搜索网页、读取正文。可以启用多个,按顺序使用,前一个失败时自动换下一个。"}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:"已启用"}),S.length?s.jsx("div",{className:"roster",children:S.map((v,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:v.name,title:ta[v.name].label}),children:[s.jsx("div",{className:"rname",children:ta[v.name].label}),s.jsx("div",{className:"rprov",children:ta[v.name].desc})]}),s.jsx("button",{className:"ib rmove",title:"上移",disabled:p||N===0,onClick:()=>E(v.name,-1),children:s.jsx(Q,{name:"down",size:15,className:"up"})}),s.jsx("button",{className:"ib rmove",title:"下移",disabled:p||N===S.length-1,onClick:()=>E(v.name,1),children:s.jsx(Q,{name:"down",size:15})})]},v.name))}):s.jsx("div",{className:"note",children:"尚未启用服务商,助手和任务暂时不能联网搜索。"}),f?s.jsx("div",{className:"badline",children:f}):null]}),s.jsxs(ye,{children:[s.jsx("div",{className:"lbl",children:S.length?"其他服务商":"选择服务商"}),s.jsx("div",{className:"roster",children:r.filter(v=>!v.enabled).map(v=>s.jsxs("button",{className:"rrow",onClick:()=>tl({kind:"searchProvider",name:v.name,title:ta[v.name].label}),children:[s.jsxs("div",{className:"rmain",children:[s.jsx("div",{className:"rname",children:ta[v.name].label}),s.jsx("div",{className:"rprov",children:ta[v.name].desc})]}),s.jsx("span",{className:"note",children:j(v)}),s.jsx(Q,{name:"chev",size:15,className:"rgo"})]},v.name))})]})]})}function PS({provider:l,configured:i,busy:r,save:o}){const d=ta[l.name],[f,g]=w.useState(l.baseUrl??""),[p,m]=w.useState(""),[x,y]=w.useState(null),[k,S]=w.useState(!1),[E,j]=w.useState(null),[v,N]=w.useState(!1);w.useEffect(()=>g(l.baseUrl??""),[l.baseUrl]);const A=f.trim()!==(l.baseUrl??"")||!!p.trim(),O=i||!!p.trim()||d.keyOptional&&!!f.trim(),V=async()=>{S(!0),y(null);try{const K=await k1(l.name,f.trim(),p.trim()||void 0);return y({ok:K.ok,text:K.ok?`搜索成功,返回 ${K.count} 条结果`:K.error??"搜索失败"}),K.ok}catch(K){return y({ok:!1,text:ra(K)}),!1}finally{S(!1)}},ee=async(K,q)=>{j(null),N(!1);const L=await o(K,q);return L?(j(L),!1):(N(!0),!0)},ne=async()=>{await V()&&await ee({...l,baseUrl:f.trim()||void 0},p.trim()||void 0)&&m("")};return s.jsxs(s.Fragment,{children:[s.jsx(Hn,{label:"联网搜索"}),s.jsx(dt,{title:d.label,desc:d.desc}),s.jsxs(ye,{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:r||!l.enabled&&!O,onClick:()=>void ee({...l,enabled:!l.enabled})})]}),!l.enabled&&!O?s.jsxs("div",{className:"note",children:[d.url?"填写服务地址":"填写 API Key","并保存后即可启用。"]}):null]}),s.jsx(ye,{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:K=>{g(K.target.value),y(null)},placeholder:"http://127.0.0.1:8888",disabled:r})})]}):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:K=>{m(K.target.value),y(null)},placeholder:i?"已保存,留空则沿用":"填写 API Key",disabled:r})}),s.jsx("div",{className:"note",children:"API Key 只保存在本机,保存后不再显示。"}),s.jsxs("div",{className:"testrow",children:[s.jsx("button",{className:"pbtn",onClick:()=>void V(),disabled:r||k,children:k?"正在搜索…":"测试搜索"}),x?s.jsx("span",{className:x.ok?"okline":"badline",children:x.text}):null]}),s.jsxs(oa,{saved:v&&!A,error:E,children:[i?s.jsx("button",{className:"pbtn",disabled:r,onClick:()=>void ee(l,""),children:"删除 Key"}):null,s.jsx("button",{className:"pbtn solid",disabled:r||k||!A,onClick:()=>void ne(),children:"保存"})]})]})})]})}function ew(){const[l,i]=w.useState(null);if(w.useEffect(()=>{o1().then(i)},[]),!l)return s.jsx("div",{className:"empty",children:"正在读取版本信息…"});const r=[["Hob 版本",l.version],["数据目录",l.home]];return s.jsxs(s.Fragment,{children:[s.jsx(dt,{title:"关于",desc:"Hob 的版本与数据目录。"}),s.jsx("div",{className:"kvcard",children:r.map(([o,d])=>s.jsxs("div",{className:"kvrow",children:[s.jsx("span",{className:"k",children:o}),s.jsx("span",{className:"v",children:d})]},o))})]})}const tw=l=>l.id;function nw(){const l=we(),i=l.assistants.filter(d=>d.pinned&&!d.hidden&&pi(d,l.query)),r=Fv(i,tw),o=Px(i.length);return s.jsxs("aside",{className:"side",children:[s.jsxs("div",{className:"side-top",children:[s.jsxs("div",{className:"search",children:[s.jsx(Q,{name:"search",size:15}),s.jsx("input",{value:l.query,placeholder:"搜索助手",onChange:d=>px(d.target.value)})]}),s.jsx("button",{className:"ib",title:"创建专属助手",onClick:hx,children:s.jsx(Q,{name:"plus",size:18})}),s.jsx("button",{className:"ib",title:"写新消息",onClick:sa,children:s.jsx(Q,{name:"edit",size:17})})]}),s.jsxs("div",{className:"side-scroll",children:[s.jsx("div",{className:`pins${o.cls}`,children:r.map(d=>s.jsx("div",{className:`srow${d.state==="still"?"":` ${d.state}`}`,children:s.jsx("div",{className:"srowclip",children:s.jsx(Wx,{a:d.item,sel:d.item.id===l.sel,size:o.size})})},d.key))}),s.jsx(eb,{size:42,markSel:!0})]}),s.jsx("div",{className:"side-foot",children:s.jsxs("button",{className:"frow",onClick:Qd,children:[s.jsx(Q,{name:"gear",size:18}),s.jsx("span",{className:"sp",children:"设置"})]})})]})}function lw(){"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").then(l=>{const i=r=>{r&&r.addEventListener("statechange",()=>{r.state==="installed"&&navigator.serviceWorker.controller&&ak()})};i(l.installing),l.addEventListener("updatefound",()=>i(l.installing))}).catch(()=>{})})}async function aw(){var o;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 r=await navigator.serviceWorker.getRegistration();(o=r==null?void 0:r.waiting)==null||o.postMessage("skip-waiting"),setTimeout(i,1200)}function sw(l){return l.replace(/^无法连接 Hob:/,"")}function iw(){const l=we(),[i,r]=w.useState(()=>window.innerWidth<768),o=Un(l.mobile==="chat"&&!!l.sel,240),d=Un(l.page==="settings",180),f=Un(l.sheet,180);if(w.useLayoutEffect(()=>{ex(l,i)},[l.phase,l.page,l.mobile,l.sheet,l.detail,l.filePreview,l.theme,i]),w.useEffect(()=>{_1()},[]),w.useEffect(()=>{const p=()=>r(window.innerWidth<768);return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),w.useEffect(()=>{const p=setInterval(()=>sk(),3e4);return()=>clearInterval(p)},[]),w.useEffect(()=>{const p=l.assistants.reduce((m,x)=>m+x.unread,0);document.title=p>0?`(${p}) Hob`:"Hob"},[l.assistants]),w.useEffect(()=>{if(!l.notice)return;const p=setTimeout(()=>lk(),6e3);return()=>clearTimeout(p)},[l.notice]),l.phase==="login")return s.jsx(FN,{});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:sw(l.error)}):null]})});if(l.phase==="loading")return s.jsx("div",{className:"boot",children:"正在连接 Hob…"});const g=l.notice?s.jsx("div",{className:"toast",children:l.notice}):l.updateReady?s.jsx("button",{className:"upd",onClick:()=>void aw(),children:"有新版本,点击更新"}):null;return d.mounted?s.jsxs(s.Fragment,{children:[s.jsx(yS,{narrow:i,leaving:d.leaving}),s.jsx(dd,{}),s.jsx(od,{}),g]}):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(gS,{})}),o.mounted?s.jsx("div",{className:`mpane chat${o.leaving?" out":""}`,children:s.jsx(kN,{})}):null,f.mounted?s.jsx(vS,{leaving:f.leaving}):null]}),s.jsx(xv,{}),s.jsx(dd,{}),s.jsx(od,{}),g]}):s.jsxs("div",{className:"app",children:[s.jsx(nw,{}),s.jsx(jN,{}),s.jsx("div",{className:`panelwrap${l.detail?" detail":l.collapsed?" off":""}`,children:l.detail?s.jsx(dd,{embedded:!0}):s.jsx(Ix,{})}),s.jsx(od,{}),s.jsx(xv,{}),l.offline?s.jsx("div",{className:"toast",children:l.offline}):null,g]})}pj.createRoot(document.getElementById("root")).render(s.jsx(iw,{}));document.addEventListener("gesturestart",l=>l.preventDefault());lw();