@goodfish/jarvy 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,850 @@
1
+ var k7=Object.defineProperty;var Rx=e=>{throw TypeError(e)};var S7=(e,n,i)=>n in e?k7(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var He=(e,n,i)=>S7(e,typeof n!="symbol"?n+"":n,i),Ox=(e,n,i)=>n.has(e)||Rx("Cannot "+i);var oa=(e,n,i)=>(Ox(e,n,"read from private field"),i?i.call(e):n.get(e)),zx=(e,n,i)=>n.has(e)?Rx("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),jp=(e,n,i,r)=>(Ox(e,n,"write to private field"),r?r.call(e,i):n.set(e,i),i);function C7(e,n){for(var i=0;i<n.length;i++){const r=n[i];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wp={exports:{}},Mc={};/**
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 Dx;function N7(){if(Dx)return Mc;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(r,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:r,key:d,ref:l!==void 0?l:null,props:c}}return Mc.Fragment=n,Mc.jsx=i,Mc.jsxs=i,Mc}var Lx;function E7(){return Lx||(Lx=1,wp.exports=N7()),wp.exports}var o=E7(),kp={exports:{}},it={};/**
10
+ * @license React
11
+ * react.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 Bx;function T7(){if(Bx)return it;Bx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),b=Symbol.iterator;function k(F){return F===null||typeof F!="object"?null:(F=b&&F[b]||F["@@iterator"],typeof F=="function"?F:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,C={};function M(F,ee,W){this.props=F,this.context=ee,this.refs=C,this.updater=W||S}M.prototype.isReactComponent={},M.prototype.setState=function(F,ee){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,ee,"setState")},M.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function E(){}E.prototype=M.prototype;function T(F,ee,W){this.props=F,this.context=ee,this.refs=C,this.updater=W||S}var _=T.prototype=new E;_.constructor=T,N(_,M.prototype),_.isPureReactComponent=!0;var R=Array.isArray;function O(){}var I={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function z(F,ee,W){var fe=W.ref;return{$$typeof:e,type:F,key:ee,ref:fe!==void 0?fe:null,props:W}}function q(F,ee){return z(F.type,ee,F.props)}function $(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function Q(F){var ee={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(W){return ee[W]})}var Y=/\/+/g;function H(F,ee){return typeof F=="object"&&F!==null&&F.key!=null?Q(""+F.key):ee.toString(36)}function K(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(O,O):(F.status="pending",F.then(function(ee){F.status==="pending"&&(F.status="fulfilled",F.value=ee)},function(ee){F.status==="pending"&&(F.status="rejected",F.reason=ee)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function V(F,ee,W,fe,le){var be=typeof F;(be==="undefined"||be==="boolean")&&(F=null);var we=!1;if(F===null)we=!0;else switch(be){case"bigint":case"string":case"number":we=!0;break;case"object":switch(F.$$typeof){case e:case n:we=!0;break;case y:return we=F._init,V(we(F._payload),ee,W,fe,le)}}if(we)return le=le(F),we=fe===""?"."+H(F,0):fe,R(le)?(W="",we!=null&&(W=we.replace(Y,"$&/")+"/"),V(le,ee,W,"",function(Ce){return Ce})):le!=null&&($(le)&&(le=q(le,W+(le.key==null||F&&F.key===le.key?"":(""+le.key).replace(Y,"$&/")+"/")+we)),ee.push(le)),1;we=0;var ve=fe===""?".":fe+":";if(R(F))for(var re=0;re<F.length;re++)fe=F[re],be=ve+H(fe,re),we+=V(fe,ee,W,be,le);else if(re=k(F),typeof re=="function")for(F=re.call(F),re=0;!(fe=F.next()).done;)fe=fe.value,be=ve+H(fe,re++),we+=V(fe,ee,W,be,le);else if(be==="object"){if(typeof F.then=="function")return V(K(F),ee,W,fe,le);throw ee=String(F),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return we}function X(F,ee,W){if(F==null)return F;var fe=[],le=0;return V(F,fe,"","",function(be){return ee.call(W,be,le++)}),fe}function Z(F){if(F._status===-1){var ee=F._result,W=ee();W.then(function(fe){(F._status===0||F._status===-1)&&(F._status=1,F._result=fe,W.status===void 0&&(W.status="fulfilled",W.value=fe))},function(fe){(F._status===0||F._status===-1)&&(F._status=2,F._result=fe,W.status===void 0&&(W.status="rejected",W.reason=fe))}),F._status===-1&&(F._status=0,F._result=W)}if(F._status===1)return F._result.default;throw F._result}var D=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)};function se(F){var ee=I.T,W={};W.types=ee!==null?ee.types:null,I.T=W;try{var fe=F(),le=I.S;le!==null&&le(W,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(O,D)}catch(be){D(be)}finally{ee!==null&&W.types!==null&&(ee.types=W.types),I.T=ee}}function ne(F){var ee=I.T;if(ee!==null){var W=ee.types;W===null?ee.types=[F]:W.indexOf(F)===-1&&W.push(F)}else se(ne.bind(null,F))}var B={map:X,forEach:function(F,ee,W){X(F,function(){ee.apply(this,arguments)},W)},count:function(F){var ee=0;return X(F,function(){ee++}),ee},toArray:function(F){return X(F,function(ee){return ee})||[]},only:function(F){if(!$(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return it.Activity=m,it.Children=B,it.Component=M,it.Fragment=i,it.Profiler=l,it.PureComponent=T,it.StrictMode=r,it.Suspense=h,it.ViewTransition=j,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,it.__COMPILER_RUNTIME={__proto__:null,c:function(F){return I.H.useMemoCache(F)}},it.addTransitionType=ne,it.cache=function(F){return function(){return F.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(F,ee,W){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var fe=N({},F.props),le=F.key;if(ee!=null)for(be in ee.key!==void 0&&(le=""+ee.key),ee)!P.call(ee,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&ee.ref===void 0||(fe[be]=ee[be]);var be=arguments.length-2;if(be===1)fe.children=W;else if(1<be){for(var we=Array(be),ve=0;ve<be;ve++)we[ve]=arguments[ve+2];fe.children=we}return z(F.type,le,fe)},it.createContext=function(F){return F={$$typeof:d,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:c,_context:F},F},it.createElement=function(F,ee,W){var fe,le={},be=null;if(ee!=null)for(fe in ee.key!==void 0&&(be=""+ee.key),ee)P.call(ee,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(le[fe]=ee[fe]);var we=arguments.length-2;if(we===1)le.children=W;else if(1<we){for(var ve=Array(we),re=0;re<we;re++)ve[re]=arguments[re+2];le.children=ve}if(F&&F.defaultProps)for(fe in we=F.defaultProps,we)le[fe]===void 0&&(le[fe]=we[fe]);return z(F,be,le)},it.createRef=function(){return{current:null}},it.forwardRef=function(F){return{$$typeof:f,render:F}},it.isValidElement=$,it.lazy=function(F){return{$$typeof:y,_payload:{_status:-1,_result:F},_init:Z}},it.memo=function(F,ee){return{$$typeof:g,type:F,compare:ee===void 0?null:ee}},it.startTransition=se,it.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},it.use=function(F){return I.H.use(F)},it.useActionState=function(F,ee,W){return I.H.useActionState(F,ee,W)},it.useCallback=function(F,ee){return I.H.useCallback(F,ee)},it.useContext=function(F){return I.H.useContext(F)},it.useDebugValue=function(){},it.useDeferredValue=function(F,ee){return I.H.useDeferredValue(F,ee)},it.useEffect=function(F,ee){return I.H.useEffect(F,ee)},it.useEffectEvent=function(F){return I.H.useEffectEvent(F)},it.useId=function(){return I.H.useId()},it.useImperativeHandle=function(F,ee,W){return I.H.useImperativeHandle(F,ee,W)},it.useInsertionEffect=function(F,ee){return I.H.useInsertionEffect(F,ee)},it.useLayoutEffect=function(F,ee){return I.H.useLayoutEffect(F,ee)},it.useMemo=function(F,ee){return I.H.useMemo(F,ee)},it.useOptimistic=function(F,ee){return I.H.useOptimistic(F,ee)},it.useReducer=function(F,ee,W){return I.H.useReducer(F,ee,W)},it.useRef=function(F){return I.H.useRef(F)},it.useState=function(F){return I.H.useState(F)},it.useSyncExternalStore=function(F,ee,W){return I.H.useSyncExternalStore(F,ee,W)},it.useTransition=function(){return I.H.useTransition()},it.version="19.3.0",it}var Ix;function yg(){return Ix||(Ix=1,kp.exports=T7()),kp.exports}var w=yg();const M7=vg(w),Jc=C7({__proto__:null,default:M7},[w]);var Sp={exports:{}},Ac={},Cp={exports:{}},Np={};/**
18
+ * @license React
19
+ * scheduler.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 qx;function A7(){return qx||(qx=1,(function(e){function n(K,V){var X=K.length;K.push(V);e:for(;0<X;){var Z=X-1>>>1,D=K[Z];if(0<l(D,V))K[Z]=V,K[X]=D,X=Z;else break e}}function i(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var V=K[0],X=K.pop();if(X!==V){K[0]=X;e:for(var Z=0,D=K.length,se=D>>>1;Z<se;){var ne=2*(Z+1)-1,B=K[ne],F=ne+1,ee=K[F];if(0>l(B,X))F<D&&0>l(ee,B)?(K[Z]=ee,K[F]=X,Z=F):(K[Z]=B,K[ne]=X,Z=ne);else if(F<D&&0>l(ee,X))K[Z]=ee,K[F]=X,Z=F;else break e}}return V}function l(K,V){var X=K.sortIndex-V.sortIndex;return X!==0?X:K.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],g=[],y=1,m=null,j=3,b=!1,k=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(K){for(var V=i(g);V!==null;){if(V.callback===null)r(g);else if(V.startTime<=K)r(g),V.sortIndex=V.expirationTime,n(h,V);else break;V=i(g)}}function _(K){if(S=!1,T(K),!k)if(i(h)!==null)k=!0,R||(R=!0,$());else{var V=i(g);V!==null&&H(_,V.startTime-K)}}var R=!1,O=-1,I=5,P=-1;function z(){return N?!0:!(e.unstable_now()-P<I)}function q(){if(N=!1,R){var K=e.unstable_now();P=K;var V=!0;try{e:{k=!1,S&&(S=!1,M(O),O=-1),b=!0;var X=j;try{t:{for(T(K),m=i(h);m!==null&&!(m.expirationTime>K&&z());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,j=m.priorityLevel;var D=Z(m.expirationTime<=K);if(K=e.unstable_now(),typeof D=="function"){m.callback=D,T(K),V=!0;break t}m===i(h)&&r(h),T(K)}else r(h);m=i(h)}if(m!==null)V=!0;else{var se=i(g);se!==null&&H(_,se.startTime-K),V=!1}}break e}finally{m=null,j=X,b=!1}V=void 0}}finally{V?$():R=!1}}}var $;if(typeof E=="function")$=function(){E(q)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=q,$=function(){Y.postMessage(null)}}else $=function(){C(q,0)};function H(K,V){O=C(function(){K(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(K){switch(j){case 1:case 2:case 3:var V=3;break;default:V=j}var X=j;j=V;try{return K()}finally{j=X}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(K,V){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var X=j;j=K;try{return V()}finally{j=X}},e.unstable_scheduleCallback=function(K,V,X){var Z=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Z+X:Z):X=Z,K){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=X+D,K={id:y++,callback:V,priorityLevel:K,startTime:X,expirationTime:D,sortIndex:-1},X>Z?(K.sortIndex=X,n(g,K),i(h)===null&&K===i(g)&&(S?(M(O),O=-1):S=!0,H(_,X-Z))):(K.sortIndex=D,n(h,K),k||b||(k=!0,R||(R=!0,$()))),K},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(K){var V=j;return function(){var X=j;j=V;try{return K.apply(this,arguments)}finally{j=X}}}})(Np)),Np}var Px;function _7(){return Px||(Px=1,Cp.exports=A7()),Cp.exports}var Ep={exports:{}},Jn={};/**
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 Hx;function R7(){if(Hx)return Jn;Hx=1;var e=yg();function n(y){var m="https://react.dev/errors/"+y;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)m+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+y+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function f(y,m,j){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:b==null?null:b===d?d:""+b,children:y,containerInfo:m,implementation:j}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jn.browser=function(y){return{$$typeof:c,_reason:y}},Jn.createPortal=function(y,m){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return f(y,m,null,j)},Jn.flushSync=function(y){var m=h.T,j=r.p;try{if(h.T=null,r.p=2,y)return y()}finally{h.T=m,r.p=j,r.d.f()}},Jn.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(y,m))},Jn.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},Jn.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var j=m.as,b=g(j,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;j==="style"?r.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:k,fetchPriority:S}):j==="script"&&r.d.X(y,{crossOrigin:b,integrity:k,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Jn.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var j=g(m.as,m.crossOrigin);r.d.M(y,{crossOrigin:j,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}}else m==null&&r.d.M(y)},Jn.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var j=m.as,b=g(j,m.crossOrigin);r.d.L(y,j,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Jn.preloadModule=function(y,m){if(typeof y=="string")if(m){var j=g(m.as,m.crossOrigin);r.d.m(y,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:j,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0})}else r.d.m(y)},Jn.requestFormReset=function(y){r.d.r(y)},Jn.unstable_batchedUpdates=function(y,m){return y(m)},Jn.useFormState=function(y,m,j){return h.H.useFormState(y,m,j)},Jn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Jn.version="19.3.0",Jn}var Fx;function j4(){if(Fx)return Ep.exports;Fx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ep.exports=R7(),Ep.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 Ux;function O7(){if(Ux)return Ac;Ux=1;var e=_7(),n=yg(),i=j4();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){for(var a=t,s=a;s&&!s.alternate;)a=s,(a.flags&4098)!==0&&(t=a.return),s=a.return;for(;a.return;)a=a.return;return a.tag===3?t:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(r(188))}function g(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,u=a;;){var p=s.return;if(p===null)break;var x=p.alternate;if(x===null){if(u=p.return,u!==null){s=u;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===s)return h(p),t;if(x===u)return h(p),a;x=x.sibling}throw Error(r(188))}if(s.return!==u.return)s=p,u=x;else{for(var A=!1,L=p.child;L;){if(L===s){A=!0,s=p,u=x;break}if(L===u){A=!0,u=p,s=x;break}L=L.sibling}if(!A){for(L=x.child;L;){if(L===s){A=!0,s=x,u=p;break}if(L===u){A=!0,u=x,s=p;break}L=L.sibling}if(!A)throw Error(r(189))}}if(s.alternate!==u)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function y(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=y(t),a!==null)return a;t=t.sibling}return null}function m(t,a,s,u,p,x){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&s(t,u,p,x)||(t.tag!==22||t.memoizedState===null)&&(a||t.tag!==5&&t.tag!==27)&&m(t.child,a,s,u,p,x))return!0;t=t.sibling}return!1}function j(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function b(t){var a=!1;for(t=t.return;t!==null&&(t.tag===4&&(a=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return a}function k(t){var a=[null,null],s=j(t);return s===null||S(a,t,s.child,{foundSelf:!1}),a}function S(t,a,s,u){for(;s!==null;){if(s===a)u.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(u.foundSelf)return t[1]=s,!0;t[0]=s}else if((s.tag!==22||s.memoizedState===null)&&S(t,a,s.child,u))return!0;s=s.sibling}return!1}function N(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(r(559))}}var C=null,M=null;function E(t,a,s){return t===s?!0:t===a?(C=t,!0):!1}function T(t,a,s){return t===s?(M=t,!1):t===a?(M!==null&&(C=t),!0):!1}function _(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,a,s){for(var u=0,p=t;p;p=s(p))u++;p=0;for(var x=a;x;x=s(x))p++;for(;0<u-p;)t=s(t),u--;for(;0<p-u;)a=s(a),p--;for(;u--;){if(t===a||a!==null&&t===a.alternate)return t;t=s(t),a=s(a)}return null}var O=Object.assign,I=Symbol.for("react.element"),P=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),H=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),ne=Symbol.for("react.legacy_hidden"),B=Symbol.for("react.memo_cache_sentinel"),F=Symbol.for("react.view_transition"),ee=Symbol.for("react.recoverable"),W=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=W&&t[W]||t["@@iterator"],typeof t=="function"?t:null)}var le=Symbol.for("react.client.reference");function be(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case q:return"Fragment";case Q:return"Profiler";case $:return"StrictMode";case V:return"Suspense";case X:return"SuspenseList";case se:return"Activity";case F:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case H:return t.displayName||"Context";case Y:return(t._context.displayName||"Context")+".Consumer";case K:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Z:return a=t.displayName||null,a!==null?a:be(t.type)||"Memo";case D:a=t._payload,t=t._init;try{return be(t(a))}catch{}}return null}var we=Array.isArray,ve=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ce={pending:!1,data:null,method:null,action:null},Ve=[],Pe=-1;function Ze(t){return{current:t}}function Fe(t){0>Pe||(t.current=Ve[Pe],Ve[Pe]=null,Pe--)}function Ke(t,a){Pe++,Ve[Pe]=t.current,t.current=a}var gt=Ze(null),Ht=Ze(null),Jt=Ze(null),tn=Ze(null);function kn(t,a){switch(Ke(Jt,a),Ke(Ht,t),Ke(gt,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Hy(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Hy(a),t=Fy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Fe(gt),Ke(gt,t)}function vn(){Fe(gt),Fe(Ht),Fe(Jt)}function on(t){var a=t.memoizedState;a!==null&&(ml._currentValue=a.memoizedState,Ke(tn,t)),a=gt.current;var s=Fy(a,t.type);a!==s&&(Ke(Ht,t),Ke(gt,s))}function ge(t){Ht.current===t&&(Fe(gt),Fe(Ht)),tn.current===t&&(Fe(tn),ml._currentValue=Ce)}var Me,Xe;function Je(t){if(Me===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Me=a&&a[1]||"",Xe=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Me+t+Xe}var rt=!1;function Wt(t,a){if(!t||rt)return"";rt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(Oe){var te=Oe}Reflect.construct(t,[],xe)}else{try{xe.call()}catch(Oe){te=Oe}xe=!1;try{var ce=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),xe=!0,new t}finally{xe&&(ce!==void 0?Object.defineProperty(t.prototype,"props",ce):delete t.prototype.props)}}}else{try{throw Error()}catch(Oe){te=Oe}(xe=t())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(Oe){if(Oe&&te&&typeof Oe.stack=="string")return[Oe.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),A=x[0],L=x[1];if(A&&L){var G=A.split(`
44
+ `),ie=L.split(`
45
+ `);for(p=u=0;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;for(;p<ie.length&&!ie[p].includes("DetermineComponentFrameRoot");)p++;if(u===G.length||p===ie.length)for(u=G.length-1,p=ie.length-1;1<=u&&0<=p&&G[u]!==ie[p];)p--;for(;1<=u&&0<=p;u--,p--)if(G[u]!==ie[p]){if(u!==1||p!==1)do if(u--,p--,0>p||G[u]!==ie[p]){var he=`
46
+ `+G[u].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),he}while(1<=u&&0<=p);break}}}finally{rt=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Je(s):""}function _n(t,a){switch(t.tag){case 26:case 27:case 5:return Je(t.type);case 16:return Je("Lazy");case 13:return t.child!==a&&a!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Wt(t.type,!1);case 11:return Wt(t.type.render,!1);case 1:return Wt(t.type,!0);case 31:return Je("Activity");case 30:return Je("ViewTransition");default:return""}}function dn(t){try{var a="",s=null;do a+=_n(t,s),s=t,t=t.return;while(t);return a}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}var Ln=Object.prototype.hasOwnProperty,me=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,_e=e.unstable_shouldYield,Be=e.unstable_requestPaint,ze=e.unstable_now,dt=e.unstable_getCurrentPriorityLevel,ta=e.unstable_ImmediatePriority,Rn=e.unstable_UserBlockingPriority,yn=e.unstable_NormalPriority,lr=e.unstable_LowPriority,Ri=e.unstable_IdlePriority,Xr=e.log,cr=e.unstable_setDisableYieldValue,Yt=null,xn=null;function Kt(t){if(typeof Xr=="function"&&cr(t),xn&&typeof xn.setStrictMode=="function")try{xn.setStrictMode(Yt,t)}catch{}}var sn=Math.clz32?Math.clz32:mi,qa=Math.log,Ca=Math.LN2;function mi(t){return t>>>=0,t===0?32:31-(qa(t)/Ca|0)|0}var Na=256,Pa=262144,da=4194304;function Wa(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ft(t,a,s){var u=t.pendingLanes;if(u===0)return 0;var p=0,x=t.suspendedLanes,A=t.pingedLanes;t=t.warmLanes;var L=u&134217727;return L!==0?(u=L&~x,u!==0?p=Wa(u):(A&=L,A!==0?p=Wa(A):s||(s=L&~t,s!==0&&(p=Wa(s))))):(L=u&~x,L!==0?p=Wa(L):A!==0?p=Wa(A):s||(s=u&~t,s!==0&&(p=Wa(s)))),p===0?0:a!==0&&a!==p&&(a&x)===0&&(x=p&-p,s=a&-a,x>=s||x===32&&(s&4194048)!==0)?a:p}function na(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Oi(t,a){(a&8)!==0&&(a|=a&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=a;0<s;){var u=31-sn(s),p=1<<u;a|=t[u],s&=~p}return a}function ur(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 fa(){var t=da;return da<<=1,(da&62914560)===0&&(da=4194304),t}function ha(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function pi(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function $n(t,a,s,u,p,x){var A=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var L=t.entanglements,G=t.expirationTimes,ie=t.hiddenUpdates;for(s=A&~s;0<s;){var he=31-sn(s),xe=1<<he;L[he]=0,G[he]=-1;var te=ie[he];if(te!==null)for(ie[he]=null,he=0;he<te.length;he++){var ce=te[he];ce!==null&&(ce.lane&=-536870913)}s&=~xe}u!==0&&ma(t,u,0),x!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=x&~(A&~a))}function ma(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var u=31-sn(a);t.entangledLanes|=a,t.entanglements[u]=t.entanglements[u]|1073741824|s&261930}function dr(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var u=31-sn(s),p=1<<u;p&a|t[u]&a&&(t[u]|=a),s&=~p}}function fr(t,a){var s=a&-a;return s=(s&42)!==0?1:gi(s),(s&(t.suspendedLanes|a))!==0?0:s}function gi(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function pa(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ea(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:Cx(t.type))}function hr(t,a){var s=re.p;try{return re.p=t,a()}finally{re.p=s}}var nn=Math.random().toString(36).slice(2),en="__reactFiber$"+nn,On="__reactProps$"+nn,aa="__reactContainer$"+nn,Ho="__reactEvents$"+nn,Qr="__reactListeners$"+nn,Zr="__reactHandles$"+nn,zi="__reactResources$"+nn,mr="__reactMarker$"+nn,Jr="__reactLoad$"+nn;function Wr(t){delete t[en],delete t[On],delete t[Qr],delete t[Zr]}function Ha(t){var a;if(a=t[en])return a;for(var s=t.parentNode;s;){if(a=s[aa]||s[en]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=rx(t);t!==null;){if(s=t[en])return s;t=rx(t)}return a}t=s,s=t.parentNode}return null}function ei(t){if(t=t[en]||t[aa]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function de(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function ke(t){var a=t[zi];return a||(a=t[zi]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function je(t){t[mr]=!0}function De(t){t[Jr]=void 0}var at=new Set,et={};function st(t,a){yt(t,a),yt(t+"Capture",a)}function yt(t,a){for(et[t]=a,t=0;t<a.length;t++)at.add(a[t])}var _t=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]*$"),Ye={},nt={};function xt(t){return Ln.call(nt,t)?!0:Ln.call(Ye,t)?!1:_t.test(t)?nt[t]=!0:(Ye[t]=!0,!1)}var Ge=!1;function bn(){var t=Ge;return Ge=!1,t}function zt(t,a,s){if(xt(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,s)}}function ga(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,s)}}function fn(t,a,s,u){if(u===null)t.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,u)}}function ln(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pr(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function eo(t,a,s){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,x=u.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return p.call(this)},set:function(A){s=""+A,x.call(this,A)}}),Object.defineProperty(t,a,{enumerable:u.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function ti(t){if(!t._valueTracker){var a=pr(t)?"checked":"value";t._valueTracker=eo(t,a,""+t[a])}}function gr(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),u="";return t&&(u=pr(t)?t.checked?"true":"false":t.value),t=u,t!==s?(a.setValue(t),!0):!1}var Fo=/[\n"\\]/g;function U(t){return t.replace(Fo,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function pe(t,a,s,u,p,x,A,L){t.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.type=A:t.removeAttribute("type"),a!=null?A==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+ln(a)):t.value!==""+ln(a)&&(t.value=""+ln(a)):A!=="submit"&&A!=="reset"||t.removeAttribute("value"),a!=null?A==="number"&&t.value==a?lt(t,ln(t.value)):lt(t,ln(a)):s!=null?lt(t,ln(s)):u!=null&&t.removeAttribute("value"),p==null&&x!=null&&(t.defaultChecked=!!x),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.name=""+ln(L):t.removeAttribute("name")}function Ae(t,a,s,u,p,x,A,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),a!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){ti(t);return}s=s!=null?""+ln(s):"",a=a!=null?""+ln(a):s,L||a===t.value||(t.value=a),t.defaultValue=a}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=L?t.checked:!!u,t.defaultChecked=!!u,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(t.name=A),ti(t)}function lt(t,a){t.defaultValue!==""+a&&(t.defaultValue=""+a)}function ht(t,a,s,u){if(t=t.options,a){a={};for(var p=0;p<s.length;p++)a["$"+s[p]]=!0;for(s=0;s<t.length;s++)p=a.hasOwnProperty("$"+t[s].value),t[s].selected!==p&&(t[s].selected=p),p&&u&&(t[s].defaultSelected=!0)}else{for(s=""+ln(s),a=null,p=0;p<t.length;p++){if(t[p].value===s){t[p].selected=!0,u&&(t[p].defaultSelected=!0);return}a!==null||t[p].disabled||(a=t[p])}a!==null&&(a.selected=!0)}}function hn(t,a,s){if(a!=null&&(a=""+ln(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+ln(s):""}function Ue(t,a,s,u){if(a==null){if(u!=null){if(s!=null)throw Error(r(92));if(we(u)){if(1<u.length)throw Error(r(93));u=u[0]}s=u}s==null&&(s=""),a=s}s=ln(a),t.defaultValue=s,u=t.textContent,u===s&&u!==""&&u!==null&&(t.value=u),ti(t)}function mt(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var Ft=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 Xt(t,a,s){var u=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?u?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":u?t.setProperty(a,s):typeof s!="number"||s===0||Ft.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function mn(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var u in s)!s.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="",Ge=!0);for(var p in a)u=a[p],a.hasOwnProperty(p)&&s[p]!==u&&(Xt(t,p,u),Ge=!0)}else for(var x in a)a.hasOwnProperty(x)&&Xt(t,x,a[x])}function Bn(t){if(t.indexOf("-")===-1)return!1;switch(t){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 ia=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"]]),Hl=/^[\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 Vn(t){return Hl.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function va(){}var Uo=null;function $o(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Et=null,In=null;function ni(t){var a=ei(t);if(a&&(t=a.stateNode)){var s=t[On]||null;e:switch(t=a.stateNode,a.type){case"input":if(pe(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+U(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var u=s[a];if(u!==t&&u.form===t.form){var p=u[On]||null;if(!p)throw Error(r(90));pe(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<s.length;a++)u=s[a],u.form===t.form&&gr(u)}break e;case"textarea":hn(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&ht(t,!!s.multiple,a,!1)}}}var Fa=!1;function Vo(t,a,s){if(Fa)return t(a,s);Fa=!0;try{var u=t(a);return u}finally{if(Fa=!1,(Et!==null||In!==null)&&(ud(),Et&&(a=Et,t=In,In=Et=null,ni(a),t)))for(a=0;a<t.length;a++)ni(t[a])}}function vr(t,a){var s=t.stateNode;if(s===null)return null;var u=s[On]||null;if(u===null)return null;s=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var Gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Go=!1;if(Gn)try{var Fl={};Object.defineProperty(Fl,"passive",{get:function(){Go=!0}}),window.addEventListener("test",Fl,Fl),window.removeEventListener("test",Fl,Fl)}catch{Go=!1}var to=null,rh=null,du=null;function B1(){if(du)return du;var t,a=rh,s=a.length,u,p="value"in to?to.value:to.textContent,x=p.length;for(t=0;t<s&&a[t]===p[t];t++);var A=s-t;for(u=1;u<=A&&a[s-u]===p[x-u];u++);return du=p.slice(t,1<u?1-u:void 0)}function fu(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function hu(){return!0}function I1(){return!1}function ya(t){function a(s,u,p,x,A){this._reactName=s,this._targetInst=p,this.type=u,this.nativeEvent=x,this.target=A,this.currentTarget=null;for(var L in t)t.hasOwnProperty(L)&&(s=t[L],this[L]=s?s(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?hu:I1,this.isPropagationStopped=I1,this}return O(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=hu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=hu)},persist:function(){},isPersistent:hu}),a}var no={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mu=ya(no),Ul=O({},no,{view:0,detail:0}),K6=ya(Ul),oh,sh,$l,pu=O({},Ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ch,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==$l&&($l&&t.type==="mousemove"?(oh=t.screenX-$l.screenX,sh=t.screenY-$l.screenY):sh=oh=0,$l=t),oh)},movementY:function(t){return"movementY"in t?t.movementY:sh}}),q1=ya(pu),X6=O({},pu,{dataTransfer:0}),Q6=ya(X6),Z6=O({},Ul,{relatedTarget:0}),lh=ya(Z6),J6=O({},no,{animationName:0,elapsedTime:0,pseudoElement:0}),W6=ya(J6),e8=O({},no,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),t8=ya(e8),n8=O({},no,{data:0}),P1=ya(n8),a8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i8={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"},r8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o8(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=r8[t])?!!a[t]:!1}function ch(){return o8}var s8=O({},Ul,{key:function(t){if(t.key){var a=a8[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=fu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?i8[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ch,charCode:function(t){return t.type==="keypress"?fu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?fu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),l8=ya(s8),c8=O({},pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),H1=ya(c8),u8=O({},no,{submitter:0}),d8=ya(u8),f8=O({},Ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ch}),h8=ya(f8),m8=O({},no,{propertyName:0,elapsedTime:0,pseudoElement:0}),p8=ya(m8),g8=O({},pu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),v8=ya(g8),y8=O({},no,{newState:0,oldState:0,source:0}),x8=ya(y8),b8=[9,13,27,32],uh=Gn&&"CompositionEvent"in window,Vl=null;Gn&&"documentMode"in document&&(Vl=document.documentMode);var j8=Gn&&"TextEvent"in window&&!Vl,F1=Gn&&(!uh||Vl&&8<Vl&&11>=Vl),U1=" ",$1=!1;function V1(t,a){switch(t){case"keyup":return b8.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function G1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ls=!1;function w8(t,a){switch(t){case"compositionend":return G1(a);case"keypress":return a.which!==32?null:($1=!0,U1);case"textInput":return t=a.data,t===U1&&$1?null:t;default:return null}}function k8(t,a){if(Ls)return t==="compositionend"||!uh&&V1(t,a)?(t=B1(),du=rh=to=null,Ls=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return F1&&a.locale!=="ko"?null:a.data;default:return null}}var S8={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 Y1(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!S8[t.type]:a==="textarea"}function K1(t,a,s,u){Et?In?In.push(u):In=[u]:Et=u,a=gd(a,"onChange"),0<a.length&&(s=new mu("onChange","change",null,s,u),t.push({event:s,listeners:a}))}var Gl=null,Yl=null;function C8(t){Dy(t,0)}function gu(t){var a=de(t);if(gr(a))return t}function X1(t,a){if(t==="change")return a}var Q1=!1;if(Gn){var dh;if(Gn){var fh="oninput"in document;if(!fh){var Z1=document.createElement("div");Z1.setAttribute("oninput","return;"),fh=typeof Z1.oninput=="function"}dh=fh}else dh=!1;Q1=dh&&(!document.documentMode||9<document.documentMode)}function J1(){Gl&&(Gl.detachEvent("onpropertychange",W1),Yl=Gl=null)}function W1(t){if(t.propertyName==="value"&&gu(Yl)){var a=[];K1(a,Yl,t,$o(t)),Vo(C8,a)}}function N8(t,a,s){t==="focusin"?(J1(),Gl=a,Yl=s,Gl.attachEvent("onpropertychange",W1)):t==="focusout"&&J1()}function E8(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return gu(Yl)}function T8(t,a){if(t==="click")return gu(a)}function M8(t,a){if(t==="input"||t==="change")return gu(a)}function A8(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var Ua=typeof Object.is=="function"?Object.is:A8;function Kl(t,a){if(Ua(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),u=Object.keys(a);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var p=s[u];if(!Ln.call(a,p)||!Ua(t[p],a[p]))return!1}return!0}function hh(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ev(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function tv(t,a){var s=ev(t);t=0;for(var u;s;){if(s.nodeType===3){if(u=t+s.textContent.length,t<=a&&u>=a)return{node:s,offset:a-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=ev(s)}}function nv(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?nv(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function av(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=hh(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=hh(t.document)}return a}function mh(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var _8=Gn&&"documentMode"in document&&11>=document.documentMode,Bs=null,ph=null,Xl=null,gh=!1;function iv(t,a,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;gh||Bs==null||Bs!==hh(u)||(u=Bs,"selectionStart"in u&&mh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Xl&&Kl(Xl,u)||(Xl=u,u=gd(ph,"onSelect"),0<u.length&&(a=new mu("onSelect","select",null,a,s),t.push({event:a,listeners:u}),a.target=Bs)))}function Yo(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var Is={animationend:Yo("Animation","AnimationEnd"),animationiteration:Yo("Animation","AnimationIteration"),animationstart:Yo("Animation","AnimationStart"),transitionrun:Yo("Transition","TransitionRun"),transitionstart:Yo("Transition","TransitionStart"),transitioncancel:Yo("Transition","TransitionCancel"),transitionend:Yo("Transition","TransitionEnd")},vh={},rv={};Gn&&(rv=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function Ko(t){if(vh[t])return vh[t];if(!Is[t])return t;var a=Is[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in rv)return vh[t]=a[s];return t}var ov=Ko("animationend"),sv=Ko("animationiteration"),lv=Ko("animationstart"),R8=Ko("transitionrun"),O8=Ko("transitionstart"),z8=Ko("transitioncancel"),cv=Ko("transitionend"),uv=new Map,yh="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(" ");yh.push("scrollEnd");function vi(t,a){uv.set(t,a),st(a,[t])}var D8=0;function yr(t,a){if(t.name!=null&&t.name!=="auto")return t.name;if(a.autoName!==null)return a.autoName;t=ji.identifierPrefix;var s=D8++;return t="_"+t+"t_"+s.toString(32)+"_",a.autoName=t}function dv(t){if(t==null||typeof t=="string")return t;var a=null,s=il;if(s!==null)for(var u=0;u<s.length;u++){var p=t[s[u]];if(p!=null){if(p==="none")return"none";a=a==null?p:a+(" "+p)}}return a??t.default}function xr(t,a){return t=dv(t),a=dv(a),a==null?t==="auto"?null:t:a==="auto"?null:a}var vu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ai=[],qs=0,xh=0;function yu(){for(var t=qs,a=xh=qs=0;a<t;){var s=ai[a];ai[a++]=null;var u=ai[a];ai[a++]=null;var p=ai[a];ai[a++]=null;var x=ai[a];if(ai[a++]=null,u!==null&&p!==null){var A=u.pending;A===null?p.next=p:(p.next=A.next,A.next=p),u.pending=p}x!==0&&fv(s,p,x)}}function xu(t,a,s,u){ai[qs++]=t,ai[qs++]=a,ai[qs++]=s,ai[qs++]=u,xh|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function bh(t,a,s,u){return xu(t,a,s,u),bu(t)}function Xo(t,a){return xu(t,null,null,a),bu(t)}function fv(t,a,s){t.lanes|=s;var u=t.alternate;u!==null&&(u.lanes|=s);for(var p=!1,x=t.return;x!==null;)x.childLanes|=s,u=x.alternate,u!==null&&(u.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(p=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,p&&a!==null&&(p=31-sn(s),t=x.hiddenUpdates,u=t[p],u===null?t[p]=[a]:u.push(a),a.lane=s|536870912),x):null}function bu(t){if(50<vc)throw vc=0,cd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var Ps={};function L8(t,a,s,u){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ta(t,a,s,u){return new L8(t,a,s,u)}function jh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function br(t,a){var s=t.alternate;return s===null?(s=Ta(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&1206910976,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function hv(t,a){t.flags&=1206910978;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function ju(t,a,s,u,p,x){var A=0;if(u=t,typeof u=="function")jh(u)&&(A=1);else if(typeof u=="string")A=u7(t,s,gt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(u){case se:return t=Ta(31,s,a,p),t.elementType=se,t.lanes=x,t;case q:return Qo(s.children,p,x,a);case $:A=8,p|=24;break;case Q:return t=Ta(12,s,a,p|2),t.elementType=Q,t.lanes=x,t;case V:return t=Ta(13,s,a,p),t.elementType=V,t.lanes=x,t;case X:return t=Ta(19,s,a,p),t.elementType=X,t.lanes=x,t;case ne:case F:return t=p|32,t=Ta(30,s,a,t),t.elementType=F,t.lanes=x,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case H:A=10;break e;case Y:A=9;break e;case K:A=11;break e;case Z:A=14;break e;case D:A=16,u=null;break e}A=29,s=Error(r(130,t===null?"null":typeof t,"")),u=null}return a=Ta(A,s,a,p),a.elementType=t,a.type=u,a.lanes=x,a}function Qo(t,a,s,u){return t=Ta(7,t,u,a),t.lanes=s,t}function wh(t,a,s){return t=Ta(6,t,null,a),t.lanes=s,t}function mv(t){var a=Ta(18,null,null,0);return a.stateNode=t,a}function kh(t,a,s){return a=Ta(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var pv=new WeakMap;function ii(t,a){if(typeof t=="object"&&t!==null){var s=pv.get(t);return s!==void 0?s:(a={value:t,source:a,stack:dn(a)},pv.set(t,a),a)}return{value:t,source:a,stack:dn(a)}}var Hs=[],Fs=0,wu=null,Ql=0,ri=[],oi=0,ao=null,Di=1,Li="";function jr(t,a){Hs[Fs++]=Ql,Hs[Fs++]=wu,wu=t,Ql=a}function gv(t,a,s){ri[oi++]=Di,ri[oi++]=Li,ri[oi++]=ao,ao=t;var u=Di;t=Li;var p=32-sn(u)-1;u&=~(1<<p),s+=1;var x=32-sn(a)+p;if(30<x){var A=p-p%5;x=(u&(1<<A)-1).toString(32),u>>=A,p-=A,Di=1<<32-sn(a)+p|s<<p|u,Li=x+t}else Di=1<<x|s<<p|u,Li=t}function ku(t){t.return!==null&&(jr(t,1),gv(t,1,0))}function Sh(t){for(;t===wu;)wu=Hs[--Fs],Hs[Fs]=null,Ql=Hs[--Fs],Hs[Fs]=null;for(;t===ao;)ao=ri[--oi],ri[oi]=null,Li=ri[--oi],ri[oi]=null,Di=ri[--oi],ri[oi]=null}function vv(t,a){ri[oi++]=Di,ri[oi++]=Li,ri[oi++]=ao,Di=a.id,Li=a.overflow,ao=t}var qn=null,Qt=null,pt=!1,io=null,si=!1,Ch=Error(r(519));function ro(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zl(ii(a,t)),Ch}function yv(t){var a=t.stateNode,s=t.type,u=t.memoizedProps;switch(a[en]=t,a[On]=u,s){case"dialog":jt("cancel",a),jt("close",a);break;case"iframe":case"object":case"embed":jt("load",a);break;case"video":case"audio":for(s=0;s<xc.length;s++)jt(xc[s],a);break;case"source":jt("error",a);break;case"img":case"image":case"link":jt("error",a),jt("load",a);break;case"details":jt("toggle",a);break;case"input":jt("invalid",a),Ae(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":jt("invalid",a);break;case"textarea":jt("invalid",a),Ue(a,u.value,u.defaultValue,u.children)}s=u.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||u.suppressHydrationWarning===!0||qy(a.textContent,s)?(u.popover!=null&&(jt("beforetoggle",a),jt("toggle",a)),u.onScroll!=null&&jt("scroll",a),u.onScrollEnd!=null&&jt("scrollend",a),u.onClick!=null&&(a.onclick=va),a=!0):a=!1,a||ro(t,!0)}function Su(t){for(qn=t.return;qn;)switch(qn.tag){case 5:case 31:case 13:si=!1;return;case 27:case 3:si=!0;return;default:qn=qn.return}}function Us(t){if(t!==qn)return!1;if(!pt)return Su(t),pt=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||tp(t.type,t.memoizedProps)),s=!s),s&&Qt&&ro(t),Su(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Qt=ix(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Qt=ix(t)}else a===27?(a=Qt,wo(t.type)?(t=up,up=null,Qt=t):Qt=a):Qt=qn?ci(t.stateNode.nextSibling):null;return!0}function Zo(){Qt=qn=null,pt=!1}function Nh(){var t=io;return t!==null&&(_a===null?_a=t:_a.push.apply(_a,t),io=null),t}function Zl(t){io===null?io=[t]:io.push(t)}var Eh=Ze(null),Jo=null,wr=null;function oo(t,a,s){Ke(Eh,a._currentValue),a._currentValue=s}function kr(t){t._currentValue=Eh.current,Fe(Eh)}function Cu(t,a,s){for(;t!==null;){var u=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),t===s)break;t=t.return}}function Th(t,a,s,u){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var x=p.dependencies;if(x!==null){var A=p.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=p;for(var G=0;G<a.length;G++)if(L.context===a[G]){x.lanes|=s,L=x.alternate,L!==null&&(L.lanes|=s),Cu(x.return,s,t),u||(A=null);break e}x=L.next}}else if(p.tag===18){if(A=p.return,A===null)throw Error(r(341));A.lanes|=s,x=A.alternate,x!==null&&(x.lanes|=s),Cu(A,s,t),A=null}else p.tag===13&&p.memoizedState!==null&&p.memoizedState.dehydrated===null?(p.lanes|=s,A=p.alternate,A!==null&&(A.lanes|=s),Cu(p.return,s,t),A=p.child,A=A!==null?A.sibling:null):A=p.child;if(A!==null)A.return=p;else for(A=p;A!==null;){if(A===t){A=null;break}if(p=A.sibling,p!==null){p.return=A.return,A=p;break}A=A.return}p=A}}function Wo(t,a,s,u){t=null;for(var p=a,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var A=p.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var L=p.type;Ua(p.pendingProps.value,A.value)||(t!==null?t.push(L):t=[L])}}else if(p===tn.current){if(A=p.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(ml):t=[ml])}p=p.return}return t!==null&&Th(a,t,s,u),a.flags|=262144,t!==null}function Nu(t){for(t=t.firstContext;t!==null;){if(!Ua(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function es(t){Jo=t,wr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Yn(t){return xv(Jo,t)}function Eu(t,a){return Jo===null&&es(t),xv(t,a)}function xv(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},wr===null){if(t===null)throw Error(r(308));wr=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else wr=wr.next=a;return s}var B8=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,u){t.push(u)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},I8=e.unstable_scheduleCallback,q8=e.unstable_NormalPriority,Sn={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mh(){return{controller:new B8,data:new Map,refCount:0}}function Jl(t){t.refCount--,t.refCount===0&&I8(q8,function(){t.controller.abort()})}function bv(t,a){if((t.pendingLanes&4194048)!==0){var s=t.transitionTypes;for(s===null&&(s=t.transitionTypes=[]),t=0;t<a.length;t++){var u=a[t];s.indexOf(u)===-1&&s.push(u)}}}var Wl=null;function P8(t){var a=t.transitionTypes;return t.transitionTypes=null,a}var ec=null,Ah=0,ts=0,$s=null;function H8(t,a){if(ec===null){var s=ec=[];Ah=0,ts=Gm(),$s={status:"pending",value:void 0,then:function(u){s.push(u)}}}return Ah++,a.then(jv,jv),a}function jv(){if(--Ah===0&&(Wl=null,ec!==null)){$s!==null&&($s.status="fulfilled");var t=ec;ec=null,ts=0,$s=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function F8(t,a){var s=[],u={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return t.then(function(){u.status="fulfilled",u.value=a;for(var p=0;p<s.length;p++)(0,s[p])(a)},function(p){for(u.status="rejected",u.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),u}var wv=ve.S;ve.S=function(t,a){if(my=ze(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&H8(t,a),Wl!==null)for(var s=ll;s!==null;)bv(s,Wl),s=s.next;if(s=t.types,s!==null){for(var u=ll;u!==null;)bv(u,s),u=u.next;if(ts!==0){u=Wl,u===null&&(u=Wl=[]);for(var p=0;p<s.length;p++){var x=s[p];u.indexOf(x)===-1&&u.push(x)}}}wv!==null&&wv(t,a)};var ns=Ze(null);function _h(){var t=ns.current;return t!==null?t:Ut.pooledCache}function Tu(t,a){a===null?Ke(ns,ns.current):Ke(ns,a.pool)}function kv(){var t=_h();return t===null?null:{parent:Sn._currentValue,pool:t}}var Vs=Error(r(460)),Rh=Error(r(474)),Mu=Error(r(542)),Au={then:function(){}};function Sv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Cv(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(va,va),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Ev(t),t===void 0&&!("reason"in a)?Error(r(600)):t;default:if(typeof a.status=="string")a.then(va,va);else{if(t=Ut,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(u){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=u}},function(u){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Ev(t),t}throw is=a,Vs}}function as(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(is=s,Vs):s}}var is=null;function Nv(){if(is===null)throw Error(r(459));var t=is;return is=null,t}function Ev(t){if(t===Vs||t===Mu)throw Error(r(483))}var Gs=null,tc=0;function _u(t){var a=tc;return tc+=1,Gs===null&&(Gs=[]),Cv(Gs,t,a)}function so(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Ru(t,a){throw a.$$typeof===I?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Tv(t){function a(ae,J){if(t){var oe=ae.deletions;oe===null?(ae.deletions=[J],ae.flags|=16):oe.push(J)}}function s(ae,J){if(!t)return null;for(;J!==null;)a(ae,J),J=J.sibling;return null}function u(ae){for(var J=new Map;ae!==null;)ae.key===null?J.set(ae.index,ae):J.set(ae.key,ae),ae=ae.sibling;return J}function p(ae,J){return ae=br(ae,J),ae.index=0,ae.sibling=null,ae}function x(ae,J,oe){return ae.index=oe,t?(oe=ae.alternate,oe!==null?(oe=oe.index,oe<J?(ae.flags|=2,J):oe):(ae.flags|=134217730,J)):(ae.flags|=1048576,J)}function A(ae){return t&&ae.alternate===null&&(ae.flags|=134217730),ae}function L(ae,J,oe,ye){return J===null||J.tag!==6?(J=wh(oe,ae.mode,ye),J.return=ae,J):(J=p(J,oe),J.return=ae,J)}function G(ae,J,oe,ye){var Le=oe.type;return Le===q?(ae=he(ae,J,oe.props.children,ye,oe.key),so(ae,oe),ae):J!==null&&(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&as(Le)===J.type)?(J=p(J,oe.props),so(J,oe),J.return=ae,J):(J=ju(oe.type,oe.key,oe.props,null,ae.mode,ye),so(J,oe),J.return=ae,J)}function ie(ae,J,oe,ye){return J===null||J.tag!==4||J.stateNode.containerInfo!==oe.containerInfo||J.stateNode.implementation!==oe.implementation?(J=kh(oe,ae.mode,ye),J.return=ae,J):(J=p(J,oe.children||[]),J.return=ae,J)}function he(ae,J,oe,ye,Le){return J===null||J.tag!==7?(J=Qo(oe,ae.mode,ye,Le),J.return=ae,J):(J=p(J,oe),J.return=ae,J)}function xe(ae,J,oe){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=wh(""+J,ae.mode,oe),J.return=ae,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case P:return oe=ju(J.type,J.key,J.props,null,ae.mode,oe),so(oe,J),oe.return=ae,oe;case z:return J=kh(J,ae.mode,oe),J.return=ae,J;case D:return J=as(J),xe(ae,J,oe)}if(we(J)||fe(J))return J=Qo(J,ae.mode,oe,null),J.return=ae,J;if(typeof J.then=="function")return xe(ae,_u(J),oe);if(J.$$typeof===H)return xe(ae,Eu(ae,J),oe);Ru(ae,J)}return null}function te(ae,J,oe,ye){var Le=J!==null?J.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Le!==null?null:L(ae,J,""+oe,ye);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case P:return oe.key===Le?G(ae,J,oe,ye):null;case z:return oe.key===Le?ie(ae,J,oe,ye):null;case D:return oe=as(oe),te(ae,J,oe,ye)}if(we(oe)||fe(oe))return Le!==null?null:he(ae,J,oe,ye,null);if(typeof oe.then=="function")return te(ae,J,_u(oe),ye);if(oe.$$typeof===H)return te(ae,J,Eu(ae,oe),ye);Ru(ae,oe)}return null}function ce(ae,J,oe,ye,Le){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ae=ae.get(oe)||null,L(J,ae,""+ye,Le);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case P:return ae=ae.get(ye.key===null?oe:ye.key)||null,G(J,ae,ye,Le);case z:return ae=ae.get(ye.key===null?oe:ye.key)||null,ie(J,ae,ye,Le);case D:return ye=as(ye),ce(ae,J,oe,ye,Le)}if(we(ye)||fe(ye))return ae=ae.get(oe)||null,he(J,ae,ye,Le,null);if(typeof ye.then=="function")return ce(ae,J,oe,_u(ye),Le);if(ye.$$typeof===H)return ce(ae,J,oe,Eu(J,ye),Le);Ru(J,ye)}return null}function Oe(ae,J,oe,ye){for(var Le=null,Ct=null,$e=J,We=J=0,En=null;$e!==null&&We<oe.length;We++){$e.index>We?(En=$e,$e=null):En=$e.sibling;var Tt=te(ae,$e,oe[We],ye);if(Tt===null){$e===null&&($e=En);break}t&&$e&&Tt.alternate===null&&a(ae,$e),J=x(Tt,J,We),Ct===null?Le=Tt:Ct.sibling=Tt,Ct=Tt,$e=En}if(We===oe.length)return s(ae,$e),pt&&jr(ae,We),Le;if($e===null){for(;We<oe.length;We++)$e=xe(ae,oe[We],ye),$e!==null&&(J=x($e,J,We),Ct===null?Le=$e:Ct.sibling=$e,Ct=$e);return pt&&jr(ae,We),Le}for($e=u($e);We<oe.length;We++)En=ce($e,ae,We,oe[We],ye),En!==null&&(t&&(Tt=En.alternate,Tt!==null&&$e.delete(Tt.key===null?We:Tt.key)),J=x(En,J,We),Ct===null?Le=En:Ct.sibling=En,Ct=En);return t&&$e.forEach(function(Eo){return a(ae,Eo)}),pt&&jr(ae,We),Le}function Ie(ae,J,oe,ye){if(oe==null)throw Error(r(151));for(var Le=null,Ct=null,$e=J,We=J=0,En=null,Tt=oe.next();$e!==null&&!Tt.done;We++,Tt=oe.next()){$e.index>We?(En=$e,$e=null):En=$e.sibling;var Eo=te(ae,$e,Tt.value,ye);if(Eo===null){$e===null&&($e=En);break}t&&$e&&Eo.alternate===null&&a(ae,$e),J=x(Eo,J,We),Ct===null?Le=Eo:Ct.sibling=Eo,Ct=Eo,$e=En}if(Tt.done)return s(ae,$e),pt&&jr(ae,We),Le;if($e===null){for(;!Tt.done;We++,Tt=oe.next())Tt=xe(ae,Tt.value,ye),Tt!==null&&(J=x(Tt,J,We),Ct===null?Le=Tt:Ct.sibling=Tt,Ct=Tt);return pt&&jr(ae,We),Le}for($e=u($e);!Tt.done;We++,Tt=oe.next())Tt=ce($e,ae,We,Tt.value,ye),Tt!==null&&(t&&(En=Tt.alternate,En!==null&&$e.delete(En.key===null?We:En.key)),J=x(Tt,J,We),Ct===null?Le=Tt:Ct.sibling=Tt,Ct=Tt);return t&&$e.forEach(function(w7){return a(ae,w7)}),pt&&jr(ae,We),Le}function ut(ae,J,oe,ye){if(typeof oe=="object"&&oe!==null&&oe.type===q&&oe.key===null&&oe.props.ref===void 0&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case P:e:{for(var Le=oe.key;J!==null;){if(J.key===Le){if(Le=oe.type,Le===q){if(J.tag===7){s(ae,J.sibling),ye=p(J,oe.props.children),so(ye,oe),ye.return=ae,ae=ye;break e}}else if(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&as(Le)===J.type){s(ae,J.sibling),ye=p(J,oe.props),so(ye,oe),ye.return=ae,ae=ye;break e}s(ae,J);break}else a(ae,J);J=J.sibling}oe.type===q?(ye=Qo(oe.props.children,ae.mode,ye,oe.key),so(ye,oe),ye.return=ae,ae=ye):(ye=ju(oe.type,oe.key,oe.props,null,ae.mode,ye),so(ye,oe),ye.return=ae,ae=ye)}return A(ae);case z:e:{for(Le=oe.key;J!==null;){if(J.key===Le)if(J.tag===4&&J.stateNode.containerInfo===oe.containerInfo&&J.stateNode.implementation===oe.implementation){s(ae,J.sibling),ye=p(J,oe.children||[]),ye.return=ae,ae=ye;break e}else{s(ae,J);break}else a(ae,J);J=J.sibling}ye=kh(oe,ae.mode,ye),ye.return=ae,ae=ye}return A(ae);case D:return oe=as(oe),ut(ae,J,oe,ye)}if(we(oe))return Oe(ae,J,oe,ye);if(fe(oe)){if(Le=fe(oe),typeof Le!="function")throw Error(r(150));return oe=Le.call(oe),Ie(ae,J,oe,ye)}if(typeof oe.then=="function")return ut(ae,J,_u(oe),ye);if(oe.$$typeof===H)return ut(ae,J,Eu(ae,oe),ye);Ru(ae,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,J!==null&&J.tag===6?(s(ae,J.sibling),ye=p(J,oe),ye.return=ae,ae=ye):(s(ae,J),ye=wh(oe,ae.mode,ye),ye.return=ae,ae=ye),A(ae)):s(ae,J)}return function(ae,J,oe,ye){try{tc=0;var Le=ut(ae,J,oe,ye);return Gs=null,Le}catch($e){if($e===Vs||$e===Mu)throw $e;var Ct=Ta(29,$e,null,ae.mode);return Ct.lanes=ye,Ct.return=ae,Ct}finally{}}}var rs=Tv(!0),Mv=Tv(!1),lo=!1;function Oh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zh(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function co(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function uo(t,a,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Rt&2)!==0){var p=u.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),u.pending=a,a=bu(t),fv(t,null,s),a}return xu(t,u,a,s),bu(t)}function nc(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var u=a.lanes;u&=t.pendingLanes,s|=u,a.lanes=s,dr(t,s)}}function Dh(t,a){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var p=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var A={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?p=x=A:x=x.next=A,s=s.next}while(s!==null);x===null?p=x=a:x=x.next=a}else p=x=a;s={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var Lh=!1;function ac(){if(Lh){var t=$s;if(t!==null)throw t}}function ic(t,a,s,u){Lh=!1;var p=t.updateQueue;lo=!1;var x=p.firstBaseUpdate,A=p.lastBaseUpdate,L=p.shared.pending;if(L!==null){p.shared.pending=null;var G=L,ie=G.next;G.next=null,A===null?x=ie:A.next=ie,A=G;var he=t.alternate;he!==null&&(he=he.updateQueue,L=he.lastBaseUpdate,L!==A&&(L===null?he.firstBaseUpdate=ie:L.next=ie,he.lastBaseUpdate=G))}if(x!==null){var xe=p.baseState;A=0,he=ie=G=null,L=x;do{var te=L.lane&-536870913,ce=te!==L.lane;if(ce?(St&te)===te:(u&te)===te){te!==0&&te===ts&&(Lh=!0),he!==null&&(he=he.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Oe=t,Ie=L;te=a;var ut=s;switch(Ie.tag){case 1:if(Oe=Ie.payload,typeof Oe=="function"){xe=Oe.call(ut,xe,te);break e}xe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ie.payload,te=typeof Oe=="function"?Oe.call(ut,xe,te):Oe,te==null)break e;xe=O({},xe,te);break e;case 2:lo=!0}}te=L.callback,te!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=p.callbacks,ce===null?p.callbacks=[te]:ce.push(te))}else ce={lane:te,tag:L.tag,payload:L.payload,callback:L.callback,next:null},he===null?(ie=he=ce,G=xe):he=he.next=ce,A|=te;if(L=L.next,L===null){if(L=p.shared.pending,L===null)break;ce=L,L=ce.next,ce.next=null,p.lastBaseUpdate=ce,p.shared.pending=null}}while(!0);he===null&&(G=xe),p.baseState=G,p.firstBaseUpdate=ie,p.lastBaseUpdate=he,x===null&&(p.shared.lanes=0),yo|=A,t.lanes=A,t.memoizedState=xe}}function Av(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function _v(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Av(s[t],a)}var fo=Ze(null),Ou=Ze(0);function Rv(t,a){t=Tr,Ke(Ou,t),Ke(fo,a),Tr=t|a.baseLanes}function Bh(){Ke(Ou,Tr),Ke(fo,fo.current)}function Ih(){Tr=Ou.current,Fe(fo),Fe(Ou)}var Kn=Ze(null),ra=null;function ho(t){var a=t.alternate;Ke(Xn,Xn.current&1),Ke(Kn,t),ra===null&&(a===null||fo.current!==null||a.memoizedState!==null)&&(ra=t)}function qh(t){Ke(Xn,Xn.current),Ke(Kn,t),ra===null&&(ra=t)}function Ov(t){t.tag===22?(Ke(Xn,Xn.current),Ke(Kn,t),ra===null&&(ra=t)):mo()}function mo(){Ke(Xn,Xn.current),Ke(Kn,Kn.current)}function $a(t){Fe(Kn),ra===t&&(ra=null),Fe(Xn)}var Xn=Ze(0);function rc(t,a){Ke(Kn,Kn.current),Ke(Xn,a)}function Ph(t){Fe(Xn),Fe(Kn),ra===t&&(ra=null)}function zu(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||lp(s)||cp(s)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Sr=0,ct=null,qt=null,Cn=null,Du=!1,Ys=!1,os=!1,Lu=0,oc=0,Ks=null,U8=0;function pn(){throw Error(r(321))}function Hh(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!Ua(t[s],a[s]))return!1;return!0}function Fh(t,a,s,u,p,x){return Sr=x,ct=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,ve.H=t===null||t.memoizedState===null?g2:v2,os=!1,x=s(u,p),os=!1,Ys&&(x=Dv(a,s,u,p)),zv(t),x}function zv(t){ve.H=Uu;var a=qt!==null&&qt.next!==null;if(Sr=0,Cn=qt=ct=null,Du=!1,oc=0,Ks=null,a)throw Error(r(300));t===null||Nn||(t=t.dependencies,t!==null&&Nu(t)&&(Nn=!0))}function Dv(t,a,s,u){ct=t;var p=0;do{if(Ys&&(Ks=null),oc=0,Ys=!1,25<=p)throw Error(r(301));if(p+=1,Cn=qt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}ve.H=Z8,x=a(s,u)}while(Ys);return x}function $8(){var t=ve.H,a=t.useState()[0];return a=typeof a.then=="function"?sc(a):a,t=t.useState()[0],(qt!==null?qt.memoizedState:null)!==t&&(ct.flags|=1024),a}function Uh(){var t=Lu!==0;return Lu=0,t}function $h(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Vh(t){if(Du){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Du=!1}Sr=0,Cn=qt=ct=null,Ys=!1,oc=Lu=0,Ks=null}function xa(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?ct.memoizedState=Cn=t:Cn=Cn.next=t,Cn}function jn(){if(qt===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=qt.next;var a=Cn===null?ct.memoizedState:Cn.next;if(a!==null)Cn=a,qt=t;else{if(t===null)throw ct.alternate===null?Error(r(467)):Error(r(310));qt=t,t={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Cn===null?ct.memoizedState=Cn=t:Cn=Cn.next=t}return Cn}function Bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sc(t){var a=oc;return oc+=1,Ks===null&&(Ks=[]),t=Cv(Ks,t,a),a=ct,(Cn===null?a.memoizedState:Cn.next)===null&&(a=a.alternate,ve.H=a===null||a.memoizedState===null?g2:v2),t}function Iu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return sc(t);if(t.$$typeof===ee)return;if(t.$$typeof===H)return Yn(t)}throw Error(r(438,String(t)))}function Gh(t){var a=null,s=ct.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var u=ct.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Bu(),ct.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),u=0;u<t;u++)s[u]=B;return a.index++,s}function Cr(t,a){return typeof a=="function"?a(t):a}function qu(t){var a=jn();return Yh(a,qt,t)}function Yh(t,a,s){var u=t.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var p=t.baseQueue,x=u.pending;if(x!==null){if(p!==null){var A=p.next;p.next=x.next,x.next=A}a.baseQueue=p=x,u.pending=null}if(x=t.baseState,p===null)t.memoizedState=x;else{a=p.next;var L=A=null,G=null,ie=a,he=!1;do{var xe=ie.lane&-536870913;if(xe!==ie.lane?(St&xe)===xe:(Sr&xe)===xe){var te=ie.revertLane;if(te===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),xe===ts&&(he=!0);else if((Sr&te)===te){ie=ie.next,te===ts&&(he=!0);continue}else xe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(L=G=xe,A=x):G=G.next=xe,ct.lanes|=te,yo|=te;xe=ie.action,os&&s(x,xe),x=ie.hasEagerState?ie.eagerState:s(x,xe)}else te={lane:xe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(L=G=te,A=x):G=G.next=te,ct.lanes|=xe,yo|=xe;ie=ie.next}while(ie!==null&&ie!==a);if(G===null?A=x:G.next=L,!Ua(x,t.memoizedState)&&(Nn=!0,he&&(s=$s,s!==null)))throw s;t.memoizedState=x,t.baseState=A,t.baseQueue=G,u.lastRenderedState=x}return p===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Kh(t){var a=jn(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var u=s.dispatch,p=s.pending,x=a.memoizedState;if(p!==null){s.pending=null;var A=p=p.next;do x=t(x,A.action),A=A.next;while(A!==p);Ua(x,a.memoizedState)||(Nn=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),s.lastRenderedState=x}return[x,u]}function Lv(t,a,s){var u=ct,p=jn(),x=pt;if(x){if(s===void 0)throw Error(r(407));s=s()}else s=a();var A=!Ua((qt||p).memoizedState,s);if(A&&(p.memoizedState=s,Nn=!0),p=p.queue,Zh(qv.bind(null,u,p,t),[t]),t=p.getSnapshot!==a||A||Cn!==null&&(Cn.memoizedState.tag&1)!==0,Xs(t?9:8,{destroy:void 0},Iv.bind(null,u,p,s,a),null),t){if(u.flags|=2048,Ut===null)throw Error(r(349));x||(Sr&127)!==0||Bv(u,a,s)}return s}function Bv(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=ct.updateQueue,a===null?(a=Bu(),ct.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function Iv(t,a,s,u){a.value=s,a.getSnapshot=u,Pv(a)&&Hv(t)}function qv(t,a,s){return s(function(){Pv(a)&&Hv(t)})}function Pv(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!Ua(t,s)}catch{return!0}}function Hv(t){var a=Xo(t,2);a!==null&&Ra(a,t,2)}function Xh(t){var a=xa();if(typeof t=="function"){var s=t;if(t=s(),os){Kt(!0);try{s()}finally{Kt(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:t},a}function Fv(t,a,s,u){return t.baseState=s,Yh(t,qt,typeof u=="function"?u:Cr)}function V8(t,a,s,u,p){if(Fu(t))throw Error(r(485));if(t=a.action,t!==null){var x={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){x.listeners.push(A)}};ve.T!==null?s(!0):x.isTransition=!1,u(x),s=a.pending,s===null?(x.next=a.pending=x,Uv(a,x)):(x.next=s.next,a.pending=s.next=x)}}function Uv(t,a){var s=a.action,u=a.payload,p=t.state;if(a.isTransition){var x=ve.T,A={};A.types=x!==null?x.types:null,ve.T=A;try{var L=s(p,u),G=ve.S;G!==null&&G(A,L),$v(t,a,L)}catch(ie){Qh(t,a,ie)}finally{x!==null&&A.types!==null&&(x.types=A.types),ve.T=x}}else try{x=s(p,u),$v(t,a,x)}catch(ie){Qh(t,a,ie)}}function $v(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(u){Vv(t,a,u)},function(u){return Qh(t,a,u)}):Vv(t,a,s)}function Vv(t,a,s){a.status="fulfilled",a.value=s,Gv(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,Uv(t,s)))}function Qh(t,a,s){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=s,Gv(a),a=a.next;while(a!==u)}t.action=null}function Gv(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function Yv(t,a){return a}function Kv(t,a){if(pt){var s=Ut.formState;if(s!==null){e:{var u=ct;if(pt){if(Qt){t:{for(var p=Qt,x=si;p.nodeType!==8;){if(!x){p=null;break t}if(p=ci(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){Qt=ci(p.nextSibling),u=p.data==="F!";break e}}ro(u)}u=!1}u&&(a=s[0])}}return s=xa(),s.memoizedState=s.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yv,lastRenderedState:a},s.queue=u,s=h2.bind(null,ct,u),u.dispatch=s,u=Xh(!1),x=nm.bind(null,ct,!1,u.queue),u=xa(),p={state:a,dispatch:null,action:t,pending:null},u.queue=p,s=V8.bind(null,ct,p,x,s),p.dispatch=s,u.memoizedState=t,[a,s,!1]}function Xv(t){var a=jn();return Qv(a,qt,t)}function Qv(t,a,s){if(a=Yh(t,a,Yv)[0],t=qu(Cr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=sc(a)}catch(A){throw A===Vs?Mu:A}else u=a;a=jn();var p=a.queue,x=p.dispatch;return s!==a.memoizedState&&(ct.flags|=2048,Xs(9,{destroy:void 0},G8.bind(null,p,s),null)),[u,x,t]}function G8(t,a){t.action=a}function Zv(t){var a=jn(),s=qt;if(s!==null)return Qv(a,s,t);jn(),a=a.memoizedState,s=jn();var u=s.queue.dispatch;return s.memoizedState=t,[a,u,!1]}function Xs(t,a,s,u){return t={tag:t,create:s,deps:u,inst:a,next:null},a=ct.updateQueue,a===null&&(a=Bu(),ct.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(u=s.next,s.next=t,t.next=u,a.lastEffect=t),t}function Jv(){return jn().memoizedState}function Pu(t,a,s,u){var p=xa();ct.flags|=t,p.memoizedState=Xs(1|a,{destroy:void 0},s,u===void 0?null:u)}function Hu(t,a,s,u){var p=jn();u=u===void 0?null:u;var x=p.memoizedState.inst;qt!==null&&u!==null&&Hh(u,qt.memoizedState.deps)?p.memoizedState=Xs(a,x,s,u):(ct.flags|=t,p.memoizedState=Xs(1|a,x,s,u))}function Wv(t,a){Pu(8390656,8,t,a)}function Zh(t,a){Hu(2048,8,t,a)}function Y8(t){ct.flags|=4;var a=ct.updateQueue;if(a===null)a=Bu(),ct.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function e2(t){var a=jn().memoizedState;return Y8({ref:a,nextImpl:t}),function(){if((Rt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function t2(t,a){return Hu(4,2,t,a)}function n2(t,a){return Hu(4,4,t,a)}function a2(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function i2(t,a,s){s=s!=null?s.concat([t]):null,Hu(4,4,a2.bind(null,a,t),s)}function Jh(){}function r2(t,a){var s=jn();a=a===void 0?null:a;var u=s.memoizedState;return a!==null&&Hh(a,u[1])?u[0]:(s.memoizedState=[t,a],t)}function o2(t,a){var s=jn();a=a===void 0?null:a;var u=s.memoizedState;if(a!==null&&Hh(a,u[1]))return u[0];if(u=t(),os){Kt(!0);try{t()}finally{Kt(!1)}}return s.memoizedState=[u,a],u}function Wh(t,a,s){return s===void 0||(Sr&1073741824)!==0&&(St&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=gy(),ct.lanes|=t,yo|=t,s)}function s2(t,a,s,u){return Ua(s,a)?s:fo.current!==null?(t=Wh(t,s,u),Ua(t,a)||(Nn=!0),t):(Sr&106)===0||(Sr&1073741824)!==0&&(St&261930)===0?(Nn=!0,t.memoizedState=s):(t=gy(),ct.lanes|=t,yo|=t,a)}function l2(t,a,s,u,p){var x=re.p;re.p=x!==0&&8>x?x:8;var A=ve.T,L={};L.types=A!==null?A.types:null,ve.T=L,nm(t,!1,a,s);try{var G=p(),ie=ve.S;if(ie!==null&&ie(L,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var he=F8(G,u);lc(t,a,he,Ka(t))}else lc(t,a,u,Ka(t))}catch(xe){lc(t,a,{then:function(){},status:"rejected",reason:xe},Ka())}finally{re.p=x,A!==null&&L.types!==null&&(A.types=L.types),ve.T=A}}function K8(){}function em(t,a,s,u){if(t.tag!==5)throw Error(r(476));var p=c2(t).queue;l2(t,p,a,Ce,s===null?K8:function(){return u2(t),s(u)})}function c2(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:Ce,baseState:Ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:Ce},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function u2(t){var a=c2(t);a.next===null&&(a=t.alternate.memoizedState),lc(t,a.next.queue,{},Ka())}function tm(){return Yn(ml)}function d2(){return jn().memoizedState}function f2(){return jn().memoizedState}function X8(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=Ka();t=co(s);var u=uo(a,t,s);u!==null&&(Ra(u,a,s),nc(u,a,s)),a={cache:Mh()},t.payload=a;return}a=a.return}}function Q8(t,a,s){var u=Ka();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Fu(t)?m2(a,s):(s=bh(t,a,s,u),s!==null&&(Ra(s,t,u),p2(s,a,u)))}function h2(t,a,s){var u=Ka();lc(t,a,s,u)}function lc(t,a,s,u){var p={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Fu(t))m2(a,p);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var A=a.lastRenderedState,L=x(A,s);if(p.hasEagerState=!0,p.eagerState=L,Ua(L,A))return xu(t,a,p,0),Ut===null&&yu(),!1}catch{}finally{}if(s=bh(t,a,p,u),s!==null)return Ra(s,t,u),p2(s,a,u),!0}return!1}function nm(t,a,s,u){if(u={lane:2,revertLane:Gm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Fu(t)){if(a)throw Error(r(479))}else a=bh(t,s,u,2),a!==null&&Ra(a,t,2)}function Fu(t){var a=t.alternate;return t===ct||a!==null&&a===ct}function m2(t,a){Ys=Du=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function p2(t,a,s){if((s&4194048)!==0){var u=a.lanes;u&=t.pendingLanes,s|=u,a.lanes=s,dr(t,s)}}var Uu={readContext:Yn,use:Iu,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn,useEffectEvent:pn},g2={readContext:Yn,use:Iu,useCallback:function(t,a){return xa().memoizedState=[t,a===void 0?null:a],t},useContext:Yn,useEffect:Wv,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,Pu(4194308,4,a2.bind(null,a,t),s)},useLayoutEffect:function(t,a){return Pu(4194308,4,t,a)},useInsertionEffect:function(t,a){Pu(4,2,t,a)},useMemo:function(t,a){var s=xa();a=a===void 0?null:a;var u=t();if(os){Kt(!0);try{t()}finally{Kt(!1)}}return s.memoizedState=[u,a],u},useReducer:function(t,a,s){var u=xa();if(s!==void 0){var p=s(a);if(os){Kt(!0);try{s(a)}finally{Kt(!1)}}}else p=a;return u.memoizedState=u.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},u.queue=t,t=t.dispatch=Q8.bind(null,ct,t),[u.memoizedState,t]},useRef:function(t){var a=xa();return t={current:t},a.memoizedState=t},useState:function(t){t=Xh(t);var a=t.queue,s=h2.bind(null,ct,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Jh,useDeferredValue:function(t,a){var s=xa();return Wh(s,t,a)},useTransition:function(){var t=Xh(!1);return t=l2.bind(null,ct,t.queue,!0,!1),xa().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var u=ct,p=xa();if(pt){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),Ut===null)throw Error(r(349));(St&127)!==0||Bv(u,a,s)}p.memoizedState=s;var x={value:s,getSnapshot:a};return p.queue=x,Wv(qv.bind(null,u,x,t),[t]),u.flags|=2048,Xs(9,{destroy:void 0},Iv.bind(null,u,x,s,a),null),s},useId:function(){var t=xa(),a=Ut.identifierPrefix;if(pt){var s=Li,u=Di;s=(u&~(1<<32-sn(u)-1)).toString(32)+s,a="_"+a+"R_"+s,s=Lu++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=U8++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:tm,useFormState:Kv,useActionState:Kv,useOptimistic:function(t){var a=xa();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=nm.bind(null,ct,!0,s),s.dispatch=a,[t,a]},useMemoCache:Gh,useCacheRefresh:function(){return xa().memoizedState=X8.bind(null,ct)},useEffectEvent:function(t){var a=xa(),s={impl:t};return a.memoizedState=s,function(){if((Rt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},v2={readContext:Yn,use:Iu,useCallback:r2,useContext:Yn,useEffect:Zh,useImperativeHandle:i2,useInsertionEffect:t2,useLayoutEffect:n2,useMemo:o2,useReducer:qu,useRef:Jv,useState:function(){return qu(Cr)},useDebugValue:Jh,useDeferredValue:function(t,a){var s=jn();return s2(s,qt.memoizedState,t,a)},useTransition:function(){var t=qu(Cr)[0],a=jn().memoizedState;return[typeof t=="boolean"?t:sc(t),a]},useSyncExternalStore:Lv,useId:d2,useHostTransitionStatus:tm,useFormState:Xv,useActionState:Xv,useOptimistic:function(t,a){var s=jn();return Fv(s,qt,t,a)},useMemoCache:Gh,useCacheRefresh:f2,useEffectEvent:e2},Z8={readContext:Yn,use:Iu,useCallback:r2,useContext:Yn,useEffect:Zh,useImperativeHandle:i2,useInsertionEffect:t2,useLayoutEffect:n2,useMemo:o2,useReducer:Kh,useRef:Jv,useState:function(){return Kh(Cr)},useDebugValue:Jh,useDeferredValue:function(t,a){var s=jn();return qt===null?Wh(s,t,a):s2(s,qt.memoizedState,t,a)},useTransition:function(){var t=Kh(Cr)[0],a=jn().memoizedState;return[typeof t=="boolean"?t:sc(t),a]},useSyncExternalStore:Lv,useId:d2,useHostTransitionStatus:tm,useFormState:Zv,useActionState:Zv,useOptimistic:function(t,a){var s=jn();return qt!==null?Fv(s,qt,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Gh,useCacheRefresh:f2,useEffectEvent:e2};function am(t,a,s,u){a=t.memoizedState,s=s(u,a),s=s==null?a:O({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var im={enqueueSetState:function(t,a,s){t=t._reactInternals;var u=Ka(),p=co(u);p.payload=a,s!=null&&(p.callback=s),a=uo(t,p,u),a!==null&&(Ra(a,t,u),nc(a,t,u))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var u=Ka(),p=co(u);p.tag=1,p.payload=a,s!=null&&(p.callback=s),a=uo(t,p,u),a!==null&&(Ra(a,t,u),nc(a,t,u))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=Ka(),u=co(s);u.tag=2,a!=null&&(u.callback=a),a=uo(t,u,s),a!==null&&(Ra(a,t,s),nc(a,t,s))}};function y2(t,a,s,u,p,x,A){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,x,A):a.prototype&&a.prototype.isPureReactComponent?!Kl(s,u)||!Kl(p,x):!0}function x2(t,a,s,u){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,u),a.state!==t&&im.enqueueReplaceState(a,a.state,null)}function ss(t,a){var s=a;if("ref"in a){s={};for(var u in a)u!=="ref"&&(s[u]=a[u])}if(t=t.defaultProps){s===a&&(s=O({},s));for(var p in t)s[p]===void 0&&(s[p]=t[p])}return s}function b2(t){vu(t)}function j2(t){console.error(t)}function w2(t){vu(t)}function $u(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function k2(t,a,s){try{var u=t.onCaughtError;u(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function rm(t,a,s){return s=co(s),s.tag=3,s.payload={element:null},s.callback=function(){$u(t,a)},s}function S2(t){return t=co(t),t.tag=3,t}function C2(t,a,s,u){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var x=u.value;t.payload=function(){return p(x)},t.callback=function(){k2(a,s,u)}}var A=s.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(t.callback=function(){k2(a,s,u),typeof p!="function"&&(xo===null?xo=new Set([this]):xo.add(this));var L=u.stack;this.componentDidCatch(u.value,{componentStack:L!==null?L:""})})}function J8(t,a,s,u,p){if(s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=s.alternate,a!==null&&Wo(a,s,p,!0),s=Kn.current,s!==null){switch(s.tag){case 31:case 13:case 19:return ra===null?dd():s.alternate===null&&gn===0&&(gn=3),s.flags&=-257,s.flags|=65536,s.lanes=p,u===Au?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([u]):a.add(u),Um(t,u,p)),!1;case 22:return s.flags|=65536,u===Au?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([u]):s.add(u)),Um(t,u,p)),!1}throw Error(r(435,s.tag))}return Um(t,u,p),dd(),!1}if(pt)return a=Kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,u!==Ch&&(t=Error(r(422),{cause:u}),Zl(ii(t,s)))):(u!==Ch&&(a=Error(r(423),{cause:u}),Zl(ii(a,s))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,u=ii(u,s),p=rm(t.stateNode,u,p),Dh(t,p),gn!==4&&(gn=2)),!1;var x=Error(r(520),{cause:u});if(x=ii(x,s),gc===null?gc=[x]:gc.push(x),gn!==4&&(gn=2),a===null)return!0;u=ii(u,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=p&-p,s.lanes|=t,t=rm(s.stateNode,u,t),Dh(s,t),!1;case 1:if(a=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(xo===null||!xo.has(x))))return s.flags|=65536,p&=-p,s.lanes|=p,p=S2(p),C2(p,t,s,u),Dh(s,p),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var om=Error(r(461)),Nn=!1;function zn(t,a,s,u){a.child=t===null?Mv(a,null,s,u):rs(a,t.child,s,u)}function N2(t,a,s,u,p){s=s.render;var x=a.ref;if("ref"in u){var A={};for(var L in u)L!=="ref"&&(A[L]=u[L])}else A=u;return es(a),u=Fh(t,a,s,A,x,p),L=Uh(),t!==null&&!Nn?($h(t,a,p),Nr(t,a,p)):(pt&&L&&ku(a),a.flags|=1,zn(t,a,u,p),a.child)}function E2(t,a,s,u,p){if(t===null){var x=s.type;return typeof x=="function"&&!jh(x)&&x.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=x,T2(t,a,x,u,p)):(t=ju(s.type,null,u,a,a.mode,p),t.ref=a.ref,t.return=a,a.child=t)}if(x=t.child,!mm(t,p)){var A=x.memoizedProps;if(s=s.compare,s=s!==null?s:Kl,s(A,u)&&t.ref===a.ref)return Nr(t,a,p)}return a.flags|=1,t=br(x,u),t.ref=a.ref,t.return=a,a.child=t}function T2(t,a,s,u,p){if(t!==null){var x=t.memoizedProps;if(Kl(x,u)&&t.ref===a.ref)if(Nn=!1,a.pendingProps=u=x,mm(t,p))(t.flags&131072)!==0&&(Nn=!0);else return a.lanes=t.lanes,Nr(t,a,p)}return sm(t,a,s,u,p)}function M2(t,a,s,u){var p=u.children,x=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(u=a.child=t.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~x}else u=0,a.child=null;return A2(t,a,x,s,u)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Tu(a,x!==null?x.cachePool:null),x!==null?Rv(a,x):Bh(),Ov(a);else return u=a.lanes=536870912,A2(t,a,x!==null?x.baseLanes|s:s,s,u)}else x!==null?(Tu(a,x.cachePool),Rv(a,x),mo(),a.memoizedState=null):(t!==null&&Tu(a,null),Bh(),mo());return zn(t,a,p,s),a.child}function cc(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function A2(t,a,s,u,p){var x=_h();return x=x===null?null:{parent:Sn._currentValue,pool:x},a.memoizedState={baseLanes:s,cachePool:x},t!==null&&Tu(a,null),Bh(),Ov(a),t!==null&&Wo(t,a,u,!0),a.childLanes=p,null}function Vu(t,a){return a=Gu({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function _2(t,a,s){return rs(a,t.child,null,s),t=Vu(a,a.pendingProps),t.flags|=2,$a(a),a.memoizedState=null,t}function W8(t,a,s){var u=a.pendingProps,p=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(pt){if(u.mode==="hidden")return t=Vu(a,u),a.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},cc(null,t);if(qh(a),(t=Qt)?(t=ax(t,si),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:ao!==null?{id:Di,overflow:Li}:null,retryLane:536870912,hydrationErrors:null},s=mv(t),s.return=a,a.child=s,qn=a,Qt=null)):t=null,t===null)throw ro(a);return a.lanes=536870912,null}return Vu(a,u)}var x=t.memoizedState;if(x!==null){var A=x.dehydrated;if(qh(a),p)if(a.flags&256)a.flags&=-257,a=_2(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(Nn||Wo(t,a,s,!1),p=(s&t.childLanes)!==0,Nn||p){if(fo.current===null){if(u=Ut,u!==null&&(A=fr(u,s),A!==0&&A!==x.retryLane))throw x.retryLane=A,Xo(t,A),Ra(u,t,A),om;dd()}a=_2(t,a,s)}else t=x.treeContext,Qt=ci(A.nextSibling),qn=a,pt=!0,io=null,si=!1,t!==null&&vv(a,t),a=Vu(a,u),a.flags|=134221824;return a}return t=br(t.child,{mode:u.mode,children:u.children}),t.ref=a.ref,a.child=t,t.return=a,t}function Qs(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function sm(t,a,s,u,p){return es(a),s=Fh(t,a,s,u,void 0,p),u=Uh(),t!==null&&!Nn?($h(t,a,p),Nr(t,a,p)):(pt&&u&&ku(a),a.flags|=1,zn(t,a,s,p),a.child)}function R2(t,a,s,u,p,x){return es(a),a.updateQueue=null,s=Dv(a,u,s,p),zv(t),u=Uh(),t!==null&&!Nn?($h(t,a,x),Nr(t,a,x)):(pt&&u&&ku(a),a.flags|=1,zn(t,a,s,x),a.child)}function O2(t,a,s,u,p){if(es(a),a.stateNode===null){var x=Ps,A=s.contextType;typeof A=="object"&&A!==null&&(x=Yn(A)),x=new s(u,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=im,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=u,x.state=a.memoizedState,x.refs={},Oh(a),A=s.contextType,x.context=typeof A=="object"&&A!==null?Yn(A):Ps,x.state=a.memoizedState,A=s.getDerivedStateFromProps,typeof A=="function"&&(am(a,s,A,u),x.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(A=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),A!==x.state&&im.enqueueReplaceState(x,x.state,null),ic(a,u,x,p),ac(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(t===null){x=a.stateNode;var L=a.memoizedProps,G=ss(s,L);x.props=G;var ie=x.context,he=s.contextType;A=Ps,typeof he=="object"&&he!==null&&(A=Yn(he));var xe=s.getDerivedStateFromProps;he=typeof xe=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=a.pendingProps!==L,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||ie!==A)&&x2(a,x,u,A),lo=!1;var te=a.memoizedState;x.state=te,ic(a,u,x,p),ac(),ie=a.memoizedState,L||te!==ie||lo?(typeof xe=="function"&&(am(a,s,xe,u),ie=a.memoizedState),(G=lo||y2(a,s,G,u,te,ie,A))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=ie),x.props=u,x.state=ie,x.context=A,u=G):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{x=a.stateNode,zh(t,a),A=a.memoizedProps,he=ss(s,A),x.props=he,xe=a.pendingProps,te=x.context,ie=s.contextType,G=Ps,typeof ie=="object"&&ie!==null&&(G=Yn(ie)),L=s.getDerivedStateFromProps,(ie=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A!==xe||te!==G)&&x2(a,x,u,G),lo=!1,te=a.memoizedState,x.state=te,ic(a,u,x,p),ac();var ce=a.memoizedState;A!==xe||te!==ce||lo||t!==null&&t.dependencies!==null&&Nu(t.dependencies)?(typeof L=="function"&&(am(a,s,L,u),ce=a.memoizedState),(he=lo||y2(a,s,he,u,te,ce,G)||t!==null&&t.dependencies!==null&&Nu(t.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ce,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ce,G)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||A===t.memoizedProps&&te===t.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&te===t.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ce),x.props=u,x.state=ce,x.context=G,u=he):(typeof x.componentDidUpdate!="function"||A===t.memoizedProps&&te===t.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&te===t.memoizedState||(a.flags|=1024),u=!1)}return x=u,Qs(t,a),u=(a.flags&128)!==0,x||u?(x=a.stateNode,s=u&&typeof s.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,t!==null&&u?(a.child=rs(a,t.child,null,p),a.child=rs(a,null,s,p)):zn(t,a,s,p),a.memoizedState=x.state,t=a.child):t=Nr(t,a,p),t}function z2(t,a,s,u){return Zo(),a.flags|=256,zn(t,a,s,u),a.child}var lm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cm(t){return{baseLanes:t,cachePool:kv()}}function um(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=Ya),t}function D2(t,a,s){var u=a.pendingProps,p=!1,x=(a.flags&128)!==0,A;if((A=x)||(A=t!==null&&t.memoizedState===null?!1:(Xn.current&2)!==0),A&&(p=!0,a.flags&=-129),A=(a.flags&32)!==0,a.flags&=-33,t===null){if(pt){if(p?ho(a):mo(),(t=Qt)?(t=ax(t,si),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:ao!==null?{id:Di,overflow:Li}:null,retryLane:536870912,hydrationErrors:null},s=mv(t),s.return=a,a.child=s,qn=a,Qt=null)):t=null,t===null)throw ro(a);return cp(t)?a.lanes=32:a.lanes=536870912,null}return x=u.children,u=u.fallback,p?(mo(),p=a.mode,x=Gu({mode:"hidden",children:x},p),u=Qo(u,p,s,null),x.return=a,u.return=a,x.sibling=u,a.child=x,u=a.child,u.memoizedState=cm(s),u.childLanes=um(t,A,s),a.memoizedState=lm,cc(null,u)):(ho(a),dm(a,x))}var L=t.memoizedState;if(L!==null){var G=L.dehydrated;if(G!==null)return eC(t,a,x,A,u,G,L,s)}return p?(mo(),p=u.fallback,x=a.mode,L=t.child,G=L.sibling,u=br(L,{mode:"hidden",children:u.children}),u.subtreeFlags=L.subtreeFlags&1206910976,G!==null?p=br(G,p):(p=Qo(p,x,s,null),p.flags|=2),p.return=a,u.return=a,u.sibling=p,a.child=u,cc(null,u),u=a.child,p=t.child.memoizedState,p===null?p=cm(s):(x=p.cachePool,x!==null?(L=Sn._currentValue,x=x.parent!==L?{parent:L,pool:L}:x):x=kv(),p={baseLanes:p.baseLanes|s,cachePool:x}),u.memoizedState=p,u.childLanes=um(t,A,s),a.memoizedState=lm,cc(t.child,u)):(ho(a),s=t.child,t=s.sibling,s=br(s,{mode:"visible",children:u.children}),s.return=a,s.sibling=null,t!==null&&(A=a.deletions,A===null?(a.deletions=[t],a.flags|=16):A.push(t)),a.child=s,a.memoizedState=null,s)}function dm(t,a){return a=Gu({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function Gu(t,a){return t=Ta(22,t,null,a),t.lanes=0,t}function Yu(t,a,s){return rs(a,t.child,null,s),t=dm(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function eC(t,a,s,u,p,x,A,L){if(s)return a.flags&256?(ho(a),a.flags&=-257,Yu(t,a,L)):a.memoizedState!==null?(mo(),a.child=t.child,a.flags|=128,null):(mo(),x=p.fallback,A=a.mode,p=Gu({mode:"visible",children:p.children},A),x=Qo(x,A,L,null),x.flags|=2,p.return=a,x.return=a,p.sibling=x,a.child=p,rs(a,t.child,null,L),p=a.child,p.memoizedState=cm(L),p.childLanes=um(t,u,L),a.memoizedState=lm,cc(null,p));if(ho(a),cp(x)){if(u=x.nextSibling&&x.nextSibling.dataset,u)var G=u.dgst;return u=G,u!==""&&(p=Error(r(419)),p.stack="",p.digest=u,Zl({value:p,source:null,stack:null})),Yu(t,a,L)}if(Nn||Wo(t,a,L,!1),u=(L&t.childLanes)!==0,Nn||u){if(fo.current!==null)return Yu(t,a,L);if(u=Ut,u!==null&&(p=fr(u,L),p!==0&&p!==A.retryLane))throw A.retryLane=p,Xo(t,p),Ra(u,t,p),om;return lp(x)||dd(),Yu(t,a,L)}return lp(x)?(a.flags|=192,a.child=t.child,null):(t=A.treeContext,Qt=ci(x.nextSibling),qn=a,pt=!0,io=null,si=!1,t!==null&&vv(a,t),a=dm(a,p.children),a.flags|=134221824,a)}function L2(t,a,s){t.lanes|=a;var u=t.alternate;u!==null&&(u.lanes|=a),Cu(t.return,a,s)}function B2(t){for(var a=null;t!==null;){var s=t.alternate;s!==null&&zu(s)===null&&(a=t),t=t.sibling}return a}function Ku(t,a,s,u,p,x){var A=t.memoizedState;A===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:p,treeForkCount:x}:(A.isBackwards=a,A.rendering=null,A.renderingStartTime=0,A.last=u,A.tail=s,A.tailMode=p,A.treeForkCount=x)}function fm(t){var a=t.child;for(t.child=null;a!==null;){var s=a.sibling;a.sibling=t.child,t.child=a,a=s}}function hm(t,a,s){var u=a.pendingProps,p=u.revealOrder,x=u.tail;u=u.children;var A=Xn.current;if(a.flags&128)return rc(a,A),null;var L=(A&2)!==0;if(L?(A=A&1|2,a.flags|=128):A&=1,rc(a,A),p==="backwards"&&t!==null?(fm(t),zn(t,a,u,s),fm(t)):zn(t,a,u,s),u=pt?Ql:0,!L&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&L2(t,s,a);else if(t.tag===19)L2(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"backwards":s=B2(a.child),s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null,fm(a)),Ku(a,!0,p,null,x,u);break;case"unstable_legacy-backwards":for(s=null,p=a.child,a.child=null;p!==null;){if(t=p.alternate,t!==null&&zu(t)===null){a.child=p;break}t=p.sibling,p.sibling=s,s=p,p=t}Ku(a,!0,s,null,x,u);break;case"together":Ku(a,!1,null,null,void 0,u);break;case"independent":a.memoizedState=null;break;default:s=B2(a.child),s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null),Ku(a,!1,p,s,x,u)}return a.child}function I2(t,a,s){var u=a.pendingProps;return oo(a,a.type,u.value),zn(t,a,u.children,s),a.child}function Nr(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),yo|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(Wo(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=br(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=br(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function mm(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Nu(t)))}function tC(t,a,s){switch(a.tag){case 3:kn(a,a.stateNode.containerInfo),oo(a,Sn,t.memoizedState.cache),Zo();break;case 27:case 5:on(a);break;case 4:kn(a,a.stateNode.containerInfo);break;case 10:oo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,qh(a),null;break;case 13:var u=a.memoizedState;if(u!==null){if(u.dehydrated!==null)return ho(a),a.flags|=128,null;u=Wo(t,a,s,!1);var p=a.child.childLanes;return u||(s&p)!==0?D2(t,a,s):(ho(a),t=Nr(t,a,s),t!==null?t.sibling:null)}ho(a);break;case 19:if(a.flags&128)return hm(t,a,s);if(p=(t.flags&128)!==0,u=(s&a.childLanes)!==0,u||(Wo(t,a,s,!1),u=(s&a.childLanes)!==0),p){if(u)return hm(t,a,s);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),rc(a,Xn.current),u)break;return null;case 22:return a.lanes=0,M2(t,a,s,a.pendingProps);case 24:oo(a,Sn,t.memoizedState.cache)}return Nr(t,a,s)}function q2(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)Nn=!0;else{if(!mm(t,s)&&(a.flags&128)===0)return Nn=!1,tC(t,a,s);Nn=(t.flags&131072)!==0}else Nn=!1,pt&&(a.flags&1048576)!==0&&gv(a,Ql,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(t=as(a.elementType),a.type=t,typeof t=="function")jh(t)?(u=ss(t,u),a.tag=1,a=O2(null,a,t,u,s)):(a.tag=0,a=sm(null,a,t,u,s));else{if(t!=null){var p=t.$$typeof;if(p===K){a.tag=11,a=N2(null,a,t,u,s);break e}else if(p===Z){a.tag=14,a=E2(null,a,t,u,s);break e}else if(p===H){a.tag=10,a.type=t,a=I2(null,a,s);break e}}throw a=be(t)||t,Error(r(306,a,""))}}return a;case 0:return sm(t,a,a.type,a.pendingProps,s);case 1:return u=a.type,p=ss(u,a.pendingProps),O2(t,a,u,p,s);case 3:e:{if(kn(a,a.stateNode.containerInfo),t===null)throw Error(r(387));u=a.pendingProps;var x=a.memoizedState;p=x.element,zh(t,a),ic(a,u,null,s);var A=a.memoizedState;if(u=A.cache,oo(a,Sn,u),u!==x.cache&&Th(a,[Sn],s,!0),ac(),u=A.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:A.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=z2(t,a,u,s);break e}else if(u!==p){p=ii(Error(r(424)),a),Zl(p),a=z2(t,a,u,s);break e}else{switch(t=a.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Qt=ci(t.firstChild),qn=a,pt=!0,io=null,si=!0,s=Mv(a,null,u,s),a.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(Zo(),u===p){a=Nr(t,a,s);break e}zn(t,a,u,s)}a=a.child}return a;case 26:return Qs(t,a),t===null?(s=ux(a.type,null,a.pendingProps,null))?a.memoizedState=s:pt||(a.stateNode=Uy(a.type,a.pendingProps,Jt.current,a)):a.memoizedState=ux(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return on(a),t===null&&pt&&(u=a.stateNode=ox(a.type,a.pendingProps,Jt.current),qn=a,si=!0,p=Qt,wo(a.type)?(up=p,Qt=ci(u.firstChild)):Qt=p),zn(t,a,a.pendingProps.children,s),Qs(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&pt&&((p=u=Qt)&&(u=XC(u,a.type,a.pendingProps,si),u!==null?(a.stateNode=u,qn=a,Qt=ci(u.firstChild),si=!1,p=!0):p=!1),p||ro(a)),on(a),p=a.type,x=a.pendingProps,A=t!==null?t.memoizedProps:null,u=x.children,tp(p,x)?u=null:A!==null&&tp(p,A)&&(a.flags|=32),a.memoizedState!==null&&(p=Fh(t,a,$8,null,null,s),ml._currentValue=p),Qs(t,a),zn(t,a,u,s),a.child;case 6:return t===null&&pt&&((t=s=Qt)&&(s=QC(s,a.pendingProps,si),s!==null?(a.stateNode=s,qn=a,Qt=null,t=!0):t=!1),t||ro(a)),null;case 13:return D2(t,a,s);case 4:return kn(a,a.stateNode.containerInfo),u=a.pendingProps,t===null?a.child=rs(a,null,u,s):zn(t,a,u,s),a.child;case 11:return N2(t,a,a.type,a.pendingProps,s);case 7:return u=a.pendingProps,Qs(t,a),zn(t,a,u,s),a.child;case 8:return zn(t,a,a.pendingProps.children,s),a.child;case 12:return zn(t,a,a.pendingProps.children,s),a.child;case 10:return I2(t,a,s);case 9:return p=a.type._context,u=a.pendingProps.children,es(a),p=Yn(p),u=u(p),a.flags|=1,zn(t,a,u,s),a.child;case 14:return E2(t,a,a.type,a.pendingProps,s);case 15:return T2(t,a,a.type,a.pendingProps,s);case 19:return hm(t,a,s);case 31:return W8(t,a,s);case 22:return M2(t,a,s,a.pendingProps);case 24:return es(a),u=Yn(Sn),t===null?(p=_h(),p===null&&(p=Ut,x=Mh(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=s),p=x),a.memoizedState={parent:u,cache:p},Oh(a),oo(a,Sn,p)):((t.lanes&s)!==0&&(zh(t,a),ic(a,null,null,s),ac()),p=t.memoizedState,x=a.memoizedState,p.parent!==u?(p={parent:u,cache:u},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),oo(a,Sn,u)):(u=x.cache,oo(a,Sn,u),u!==p.cache&&Th(a,[Sn],s,!0))),zn(t,a,a.pendingProps.children,s),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),u=a.pendingProps,u.name!=null&&u.name!=="auto"?a.flags|=t===null?18882560:18874368:pt&&ku(a),t!==null&&t.memoizedProps.name!==u.name?a.flags|=4194816:Qs(t,a),zn(t,a,u.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Er(t){t.flags|=4}function pm(t,a,s,u,p){var x;if((x=(t.mode&32)!==0)&&(x=s===null?mx(a,u):mx(a,u)&&(u.src!==s.src||u.srcSet!==s.srcSet)),x){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(by())t.flags|=8192;else throw is=Au,Rh}else t.flags&=-16777217}function P2(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!px(a))if(by())t.flags|=8192;else throw is=Au,Rh}function Xu(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?fa():536870912,t.lanes|=a,tl|=a)}function uc(t,a){if(!pt)switch(t.tailMode){case"visible":break;case"collapsed":for(var s=t.tail,u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null;break;default:for(a=t.tail,s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null}}function Zt(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,u=0;if(a)for(var p=t.child;p!==null;)s|=p.lanes|p.childLanes,u|=p.subtreeFlags&1206910976,u|=p.flags&1206910976,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)s|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=u,t.childLanes=s,a}function nC(t,a,s){var u=a.pendingProps;switch(Sh(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(a),null;case 1:return Zt(a),null;case 3:return s=a.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),kr(Sn),vn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Us(a)?Er(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Nh())),Zt(a),null;case 26:var p=a.type,x=a.memoizedState;return t===null?(Er(a),x!==null?(Zt(a),P2(a,x)):(Zt(a),pm(a,p,null,u,s))):x?x!==t.memoizedState?(Er(a),Zt(a),P2(a,x)):(Zt(a),a.flags&=-16777217):(t=t.memoizedProps,t!==u&&Er(a),Zt(a),pm(a,p,t,u,s)),null;case 27:if(ge(a),s=Jt.current,p=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&Er(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Zt(a),a.subtreeFlags&=-33554433,null}t=gt.current,Us(a)?yv(a):(t=ox(p,u,s),a.stateNode=t,Er(a))}return Zt(a),a.subtreeFlags&=-33554433,null;case 5:if(ge(a),p=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==u&&Er(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Zt(a),a.subtreeFlags&=-33554433,null}if(x=gt.current,Us(a))yv(a);else{var A=jc(Jt.current);switch(x){case 1:x=A.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=A.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=A.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?A.createElement("select",{is:u.is}):A.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?A.createElement(p,{is:u.is}):A.createElement(p)}}x[en]=a,x[On]=u;e:for(A=a.child;A!==null;){if(A.tag===5||A.tag===6)x.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===a)break e;for(;A.sibling===null;){if(A.return===null||A.return===a)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}a.stateNode=x;e:switch(Zn(x,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Er(a)}}return Zt(a),a.subtreeFlags&=-33554433,pm(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==u&&Er(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(t=Jt.current,Us(a)){if(t=a.stateNode,s=a.memoizedProps,u=null,p=qn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}t[en]=a,t=!!(t.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||qy(t.nodeValue,s)),t||ro(a,!0)}else t=jc(t).createTextNode(u),t[en]=a,a.stateNode=t}return Zt(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(u=Us(a),s!==null){if(t===null){if(!u)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[en]=a}else Zo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Zt(a),t=!1}else s=Nh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?($a(a),a):($a(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Zt(a),null;case 13:if(u=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=Us(a),u!==null&&u.dehydrated!==null){if(t===null){if(!p)throw Error(r(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[en]=a}else Zo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Zt(a),p=!1}else p=Nh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?($a(a),a):($a(a),null)}return $a(a),(a.flags&128)!==0?(a.lanes=s,a):(s=u!==null,t=t!==null&&t.memoizedState!==null,s&&(u=a.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),Xu(a,a.updateQueue),Zt(a),null);case 4:return vn(),t===null&&Qm(a.stateNode.containerInfo),a.flags|=67108864,Zt(a),null;case 10:return kr(a.type),Zt(a),null;case 19:if(Ph(a),u=a.memoizedState,u===null)return Zt(a),null;if(p=(a.flags&128)!==0,x=u.rendering,x===null)if(p)uc(u,!1);else{if(gn!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(x=zu(t),x!==null){for(a.flags|=128,uc(u,!1),t=x.updateQueue,a.updateQueue=t,Xu(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)hv(s,t),s=s.sibling;return rc(a,Xn.current&1|2),pt&&jr(a,u.treeForkCount),a.child}t=t.sibling}u.tail!==null&&ze()>sd&&(a.flags|=128,p=!0,uc(u,!1),a.lanes=4194304)}else{if(!p)if(t=zu(x),t!==null){if(a.flags|=128,p=!0,t=t.updateQueue,a.updateQueue=t,Xu(a,t),uc(u,!0),u.tail===null&&u.tailMode!=="collapsed"&&u.tailMode!=="visible"&&!x.alternate&&!pt)return Zt(a),null}else 2*ze()-u.renderingStartTime>sd&&s!==536870912&&(a.flags|=128,p=!0,uc(u,!1),a.lanes=4194304);u.isBackwards?(x.sibling=a.child,a.child=x):(t=u.last,t!==null?t.sibling=x:a.child=x,u.last=x)}if(u.tail!==null){t=u.tail;e:{for(s=t;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ze(),t.sibling=null,x=Xn.current,x=p?x&1|2:x&1,u.tailMode==="visible"||u.tailMode==="collapsed"||!s||pt?rc(a,x):(s=x,Ke(Kn,a),Ke(Xn,s),ra===null&&(ra=a)),pt&&jr(a,u.treeForkCount),t}return Zt(a),null;case 22:case 23:return $a(a),Ih(),u=a.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(s&536870912)!==0&&(a.flags&128)===0&&(Zt(a),a.subtreeFlags&6&&(a.flags|=8192)):Zt(a),s=a.updateQueue,s!==null&&Xu(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==s&&(a.flags|=2048),t!==null&&Fe(ns),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),kr(Sn),Zt(a),null;case 25:return null;case 30:return a.flags|=33554432,Zt(a),null}throw Error(r(156,a.tag))}function aC(t,a){switch(Sh(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return kr(Sn),vn(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return ge(a),null;case 31:if(a.memoizedState!==null){if($a(a),a.alternate===null)throw Error(r(340));Zo()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if($a(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Zo()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Ph(a),t=a.flags,t&65536?(a.flags=t&-65537|128,t=a.memoizedState,t!==null&&(t.rendering=null,t.tail=null),a.flags|=4,a):null;case 4:return vn(),null;case 10:return kr(a.type),null;case 22:case 23:return $a(a),Ih(),t!==null&&Fe(ns),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return kr(Sn),null;case 25:return null;default:return null}}function H2(t,a){switch(Sh(a),a.tag){case 3:kr(Sn),vn();break;case 26:case 27:case 5:ge(a);break;case 4:vn();break;case 31:a.memoizedState!==null&&$a(a);break;case 13:$a(a);break;case 19:Ph(a);break;case 10:kr(a.type);break;case 22:case 23:$a(a),Ih(),t!==null&&Fe(ns);break;case 24:kr(Sn)}}function dc(t,a){try{var s=a.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var p=u.next;s=p;do{if((s.tag&t)===t){u=void 0;var x=s.create,A=s.inst;u=x(),A.destroy=u}s=s.next}while(s!==p)}}catch(L){Lt(a,a.return,L)}}function po(t,a,s){try{var u=a.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&t)===t){var A=u.inst,L=A.destroy;if(L!==void 0){A.destroy=void 0,p=a;var G=s,ie=L;try{ie()}catch(he){Lt(p,G,he)}}}u=u.next}while(u!==x)}}catch(he){Lt(a,a.return,he)}}function F2(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{_v(a,s)}catch(u){Lt(t,t.return,u)}}}function U2(t,a,s){s.props=ss(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(u){Lt(t,a,u)}}function Bi(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:var p=t.stateNode,x=yr(t.memoizedProps,p);(p.ref===null||p.ref.name!==x)&&(p.ref=Qy(x)),u=p.ref;break;case 7:if(t.stateNode===null){var A=new Xa(t);m(t.child,!1,YC,A,void 0,void 0),t.stateNode=A}u=t.stateNode;break;default:u=t.stateNode}typeof s=="function"?t.refCleanup=s(u):s.current=u}}catch(L){Lt(t,a,L)}}function Qn(t,a){var s=t.ref,u=t.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(p){Lt(t,a,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Lt(t,a,p)}else s.current=null}function Qu(t,a){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&a!==null)for(var s=0;s<a.length;s++)nx(t.stateNode,a[s])}function $2(t){for(var a=t.return;a!==null&&(vm(a)&&nx(t.stateNode,a.stateNode),!gm(a));)a=a.return}function fc(t){for(var a=t.return;a!==null&&(vm(a)&&KC(t.stateNode,a.stateNode),!gm(a));)a=a.return}function gm(t){return t.tag===5||t.tag===3||t.tag===27}function vm(t){return t&&t.tag===7&&t.stateNode!==null}function ym(t){var a=t.type,s=t.memoizedProps,u=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(p){Lt(t,t.return,p)}}function xm(t,a,s){try{var u=t.stateNode;MC(u,t.type,s,a),u[On]=a}catch(p){Lt(t,t.return,p)}}function V2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&wo(t.type)||t.tag===4}function bm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||V2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&wo(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function jm(t,a,s,u){var p=t.tag;if(p===5||p===6)p=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(p,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(p),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=va)),Qu(t,u),Ge=!0;else if(p!==4&&(p===27&&(Qu(t,u),u=null,wo(t.type)&&(s=t.stateNode,a=null)),t=t.child,t!==null))for(jm(t,a,s,u),t=t.sibling;t!==null;)jm(t,a,s,u),t=t.sibling}function Zu(t,a,s,u){var p=t.tag;if(p===5||p===6)p=t.stateNode,a?s.insertBefore(p,a):s.appendChild(p),Qu(t,u),Ge=!0;else if(p!==4&&(p===27&&(Qu(t,u),u=null,wo(t.type)&&(s=t.stateNode)),t=t.child,t!==null))for(Zu(t,a,s,u),t=t.sibling;t!==null;)Zu(t,a,s,u),t=t.sibling}function G2(t){var a=t.stateNode,s=t.memoizedProps;try{for(var u=t.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);Zn(a,u,s),a[en]=t,a[On]=s}catch(x){Lt(t,t.return,x)}}var Ju=!1,Va=null;function Y2(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Ju=!0)}var Ii=null;function K2(){var t=Ii;return Ii=null,t}var Ma=0;function Zs(t,a,s,u,p){return Ma=0,X2(t.child,a,s,u,p)}function X2(t,a,s,u,p){for(var x=!1;t!==null;){if(t.tag===5){var A=t.stateNode;if(u!==null){var L=ip(A);u.push(L),L.view&&(x=!0)}else x||ip(A).view&&(x=!0);Ju=!0,Ky(A,Ma===0?a:a+"_"+Ma,s),Ma++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&p||X2(t.child,a,s,u,p)&&(x=!0));t=t.sibling}return x}function qi(t,a){for(;t!==null;)t.tag===5?Xy(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a||qi(t.child,a)),t=t.sibling}function Wu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Wu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var a=t.memoizedProps;if(a.name==null||a.name==="auto")throw Error(r(544));var s=a.name;a=xr(a.default,a.share),a!=="none"&&(Zs(t,s,a,null,!1)||qi(t.child,!1))}t=t.sibling}}function wm(t,a){if(t.tag===30){var s=t.stateNode,u=t.memoizedProps,p=yr(u,s),x=xr(u.default,s.paired?u.share:u.enter);x!=="none"?Zs(t,p,x,null,!1)?(Wu(t),s.paired||a||rl(t,u.onEnter)):qi(t.child,!1):Wu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)wm(t,a),t=t.sibling;else Wu(t)}function km(t){if(Va!==null&&Va.size!==0){var a=Va;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var s=t.memoizedProps,u=s.name;if(u!=null&&u!=="auto"){var p=a.get(u);if(p!==void 0){var x=xr(s.default,s.share);if(x!=="none"&&(Zs(t,u,x,null,!1)?(x=t.stateNode,p.paired=x,x.paired=p,rl(t,s.onShare)):qi(t.child,!1)),a.delete(u),a.size===0)break}}}km(t)}t=t.sibling}}}function Sm(t){if(t.tag===30){var a=t.memoizedProps,s=yr(a,t.stateNode),u=Va!==null?Va.get(s):void 0,p=xr(a.default,u!==void 0?a.share:a.exit);p!=="none"&&(Zs(t,s,p,null,!1)?u!==void 0?(p=t.stateNode,u.paired=p,p.paired=u,Va.delete(s),rl(t,a.onShare)):rl(t,a.onExit):qi(t.child,!1)),Va!==null&&km(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Sm(t),t=t.sibling;else Va!==null&&km(t)}function Q2(t){for(t=t.child;t!==null;){if(t.tag===30){var a=t.memoizedProps,s=yr(a,t.stateNode);a=xr(a.default,a.update),t.flags&=-5,a!=="none"&&Zs(t,s,a,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&Q2(t);t=t.sibling}}function Cm(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var a=t.stateNode;a.paired!==null&&(a.paired=null,qi(t.child,!1))}Cm(t)}t=t.sibling}}function ed(t){if(t.tag===30)t.stateNode.paired=null,qi(t.child,!1),Cm(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)ed(t),t=t.sibling;else Cm(t)}function Z2(t){for(t=t.child;t!==null;)t.tag===30?qi(t.child,!1):(t.subtreeFlags&33554432)!==0&&Z2(t),t=t.sibling}function Nm(t,a,s,u,p,x,A){for(var L=!1;a!==null;){if(a.tag===5){var G=a.stateNode;if(x!==null&&Ma<x.length){var ie=x[Ma],he=ip(G);(ie.view||he.view)&&(L=!0);var xe;if(xe=(t.flags&4)===0)if(he.clip)xe=!0;else{xe=ie.rect;var te=he.rect;xe=xe.y!==te.y||xe.x!==te.x||xe.height!==te.height||xe.width!==te.width}xe&&(t.flags|=4),he.abs?he=!ie.abs:(ie=ie.rect,he=he.rect,he=ie.height!==he.height||ie.width!==he.width),he&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&Ky(G,Ma===0?s:s+"_"+Ma,p),L&&(t.flags&4)!==0||(Ii===null&&(Ii=[]),Ii.push(G,Ma===0?u:u+"_"+Ma,a.memoizedProps)),Ma++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&A?t.flags|=a.flags&32:Nm(t,a.child,s,u,p,x,A)&&(L=!0));a=a.sibling}return L}function J2(t,a){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,u=t.stateNode,p=yr(s,u),x=xr(s.default,s.update),A;A=t.memoizedState,t.memoizedState=null,u=t;var L=t.child;Ma=0,p=Nm(u,L,p,p,x,A,!1),(t.flags&4)!==0&&p&&rl(t,s.onUpdate)}else(t.subtreeFlags&33554432)!==0&&J2(t);t=t.sibling}}var Pn=!1,Ot=!1,Pi=!1,Em=!1,W2=typeof WeakSet=="function"?WeakSet:Set,Hn=null,Hi=!1,hc=!1,td=!1,Tm=!1;function iC(t,a,s){if(t=t.containerInfo,Wm=pl,t=av(t),mh(t)){if("selectionStart"in t)var u={start:t.selectionStart,end:t.selectionEnd};else e:{u=(u=t.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,A=p.focusNode;p=p.focusOffset;try{u.nodeType,A.nodeType}catch{u=null;break e}var L=0,G=-1,ie=-1,he=0,xe=0,te=t,ce=null;t:for(;;){for(var Oe;te!==u||x!==0&&te.nodeType!==3||(G=L+x),te!==A||p!==0&&te.nodeType!==3||(ie=L+p),te.nodeType===3&&(L+=te.nodeValue.length),(Oe=te.firstChild)!==null;)ce=te,te=Oe;for(;;){if(te===t)break t;if(ce===u&&++he===x&&(G=L),ce===A&&++xe===p&&(ie=L),(Oe=te.nextSibling)!==null)break;te=ce,ce=te.parentNode}te=Oe}u=G===-1||ie===-1?null:{start:G,end:ie}}else u=null}u=u||{start:0,end:0}}else u=null;for(ep={focusedElem:t,selectionRange:u},pl=!1,s=(s&335544064)===s,Hn=a,a=s?9270:1024;Hn!==null;){if(t=Hn,s&&(u=t.deletions,u!==null))for(x=0;x<u.length;x++)s&&Sm(u[x]);if(t.alternate===null&&(t.flags&2)!==0)s&&Y2(t),nd(s);else{if(t.tag===22){if(u=t.alternate,t.memoizedState!==null){u!==null&&u.memoizedState===null&&s&&Sm(u),nd(s);continue}else if(u!==null&&u.memoizedState!==null){s&&Y2(t),nd(s);continue}}u=t.child,(t.subtreeFlags&a)!==0&&u!==null?(u.return=t,Hn=u):(s&&Q2(t),nd(s))}}Va=null}function nd(t){for(;Hn!==null;){var a=Hn,s=t,u=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((p&1024)!==0&&u!==null){s=void 0,p=u.memoizedProps,u=u.memoizedState;var x=a.stateNode;try{var A=ss(a.type,p);s=x.getSnapshotBeforeUpdate(A,u),x.__reactInternalSnapshotBeforeUpdate=s}catch(L){Lt(a,a.return,L)}}break;case 3:if((p&1024)!==0){if(u=a.stateNode.containerInfo,s=u.nodeType,s===9)sp(u);else if(s===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":sp(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&u!==null&&(s=yr(u.memoizedProps,u.stateNode),p=a.memoizedProps,p=xr(p.default,p.update),p!=="none"&&Zs(u,s,p,u.memoizedState=[],!0));break;default:if((p&1024)!==0)throw Error(r(163))}if(u=a.sibling,u!==null){u.return=a.return,Hn=u;break}Hn=a.return}}function ey(t,a,s){var u=s.flags;switch(s.tag){case 0:case 11:case 15:Fi(t,s),u&4&&dc(5,s);break;case 1:if(Fi(t,s),u&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(A){Lt(s,s.return,A)}else{var p=ss(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(p,a,t.__reactInternalSnapshotBeforeUpdate)}catch(A){Lt(s,s.return,A)}}u&64&&F2(s),u&512&&Bi(s,s.return);break;case 3:if(Fi(t,s),u&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{_v(t,a)}catch(A){Lt(s,s.return,A)}}break;case 27:a===null&&u&4&&G2(s);case 26:case 5:Fi(t,s),a===null&&u&4&&ym(s),u&512&&Bi(s,s.return);break;case 12:Fi(t,s);break;case 31:Fi(t,s),u&4&&iy(t,s);break;case 13:Fi(t,s),u&4&&ry(t,s),u&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=gC.bind(null,s),ZC(t,s))));break;case 22:if(u=s.memoizedState!==null||Pn,!u){var x=a!==null&&a.memoizedState!==null||Ot;a=Pn,p=Ot,Pn=u,(Ot=x)&&!p?(u=2,(s.subtreeFlags&8772)!==0&&(u|=1),bi(t,s,u)):Fi(t,s),Pn=a,Ot=p}break;case 30:Fi(t,s),u&512&&Bi(s,s.return);break;case 7:u&512&&Bi(s,s.return);default:Fi(t,s)}}function Mm(t,a){for(t=t.child;t!==null;)ty(t,a),t=t.sibling}function ty(t,a){switch(t.tag){case 5:case 26:try{var s=t.stateNode;if(a){var u=s.style;typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"}else{var p=t.stateNode,x=t.memoizedProps.style,A=x!=null&&x.hasOwnProperty("display")?x.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(G){Lt(t,t.return,G)}Am(t,a);break;case 6:try{t.stateNode.nodeValue=a?"":t.memoizedProps,Ge=!0}catch(G){Lt(t,t.return,G)}break;case 18:try{var L=t.stateNode;a?Yy(L,!0):Yy(t.stateNode,!1)}catch(G){Lt(t,t.return,G)}break;case 22:case 23:t.memoizedState===null&&Mm(t,a);break;default:Mm(t,a)}}function Am(t,a){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var s=t,u=a;switch(s.tag){case 4:ty(s,u);break e;case 22:s.memoizedState===null&&Am(s,u);break e;default:Am(s,u)}}t=t.sibling}}function ny(t){var a=t.alternate;a!==null&&(t.alternate=null,ny(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Wr(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var an=null,Aa=!1;function yi(t,a,s){for(s=s.child;s!==null;)ay(t,a,s),s=s.sibling}function ay(t,a,s){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(Yt,s)}catch{}switch(s.tag){case 26:Ot||Qn(s,a),yi(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Ot&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ot||Qn(s,a),fc(s);var u=an,p=Aa;wo(s.type)&&(an=s.stateNode,Aa=!1),yi(t,a,s),sx(s.stateNode,s.type,s.memoizedProps),an=u,Aa=p;break;case 5:Ot||Qn(s,a),fc(s);case 6:if(s.tag===6&&fc(s),u=an,p=Aa,an=null,yi(t,a,s),an=u,Aa=p,an!==null)if(Aa)try{(an.nodeType===9?an.body:an.nodeName==="HTML"?an.ownerDocument.body:an).removeChild(s.stateNode),Ge=!0}catch(x){Lt(s,a,x)}else try{an.removeChild(s.stateNode),Ge=!0}catch(x){Lt(s,a,x)}break;case 18:an!==null&&(Aa?(t=an,Gy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),gl(t)):Gy(an,s.stateNode));break;case 4:u=an,p=Aa,an=s.stateNode.containerInfo,Aa=!0,yi(t,a,s),an=u,Aa=p;break;case 0:case 11:case 14:case 15:po(2,s,a),Ot||po(4,s,a),yi(t,a,s);break;case 1:Ot||(Qn(s,a),u=s.stateNode,typeof u.componentWillUnmount=="function"&&U2(s,a,u)),yi(t,a,s);break;case 21:yi(t,a,s);break;case 22:Ot=(u=Ot)||s.memoizedState!==null,yi(t,a,s),Ot=u;break;case 30:Qn(s,a),yi(t,a,s);break;case 7:Ot||Qn(s,a),yi(t,a,s);break;default:yi(t,a,s)}}function iy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{gl(t)}catch(s){Lt(a,a.return,s)}}}function ry(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{gl(t)}catch(s){Lt(a,a.return,s)}}function rC(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new W2),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new W2),a;default:throw Error(r(435,t.tag))}}function ad(t,a){var s=rC(t);a.forEach(function(u){if(!s.has(u)){s.add(u);var p=vC.bind(null,t,u);u.then(p,p)}})}function ba(t,a,s){var u=a.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],A=t,L=a,G=L;e:for(;G!==null;){switch(G.tag){case 27:if(wo(G.type)){an=G.stateNode,Aa=!1;break e}break;case 5:an=G.stateNode,Aa=!1;break e;case 3:case 4:an=G.stateNode.containerInfo,Aa=!0;break e}G=G.return}if(an===null)throw Error(r(160));ay(A,L,x),an=null,Aa=!1,A=x.alternate,A!==null&&(A.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)oy(a,t,s),a=a.sibling}var xi=null;function oy(t,a,s){var u=t.alternate,p=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(p&4&&(u=t.updateQueue,u=u!==null?u.events:null,u!==null))for(var x=0;x<u.length;x++){var A=u[x];A.ref.impl=A.nextImpl}ba(a,t,s),ja(t),p&4&&(po(3,t,t.return),dc(3,t),po(5,t,t.return));break;case 1:ba(a,t,s),ja(t),p&512&&(Ot||u===null||Qn(u,u.return)),p&64&&Pn&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?a:s.concat(a))));break;case 26:if(x=xi,ba(a,t,s),ja(t),p&512&&(Ot||u===null||Qn(u,u.return)),p&4)if(p=u!==null?u.memoizedState:null,s=t.memoizedState,u===null)if(s===null)if(t.stateNode===null)if(Pn)t.stateNode=Uy(t.type,t.memoizedProps,a.containerInfo,t);else{e:{a=t.type,s=t.memoizedProps,p=x.ownerDocument||x;t:switch(a){case"title":u=p.getElementsByTagName("title")[0],(!u||u[mr]||u[en]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=p.createElement(a),p.head.insertBefore(u,p.querySelector("head > title"))),Zn(u,a,s),u[en]=t,je(u),a=u;break e;case"link":if(x=hx("link","href",p).get(a+(s.href||""))){for(A=0;A<x.length;A++)if(u=x[A],u.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&u.getAttribute("rel")===(s.rel==null?null:s.rel)&&u.getAttribute("title")===(s.title==null?null:s.title)&&u.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(A,1);break t}}u=p.createElement(a),Zn(u,a,s),p.head.appendChild(u);break;case"meta":if(x=hx("meta","content",p).get(a+(s.content||""))){for(A=0;A<x.length;A++)if(u=x[A],u.getAttribute("content")===(s.content==null?null:""+s.content)&&u.getAttribute("name")===(s.name==null?null:s.name)&&u.getAttribute("property")===(s.property==null?null:s.property)&&u.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&u.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(A,1);break t}}u=p.createElement(a),Zn(u,a,s),p.head.appendChild(u);break;default:throw Error(r(468,a))}u[en]=t,je(u),a=u}t.stateNode=a}else Pn||mp(x,t.type,t.stateNode);else t.stateNode=fx(x,s,t.memoizedProps);else p!==s?(p===null?(a=u.stateNode,a===null||Ot||a.parentNode.removeChild(a)):p.count--,s===null?Pn||mp(x,t.type,t.stateNode):fx(x,s,t.memoizedProps)):s===null&&t.stateNode!==null&&xm(t,t.memoizedProps,u.memoizedProps);break;case 27:ba(a,t,s),ja(t),p&512&&(Ot||u===null||Qn(u,u.return)),u!==null&&p&4&&xm(t,t.memoizedProps,u.memoizedProps);break;case 5:if(x=Pi,Pi=!1,ba(a,t,s),Pi=x,ja(t),p&512&&(Ot||u===null||Qn(u,u.return)),t.flags&32){a=t.stateNode;try{mt(a,""),Ge=!0}catch(he){Lt(t,t.return,he)}}p&4&&t.stateNode!=null&&(a=t.memoizedProps,xm(t,a,u!==null?u.memoizedProps:a)),p&1024&&(Em=!0);break;case 6:if(ba(a,t,s),ja(t),p&4){if(t.stateNode===null)throw Error(r(162));a=t.memoizedProps,s=t.stateNode;try{s.nodeValue=a,Ge=!0}catch(he){Lt(t,t.return,he)}}break;case 3:if(Ge=!1,yd=null,x=xi,xi=wc(a.containerInfo),ba(a,t,s),xi=x,ja(t),p&4&&u!==null&&u.memoizedState.isDehydrated)try{gl(a.containerInfo)}catch(he){Lt(t,t.return,he)}Em&&(Em=!1,sy(t)),Ge=!1;break;case 4:p=Pi,Pi=Pn,u=bn(),x=xi,xi=wc(t.stateNode.containerInfo),ba(a,t,s),ja(t),xi=x,Ge&&hc&&(td=!0),Ge=u,Pi=p;break;case 12:ba(a,t,s),ja(t);break;case 31:ba(a,t,s),ja(t),p&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,ad(t,a)));break;case 13:ba(a,t,s),ja(t),t.child.flags&8192&&t.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(od=ze()),p&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,ad(t,a)));break;case 22:x=t.memoizedState!==null,A=u!==null&&u.memoizedState!==null;var L=Pn,G=Ot,ie=Pi;Pn=L||x,Pi=ie||x,Ot=G||A,ba(a,t,s),Ot=G,Pi=ie,Pn=L,ja(t),p&8192&&(a=t.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,!x||u===null||A||Pn||Ot||(a=A||Ot,s=Pn,u=Ot,Pn=x||Pn,Ot=a,go(t,2),Pn=s,Ot=u),!x&&Pi||Mm(t,x)),p&4&&(a=t.updateQueue,a!==null&&(s=a.retryQueue,s!==null&&(a.retryQueue=null,ad(t,s))));break;case 19:ba(a,t,s),ja(t),p&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,ad(t,a)));break;case 30:p&512&&(Ot||u===null||Qn(u,u.return)),p=bn(),x=hc,A=(s&335544064)===s,L=t.memoizedProps,hc=A&&xr(L.default,L.update)!=="none",ba(a,t,s),ja(t),A&&u!==null&&Ge&&(t.flags|=4),hc=x,Ge=p;break;case 21:break;case 7:p&512&&(Ot||u===null||Qn(u,u.return)),u&&u.stateNode!==null&&(u.stateNode._fragmentFiber=t);default:ba(a,t,s),ja(t)}}function ja(t){var a=t.flags;if(a&2){try{for(var s,u=t.return;u!==null;){if(V2(u)){s=u;break}u=u.return}u=null;for(var p=t.return;p!==null;){if(vm(p)){var x=p.stateNode;u===null?u=[x]:u.push(x)}if(gm(p))break;p=p.return}var A=u;if(s==null)throw Error(r(160));switch(s.tag){case 27:var L=s.stateNode,G=bm(t);Zu(t,G,L,A);break;case 5:var ie=s.stateNode;s.flags&32&&(mt(ie,""),s.flags&=-33);var he=bm(t);Zu(t,he,ie,A);break;case 3:case 4:var xe=s.stateNode.containerInfo,te=bm(t);jm(t,te,xe,A);break;default:throw Error(r(161))}}catch(ce){Lt(t,t.return,ce)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function sy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;sy(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,pl=!0,a.reset(),pl=!1),t=t.sibling}}function Js(t,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)ly(a,t),a=a.sibling;else J2(a)}function ly(t,a){var s=t.alternate;if(s===null)wm(t,!1);else switch(t.tag){case 3:if(Tm=Hi=!1,K2(),Js(a,t),!Hi&&!td){if(t=Ii,t!==null)for(var u=0;u<t.length;u+=3){s=t[u];var p=t[u+1];Xy(s,t[u+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+p+")"})}t=a.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Tm=!0}Ii=null;break;case 5:Js(a,t);break;case 4:u=Hi,Hi=!1,Js(a,t),Hi&&(td=!0),Hi=u;break;case 22:t.memoizedState===null&&(s.memoizedState!==null?wm(t,!1):Js(a,t));break;case 30:u=Hi,p=K2(),Hi=!1,Js(a,t),Hi&&(t.flags|=4);var x=t.memoizedProps,A=t.stateNode;a=yr(x,A),A=yr(s.memoizedProps,A);var L=xr(x.default,x.update);L==="none"?a=!1:(x=s.memoizedState,s.memoizedState=null,s=t.child,Ma=0,a=Nm(t,s,a,A,L,x,!0),Ma!==(x===null?0:x.length)&&(t.flags|=32)),(t.flags&4)!==0&&a?(rl(t,t.memoizedProps.onUpdate),Ii=p):p!==null&&(p.push.apply(p,Ii),Ii=p),Hi=(t.flags&32)!==0?!0:u;break;default:Js(a,t)}}function Fi(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)ey(t,a.alternate,a),a=a.sibling}function go(t,a){for(t=t.child;t!==null;){var s=t,u=a;switch(s.tag){case 0:case 11:case 14:case 15:po(4,s,s.return),go(s,u);break;case 1:Qn(s,s.return);var p=s.stateNode;typeof p.componentWillUnmount=="function"&&U2(s,s.return,p),go(s,u);break;case 27:(u&2)!==0&&sx(s.stateNode,s.type,s.memoizedProps);case 5:Qn(s,s.return),s.tag!==5&&s.tag!==27||fc(s),go(s,u);break;case 6:fc(s);break;case 26:Qn(s,s.return),p=s.stateNode,s.memoizedState!==null||p===null||Ot||p.parentNode.removeChild(p),go(s,u);break;case 22:s.memoizedState===null&&go(s,u);break;case 30:Qn(s,s.return),go(s,u);break;case 7:Qn(s,s.return);default:go(s,u)}t=t.sibling}}function bi(t,a,s){for(s=(a.subtreeFlags&8772)!==0?s:s&-2,a=a.child;a!==null;){var u=a.alternate,p=t,x=a,A=x.flags,L=(s&1)!==0;switch(x.tag){case 0:case 11:case 15:bi(p,x,s),dc(4,x);break;case 1:if(bi(p,x,s),u=x,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(he){Lt(u,u.return,he)}if(u=x,p=u.updateQueue,p!==null){var G=u.stateNode;try{var ie=p.shared.hiddenCallbacks;if(ie!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ie.length;p++)Av(ie[p],G)}catch(he){Lt(u,u.return,he)}}L&&A&64&&F2(x),Bi(x,x.return);break;case 27:(s&2)!==0&&G2(x);case 5:x.tag!==5&&x.tag!==27||$2(x),bi(p,x,s),L&&u===null&&A&4&&ym(x),Bi(x,x.return);break;case 6:$2(x);break;case 26:G=x.stateNode,x.memoizedState!==null||G===null||Pn||mp(wc(G.ownerDocument),x.type,G),bi(p,x,s),L&&u===null&&A&4&&ym(x),Bi(x,x.return);break;case 12:bi(p,x,s);break;case 31:bi(p,x,s),L&&A&4&&iy(p,x);break;case 13:bi(p,x,s),L&&A&4&&ry(p,x);break;case 22:x.memoizedState===null&&bi(p,x,s),Bi(x,x.return);break;case 30:bi(p,x,s),Bi(x,x.return);break;case 7:Bi(x,x.return);default:bi(p,x,s)}a=a.sibling}}function _m(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Jl(s))}function Rm(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Jl(t))}function li(t,a,s,u){var p=(s&335544064)===s;if(a.subtreeFlags&(p?10262:10256))for(a=a.child;a!==null;)cy(t,a,s,u),a=a.sibling;else p&&Z2(a)}function cy(t,a,s,u){var p=(s&335544064)===s;p&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&ed(a);var x=a.flags;switch(a.tag){case 0:case 11:case 15:li(t,a,s,u),x&2048&&dc(9,a);break;case 1:li(t,a,s,u);break;case 3:li(t,a,s,u),p&&Tm&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),x&2048&&(x=null,a.alternate!==null&&(x=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==x&&(a.refCount++,x!=null&&Jl(x)));break;case 12:if(x&2048){li(t,a,s,u),x=a.stateNode;try{var A=a.memoizedProps,L=A.id,G=A.onPostCommit;typeof G=="function"&&G(L,a.alternate===null?"mount":"update",x.passiveEffectDuration,-0)}catch(ie){Lt(a,a.return,ie)}}else li(t,a,s,u);break;case 31:li(t,a,s,u);break;case 13:li(t,a,s,u);break;case 23:break;case 22:A=a.stateNode,L=a.alternate,a.memoizedState!==null?(p&&L!==null&&L.memoizedState===null&&ed(L),A._visibility&2?li(t,a,s,u):mc(t,a)):(p&&L!==null&&L.memoizedState!==null&&ed(a),A._visibility&2?li(t,a,s,u):(A._visibility|=2,Ws(t,a,s,u,(a.subtreeFlags&10256)!==0||!1))),x&2048&&_m(L,a);break;case 24:li(t,a,s,u),x&2048&&Rm(a.alternate,a);break;case 30:p&&(x=a.alternate,x!==null&&(qi(x.child,!0),qi(a.child,!0))),li(t,a,s,u);break;default:li(t,a,s,u)}}function Ws(t,a,s,u,p){for(p=p&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=t,A=a,L=s,G=u,ie=A.flags;switch(A.tag){case 0:case 11:case 15:Ws(x,A,L,G,p),dc(8,A);break;case 23:break;case 22:var he=A.stateNode;A.memoizedState!==null?he._visibility&2?Ws(x,A,L,G,p):mc(x,A):(he._visibility|=2,Ws(x,A,L,G,p)),p&&ie&2048&&_m(A.alternate,A);break;case 24:Ws(x,A,L,G,p),p&&ie&2048&&Rm(A.alternate,A);break;default:Ws(x,A,L,G,p)}a=a.sibling}}function mc(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,u=a,p=u.flags;switch(u.tag){case 22:mc(s,u),p&2048&&_m(u.alternate,u);break;case 24:mc(s,u),p&2048&&Rm(u.alternate,u);break;default:mc(s,u)}a=a.sibling}}var ls=8192;function cs(t,a,s){if(t.subtreeFlags&ls)for(t=t.child;t!==null;)uy(t,a,s),t=t.sibling}function uy(t,a,s){switch(t.tag){case 26:cs(t,a,s),t.flags&ls&&(t.memoizedState!==null?d7(s,xi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(a&335544128)===a&&vx(s,t)));break;case 5:cs(t,a,s),t.flags&ls&&(t=t.stateNode,(a&335544128)===a&&vx(s,t));break;case 3:case 4:var u=xi;xi=wc(t.stateNode.containerInfo),cs(t,a,s),xi=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=ls,ls=16777216,cs(t,a,s),ls=u):cs(t,a,s));break;case 30:if((t.flags&ls)!==0&&(u=t.memoizedProps.name,u!=null&&u!=="auto")){var p=t.stateNode;p.paired=null,Va===null&&(Va=new Map),Va.set(u,p)}cs(t,a,s);break;default:cs(t,a,s)}}function dy(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function pc(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var u=a[s];Hn=u,hy(u,t)}dy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)fy(t),t=t.sibling}function fy(t){switch(t.tag){case 0:case 11:case 15:pc(t),t.flags&2048&&po(9,t,t.return);break;case 3:pc(t);break;case 12:pc(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,id(t)):pc(t);break;default:pc(t)}}function id(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var u=a[s];Hn=u,hy(u,t)}dy(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:po(8,a,a.return),id(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,id(a));break;default:id(a)}t=t.sibling}}function hy(t,a){for(;Hn!==null;){var s=Hn;switch(s.tag){case 0:case 11:case 15:po(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var u=s.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Jl(s.memoizedState.cache)}if(u=s.child,u!==null)u.return=s,Hn=u;else e:for(s=t;Hn!==null;){u=Hn;var p=u.sibling,x=u.return;if(ny(u),u===s){Hn=null;break e}if(p!==null){p.return=x,Hn=p;break e}Hn=x}}}var oC={getCacheForType:function(t){var a=Yn(Sn),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Yn(Sn).controller.signal}},sC=typeof WeakMap=="function"?WeakMap:Map,Rt=0,Ut=null,bt=null,St=0,Dt=0,Ga=null,vo=!1,el=!1,Om=!1,Tr=0,gn=0,yo=0,us=0,rd=0,Ya=0,tl=0,gc=null,_a=null,zm=!1,od=0,my=0,sd=1/0,ld=null,xo=null,cn=0,ji=null,ds=null,Ui=0,Dm=0,Lm=null,py=null,nl=null,al=null,il=null,vc=0,cd=null;function Ka(){return(Rt&2)!==0&&St!==0?St&-St:ve.T!==null?Gm():Ea()}function gy(){if(Ya===0)if((St&536870912)===0||pt){var t=Pa;Pa<<=1,(Pa&3932160)===0&&(Pa=262144),Ya=t}else Ya=536870912;return t=Kn.current,t!==null&&(t.flags|=32),Ya}function rl(t,a){if(a!=null){var s=t.stateNode,u=s.ref;u===null&&(u=s.ref=Qy(yr(t.memoizedProps,s))),al===null&&(al=[]),al.push(a.bind(null,u))}}function Ra(t,a,s){(t===Ut&&(Dt===2||Dt===9)||t.cancelPendingCommit!==null)&&(ol(t,0),bo(t,St,Ya,!1)),pi(t,s),((Rt&2)===0||t!==Ut)&&(t===Ut&&((Rt&2)===0&&(us|=s),gn===4&&bo(t,St,Ya,!1)),$i(t))}function vy(t,a,s){if((Rt&6)!==0)throw Error(r(327));var u=!s&&(a&127)===0&&(a&t.expiredLanes)===0||na(t,a),p=u?uC(t,a):Im(t,a,!0),x=u;do{if(p===0){el&&!u&&bo(t,a,0,!1);break}else{if(s=t.current.alternate,x&&!lC(s)){p=Im(t,a,!1),x=!1;continue}if(p===2){if(x=a,t.errorRecoveryDisabledLanes&x)var A=0;else A=t.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){a=A;e:{var L=t;p=gc;var G=L.current.memoizedState.isDehydrated;if(G&&(ol(L,A).flags|=256),A=Im(L,A,!1),A!==2&&A!==6){if(Om&&!G){L.errorRecoveryDisabledLanes|=x,us|=x,p=4;break e}x=_a,_a=p,x!==null&&(_a===null?_a=x:_a.push.apply(_a,x))}p=A}if(x=!1,p!==2)continue}}if(p===1){ol(t,0),bo(t,a,0,!0);break}e:{switch(u=t,x=p,x){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:bo(u,a,Ya,!vo);break e;case 2:_a=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(p=od+300-ze(),10<p)){if(bo(u,a,Ya,!vo),ft(u,0,!0)!==0)break e;Ui=a,u.timeoutHandle=ap(yy.bind(null,u,s,_a,ld,zm,a,Ya,us,tl,vo,x,"Throttled",-0,0),p);break e}yy(u,s,_a,ld,zm,a,Ya,us,tl,vo,x,null,-0,0)}}break}while(!0);$i(t)}function yy(t,a,s,u,p,x,A,L,G,ie,he,xe,te,ce){t.timeoutHandle=-1;var Oe=a.subtreeFlags,Ie=(x&335544064)===x;if(xe=null,(Ie||Oe&8192||(Oe&16785408)===16785408)&&(xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:va},Va=null,uy(a,x,xe),Ie&&(Oe=xe,Ie=t.containerInfo,Ie=(Ie.nodeType===9?Ie:Ie.ownerDocument).__reactViewTransition,Ie!=null&&(Oe.count++,Oe.waitingForViewTransition=!0,Oe=Cc.bind(Oe),Ie.finished.then(Oe,Oe))),Oe=(x&62914560)===x?od-ze():(x&4194048)===x?my-ze():0,Oe=f7(xe,Oe),Oe!==null)){Ui=x,t.cancelPendingCommit=Oe(Ny.bind(null,t,a,x,s,u,p,A,L,G,ie,he,xe,null,te,ce)),bo(t,x,A,!ie);return}Ny(t,a,x,s,u,p,A,L,G,ie,he,xe)}function lC(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var u=0;u<s.length;u++){var p=s[u],x=p.getSnapshot;p=p.value;try{if(!Ua(x(),p))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function bo(t,a,s,u){a=Oi(t,a),a&=~rd,a&=~us,t.suspendedLanes|=a,t.pingedLanes&=~a,u&&(t.warmLanes|=a),u=t.expirationTimes;for(var p=a;0<p;){var x=31-sn(p),A=1<<x;u[x]=-1,p&=~A}s!==0&&ma(t,s,a)}function ud(){return(Rt&6)===0?(yc(0),!1):!0}function Bm(){if(bt!==null){if(Dt===0)var t=bt.return;else t=bt,wr=Jo=null,Vh(t),Gs=null,tc=0,t=bt;for(;t!==null;)H2(t.alternate,t),t=t.return;bt=null}}function ol(t,a){var s=t.timeoutHandle;return s!==-1&&(t.timeoutHandle=-1,RC(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Ui=0,Bm(),Ut=t,bt=s=br(t.current,null),St=a,Dt=0,Ga=null,vo=!1,el=na(t,a),Om=!1,tl=Ya=rd=us=yo=gn=0,_a=gc=null,zm=!1,Tr=Oi(t,a),yu(),s}function xy(t,a){ct=null,ve.H=Uu,a===Vs||a===Mu?(a=Nv(),Dt=3):a===Rh?(a=Nv(),Dt=4):Dt=a===om?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ga=a,bt===null&&(gn=1,$u(t,ii(a,t.current)))}function by(){var t=Kn.current;return t===null?!0:(St&4194048)===St?ra===null:(St&62914560)===St||(St&536870912)!==0?t===ra:!1}function jy(){var t=ve.H;return ve.H=Uu,t===null?Uu:t}function wy(){var t=ve.A;return ve.A=oC,t}function dd(){gn=4,vo||(St&4194048)!==St&&Kn.current!==null||(el=!0),(yo&134217727)===0&&(us&134217727)===0||Ut===null||bo(Ut,St,Ya,!1)}function Im(t,a,s){var u=Rt;Rt|=2;var p=jy(),x=wy();(Ut!==t||St!==a)&&(ld=null,ol(t,a)),a=!1;var A=gn;e:do try{if(Dt!==0&&bt!==null){var L=bt,G=Ga;switch(Dt){case 8:Bm(),A=6;break e;case 3:case 2:case 9:case 6:Kn.current===null&&(a=!0);var ie=Dt;if(Dt=0,Ga=null,sl(t,L,G,ie),s&&el){A=0;break e}break;default:ie=Dt,Dt=0,Ga=null,sl(t,L,G,ie)}}cC(),A=gn;break}catch(he){xy(t,he)}while(!0);return a&&t.shellSuspendCounter++,wr=Jo=null,Rt=u,ve.H=p,ve.A=x,bt===null&&(Ut=null,St=0,yu()),A}function cC(){for(;bt!==null;)ky(bt)}function uC(t,a){var s=Rt;Rt|=2;var u=jy(),p=wy();Ut!==t||St!==a?(ld=null,sd=ze()+500,ol(t,a)):el=na(t,a);e:do try{if(Dt!==0&&bt!==null){a=bt;var x=Ga;t:switch(Dt){case 1:Dt=0,Ga=null,sl(t,a,x,1);break;case 2:case 9:if(Sv(x)){Dt=0,Ga=null,Sy(a);break}a=function(){Dt!==2&&Dt!==9||Ut!==t||(Dt=7),$i(t)},x.then(a,a);break e;case 3:Dt=7;break e;case 4:Dt=5;break e;case 7:Sv(x)?(Dt=0,Ga=null,Sy(a)):(Dt=0,Ga=null,sl(t,a,x,7));break;case 5:var A=null;switch(bt.tag){case 26:A=bt.memoizedState;case 5:case 27:var L=bt;if(A?px(A):L.stateNode.complete){Dt=0,Ga=null;var G=L.sibling;if(G!==null)bt=G;else{var ie=L.return;ie!==null?(bt=ie,fd(ie)):bt=null}break t}}Dt=0,Ga=null,sl(t,a,x,5);break;case 6:Dt=0,Ga=null,sl(t,a,x,6);break;case 8:Bm(),gn=6;break e;default:throw Error(r(462))}}dC();break}catch(he){xy(t,he)}while(!0);return wr=Jo=null,ve.H=u,ve.A=p,Rt=s,bt!==null?0:(Ut=null,St=0,yu(),gn)}function dC(){for(;bt!==null&&!_e();)ky(bt)}function ky(t){var a=q2(t.alternate,t,Tr);t.memoizedProps=t.pendingProps,a===null?fd(t):bt=a}function Sy(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=R2(s,a,a.pendingProps,a.type,void 0,St);break;case 11:a=R2(s,a,a.pendingProps,a.type.render,a.ref,St);break;case 5:Vh(a);var u=a;u===qn&&(pt?(Su(u),u.tag===5&&u.stateNode!=null&&(Qt=u.stateNode)):(Su(u),pt=!0));default:H2(s,a),a=bt=hv(a,Tr),a=q2(s,a,Tr)}t.memoizedProps=t.pendingProps,a===null?fd(t):bt=a}function sl(t,a,s,u){wr=Jo=null,Vh(a),Gs=null,tc=0;var p=a.return;try{if(J8(t,p,a,s,St)){gn=1,$u(t,ii(s,t.current)),bt=null;return}}catch(x){if(p!==null)throw bt=p,x;gn=1,$u(t,ii(s,t.current)),bt=null;return}a.flags&32768?(pt||u===1?t=!0:el||(St&536870912)!==0?t=!1:(vo=t=!0,(u===2||u===9||u===3||u===6)&&(u=Kn.current,u!==null&&u.tag===13&&(u.flags|=16384))),Cy(a,t)):fd(a)}function fd(t){var a=t;do{if((a.flags&32768)!==0){Cy(a,vo);return}t=a.return;var s=nC(a.alternate,a,Tr);if(s!==null){bt=s;return}if(a=a.sibling,a!==null){bt=a;return}bt=a=t}while(a!==null);gn===0&&(gn=5)}function Cy(t,a){do{var s=aC(t.alternate,t);if(s!==null){s.flags&=32767,bt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){bt=t;return}bt=t=s}while(t!==null);gn=6,bt=null}function Ny(t,a,s,u,p,x,A,L,G,ie,he,xe){t.cancelPendingCommit=null;do hd();while(cn!==0);if((Rt&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));t===Ut&&(bt=Ut=null,St=0),ds=a,ji=t,Ui=s,Lm=p,py=u,fC(t,a,s,A,L,G,xe)}}function fC(t,a,s,u,p,x,A){var L=a.lanes|a.childLanes;if(Dm=L,L|=xh,$n(t,s,L,u,p,x),al=null,(s&335544064)===s?(il=P8(t),u=10262):(il=null,u=10256),(a.subtreeFlags&u)!==0||(a.flags&u)!==0?(t.callbackNode=null,t.callbackPriority=0,yC(yn,function(){return Fm(),null})):(t.callbackNode=null,t.callbackPriority=0),Ju=!1,u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=ve.T,ve.T=null,p=re.p,re.p=2,x=Rt,Rt|=4;try{iC(t,a,s)}finally{Rt=x,re.p=p,ve.T=u}}cn=1,Ju?nl=IC(A,t.containerInfo,il,qm,Pm,mC,Hm,Fm,hC):(qm(),Pm(),Hm())}function hC(t){if(cn!==0){var a=ji.onRecoverableError;a(t,{componentStack:null})}}function mC(){cn===3&&(cn=0,ly(ds,ji),cn=4)}function qm(){if(cn===1){cn=0;var t=ji,a=ds,s=Ui,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=ve.T,ve.T=null;var p=re.p;re.p=2;var x=Rt;Rt|=4;try{hc=td=!1,oy(a,t,s),s=ep;var A=av(t.containerInfo),L=s.focusedElem,G=s.selectionRange;if(A!==L&&L&&L.ownerDocument&&nv(L.ownerDocument.documentElement,L)){if(G!==null&&mh(L)){var ie=G.start,he=G.end;if(he===void 0&&(he=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(he,L.value.length);else{var xe=L.ownerDocument||document,te=xe&&xe.defaultView||window;if(te.getSelection){var ce=te.getSelection(),Oe=L.textContent.length,Ie=Math.min(G.start,Oe),ut=G.end===void 0?Ie:Math.min(G.end,Oe);!ce.extend&&Ie>ut&&(A=ut,ut=Ie,Ie=A);var ae=tv(L,Ie),J=tv(L,ut);if(ae&&J&&(ce.rangeCount!==1||ce.anchorNode!==ae.node||ce.anchorOffset!==ae.offset||ce.focusNode!==J.node||ce.focusOffset!==J.offset)){var oe=xe.createRange();oe.setStart(ae.node,ae.offset),ce.removeAllRanges(),Ie>ut?(ce.addRange(oe),ce.extend(J.node,J.offset)):(oe.setEnd(J.node,J.offset),ce.addRange(oe))}}}}for(xe=[],ce=L;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<xe.length;L++){var ye=xe[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}pl=!!Wm,ep=Wm=null}finally{Rt=x,re.p=p,ve.T=u}}t.current=a,cn=2}}function Pm(){if(cn===2){cn=0;var t=ji,a=ds,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=ve.T,ve.T=null;var u=re.p;re.p=2;var p=Rt;Rt|=4;try{ey(t,a.alternate,a)}finally{Rt=p,re.p=u,ve.T=s}}cn=3}}function Hm(){if(cn===4||cn===3){cn=0;var t=nl;nl=null,Be();var a=ji,s=ds,u=Ui,p=py,x=(u&335544064)===u?10262:10256;if((s.subtreeFlags&x)!==0||(s.flags&x)!==0?cn=5:(cn=0,ds=ji=null,Ey(a,a.pendingLanes)),x=a.pendingLanes,x===0&&(xo=null),pa(u),s=s.stateNode,xn&&typeof xn.onCommitFiberRoot=="function")try{xn.onCommitFiberRoot(Yt,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=ve.T,x=re.p,re.p=2,ve.T=null;try{for(var A=a.onRecoverableError,L=0;L<p.length;L++){var G=p[L];A(G.value,{componentStack:G.stack})}}finally{ve.T=s,re.p=x}}if(p=al,A=il,il=null,p!==null&&(al=null,A===null&&(A=[]),t!==null))for(G=0;G<p.length;G++)s=(0,p[G])(A),s!==void 0&&t.finished.finally(s);(Ui&3)!==0&&hd(),$i(a),x=a.pendingLanes,(u&261930)!==0&&(x&42)!==0?a===cd?vc++:(vc=0,cd=a):(vc=0,cd=null),yc(0)}}function Ey(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Jl(a)))}function hd(){return nl!==null&&(nl.skipTransition(),nl=null),qm(),Pm(),Hm(),Fm()}function Fm(){if(cn!==5)return!1;var t=ji,a=Dm;Dm=0;var s=pa(Ui),u=ve.T,p=re.p;try{re.p=32>s?32:s,ve.T=null,s=Lm,Lm=null;var x=ji,A=Ui;if(cn=0,ds=ji=null,Ui=0,(Rt&6)!==0)throw Error(r(331));var L=Rt;if(Rt|=4,fy(x.current),cy(x,x.current,A,s),Rt=L,yc(0,!1),xn&&typeof xn.onPostCommitFiberRoot=="function")try{xn.onPostCommitFiberRoot(Yt,x)}catch{}return!0}finally{re.p=p,ve.T=u,Ey(t,a)}}function Ty(t,a,s){a=ii(s,a),a=rm(t.stateNode,a,2),t=uo(t,a,2),t!==null&&(pi(t,2),$i(t))}function Lt(t,a,s){if(t.tag===3)Ty(t,t,s);else for(;a!==null;){if(a.tag===3){Ty(a,t,s);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(xo===null||!xo.has(u))){t=ii(s,t),s=S2(2),u=uo(a,s,2),u!==null&&(C2(s,u,a,t),pi(u,2),$i(u));break}}a=a.return}}function Um(t,a,s){var u=t.pingCache;if(u===null){u=t.pingCache=new sC;var p=new Set;u.set(a,p)}else p=u.get(a),p===void 0&&(p=new Set,u.set(a,p));p.has(s)||(Om=!0,p.add(s),t=pC.bind(null,t,a,s),a.then(t,t))}function pC(t,a,s){var u=t.pingCache;u!==null&&u.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ut===t&&(St&s)===s&&((gn===4||gn===3&&(St&62914560)===St&&300>ze()-od)&&(Rt&2)===0?ol(t,0):rd|=s,tl===St&&(tl=0)),$i(t)}function My(t,a){a===0&&(a=fa()),t=Xo(t,a),t!==null&&(pi(t,a),$i(t))}function gC(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),My(t,s)}function vC(t,a){var s=0;switch(t.tag){case 31:case 13:var u=t.stateNode,p=t.memoizedState;p!==null&&(s=p.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(a),My(t,s)}function yC(t,a){return me(t,a)}var ll=null,cl=null,$m=!1,md=!1,Vm=!1,jo=0;function $i(t){t!==cl&&t.next===null&&(cl===null?ll=cl=t:cl=cl.next=t),md=!0,$m||($m=!0,bC())}function yc(t,a){if(!Vm&&md){Vm=!0;do for(var s=!1,u=ll;u!==null;){if(t!==0){var p=u.pendingLanes;if(p===0)var x=0;else{var A=u.suspendedLanes,L=u.pingedLanes;x=(1<<31-sn(42|t)+1)-1,x&=p&~(A&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,Oy(u,x))}else x=St,x=ft(u,u===Ut?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||na(u,x)||(s=!0,Oy(u,x));u=u.next}while(s);Vm=!1}}function xC(){Ay()}function Ay(){md=$m=!1;var t=0;jo!==0&&_C()&&(t=jo);for(var a=ze(),s=null,u=ll;u!==null;){var p=u.next,x=_y(u,a);x===0?(u.next=null,s===null?ll=p:s.next=p,p===null&&(cl=s)):(s=u,(t!==0||(x&3)!==0)&&(md=!0)),u=p}cn!==0&&cn!==5||yc(t),jo!==0&&(jo=0)}function _y(t,a){for(var s=t.suspendedLanes,u=t.pingedLanes,p=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var A=31-sn(x),L=1<<A,G=p[A];G===-1?((L&s)===0||(L&u)!==0)&&(p[A]=ur(L,a)):G<=a&&(t.expiredLanes|=L),x&=~L}if(a=Ut,s=St,s=ft(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,s===0||t===a&&(Dt===2||Dt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Ee(u),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||na(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(u!==null&&Ee(u),pa(s)){case 2:case 8:s=Rn;break;case 32:s=yn;break;case 268435456:s=Ri;break;default:s=yn}return u=Ry.bind(null,t),s=me(s,u),t.callbackPriority=a,t.callbackNode=s,a}return u!==null&&u!==null&&Ee(u),t.callbackPriority=2,t.callbackNode=null,2}function Ry(t,a){if(cn!==0&&cn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(hd()&&t.callbackNode!==s)return null;var u=St;return u=ft(t,t===Ut?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(vy(t,u,a),_y(t,ze()),t.callbackNode!=null&&t.callbackNode===s?Ry.bind(null,t):null)}function Oy(t,a){if(hd())return null;vy(t,a,!0)}function bC(){OC(function(){(Rt&6)!==0?me(ta,xC):Ay()})}function Gm(){if(jo===0){var t=ts;t===0&&(t=Na,Na<<=1,(Na&261888)===0&&(Na=256)),jo=t}return jo}function zy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vn(t)}function jC(t,a,s,u,p){if(a==="submit"&&s&&s.stateNode===p){var x=zy((p[On]||null).action),A=u.submitter;A&&(a=(a=A[On]||null)?zy(a.formAction):A.getAttribute("formAction"),a!==null&&(x=a,A=null));var L=new mu("action","action",null,u,p);t.push({event:L,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(jo!==0){var G=new FormData(p,A);em(s,{pending:!0,data:G,method:p.method,action:x},null,G)}}else typeof x=="function"&&(L.preventDefault(),G=new FormData(p,A),em(s,{pending:!0,data:G,method:p.method,action:x},x,G))},currentTarget:p}]})}}for(var Ym=0;Ym<yh.length;Ym++){var Km=yh[Ym],wC=Km.toLowerCase(),kC=Km[0].toUpperCase()+Km.slice(1);vi(wC,"on"+kC)}vi(ov,"onAnimationEnd"),vi(sv,"onAnimationIteration"),vi(lv,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(R8,"onTransitionRun"),vi(O8,"onTransitionStart"),vi(z8,"onTransitionCancel"),vi(cv,"onTransitionEnd"),yt("onMouseEnter",["mouseout","mouseover"]),yt("onMouseLeave",["mouseout","mouseover"]),yt("onPointerEnter",["pointerout","pointerover"]),yt("onPointerLeave",["pointerout","pointerover"]),st("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),st("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),st("onBeforeInput",["compositionend","keypress","textInput","paste"]),st("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xc="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(" "),SC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xc));function Dy(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var u=t[s],p=u.event;u=u.listeners;e:{var x=void 0;if(a)for(var A=u.length-1;0<=A;A--){var L=u[A],G=L.instance,ie=L.currentTarget;if(L=L.listener,G!==x&&p.isPropagationStopped())break e;x=L,p.currentTarget=ie;try{x(p)}catch(he){vu(he)}p.currentTarget=null,x=G}else for(A=0;A<u.length;A++){if(L=u[A],G=L.instance,ie=L.currentTarget,L=L.listener,G!==x&&p.isPropagationStopped())break e;x=L,p.currentTarget=ie;try{x(p)}catch(he){vu(he)}p.currentTarget=null,x=G}}}}function jt(t,a){var s=a[Ho];s===void 0&&(s=a[Ho]=new Set);var u=t+"__bubble";s.has(u)||(Ly(a,t,2,!1),s.add(u))}function Xm(t,a,s){var u=0;a&&(u|=4),Ly(s,t,u,a)}var pd="_reactListening"+Math.random().toString(36).slice(2);function Qm(t){if(!t[pd]){t[pd]=!0,at.forEach(function(s){s!=="selectionchange"&&(SC.has(s)||Xm(s,!1,t),Xm(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[pd]||(a[pd]=!0,Xm("selectionchange",!1,a))}}function Ly(t,a,s,u){switch(Cx(a)){case 2:var p=g7;break;case 8:p=v7;break;default:p=gp}s=p.bind(null,a,s,t),p=void 0,!Go||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),u?p!==void 0?t.addEventListener(a,s,{capture:!0,passive:p}):t.addEventListener(a,s,!0):p!==void 0?t.addEventListener(a,s,{passive:p}):t.addEventListener(a,s,!1)}function Zm(t,a,s,u,p){var x=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var A=u.tag;if(A===3||A===4){var L=u.stateNode.containerInfo;if(L===p)break;if(A===4)for(A=u.return;A!==null;){var G=A.tag;if((G===3||G===4)&&A.stateNode.containerInfo===p)return;A=A.return}for(;L!==null;){if(A=Ha(L),A===null)return;if(G=A.tag,G===5||G===6||G===26||G===27){u=x=A;continue e}L=L.parentNode}}u=u.return}Vo(function(){var ie=x,he=$o(s),xe=[];e:{var te=uv.get(t);if(te!==void 0){var ce=mu,Oe=t;switch(t){case"keypress":if(fu(s)===0)break e;case"keydown":case"keyup":ce=l8;break;case"focusin":Oe="focus",ce=lh;break;case"focusout":Oe="blur",ce=lh;break;case"beforeblur":case"afterblur":ce=lh;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=q1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Q6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=h8;break;case ov:case sv:case lv:ce=W6;break;case cv:ce=p8;break;case"scroll":case"scrollend":ce=K6;break;case"wheel":ce=v8;break;case"copy":case"cut":case"paste":ce=t8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=H1;break;case"submit":ce=d8;break;case"toggle":case"beforetoggle":ce=x8}var Ie=(a&4)!==0,ut=!Ie&&(t==="scroll"||t==="scrollend"),ae=Ie?te!==null?te+"Capture":null:te;Ie=[];for(var J=ie,oe;J!==null;){var ye=J;if(oe=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||oe===null||ae===null||(ye=vr(J,ae),ye!=null&&Ie.push(bc(J,ye,oe))),ut)break;J=J.return}0<Ie.length&&(te=new ce(te,Oe,null,s,he),xe.push({event:te,listeners:Ie}))}}if((a&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",te=t==="mouseout"||t==="pointerout",ce&&s!==Uo&&(Oe=s.relatedTarget||s.fromElement)&&(Ha(Oe)||Oe[aa]))break e;(te||ce)&&(Oe=he.window===he?he:(ce=he.ownerDocument)?ce.defaultView||ce.parentWindow:window,te?(ce=s.relatedTarget||s.toElement,te=ie,ce=ce?Ha(ce):null,ce!==null&&(ut=c(ce),Ie=ce.tag,ce!==ut||Ie!==5&&Ie!==27&&Ie!==6)&&(ce=null)):(te=null,ce=ie),te!==ce&&(Ie=q1,ye="onMouseLeave",ae="onMouseEnter",J="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=H1,ye="onPointerLeave",ae="onPointerEnter",J="pointer"),ut=te==null?Oe:de(te),oe=ce==null?Oe:de(ce),Oe=new Ie(ye,J+"leave",te,s,he),Oe.target=ut,Oe.relatedTarget=oe,ye=null,Ha(he)===ie&&(Ie=new Ie(ae,J+"enter",ce,s,he),Ie.target=oe,Ie.relatedTarget=ut,ye=Ie),ut=ye,Ie=te&&ce?R(te,ce,CC):null,te!==null&&By(xe,Oe,te,Ie,!1),ce!==null&&ut!==null&&By(xe,ut,ce,Ie,!0)))}e:{if(te=ie?de(ie):window,ce=te.nodeName&&te.nodeName.toLowerCase(),ce==="select"||ce==="input"&&te.type==="file")var Le=X1;else if(Y1(te))if(Q1)Le=M8;else{Le=E8;var Ct=N8}else ce=te.nodeName,!ce||ce.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ie&&Bn(ie.elementType)&&(Le=X1):Le=T8;if(Le&&(Le=Le(t,ie))){K1(xe,Le,s,he);break e}Ct&&Ct(t,te,ie)}switch(Ct=ie?de(ie):window,t){case"focusin":(Y1(Ct)||Ct.contentEditable==="true")&&(Bs=Ct,ph=ie,Xl=null);break;case"focusout":Xl=ph=Bs=null;break;case"mousedown":gh=!0;break;case"contextmenu":case"mouseup":case"dragend":gh=!1,iv(xe,s,he);break;case"selectionchange":if(_8)break;case"keydown":case"keyup":iv(xe,s,he)}var $e;if(uh)e:{switch(t){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Ls?V1(t,s)&&(We="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(We="onCompositionStart");We&&(F1&&s.locale!=="ko"&&(Ls||We!=="onCompositionStart"?We==="onCompositionEnd"&&Ls&&($e=B1()):(to=he,rh="value"in to?to.value:to.textContent,Ls=!0)),Ct=gd(ie,We),0<Ct.length&&(We=new P1(We,t,null,s,he),xe.push({event:We,listeners:Ct}),$e?We.data=$e:($e=G1(s),$e!==null&&(We.data=$e)))),($e=j8?w8(t,s):k8(t,s))&&(We=gd(ie,"onBeforeInput"),0<We.length&&(Ct=new P1("onBeforeInput","beforeinput",null,s,he),xe.push({event:Ct,listeners:We}),Ct.data=$e)),jC(xe,t,ie,s,he)}Dy(xe,a)})}function bc(t,a,s){return{instance:t,listener:a,currentTarget:s}}function gd(t,a){for(var s=a+"Capture",u=[];t!==null;){var p=t,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=vr(t,s),p!=null&&u.unshift(bc(t,p,x)),p=vr(t,a),p!=null&&u.push(bc(t,p,x))),t.tag===3)return u;t=t.return}return[]}function CC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function By(t,a,s,u,p){for(var x=a._reactName,A=[];s!==null&&s!==u;){var L=s,G=L.alternate,ie=L.stateNode;if(L=L.tag,G!==null&&G===u)break;L!==5&&L!==26&&L!==27||ie===null||(G=ie,p?(ie=vr(s,x),ie!=null&&A.unshift(bc(s,ie,G))):p||(ie=vr(s,x),ie!=null&&A.push(bc(s,ie,G)))),s=s.return}A.length!==0&&t.push({event:a,listeners:A})}var NC=/\r\n?/g,EC=/\u0000|\uFFFD/g;function Iy(t){return(typeof t=="string"?t:""+t).replace(NC,`
49
+ `).replace(EC,"")}function qy(t,a){return a=Iy(a),Iy(t)===a}function Bt(t,a,s,u,p,x){switch(s){case"children":if(typeof u=="string")a==="body"||a==="textarea"&&u===""||mt(t,u);else if(typeof u=="number"||typeof u=="bigint")a!=="body"&&mt(t,""+u);else return;break;case"className":ga(t,"class",u);break;case"tabIndex":ga(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ga(t,s,u);break;case"style":mn(t,u,x);return;case"data":if(a!=="object"){ga(t,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Vn(u),t.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(s,"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 x=="function"&&(s==="formAction"?(a!=="input"&&Bt(t,a,"name",p.name,p,null),Bt(t,a,"formEncType",p.formEncType,p,null),Bt(t,a,"formMethod",p.formMethod,p,null),Bt(t,a,"formTarget",p.formTarget,p,null)):(Bt(t,a,"encType",p.encType,p,null),Bt(t,a,"method",p.method,p,null),Bt(t,a,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(s);break}u=Vn(u),t.setAttribute(s,u);break;case"onClick":u!=null&&(t.onclick=va);return;case"onScroll":u!=null&&jt("scroll",t);return;case"onScrollEnd":u!=null&&jt("scrollend",t);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(s=u.__html,s!=null){if(p.children!=null)throw Error(r(60));(x!=null?x.__html:void 0)!==s&&(t.innerHTML=s)}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}s=Vn(u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":u===!0?t.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(s,u):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(s,u):t.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(s):t.setAttribute(s,u);break;case"popover":jt("beforetoggle",t),jt("toggle",t),zt(t,"popover",u);break;case"xlinkActuate":fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":fn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":fn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":fn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":fn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":zt(t,"is",u);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=ia.get(s)||s,zt(t,s,u);else return}Ge=!0}function Jm(t,a,s,u,p,x){switch(s){case"style":mn(t,u,x);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(s=u.__html,s!=null){if(p.children!=null)throw Error(r(60));(x!=null?x.__html:void 0)!==s&&(t.innerHTML=s)}}break;case"children":if(typeof u=="string")mt(t,u);else if(typeof u=="number"||typeof u=="bigint")mt(t,""+u);else return;break;case"onScroll":u!=null&&jt("scroll",t);return;case"onScrollEnd":u!=null&&jt("scrollend",t);return;case"onClick":u!=null&&(t.onclick=va);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!et.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),x=s.slice(2,p?s.length-7:void 0),a=t[On]||null,a=a!=null?a[s]:null,typeof a=="function"&&t.removeEventListener(x,a,p),typeof u=="function")){typeof a!="function"&&a!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(x,u,p);break e}Ge=!0,s in t?t[s]=u:u===!0?t.setAttribute(s,""):zt(t,s,u)}return}Ge=!0}function Zn(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",t),jt("load",t);var u=!1,p=!1,x;for(x in s)if(s.hasOwnProperty(x)){var A=s[x];if(A!=null)switch(x){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Bt(t,a,x,A,s,null)}}p&&Bt(t,a,"srcSet",s.srcSet,s,null),u&&Bt(t,a,"src",s.src,s,null);return;case"input":jt("invalid",t);var L=x=A=p=null,G=null,ie=null;for(u in s)if(s.hasOwnProperty(u)){var he=s[u];if(he!=null)switch(u){case"name":p=he;break;case"type":A=he;break;case"checked":G=he;break;case"defaultChecked":ie=he;break;case"value":x=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,a));break;default:Bt(t,a,u,he,s,null)}}Ae(t,x,L,G,ie,A,p,!1);return;case"select":jt("invalid",t),u=A=x=null;for(p in s)if(s.hasOwnProperty(p)&&(L=s[p],L!=null))switch(p){case"value":x=L;break;case"defaultValue":A=L;break;case"multiple":u=L;default:Bt(t,a,p,L,s,null)}a=x,s=A,t.multiple=!!u,a!=null?ht(t,!!u,a,!1):s!=null&&ht(t,!!u,s,!0);return;case"textarea":jt("invalid",t),x=p=u=null;for(A in s)if(s.hasOwnProperty(A)&&(L=s[A],L!=null))switch(A){case"value":u=L;break;case"defaultValue":p=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Bt(t,a,A,L,s,null)}Ue(t,u,p,x);return;case"option":for(G in s)if(s.hasOwnProperty(G)&&(u=s[G],u!=null))switch(G){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Bt(t,a,G,u,s,null)}return;case"dialog":jt("beforetoggle",t),jt("toggle",t),jt("cancel",t),jt("close",t);break;case"iframe":case"object":jt("load",t);break;case"video":case"audio":for(u=0;u<xc.length;u++)jt(xc[u],t);break;case"image":jt("error",t),jt("load",t);break;case"details":jt("toggle",t);break;case"embed":case"source":case"link":jt("error",t),jt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(u=s[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Bt(t,a,ie,u,s,null)}return;default:if(Bn(a)){for(he in s)s.hasOwnProperty(he)&&(u=s[he],u!==void 0&&Jm(t,a,he,u,s,void 0));return}}for(L in s)s.hasOwnProperty(L)&&(u=s[L],u!=null&&Bt(t,a,L,u,s,null))}var TC={};function MC(t,a,s,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,A=null,L=null,G=null,ie=null,he=null;for(ce in s){var xe=s[ce];if(s.hasOwnProperty(ce)&&xe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":G=xe;default:u.hasOwnProperty(ce)||Bt(t,a,ce,null,u,xe)}}for(var te in u){var ce=u[te];if(xe=s[te],u.hasOwnProperty(te)&&(ce!=null||xe!=null))switch(te){case"type":ce!==xe&&(Ge=!0),x=ce;break;case"name":ce!==xe&&(Ge=!0),p=ce;break;case"checked":ce!==xe&&(Ge=!0),ie=ce;break;case"defaultChecked":ce!==xe&&(Ge=!0),he=ce;break;case"value":ce!==xe&&(Ge=!0),A=ce;break;case"defaultValue":ce!==xe&&(Ge=!0),L=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,a));break;default:ce!==xe&&Bt(t,a,te,ce,u,xe)}}pe(t,A,L,G,ie,he,x,p);return;case"select":ce=A=L=te=null;for(x in s)if(G=s[x],s.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":ce=G;default:u.hasOwnProperty(x)||Bt(t,a,x,null,u,G)}for(p in u)if(x=u[p],G=s[p],u.hasOwnProperty(p)&&(x!=null||G!=null))switch(p){case"value":x!==G&&(Ge=!0),te=x;break;case"defaultValue":x!==G&&(Ge=!0),L=x;break;case"multiple":x!==G&&(Ge=!0),A=x;default:x!==G&&Bt(t,a,p,x,u,G)}a=L,s=A,u=ce,te!=null?ht(t,!!s,te,!1):!!u!=!!s&&(a!=null?ht(t,!!s,a,!0):ht(t,!!s,s?[]:"",!1));return;case"textarea":ce=te=null;for(L in s)if(p=s[L],s.hasOwnProperty(L)&&p!=null&&!u.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Bt(t,a,L,null,u,p)}for(A in u)if(p=u[A],x=s[A],u.hasOwnProperty(A)&&(p!=null||x!=null))switch(A){case"value":p!==x&&(Ge=!0),te=p;break;case"defaultValue":p!==x&&(Ge=!0),ce=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==x&&Bt(t,a,A,p,u,x)}hn(t,te,ce);return;case"option":for(var Oe in s)if(te=s[Oe],s.hasOwnProperty(Oe)&&te!=null&&!u.hasOwnProperty(Oe))switch(Oe){case"selected":t.selected=!1;break;default:Bt(t,a,Oe,null,u,te)}for(G in u)if(te=u[G],ce=s[G],u.hasOwnProperty(G)&&te!==ce&&(te!=null||ce!=null))switch(G){case"selected":te!==ce&&(Ge=!0),t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Bt(t,a,G,te,u,ce)}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 Ie in s)te=s[Ie],s.hasOwnProperty(Ie)&&te!=null&&!u.hasOwnProperty(Ie)&&Bt(t,a,Ie,null,u,te);for(ie in u)if(te=u[ie],ce=s[ie],u.hasOwnProperty(ie)&&te!==ce&&(te!=null||ce!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,a));break;default:Bt(t,a,ie,te,u,ce)}return;default:if(Bn(a)){for(var ut in s)te=s[ut],s.hasOwnProperty(ut)&&te!==void 0&&!u.hasOwnProperty(ut)&&Jm(t,a,ut,void 0,u,te);for(he in u)te=u[he],ce=s[he],!u.hasOwnProperty(he)||te===ce||te===void 0&&ce===void 0||Jm(t,a,he,te,u,ce);return}}for(var ae in s)te=s[ae],s.hasOwnProperty(ae)&&te!=null&&!u.hasOwnProperty(ae)&&Bt(t,a,ae,null,u,te);for(xe in u)te=u[xe],ce=s[xe],!u.hasOwnProperty(xe)||te===ce||te==null&&ce==null||Bt(t,a,xe,te,u,ce)}function Py(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),u=0;u<s.length;u++){var p=s[u],x=p.transferSize,A=p.initiatorType,L=p.duration;if(x&&L&&Py(A)){for(A=0,L=p.responseEnd,u+=1;u<s.length;u++){var G=s[u],ie=G.startTime;if(ie>L)break;var he=G.transferSize,xe=G.initiatorType;he&&Py(xe)&&(G=G.responseEnd,A+=he*(G<L?1:(L-ie)/(G-ie)))}if(--u,a+=8*(x+A)/(p.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Wm=null,ep=null;function jc(t){return t.nodeType===9?t:t.ownerDocument}function Hy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fy(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Uy(t,a,s,u){return s=jc(s).createElement(t),s[en]=u,s[On]=a,Zn(s,t,a),je(s),s}function tp(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var np=null;function _C(){var t=window.event;return t&&t.type==="popstate"?t===np?!1:(np=t,!0):(np=null,!1)}var ap=typeof setTimeout=="function"?setTimeout:void 0,RC=typeof clearTimeout=="function"?clearTimeout:void 0,$y=typeof Promise=="function"?Promise:void 0,Vy=typeof requestAnimationFrame=="function"?requestAnimationFrame:ap,OC=typeof queueMicrotask=="function"?queueMicrotask:typeof $y<"u"?function(t){return $y.resolve(null).then(t).catch(zC)}:ap;function zC(t){setTimeout(function(){throw t})}function wo(t){return t==="head"}function Gy(t,a){var s=a,u=0;do{var p=s.nextSibling;if(t.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(u===0){t.removeChild(p),gl(a);return}u--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")u++;else if(s==="html")dp(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,dp(s);for(var x=s.firstChild;x;){var A=x.nextSibling,L=x.nodeName;x[mr]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=A}}else s==="body"&&dp(t.ownerDocument.body);s=p}while(s);gl(a)}function Yy(t,a){var s=t;t=0;do{var u=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=u}while(s)}function Ky(t,a,s){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,t.style.viewTransitionName=a,s!=null&&(t.style.viewTransitionClass=s),s=getComputedStyle(t),s.display==="inline"){if(a=t.getClientRects(),a.length===1)var u=1;else for(var p=u=0;p<a.length;p++){var x=a[p];0<x.width&&0<x.height&&u++}u===1&&(t=t.style,t.display=a.length===1?"inline-block":"block",t.marginTop="-"+s.paddingTop,t.marginBottom="-"+s.paddingBottom)}}function Xy(t,a){t=t.style,a=a.style;var s=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;t.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,t.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),t.display==="inline-block"&&(a==null?t.display=t.margin="":(s=a.display,t.display=s==null||typeof s=="boolean"?"":s,s=a.margin,s!=null?t.margin=s:(s=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],t.marginTop=s==null||typeof s=="boolean"?"":s,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],t.marginBottom=a==null||typeof a=="boolean"?"":a)))}function DC(t,a,s){return s=s.ownerDocument.defaultView,{rect:t,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=s.innerHeight&&t.left<=s.innerWidth}}function ip(t){var a=t.getBoundingClientRect(),s=getComputedStyle(t);return DC(a,s,t)}function LC(t){return t.documentElement.clientHeight}function BC(t){this.addEventListener("load",t),this.addEventListener("error",t)}function IC(t,a,s,u,p,x,A,L,G){var ie=a.nodeType===9?a:a.ownerDocument;try{var he=ie.startViewTransition({update:function(){var te=ie.defaultView,ce=te.navigation&&te.navigation.transition,Oe=ie.fonts.status;u();var Ie=[];if(Oe==="loaded"&&(LC(ie),ie.fonts.status==="loading"&&Ie.push(ie.fonts.ready)),Oe=Ie.length,t!==null)for(var ut=t.suspenseyImages,ae=0,J=0;J<ut.length;J++){var oe=ut[J];if(!oe.complete){var ye=oe.getBoundingClientRect();if(0<ye.bottom&&0<ye.right&&ye.top<te.innerHeight&&ye.left<te.innerWidth){if(ae+=gx(oe),ae>xd){Ie.length=Oe;break}oe=new Promise(BC.bind(oe)),Ie.push(oe)}}}if(0<Ie.length)return te=Promise.race([Promise.all(Ie),new Promise(function(Le){return setTimeout(Le,500)})]).then(p,p),(ce?Promise.allSettled([ce.finished,te]):te).then(x,x);if(p(),ce)return ce.finished.then(x,x);x()},types:s});ie.__reactViewTransition=he;var xe=[];return he.ready.then(function(){for(var te=ie.documentElement.getAnimations({subtree:!0}),ce=0;ce<te.length;ce++){var Oe=te[ce],Ie=Oe.effect,ut=Ie.pseudoElement;if(ut!=null&&ut.startsWith("::view-transition")){xe.push(Oe),Oe=Ie.getKeyframes();for(var ae=ut=void 0,J=!0,oe=0;oe<Oe.length;oe++){var ye=Oe[oe],Le=ye.width;if(ut===void 0)ut=Le;else if(ut!==Le){J=!1;break}if(Le=ye.height,ae===void 0)ae=Le;else if(ae!==Le){J=!1;break}delete ye.width,delete ye.height,ye.transform==="none"&&delete ye.transform}J&&ut!==void 0&&ae!==void 0&&(Ie.setKeyframes(Oe),J=getComputedStyle(Ie.target,Ie.pseudoElement),J.width!==ut||J.height!==ae)&&(J=Oe[0],J.width=ut,J.height=ae,J=Oe[Oe.length-1],J.width=ut,J.height=ae,Ie.setKeyframes(Oe))}}A()},function(te){ie.__reactViewTransition===he&&(ie.__reactViewTransition=null);try{if(typeof te=="object"&&te!==null)switch(te.name){case"InvalidStateError":(te.message==="View transition was skipped because document visibility state is hidden."||te.message==="Skipping view transition because document visibility state has become hidden."||te.message==="Skipping view transition because viewport size changed."||te.message==="Transition was aborted because of invalid state")&&(te=null)}te!==null&&G(te)}finally{u(),p(),A()}}),he.finished.finally(function(){for(var te=0;te<xe.length;te++)xe[te].cancel();ie.__reactViewTransition===he&&(ie.__reactViewTransition=null),L()}),he}catch{return u(),p(),A(),null}}function fs(t,a){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+a+")"}fs.prototype.animate=function(t,a){return a=typeof a=="number"?{duration:a}:O({},a),a.pseudoElement=this._selector,this._scope.animate(t,a)},fs.prototype.getAnimations=function(){for(var t=this._scope,a=this._selector,s=t.getAnimations({subtree:!0}),u=[],p=0;p<s.length;p++){var x=s[p].effect;x!==null&&x.target===t&&x.pseudoElement===a&&u.push(s[p])}return u},fs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Qy(t){return{name:t,group:new fs("group",t),imagePair:new fs("image-pair",t),old:new fs("old",t),new:new fs("new",t)}}function Xa(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Xa.prototype.addEventListener=function(t,a,s){var u=null,p=null;if(!(s!=null&&typeof s!="boolean"&&(u=s.signal||null,u!==null&&u.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var x=this._eventListeners;if(Jy(x,t,a,s)===-1){var A=this,L=a;s!=null&&typeof s!="boolean"&&s.once===!0&&(L=function(G){A.removeEventListener(t,a,s),typeof a=="function"?a.call(this,G):a.handleEvent(G)}),u!==null&&(p=A.removeEventListener.bind(A,t,a,s),u.addEventListener("abort",p,{once:!0}),p=u.removeEventListener.bind(u,"abort",p)),u=ul(s),x.push({type:t,listener:a,optionsOrUseCapture:s,attachedListener:L,cleanup:p}),m(this._fragmentFiber.child,!1,qC,t,L,u)}this._eventListeners=x}};function qC(t,a,s,u){return N(t).addEventListener(a,s,u),!1}Xa.prototype.removeEventListener=function(t,a,s){var u=this._eventListeners;if(u!==null&&(a=Jy(u,t,a,s),a!==-1)){var p=u[a];s=p.attachedListener;var x=p.cleanup;p=ul(p.optionsOrUseCapture),m(this._fragmentFiber.child,!1,PC,t,s,p),u.splice(a,1),x!==null&&x()}};function PC(t,a,s,u){return N(t).removeEventListener(a,s,u),!1}function ul(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function Zy(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Jy(t,a,s,u){if(t.length===0)return-1;u=Zy(u);for(var p=0;p<t.length;p++){var x=t[p];if(x.type===a&&x.listener===s&&Zy(x.optionsOrUseCapture)===u)return p}return-1}Xa.prototype.dispatchEvent=function(t){var a=j(this._fragmentFiber);if(a===null)return!0;a=N(a);var s=this._eventListeners;if(s!==null&&0<s.length||!t.bubbles){var u=a.nodeType===9?a.createComment(""):document.createTextNode("");if(s)for(var p=0;p<s.length;p++){var x=s[p];u.addEventListener(x.type,x.attachedListener,ul(x.optionsOrUseCapture))}if(a.appendChild(u),t=u.dispatchEvent(t),s)for(p=0;p<s.length;p++)x=s[p],u.removeEventListener(x.type,x.attachedListener,ul(x.optionsOrUseCapture));return a.removeChild(u),t}return a.dispatchEvent(t)},Xa.prototype.focus=function(t){m(this._fragmentFiber.child,!0,Wy,t,void 0,void 0)};function Wy(t,a){return t.tag===6?!1:(t=N(t),JC(t,a))}Xa.prototype.focusLast=function(t){var a=[];m(this._fragmentFiber.child,!0,rp,a,void 0,void 0);for(var s=a.length-1;0<=s&&!Wy(a[s],t);s--);};function rp(t,a){return a.push(t),!1}Xa.prototype.blur=function(){var t=j(this._fragmentFiber);t!==null&&(t=N(t),t=jc(t).activeElement,t!==null&&m(this._fragmentFiber.child,!1,HC,t,void 0,void 0))};function HC(t,a){return t.tag===6?!1:(t=N(t),t===a||t.contains(a)?(a.blur(),!0):!1)}Xa.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),m(this._fragmentFiber.child,!1,FC,t,void 0,void 0)};function FC(t,a){return t.tag===6||(t=N(t),a.observe(t)),!1}Xa.prototype.unobserveUsing=function(t){var a=this._observers;if(a!==null&&a.has(t)){a.delete(t),m(this._fragmentFiber.child,!1,UC,t,void 0,void 0);for(var s=a=0;s<wi.length;s++){var u=wi[s];u.fragmentInstance===this&&u.observer===t?t.unobserve(u.instance):wi[a++]=u}wi.length=a}};function UC(t,a){return t.tag===6||(t=N(t),a.unobserve(t)),!1}var wi=[],op=!1;function $C(t,a,s){wi.push({fragmentInstance:t,observer:a,instance:s}),op||(op=!0,WC(function(){op=!1;var u=wi;wi=[];for(var p=0;p<u.length;p++){var x=u[p];x.observer.unobserve(x.instance)}}))}Xa.prototype.getClientRects=function(){var t=[];return m(this._fragmentFiber.child,!1,VC,t,void 0,void 0),t};function VC(t,a){if(t.tag===6){t=t.stateNode;var s=t.ownerDocument.createRange();s.selectNodeContents(t),a.push.apply(a,s.getClientRects())}else t=N(t),a.push.apply(a,t.getClientRects());return!1}Xa.prototype.getRootNode=function(t){var a=j(this._fragmentFiber);return a===null?this:N(a).getRootNode(t)},Xa.prototype.compareDocumentPosition=function(t){var a=j(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];m(this._fragmentFiber.child,!1,rp,s,void 0,void 0);var u=N(a);if(s.length===0){if(s=u,b(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(s=a)}a=this._fragmentFiber;var p=u=s.compareDocumentPosition(t);return s===t?p=Node.DOCUMENT_POSITION_CONTAINS:u&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=k(a)[1],s===null?p=Node.DOCUMENT_POSITION_PRECEDING:(t=N(s).compareDocumentPosition(t),p=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),p|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=N(s[0]),p=N(s[s.length-1]);var x=b(this._fragmentFiber)?a.parentElement:u;if(x==null)return Node.DOCUMENT_POSITION_DISCONNECTED;u=x.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,x=x.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY;var A=a.compareDocumentPosition(t),L=p.compareDocumentPosition(t),G=A&Node.DOCUMENT_POSITION_CONTAINED_BY||L&Node.DOCUMENT_POSITION_CONTAINED_BY;return L=u&&x&&A&Node.DOCUMENT_POSITION_FOLLOWING&&L&Node.DOCUMENT_POSITION_PRECEDING,a=u&&a===t||x&&p===t||G||L?Node.DOCUMENT_POSITION_CONTAINED_BY:!u&&a===t||!x&&p===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:A,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||GC(a,this._fragmentFiber,s[0],s[s.length-1],t)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function GC(t,a,s,u,p){var x=Ha(p);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!x)e:{for(;x!==null;){if(x.tag===7&&(x===a||x.alternate===a)){s=!0;break e}x=x.return}s=!1}return s}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(x===null)return x=p.ownerDocument,p===x||p===x.documentElement||p===x.body;e:{for(x=a,a=j(a);x!==null;){if(!(x.tag!==5&&x.tag!==3&&x.tag!==27||x!==a&&x.alternate!==a)){x=!0;break e}x=x.return}x=!1}return x}return t&Node.DOCUMENT_POSITION_PRECEDING?((a=!!x)&&!(a=x===s)&&(a=R(s,x,_),a===null?a=!1:(m(a,!0,E,x,s),x=C,C=null,a=x!==null)),a):t&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!x)&&!(a=x===u)&&(a=R(u,x,_),a===null?a=!1:(m(a,!0,T,x,u),x=C,M=C=null,a=x!==null)),a):!1}function ex(t,a){var s=t.ownerDocument.createRange();s.selectNodeContents(t),t=s.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,a?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Xa.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(r(566));var a=[];m(this._fragmentFiber.child,!1,rp,a,void 0,void 0);var s=t!==!1;if(a.length===0){var u=k(this._fragmentFiber);if(u=s?u[1]||u[0]||j(this._fragmentFiber):u[0]||u[1],u===null)return;if(u.tag===6){t=N(u),ex(t,s);return}if(u=N(u),u.nodeType!==9){if(u.nodeType===11){s="host"in u?u.host:null,s!==null&&s.scrollIntoView(t);return}u.scrollIntoView(t)}}for(u=s?a.length-1:0;u!==(s?-1:a.length);){var p=a[u];p.tag===6?(p=N(p),ex(p,s)):N(p).scrollIntoView(t),u+=s?-1:1}};function YC(t,a){return t=N(t),tx(t,a),!1}function tx(t,a){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(a)}function nx(t,a){var s=a._eventListeners;if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];t.addEventListener(p.type,p.attachedListener,ul(p.optionsOrUseCapture))}t.nodeType!==3&&(s=a._observers,s!==null&&s.forEach(function(x){for(var A=0,L=0;L<wi.length;L++){var G=wi[L];(G.fragmentInstance!==a||G.observer!==x||G.instance!==t)&&(wi[A++]=G)}wi.length=A,x.observe(t)}),tx(t,a))}function KC(t,a){var s=a._eventListeners;if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];t.removeEventListener(p.type,p.attachedListener,ul(p.optionsOrUseCapture))}t.nodeType!==3&&(s=a._observers,s!==null&&s.forEach(function(x){typeof x.rootMargin=="string"?$C(a,x,t):x.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(a))}function sp(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":sp(s),Wr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function XC(t,a,s,u){for(;t.nodeType===1;){var p=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[mr])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function QC(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=ci(t.nextSibling),t===null))return null;return t}function ax(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ci(t.nextSibling),t===null))return null;return t}function lp(t){return t.data==="$?"||t.data==="$~"}function cp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ZC(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var u=function(){a(),s.removeEventListener("DOMContentLoaded",u)};s.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function ci(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var up=null;function ix(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return ci(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function rx(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function JC(t,a){function s(){u=!0}if(t.ownerDocument.activeElement===t)return!0;var u=!1;try{t.ownerDocument.addEventListener("focus",s,!0),(t.focus||HTMLElement.prototype.focus).call(t,a)}finally{t.ownerDocument.removeEventListener("focus",s,!0)}return u}function WC(t){Vy(function(){Vy(function(a){return t(a)})})}function ox(t,a,s){switch(a=jc(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function sx(t,a,s){for(var u in s){var p=s[u];s.hasOwnProperty(u)&&p!=null&&Bt(t,a,u,null,TC,p)}s.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===va&&(t.onclick=null),Wr(t)}function dp(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Wr(t)}var ui=new Map,lx=new Set;function wc(t){if(typeof t.getRootNode=="function"){var a=t.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return t.nodeType===9?t:t.ownerDocument}var Mr=re.d;re.d={f:e7,r:t7,D:n7,C:a7,L:i7,m:r7,X:s7,S:o7,M:l7};function e7(){var t=Mr.f(),a=ud();return t||a}function t7(t){var a=ei(t);a!==null&&a.tag===5&&a.type==="form"?u2(a):Mr.r(t)}var dl=typeof document>"u"?null:document;function cx(t,a,s){var u=dl;if(u&&typeof a=="string"&&a){var p=U(a);p='link[rel="'+t+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),lx.has(p)||(lx.add(p),t={rel:t,crossOrigin:s,href:a},u.querySelector(p)===null&&(a=u.createElement("link"),Zn(a,"link",t),je(a),u.head.appendChild(a)))}}function n7(t){Mr.D(t),cx("dns-prefetch",t,null)}function a7(t,a){Mr.C(t,a),cx("preconnect",t,a)}function i7(t,a,s){Mr.L(t,a,s);var u=dl;if(u&&t&&a){var p='link[rel="preload"][as="'+U(a)+'"]';a==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+U(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+U(s.imageSizes)+'"]')):p+='[href="'+U(t)+'"]';var x=p;switch(a){case"style":x=fl(t);break;case"script":x=hl(t)}if(!(ui.has(x)||(t=O({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),ui.set(x,t),u.querySelector(p)!==null||a==="style"&&u.querySelector(kc(x))||a==="script"&&u.querySelector(Sc(x))))){var A=u.createElement("link");Zn(A,"link",t),a==="style"&&(A[Jr]=!0,A.onload=A.onerror=function(){De(A)}),je(A),u.head.appendChild(A)}}}function r7(t,a){Mr.m(t,a);var s=dl;if(s&&t){var u=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+U(u)+'"][href="'+U(t)+'"]',x=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=hl(t)}if(!ui.has(x)&&(t=O({rel:"modulepreload",href:t},a),ui.set(x,t),s.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Sc(x)))return}u=s.createElement("link"),Zn(u,"link",t),je(u),s.head.appendChild(u)}}}function o7(t,a,s){Mr.S(t,a,s);var u=dl;if(u&&t){var p=ke(u).hoistableStyles,x=fl(t);a=a||"default";var A=p.get(x);if(!A){var L={loading:0,preload:null};if(A=u.querySelector(kc(x)))L.loading=5;else{t=O({rel:"stylesheet",href:t,"data-precedence":a},s),(s=ui.get(x))&&fp(t,s);var G=A=u.createElement("link");je(G),Zn(G,"link",t),G._p=new Promise(function(ie,he){G.onload=ie,G.onerror=he}),G.addEventListener("load",function(){L.loading|=1}),G.addEventListener("error",function(){L.loading|=2}),L.loading|=4,vd(A,a,u)}A={type:"stylesheet",instance:A,count:1,state:L},p.set(x,A)}}}function s7(t,a){Mr.X(t,a);var s=dl;if(s&&t){var u=ke(s).hoistableScripts,p=hl(t),x=u.get(p);x||(x=s.querySelector(Sc(p)),x||(t=O({src:t,async:!0},a),(a=ui.get(p))&&hp(t,a),x=s.createElement("script"),je(x),Zn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(p,x))}}function l7(t,a){Mr.M(t,a);var s=dl;if(s&&t){var u=ke(s).hoistableScripts,p=hl(t),x=u.get(p);x||(x=s.querySelector(Sc(p)),x||(t=O({src:t,async:!0,type:"module"},a),(a=ui.get(p))&&hp(t,a),x=s.createElement("script"),je(x),Zn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(p,x))}}function ux(t,a,s,u){var p=(p=Jt.current)?wc(p):null;if(!p)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=fl(s.href),a=ke(p).hoistableStyles,u=a.get(s),u||(u={type:"style",instance:null,count:0,state:null},a.set(s,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=fl(s.href);var x=ke(p).hoistableStyles,A=x.get(t);if(A||(p=p.ownerDocument||p,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,A),(x=p.querySelector(kc(t)))?x._p||(A.instance=x,A.state.loading=5):(x=ui.get(t),x||(x={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ui.set(t,x)),c7(p,t,x,A.state))),a&&u===null)throw Error(r(528,""));return A}if(a&&u!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(s=hl(s),a=ke(p).hoistableScripts,u=a.get(s),u||(u={type:"script",instance:null,count:0,state:null},a.set(s,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function fl(t){return'href="'+U(t)+'"'}function kc(t){return'link[rel="stylesheet"]['+t+"]"}function dx(t){return O({},t,{"data-precedence":t.precedence,precedence:null})}function c7(t,a,s,u){if(a=t.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[Jr]!==!0){u.loading=1;return}}else a=t.createElement("link"),a[Jr]=!0,a.onload=a.onerror=De.bind(null,a),Zn(a,"link",s),je(a),t.head.appendChild(a);u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2})}function hl(t){return'[src="'+U(t)+'"]'}function Sc(t){return"script[async]"+t}function fx(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var u=t.querySelector('style[data-href~="'+U(s.href)+'"]');if(u)return a.instance=u,je(u),u;var p=O({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),je(u),Zn(u,"style",p),vd(u,s.precedence,t),a.instance=u;case"stylesheet":p=fl(s.href);var x=t.querySelector(kc(p));if(x)return a.state.loading|=4,a.instance=x,je(x),x;u=dx(s),(p=ui.get(p))&&fp(u,p),x=(t.ownerDocument||t).createElement("link"),je(x);var A=x;return A._p=new Promise(function(L,G){A.onload=L,A.onerror=G}),Zn(x,"link",u),a.state.loading|=4,vd(x,s.precedence,t),a.instance=x;case"script":return x=hl(s.src),(p=t.querySelector(Sc(x)))?(a.instance=p,je(p),p):(u=s,(p=ui.get(x))&&(u=O({},s),hp(u,p)),t=t.ownerDocument||t,p=t.createElement("script"),je(p),Zn(p,"link",u),t.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,vd(u,s.precedence,t));return a.instance}function vd(t,a,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,x=p,A=0;A<u.length;A++){var L=u[A];if(L.dataset.precedence===a)x=L;else if(x!==p)break}x?x.parentNode.insertBefore(t,x.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function fp(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function hp(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var yd=null;function hx(t,a,s){if(yd===null){var u=new Map,p=yd=new Map;p.set(s,u)}else p=yd,u=p.get(s),u||(u=new Map,p.set(s,u));if(u.has(t))return u;for(u.set(t,null),s=s.getElementsByTagName(t),p=0;p<s.length;p++){var x=s[p];if(!(x[mr]||x[en]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var A=x.getAttribute(a)||"";A=t+A;var L=u.get(A);L?L.push(x):u.set(A,[x])}}return u}function mp(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function u7(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return t=a.disabled,typeof a.precedence=="string"&&t==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function mx(t,a){return t==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function px(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gx(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function vx(t,a){typeof a.decode=="function"&&(t.imgCount++,a.complete||(t.imgBytes+=gx(a),t.suspenseyImages.push(a)),t=h7.bind(t),a.decode().then(t,t))}function d7(t,a,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=fl(u.href),x=a.querySelector(kc(p));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Cc.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=x,je(x);return}x=a.ownerDocument||a,u=dx(u),(p=ui.get(p))&&fp(u,p),x=x.createElement("link"),je(x);var A=x;A._p=new Promise(function(L,G){A.onload=L,A.onerror=G}),Zn(x,"link",u),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Cc.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var xd=0;function f7(t,a){return t.stylesheets&&t.count===0&&jd(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var u=setTimeout(function(){if(t.stylesheets&&jd(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+a);0<t.imgBytes&&xd===0&&(xd=62500*AC());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&jd(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>xd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function yx(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)jd(t,t.stylesheets);else if(t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}}}function Cc(){this.count--,yx(this)}function h7(){this.imgCount--,yx(this)}var bd=null;function jd(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bd=new Map,a.forEach(m7,t),bd=null,Cc.call(t))}function m7(t,a){if(!(a.state.loading&4)){var s=bd.get(t);if(s)var u=s.get(null);else{s=new Map,bd.set(t,s);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var A=p[x];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(s.set(A.dataset.precedence,A),u=A)}u&&s.set(null,u)}p=a.instance,A=p.getAttribute("data-precedence"),x=s.get(A)||u,x===u&&s.set(null,p),s.set(A,p),this.count++,u=Cc.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),x?x.parentNode.insertBefore(p,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),a.state.loading|=4}}var ml={$$typeof:H,Provider:null,Consumer:null,_currentValue:Ce,_currentValue2:Ce,_threadCount:0};function p7(t,a,s,u,p,x,A,L,G){this.tag=1,this.containerInfo=t,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=ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ha(0),this.hiddenUpdates=ha(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.transitionTypes=null,this.incompleteTransitions=new Map}function xx(t,a,s,u,p,x,A,L,G,ie,he,xe){return t=new p7(t,a,s,A,G,ie,he,xe,L),a=1,x===!0&&(a|=24),x=Ta(3,null,null,a),t.current=x,x.stateNode=t,a=Mh(),a.refCount++,t.pooledCache=a,a.refCount++,x.memoizedState={element:u,isDehydrated:s,cache:a},Oh(x),t}function bx(t){return t?(t=Ps,t):Ps}function jx(t,a,s,u,p,x){p=bx(p),u.context===null?u.context=p:u.pendingContext=p,u=co(a),u.payload={element:s},x=x===void 0?null:x,x!==null&&(u.callback=x),s=uo(t,u,a),s!==null&&(Ra(s,t,a),nc(s,t,a))}function wx(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function pp(t,a){wx(t,a),(t=t.alternate)&&wx(t,a)}function kx(t){if(t.tag===13||t.tag===31){var a=Xo(t,67108864);a!==null&&Ra(a,t,67108864),pp(t,67108864)}}function Sx(t){if(t.tag===13||t.tag===31){var a=Ka();a=gi(a);var s=Xo(t,a);s!==null&&Ra(s,t,a),pp(t,a)}}var pl=!0;function g7(t,a,s,u){var p=ve.T;ve.T=null;var x=re.p;try{re.p=2,gp(t,a,s,u)}finally{re.p=x,ve.T=p}}function v7(t,a,s,u){var p=ve.T;ve.T=null;var x=re.p;try{re.p=8,gp(t,a,s,u)}finally{re.p=x,ve.T=p}}function gp(t,a,s,u){if(pl){var p=vp(u);if(p===null)Zm(t,a,u,wd,s),Nx(t,u);else if(x7(p,t,a,s,u))u.stopPropagation();else if(Nx(t,u),a&4&&-1<y7.indexOf(t)){for(;p!==null;){var x=ei(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var A=Wa(x.pendingLanes);if(A!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;A;){var G=1<<31-sn(A);L.entanglements[1]|=G,A&=~G}$i(x),(Rt&6)===0&&(sd=ze()+500,yc(0))}}break;case 31:case 13:L=Xo(x,2),L!==null&&Ra(L,x,2),ud(),pp(x,2)}if(x=vp(u),x===null&&Zm(t,a,u,wd,s),x===p)break;p=x}p!==null&&u.stopPropagation()}else Zm(t,a,u,null,s)}}function vp(t){return t=$o(t),yp(t)}var wd=null;function yp(t){if(wd=null,t=Ha(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=d(a),t!==null)return t;t=null}else if(s===31){if(t=f(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return wd=t,null}function Cx(t){switch(t){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(dt()){case ta:return 2;case Rn:return 8;case yn:case lr:return 32;case Ri:return 268435456;default:return 32}default:return 32}}var xp=!1,ko=null,So=null,Co=null,Nc=new Map,Ec=new Map,No=[],y7="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 Nx(t,a){switch(t){case"focusin":case"focusout":ko=null;break;case"dragenter":case"dragleave":So=null;break;case"mouseover":case"mouseout":Co=null;break;case"pointerover":case"pointerout":Nc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ec.delete(a.pointerId)}}function Tc(t,a,s,u,p,x){return t===null||t.nativeEvent!==x?(t={blockedOn:a,domEventName:s,eventSystemFlags:u,nativeEvent:x,targetContainers:[p]},a!==null&&(a=ei(a),a!==null&&kx(a)),t):(t.eventSystemFlags|=u,a=t.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),t)}function x7(t,a,s,u,p){switch(a){case"focusin":return ko=Tc(ko,t,a,s,u,p),!0;case"dragenter":return So=Tc(So,t,a,s,u,p),!0;case"mouseover":return Co=Tc(Co,t,a,s,u,p),!0;case"pointerover":var x=p.pointerId;return Nc.set(x,Tc(Nc.get(x)||null,t,a,s,u,p)),!0;case"gotpointercapture":return x=p.pointerId,Ec.set(x,Tc(Ec.get(x)||null,t,a,s,u,p)),!0}return!1}function Ex(t){var a=Ha(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){t.blockedOn=a,hr(t.priority,function(){Sx(s)});return}}else if(a===31){if(a=f(s),a!==null){t.blockedOn=a,hr(t.priority,function(){Sx(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function kd(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=vp(t.nativeEvent);if(s===null){s=t.nativeEvent;var u=new s.constructor(s.type,s);Uo=u,s.target.dispatchEvent(u),Uo=null}else return a=ei(s),a!==null&&kx(a),t.blockedOn=s,!1;a.shift()}return!0}function Tx(t,a,s){kd(t)&&s.delete(a)}function b7(){xp=!1,ko!==null&&kd(ko)&&(ko=null),So!==null&&kd(So)&&(So=null),Co!==null&&kd(Co)&&(Co=null),Nc.forEach(Tx),Ec.forEach(Tx)}function Sd(t,a){t.blockedOn===a&&(t.blockedOn=null,xp||(xp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,b7)))}var Cd=null;function Mx(t){Cd!==t&&(Cd=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cd===t&&(Cd=null);for(var a=0;a<t.length;a+=3){var s=t[a],u=t[a+1],p=t[a+2];if(typeof u!="function"){if(yp(u||s)===null)continue;break}var x=ei(s);x!==null&&(t.splice(a,3),a-=3,em(x,{pending:!0,data:p,method:s.method,action:u},u,p))}}))}function gl(t){function a(G){return Sd(G,t)}ko!==null&&Sd(ko,t),So!==null&&Sd(So,t),Co!==null&&Sd(Co,t),Nc.forEach(a),Ec.forEach(a);for(var s=0;s<No.length;s++){var u=No[s];u.blockedOn===t&&(u.blockedOn=null)}for(;0<No.length&&(s=No[0],s.blockedOn===null);)Ex(s),s.blockedOn===null&&No.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(u=0;u<s.length;u+=3){var p=s[u],x=s[u+1],A=p[On]||null;if(typeof x=="function")A||Mx(s);else if(A){var L=null;if(x&&x.hasAttribute("formAction")){if(p=x,A=x[On]||null)L=A.formAction;else if(yp(p)!==null)continue}else L=A.action;typeof L=="function"?s[u+1]=L:(s.splice(u,3),u-=3),Mx(s)}}}function Ax(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(A){return p=A})},focusReset:"manual",scroll:"manual"})}function a(){p!==null&&(p(),p=null),u||setTimeout(s,20)}function s(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),p!==null&&(p(),p=null)}}}function bp(t){this._internalRoot=t}Nd.prototype.render=bp.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,u=Ka();jx(s,u,t,a,null,null)},Nd.prototype.unmount=bp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;jx(t.current,2,null,t,null,null),ud(),a[aa]=null}};function Nd(t){this._internalRoot=t}Nd.prototype.unstable_scheduleHydration=function(t){if(t){var a=Ea();t={blockedOn:null,target:t,priority:a};for(var s=0;s<No.length&&a!==0&&a<No[s].priority;s++);No.splice(s,0,t),s===0&&Ex(t)}};var _x=n.version;if(_x!=="19.3.0")throw Error(r(527,_x,"19.3.0"));re.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=g(a),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var j7={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ve,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ed.isDisabled&&Ed.supportsFiber)try{Yt=Ed.inject(j7),xn=Ed}catch{}}return Ac.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,u="",p=b2,x=j2,A=w2;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(A=a.onRecoverableError)),a=xx(t,1,!1,null,null,s,u,null,p,x,A,Ax),t[aa]=a.current,Qm(t),new bp(a)},Ac.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var u=!1,p="",x=b2,A=j2,L=w2,G=null;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(L=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),a=xx(t,1,!0,a,s??null,u,p,G,x,A,L,Ax),a.context=bx(null),s=a.current,u=Ka(),u=gi(u),p=co(u),p.callback=null,uo(s,p,u),s=u,a.current.lanes=s,pi(a,s),$i(a),t[aa]=a.current,Qm(t),new Nd(a)},Ac.version="19.3.0",Ac}var $x;function z7(){if($x)return Sp.exports;$x=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Sp.exports=O7(),Sp.exports}var D7=z7();const L7={"locale.name":"English","locale.short":"EN","common.close":"Close","common.continue":"Continue","common.failed":"Something went wrong. Please try again.","common.listSeparator":", ","login.subtitle":"Sign in to continue","login.form":"Sign in","login.username":"Username","login.password":"Password","login.showPassword":"Show password","login.hidePassword":"Hide password","login.submit":"Sign in","login.submitting":"Signing in…","login.wrong":"Wrong username or password.","login.tooMany":"Too many attempts. Please try again later.","login.offline":"Can't connect to Jarvy. Check your network and try again.","login.themeLight":"Switch to the light theme","login.themeDark":"Switch to the dark theme","general.language":"Language","general.theme":"Theme","general.light":"Light","general.dark":"Dark","about.tagline":"A group chat where you and your AI Bots work side by side, running entirely on your own machine.","about.version":"Version {version}","about.source":"Source","about.package":"npm package","about.license":"License","about.notices":"Third-party notices","status.signedIn":"Signed in","status.signedOut":"Signed out","status.configured":"Ready","status.notConfigured":"Not set up","account.menu":"Account menu","account.menuFor":"Account menu for {name}","account.toggleTheme":"Switch theme","account.signOut":"Sign out","entry.menu":"Chat actions","entry.pin":"Pin","entry.unpin":"Unpin","entry.mute":"Mute","entry.unmute":"Unmute","entry.botInfo":"Bot info","entry.channelInfo":"Channel info","entry.deleteBot":"Delete Bot","entry.deleteChannel":"Delete channel","hint.reaction":"{actor} reacted {emoji} to your message","hint.reactionInThread":"{actor} reacted {emoji} to your message in “{title}”","hint.threadSummary":"{actor} updated the summary of “{title}”","hint.summary":"{actor} updated the thread summary","hint.notice":"{actor} updated the notice","app.connecting":"Connecting to Jarvy…","app.channelDeleted":"Channel deleted","app.botDeleted":"{name} deleted","app.notInChannel":{one:"{names} isn't in this channel, so wasn't notified",other:"{names} aren't in this channel, so weren't notified"},"app.memberAdded":"{name} joined #{channel}","app.sourceGone":"The original message no longer exists","ui.closeNamed":"Close {name}","ui.copied":"Copied","ui.copyFailed":"Couldn't copy","ui.copyCode":"Copy code","ui.image":"[Image: {alt}]","ui.imageHidden":"external image hidden","app.deleteChannelTitle":"Delete channel #{name}","app.deleteChannelBody":"Its messages, threads and attachments will be deleted. This can't be undone.","app.resizePane":"Drag to resize the side panel","common.cancel":"Cancel","common.save":"Save","common.create":"Create","common.delete":"Delete","common.retry":"Retry","common.back":"Back","common.add":"Add","common.saveFailed":"Couldn't save","common.openNav":"Open the chat list","common.you":"You","common.member":"Member","common.noMatch":"No matching members","common.searchMembers":"Search members","common.attachment":"[Attachment]","actions.reply":"Reply to this message","actions.react":"Add a reaction","actions.pickEmoji":"Pick an emoji","actions.recent":"Recent","actions.searchEmoji":"Search emoji","actions.noEmoji":"No emoji found","actions.emoji.Smileys & Emotion":"Smileys and emotion","actions.emoji.People & Body":"People and body","actions.emoji.Animals & Nature":"Animals and nature","actions.emoji.Food & Drink":"Food and drink","actions.emoji.Travel & Places":"Travel and places","actions.emoji.Activities":"Activities","actions.emoji.Objects":"Objects","actions.emoji.Symbols":"Symbols","actions.emoji.Flags":"Flags","actions.fold":"Fold to one line","actions.unfold":"Unfold","fold.folded":"Folded","fold.more":"Show all","fold.less":"Show less","dialogs.candidates":"Members you can add","dialogs.allInside":"Everyone is already in this channel","dialogs.addCount":"Add ({count})","dialogs.addFailed":"Couldn't add members","dialogs.optional":"Optional","dialogs.deleteSection":"Delete the group “{name}”? Its channels move under Channels.","dialogs.deleteFailed":"Couldn't delete. Please try again.","dialogs.editSection":"Edit channel group","dialogs.sectionName":"Group name","dialogs.newSection":"New group","api.offline":"Can't connect to Jarvy. Check your network and try again.","api.historyFailed":"Couldn't load the messages. Please try again.","error.autoconfigModel":"Enter the model ID.","error.autoconfigSource":"The selected setup source isn't valid. Choose another one.","error.botMissing":"Can't find this Bot. It may have been deleted.","error.agentUndeletable":"The agent Bot can't be deleted. You can rename or stop it.","error.chatAccessChanged":"Your access to this chat has changed. Refresh and try again.","error.computerFailed":"The sandbox couldn't start.","error.computerMissing":"This Bot has no sandbox.","error.dockerUnavailable":"Docker isn't available on the computer running Jarvy.","error.fileTooLarge":"Attachments can't be larger than {limit}.","error.connectionMissing":"Can't find this model connection. It may have been deleted.","error.credentialChanged":"The credential changed. Please try again.","error.credentialScope":"The credential belongs to another connection.","error.credentialsMissing":"Set up this connection's credential first.","error.dataLocked":"Jarvy is already running, or another program is using its data directory.","error.discoveryFormat":"This address didn't return a model list for the selected protocol. Check the API URL and protocol.","error.discoveryHttp":"Couldn't fetch the models: HTTP {status}.","error.discoveryKey":"Enter the API key.","error.discoveryProtocol":"The selected protocol can't list models. Add models manually.","error.discoveryUrl":"The API URL isn't valid.","error.discoveryUrlMissing":"Enter the API URL.","error.historyMissing":"Can't find this History record.","error.invalidCredential":"The credential format isn't valid.","error.invalidRun":"The Bot's state just changed. Refresh and try again.","error.loginInput":"Enter the authorization code or the redirect URL.","error.loginOption":"Pick a sign-in method.","error.loginStep":"The sign-in step has changed. Please start again.","error.loginFailed":"Sign-in failed. Refresh and try again.","error.messageMissing":"Can't find this message. It may have been deleted.","error.modelIncomplete":"Fill in the model's context window and max output.","error.modelMissing":"Can't find this model. It may have been removed.","error.modelRequestFailed":"Model request failed: {detail}","error.modelRequired":"Pick a model for the Bot first.","error.modelSwitchUncertain":"The model switch didn't finish. Pick the model again.","error.nameTaken":"Another member already has this name.","error.providerNameTaken":"A provider with this name already exists.","error.resetCustom":"A custom provider has no default models to reset to.","error.connectionInUse":"In use by {bots}. Switch to another model before deleting this provider.","error.questionClosed":"This question is already settled.","error.questionExpired":"This question was ignored. The Bot is no longer waiting for an answer.","error.runtimeFailed":"The Bot's run failed. Check its model settings and try again.","error.sessionCorrupt":"The Bot couldn't start (the session file can't be read).","error.sessionMismatch":"The Bot couldn't start (the session file doesn't match).","error.sessionMissing":"The Bot couldn't start (the session file is missing).","error.sessionPath":"The Bot couldn't start (the session file path isn't valid).","error.stopping":"Jarvy is shutting down. Try again later.","error.thinkingFormat":"This thinking format isn't supported.","error.toolsMissing":"Couldn't load the Bot's tools. Restart the Bot and try again.","error.unsafeReplay":"The Bot may have already taken actions before it was interrupted, so it won't retry automatically to avoid doing them twice.","error.discoveryUnreachable":"Couldn't reach {host}. Check the API URL.","color.gray":"Gray","color.blue":"Blue","color.green":"Green","color.amber":"Amber","color.rose":"Pink","color.violet":"Purple","avatar.working":"Working","avatar.openInfo":"Open {name}'s Bot info"},B7={"settings.title":"Settings","settings.sections":"Settings sections","settings.general":"General","settings.models":"Models","settings.usage":"Usage","settings.network":"Network","settings.secrets":"Secrets","settings.about":"About","group.custom":"Custom API","group.subscription":"Subscription","group.apiKey":"API key","models.add":"Add a provider","models.empty":"No model connection yet","models.count":{one:"{count} model",other:"{count} models"},"models.none":"No models yet","picker.back":"Back to the model page","picker.search":"Search providers","picker.searchPlaceholder":"Search providers…","picker.keyHint":{one:"API key · {count} model",other:"API key · {count} models"},"picker.loading":"Loading providers…","picker.retry":"Try again","picker.noMatch":"No provider matches","editor.back":"Back to the provider list","editor.delete":"Delete this provider","editor.connection":"Connection","editor.providerName":"Provider name","editor.name":"Connection name","editor.protocol":"API protocol","editor.url":"API URL","editor.defaultUrl":"The provider's own address","editor.key":"API key","editor.keyPlaceholder":"Enter the API key","editor.keySaved":"Saved. Leave empty to keep it.","editor.settings":"Connection settings","editor.models":"Model list","editor.selected":"{selected} of {total} selected","editor.fetch":"Get the model list","editor.fetching":"Getting…","editor.fetched":{one:"Got {count} model",other:"Got {count} models"},"editor.noneReturned":"This endpoint returned no models","editor.fetchFailed":"Couldn't get the model list","editor.loadingCatalog":"Loading the model catalog…","editor.autoSelected":"Autoconfigure selected","editor.addManually":"Add manually","editor.filter":"Filter models","editor.filterPlaceholder":"Filter models…","editor.selectVisible":"Select everything shown","editor.empty":"No models yet","editor.emptyCustom":"Get the model list, or add a model by hand.","editor.emptyBuiltin":"You can add a model by hand.","editor.autoSummary":"{parts}; saved with the form","editor.autoMatched":{one:"{count} configured",other:"{count} configured"},"editor.autoChoose":{one:"{count} needs a source",other:"{count} need a source"},"editor.autoNone":{one:"{count} not in the catalog",other:"{count} not in the catalog"},"editor.autoFailed":{one:"{count} failed",other:"{count} failed"},"editor.confirmDelete":'Delete "{name}" and its models?',"editor.deleteFailed":"Could not delete","editor.saveFailed":"Could not save","editor.saved":"Saved","editor.reset":"Reset models","editor.resetTitle":"Reset the models to the defaults?","editor.resetModels":{one:"{count} model will be restored to its defaults.",other:"{count} models will be restored to their defaults."},"editor.resetRemoves":{one:"{count} model not in the defaults will be removed: {names}.",other:"{count} models not in the defaults will be removed: {names}."},"editor.resetBots":{one:"{bots} uses a model that will be removed and will need to pick another.",other:"{bots} use models that will be removed and will need to pick others."},"editor.resetKeeps":"The API URL and protocol will be restored to the defaults. Sign-in details and the API key are kept. Unsaved changes will be discarded.","editor.resetConfirm":"Reset","editor.resetDone":"Models reset to the defaults","editor.resetFailed":"Couldn't reset","editor.saving":"Saving…","editor.save":"Save","card.defaultProtocol":"The provider's own protocol","card.modelId":"Model ID","card.modelName":"Model name","card.optional":"Optional","card.newModel":"New model","card.enterId":"Enter the model ID","card.use":"Use {name}","card.remove":"Remove {name}","card.image":"Image","card.reasoning":"Thinking","card.capabilities":"Capabilities","card.reasoningThinking":"Thinking / reasoning","card.imageInput":"Image input","card.specs":"Model specs","card.hidePrices":"Hide prices","card.editPrices":"Edit prices","card.context":"Context window · tokens","card.maxOutput":"Maximum output · tokens","card.costTitle":"Price per million tokens","card.costInput":"Input","card.costOutput":"Output","card.costCacheRead":"Cache read","card.costCacheWrite":"Cache write","card.notProvided":"Not given","card.advanced":"Advanced","card.apiOverride":"API protocol","card.headers":"Headers","card.headerSaved":"Saved. Leave empty to keep it.","card.addHeader":"Add a header","card.removeHeader":"Remove this header","card.compat":"Compat flags","card.jsonObject":"Enter a JSON object","auto.run":"Autoconfigure","auto.pending":"Configuring…","auto.failed":"Autoconfigure failed","auto.tagChoose":"Pick a source","auto.tagNone":"Not in the catalog","auto.official":"Official","auto.matched":"Filled in from {source}{note}{suffix}","auto.reseller":" (a reseller's catalog, not the vendor's)","auto.applied":"; it takes effect once saved.","auto.apiMismatch":"The catalog has this model on the {api} protocol, not the one chosen here, so the thinking format and compat flags were left alone.","auto.changeSource":"Change the source","auto.multiple":"Several official sources share this model name; pick one:","auto.similar":"The catalog has no {modelId}; similar models:","auto.notFound":"The catalog has no such model. Fill it in by hand.","thinking.title":"Thinking","thinking.format":"Thinking format","thinking.protocolDefault":"The protocol's default","thinking.onlyCompletions":"Only used by the OpenAI Chat Completions protocol","thinking.levels":"Thinking levels","thinking.level.off":"Off","thinking.level.minimal":"Minimal","thinking.level.low":"Low","thinking.level.medium":"Medium","thinking.level.high":"High","thinking.level.xhigh":"Extra high","thinking.level.max":"Maximum","thinking.levelName":"{level} level","thinking.levelValue":"Value sent for the {level} level","thinking.supportedDefault":"Supported (default)","thinking.unsupported":"Not supported","thinking.supportedCustom":"Supported, send this value","thinking.supported":"Levels in use: {levels}","auth.title":"Account authorization","auth.running":"Authorizing","auth.openPage":"Open the authorization page","auth.code":"Code: {code}","auth.browser":"Sign in with the browser (OAuth)","auth.deviceCode":"Sign in with a device code","auth.redirectFull":"The full redirect URL","auth.redirectOrCode":"Code or redirect URL","auth.manualNote":"If the browser does not come back on its own, paste the redirect URL here.","auth.waiting":"Waiting for authorization…","auth.cancel":"Cancel authorization","auth.configureCredential":"Set up the credential","auth.signInAgain":"Sign in again","auth.signIn":"Sign in","auth.removeCredential":"Remove the credential","auth.signOut":"Sign out","auth.statusFailed":"Couldn't get the sign-in status","auth.refresh":"Refresh the state","auth.antigravityRisk":"Using Antigravity through a third-party app may break Google's terms of service, and the account may be suspended.","picker.loadFailed":"Couldn't load the providers","quota.title":"Usage","quota.refresh":"Refresh","quota.checking":"Checking…","quota.unchecked":"Refresh to check the current usage.","quota.failed":"Couldn't check the usage: {error}","quota.stale":"Couldn't refresh; showing the last result. {error}","quota.unlimited":"No usage limits on this plan.","quota.noReport":"This subscription doesn't report its usage.","quota.openPage":"View usage","quota.checked":"Updated {time}","quota.fromReply":"Updated from a reply {time}","quota.justNow":"just now","quota.minutesAgo":{one:"{count} minute ago",other:"{count} minutes ago"},"quota.hoursAgo":{one:"{count} hour ago",other:"{count} hours ago"},"quota.hours":{one:"{count}-hour",other:"{count}-hour"},"quota.day":"Daily","quota.week":"Weekly","quota.month":"Monthly","quota.credits":"Credits","quota.premium":"Premium requests","quota.chat":"Chat","quota.completions":"Completions","quota.named":"{name} · {window}","quota.left":"{percent} left","quota.summary":"{label} {percent} left","quota.creditsLeft":"{amount} left","quota.amountLeft":"{left} of {total} left","quota.resetsSoon":"Resets soon","quota.resetsInMinutes":{one:"Resets in {count} minute",other:"Resets in {count} minutes"},"quota.resetsInHours":{one:"Resets in {count} hour",other:"Resets in {count} hours"},"quota.resetsOn":"Resets {date}"},I7={"rail.label":"Navigation","rail.chats":"Chats","rail.environments":"Environments","home.talk":"Talk to {name}","home.recent":"Recent messages","home.openDm":"Open the DM","home.call.reply":"New reply","home.call.ask":"Waiting for your answer","home.call.error":"The last run failed","home.failed":"That run failed: {reason}","home.answerInDm":"Answer in the DM","sidebar.label":"Chats","sidebar.create":"Create","sidebar.createMenu":"Create menu","sidebar.newChannel":"New channel","sidebar.newSection":"New channel group","sidebar.newBot":"New Bot","sidebar.alerts":"{count} unread for you","sidebar.unread":"{count} unread","sidebar.said":"{name}: {text}","sidebar.atMe":"[Mentioned you]","sidebar.more":"More actions for {name}","sidebar.asking":"(waiting for your answer)","sidebar.working":"(working)","sidebar.pinned":"Pinned","sidebar.muted":"Muted","sidebar.hasUnread":"Unread","sidebar.editSection":"Edit group: {name}","sidebar.search":"Search chats and messages","sidebar.results":"Search results","sidebar.chats":"Chats","sidebar.nav":"Channels and DMs","sidebar.followed":"Followed threads","sidebar.channels":"Channels","sidebar.dms":"DMs","sidebar.noDms":"No DMs yet","search.title":"Search","search.paneLabel":"Search in this chat","search.inThread":"This thread","search.inDm":"This DM","search.close":"Close search","search.placeholder":"Search messages","search.channelPlaceholder":"Search this channel and its threads","search.prompt":"Type what you're looking for","search.searching":"Searching…","search.noMessages":"No messages found","search.count":{one:"{count} message, newest first",other:"{count} messages, newest first"},"search.countLatest":"Showing the latest {count}","search.showAll":"Show all {count}","search.threads":"Threads","search.channels":"Channels (topics and notices)","search.messages":"Messages","search.channel":"Channel","member.unknown":"Unknown member","member.deleted":"{name} (deleted)","members.view":"View {name}","members.remove":"Remove {name}","members.more":"More for {name}","members.menu":"Member actions","members.creator":"Creator","members.admin":"Admin","members.makeAdmin":"Make admin","members.removeAdmin":"Remove admin","members.removeFromChannel":"Remove from channel","members.count":{one:"{count} member",other:"{count} members"},"members.people":"People","members.removeTitle":"Remove {name} from #{channel}","members.removeBody":"They won't get this channel's messages anymore.","members.removeConfirm":"Remove","chat.area":"Conversation","chat.botDms":"{name}'s DMs with other Bots","chat.botStatus":"Bot status","chat.transcript":"Messages","chat.loading":"Loading…","chat.empty":"No messages yet","chat.start":"Start a conversation with {name}","chat.loadingOlder":"Loading earlier messages…","chat.toLatest":"Jump to the latest","chat.unseen":{one:"{count} new message",other:"{count} new messages"},"chat.toChannel":"Message #{name}","chat.toBot":"Message {name}…","chat.pickModel":"Choose a model for this Bot to start messaging","chat.pick":"Pick a chat","channel.infoFor":"Channel info: {name}","channel.membersCount":{one:"{count} member",other:"{count} members"},"channel.members":"Members","channel.search":"Search channel messages (Ctrl+F)","channel.threads":"Threads","notice.title":"Notice","notice.edit":"Edit the notice","notice.content":"Notice text","notice.none":"No notice yet","notice.version":"v{version}","chat.newBelow":"New messages","chat.today":"Today","chat.yesterday":"Yesterday","channel.echo":"Replied in “{title}”","channel.replies":{one:"{count} reply",other:"{count} replies"},"channel.threadDone":"Done","channel.lastReply":"Last reply {time}","channel.replyInThread":"Reply in thread","info.edit":"Edit {name}","info.memberList":"Member list","info.back":"Back to channel info","info.addMembers":"Add members","info.name":"Name","info.newChannel":"New channel","info.topic":"Topic","info.noTopic":"No topic yet","info.section":"Group","info.menu":"Channel","info.noSection":"None","mention.menu":"Mention a member","mention.inThread":"In this thread","mention.inChannel":"Others in the channel","mention.outside":"Not in this channel","mention.outsideList":"Members not in this channel","mention.searchOutside":"Search members not in this channel","mention.invites":"Choosing someone adds them to this channel","quote.inline":"“{text}”","quote.by":"{name}:","quote.remove":"Remove quote: {text}","quote.tooMany":"A message can quote up to {count} passages","quote.selection":"Selected text","quote.copy":"Copy","quote.quote":"Quote in reply","ref.label":"Message from {name}: {text}","ref.dm":"DM · {title}","ref.open":"Go to message","composer.busy":"Still uploading. Add more once it's done.","composer.tooMany":"A message can have up to {count} attachments.","composer.size":"Attachments can't be empty or larger than {limit}.","composer.pasted":"pasted-image","composer.removeFile":"Remove attachment: {name}","composer.uploading":"Uploading: {name}","composer.cancelUpload":"Cancel upload: {name}","composer.replying":"Replying to","composer.cancelReply":"Cancel reply","composer.drop":"Drop to attach","composer.attach":"Attach files","composer.input":"Message","composer.send":"Send","files.preview":"Preview {name}","files.download":"Download {name}","files.gone":"This attachment doesn't exist or was deleted","files.readFailed":"Couldn't open the file ({status})","files.readError":"Couldn't open the file","files.kindImage":"Image","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"Text","files.kindFile":"File","files.downloadFile":"Download","files.showPreview":"Preview","files.showSource":"Source","files.showText":"Plain text","files.openTab":"Open in a new tab (isolated)","files.narrow":"Shrink the preview","files.widen":"Widen the preview","files.closePreview":"Close the preview","files.running":"Scripts are running in isolation: they can reach the network but can't read Jarvy's data.","files.scripts":{one:"This HTML has {count} script{hosts}. It isn't running. Once run, it can reach the network but can't read Jarvy's data.",other:"This HTML has {count} scripts{hosts}. They aren't running. Once run, they can reach the network but can't read Jarvy's data."},"files.scriptHosts":" (loading {hosts})","files.andMore":" and more","files.stop":"Stop scripts","files.run":"Run scripts","files.downloadToView":"Download this file to view it","files.tooLarge":"This file is over 1 MB, too large to preview here.","files.unsupported":"This file can't be previewed here.","files.reading":"Reading the file…","files.runningTitle":"{name} (running)","files.previous":"Previous attachment","files.choose":"Pick a file to preview","files.next":"Next attachment","question.failed":"Couldn't send the answer","question.dismissed":"Dismissed","request.outcome.allowed":"Allowed","request.outcome.added":"Added","request.outcome.once":"Allowed for this run","request.outcome.declined":"Declined","request.outcome.ignored":"Ignored","question.chose":"Chose: {answer}","question.dismissLabel":"Close the question without answering","question.dismiss":"Skip","question.multiple":"Pick one or more","question.note":"Add a note (optional)","question.own":"Or write your own…","question.ownLabel":"Your own answer","question.confirmCount":"OK ({count})","question.confirm":"OK","question.send":"Send","directs.back":"Back to the list","directs.between":"{name} and {other}","directs.readOnly":"Read only","files.kindVideo":"Video","files.kindAudio":"Audio","files.cantPlay":"This browser can't play it","files.cantPlayHint":"Download it and open it in a player.","reactions.more":"+{count}"},q7={"threadSort.title":"Sort","threadSort.current":"Sort: {order}","threadSort.updated":"Last updated","threadSort.created":"Created","threadSort.status":"Status","threads.list":"Thread list","threads.closeList":"Close the thread list","threads.byStatus":"Filter by status","threads.openCount":"Open {count}","threads.doneCount":"Done {count}","threads.all":"All","threads.loading":"Loading…","threads.loadFailed":"Couldn't load the threads","threads.none":"No threads yet","threads.following":"Following","threads.filter":"Filter","threads.unreadCount":"Unread {count}","threads.unread":"Unread","threads.noneUnread":"No unread threads","threads.noneOpen":"No open threads","threads.noneDone":"No finished threads","threads.notFollowing":"Not following","threads.pick":"Pick a thread","threads.open":"Open","thread.rename":"Rename","thread.title":"Thread title","thread.toggleStatus":"Switch status","thread.summary":"Summary","thread.editSummary":"Edit the summary","thread.conclude":"Mark done and post the summary to #{channel}","thread.addSummary":"Add a summary","thread.sourceElsewhere":"The original message isn't in this thread","thread.label":"Thread","thread.backToList":"Back to the thread list","thread.inChannel":"View in channel","thread.search":"Search thread messages (Ctrl+F)","thread.followingHint":"New replies count as unread","thread.notFollowingHint":"New replies don't count as unread","thread.follow":"Follow","thread.expand":"Expand","thread.collapse":"Back to the side panel","thread.close":"Close the thread panel","thread.conclusion":"Conclusion:","thread.concluded":"Marked done; the summary was posted to #{channel}","thread.noReplies":"No replies yet","thread.toLatest":"Jump to the latest reply","thread.reply":"Reply in thread"},P7={"usage.title":"Usage","usage.range":"Time range","usage.today":"Today","usage.days":"{count} days","usage.all":"All","usage.refresh":"Refresh","usage.refreshLabel":"Refresh usage","usage.retry":"Retry","usage.loading":"Loading usage…","usage.loadFailed":"Could not load usage","usage.empty":"No model calls in this period","usage.model":"Model","usage.calls":"Calls","usage.input":"Input","usage.output":"Output","usage.cacheRead":"Cache read","usage.cacheWrite":"Cache write","usage.cost":"Cost","usage.total":"Total","usage.byModel":"By model","usage.byBot":"By Bot","usage.unpriced":"No price set","usage.notePartial":"The total cost leaves out models with no price set.","usage.noteCosts":"Costs leave out models with no price set.","activity.error":"Error","activity.running":"Running","activity.reasoning":"Thinking","activity.texting":"Replying","activity.toolCalling":"Using tools","activity.asking":"Waiting for your answer","activity.noModel":"No model","activity.idle":"Idle","activity.stopped":"Not running","bot.saved":"Saved","bot.changeFailed":"Couldn't change it","bot.color":"Avatar color","bot.contextHint":"Context in use, as the model reported it with the Bot's last reply","bot.contextStale":"The latest model request failed. This is the context usage from the last successful request.","bot.context":"Context","bot.unknown":"Unknown","bot.tokens":"{used} / {window} tokens","bot.description":"Description","bot.descriptionPlaceholder":"What can this Bot do for you?","bot.personaPlaceholder":"The Bot's personality, duties and habits","bot.personaHint":"Applies from the next time it starts working.","bot.unsaved":"Unsaved changes","bot.saving":"Saving…","agent.title":"Agent Bot","agent.intro":"{name} is your agent Bot: it helps you run Jarvy itself. Ask it in a DM or a channel to:","agent.create":"Create Bots and change their name, description and persona","agent.model":"Give Bots a model and a thinking level","agent.run":"Start or stop Bots, and see their usage","agent.delete":"Delete Bots, channels and channel groups, or remove members from a channel, always after you confirm on a card","bot.aborting":"Interrupting…","bot.abort":"Interrupt the current task","bot.starting":"Starting…","bot.stopping":"Stopping…","bot.start":"Start","bot.stop":"Stop","bot.workspace":"Workspace","bot.copyWorkspace":"Copy the workspace path","bot.tab.overview":"Overview","bot.tab.profile":"Profile","bot.tab.environment":"Environment","bot.tab.tasks":"Tasks","bot.tab.access":"Access","bot.tab.activity":"Activity","bot.subscriptions":"Subscriptions","bot.noSubscriptions":"No subscriptions","bot.threadIn":"Thread · #{channel}","botModel.auto":"Default level","botModel.off":"Off","botModel.minimal":"Minimal","botModel.low":"Low","botModel.medium":"Medium","botModel.high":"High","botModel.xhigh":"Extra high","botModel.max":"Maximum","botModel.loadFailed":"Couldn't load the model list","botModel.switchFailed":"Couldn't switch the model","botModel.pick":"Pick the Bot's model","botModel.broken":"This model isn't available anymore. Choose another one.","botModel.choose":"Pick a model","botModel.filter":"Filter the Bot's models","botModel.filterPlaceholder":"Filter models…","botModel.list":"Bot models","botModel.noMatch":"No matching models","botModel.none":"No models yet. Add one in Settings.","botModel.manage":"Manage models","botModel.thinking":"Thinking","botModel.pickThinking":"Pick the thinking level","botModel.loading":"Loading models…","botModel.switching":"Switching…","botModel.pickFor":"Pick a model for {name}","deleteBot.title":"Delete {name}","deleteBot.after":"Once deleted:","deleteBot.chats":{one:"Its {count} DM, channel memberships and subscriptions are deleted.",other:"Its {count} DMs, channel memberships and subscriptions are deleted."},"deleteBot.messages":"Its messages in channels and threads stay, shown as from “{name}”; the name can be used again.","deleteBot.history":"Its session history and unfinished tasks are cleared.","deleteBot.files":"Also delete the workspace folder","deleteBot.filesHint":"The workspace may hold files it made. It's kept unless you tick this.","deleteBot.deleting":"Deleting…","deleteBot.working":"Working…","history.reasoning":"Thinking","history.text":"Text","history.empty":"(empty)","history.image":"Image in History","history.toolCall":"Tool call","history.toolResult":"Tool result","history.error":"Error","history.related":"View related record #{id}","history.result":"Result","history.call":"Call","history.details":"Structured result","history.view":"Record view","history.content":"Content","history.json":"Raw JSON","history.contentLabel":"Record content","history.tools":"Tool definitions","history.toolsRemoved":"Removed tools","history.stopReason":"Stop reason","activity.detailFailed":"Couldn't load the record","activity.detailLoading":"Loading the record…","activity.openChat":"Open the chat","activity.sentBy":"Sent by call #{id}","activity.roleSystem":"System","activity.roleUser":"Input","activity.roleAssistant":"Assistant","activity.timeline":"Bot activity timeline","activity.chatMessage":"Chat message {id}","activity.viewMessage":"View message {sequence} · {chat}","activity.attachmentOnly":"Attachments only","activity.attachments":{one:"{count} attachment",other:"{count} attachments"},"activity.viewSentBy":"View call #{id}, which sent it","activity.historyRecord":"History record #{id}","activity.viewHistory":"View History #{id} · {role}","activity.emptyMessage":"(empty message)","activity.loadFailed":"Couldn't load the activity","activity.backToTimeline":"Back to the timeline","activity.newestFirst":"Newest first","activity.refresh":"Refresh the activity","activity.reading":"Loading…","activity.columnChat":"Chat","activity.columnTime":"Time","activity.loading":"Loading the activity…","activity.empty":"No activity yet","activity.newer":"Newer","activity.page":"Page {page}","activity.older":"Older","activity.historyDetail":"History record details","activity.chatDetail":"Chat message details","activity.toolCall":"Called {name}","activity.toolResult":"{name} · result","activity.toolFailed":"{name} · failed","activity.images":{one:"{count} image",other:"{count} images"},"bot.newName":"New Bot","bot.newNameN":"New Bot {n}","agent.oversee":"See every channel and DM and other Bots' activity, and work in other Bots' sandboxes or machines it hasn't been granted once you allow it on a card; all of it is in its Log","bot.tab.log":"Log","agentLog.title":"Log","agentLog.empty":"Nothing logged yet","agentLog.more":"Load more","agentLog.loadFailed":"Couldn't load the log","agentLog.outcome.done":"Done","agentLog.outcome.failed":"Failed","agentLog.outcome.declined":"Declined","agentLog.outcome.dismissed":"Dismissed","agentLog.outcome.allowed":"Allowed","agentLog.outcome.allowedOnce":"Allowed for this run","agentLog.tool.chats.browse":"Listed every chat","agentLog.tool.chats.info":"Read a chat's details","agentLog.tool.messages.read":"Read messages","agentLog.tool.messages.search":"Searched messages","agentLog.tool.threads.list":"Listed threads","agentLog.tool.chats.join":"Joined a channel","agentLog.tool.environments.enter":"Entered an environment","agentLog.tool.bots.activity":"Read a Bot's activity","agentLog.tool.bots.create":"Created a Bot","agentLog.tool.bots.update":"Changed a Bot","agentLog.tool.bots.start":"Started a Bot","agentLog.tool.bots.stop":"Stopped a Bot","agentLog.tool.bots.delete":"Deleted a Bot","agentLog.tool.chats.delete":"Deleted a channel","agentLog.tool.chats.removeMembers":"Removed members","agentLog.tool.sections.delete":"Deleted a channel group","access.sandboxes":"Other Bots' sandboxes","access.searchSandboxes":"Search sandboxes","access.noSandboxes":"No sandbox it may enter.","access.allSandboxes":"It may enter every sandbox","access.noOtherBots":"No other Bots yet","access.sandboxOf":"{name}'s sandbox"},H7={"npc.toolbar":"NPC prototype","npc.replay":"Replay the turn","npc.mood":"Base mood","npc.mood.normal":"Normal","npc.mood.happy":"Happy","npc.mood.sad":"Sad","npc.mood.angry":"Angry","npc.mood.dizzy":"Dizzy","npc.poses":"Animations","npc.pose.sleep":"Sleeping","npc.pose.idle":"Idle","npc.pose.think":"Thinking","npc.pose.mutter":"Talking to itself","npc.pose.say":"Talking to you","npc.pose.ask":"Waiting for you","npc.pose.read":"Reading a file","npc.pose.work":"Editing, running","npc.pose.compact":"Compacting","npc.pose.busy":"Retrying","npc.pose.failed":"Failed","npc.pose.done":"Done","npc.pose.groom":"Grooming","npc.expand":"Show every step","npc.collapse":"Collapse","npc.panel":"This turn","npc.state.running":"Running","npc.state.ok":"Done","npc.state.failed":"Failed","npc.duration":"{value}s","npc.done":"Done · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"Thinking","npc.step.mutter":"Talked to itself","npc.step.read.running":"Reading {target}","npc.step.read.ok":"Read {target}","npc.step.write.running":"Editing {target}","npc.step.write.ok":"Edited {target}","npc.step.run.running":"Running {target}","npc.step.run.ok":"Ran {target}","npc.step.run.failed":"{target} failed","npc.step.compact.running":"Tidying up the context","npc.step.compact.ok":"Tidied up the context","npc.step.ask.running":"Waiting for your answer","npc.step.ask.ok":"You chose “{answer}”","npc.step.say.running":"Replying to you","npc.step.say.ok":"Replied to you","npc.step.post.running":"Posting to {chat}","npc.step.post.ok":"Posted to {chat}","npc.demo.think1":"fish says the thread pane jumps when it opens. The scroll may run at the wrong moment. Let me first see how ThreadPane scrolls.","npc.demo.think2":"It scrolls before the replies have their height. Scrolling after layout should fix it. The reply count belongs in the dependencies too.","npc.demo.mutter1":"Edited. Let me run the build first.","npc.demo.mutter2":"Hmm… the types don't pass; the ref can be null.","npc.demo.channel":"dev","npc.demo.post":"The thread pane no longer jumps when it opens, and the build passes. Waiting for fish to confirm.","npc.demo.question":"Fixed. Should I also update the screenshots in the docs?","npc.demo.yes":"Yes, update them","npc.demo.no":"Not now","npc.demo.replyYes":"Done: the thread pane now opens at the newest reply without jumping, and the screenshots in the docs are new. The build passes.","npc.demo.replyNo":"Done: the thread pane now opens at the newest reply without jumping. The build passes; I left the screenshots as they are.","npc.live.omitted":"… {count} characters left out …","npc.live.tokens":"Context: {before} → {after} tokens","npc.live.compact.running":"Tidying up the context","npc.live.compact.ok":"Tidied up the context","npc.live.compact.failed":"Couldn't tidy up the context","npc.live.retry.running":"Retrying ({attempt}/{max})","npc.live.retry.ok":"Retried","npc.live.retry.failed":"Retrying failed","npc.live.read.running":"Reading {target}","npc.live.read.ok":"Read {target}","npc.live.read.failed":"Couldn't read {target}","npc.live.edit.running":"Editing {target}","npc.live.edit.ok":"Edited {target}","npc.live.edit.failed":"Couldn't edit {target}","npc.live.write.running":"Writing {target}","npc.live.write.ok":"Wrote {target}","npc.live.write.failed":"Couldn't write {target}","npc.live.run.running":"Running {target}","npc.live.run.ok":"Ran {target}","npc.live.run.failed":"{target} failed","npc.live.script.running":"Running a script","npc.live.script.ok":"Ran a script","npc.live.script.failed":"The script failed","npc.live.tool.running":"Using {tool}","npc.live.tool.ok":"Used {tool}","npc.live.tool.failed":"{tool} failed","npc.live.sendFailed":"The message didn't go out","npc.live.switch.running":"Switching work environment","npc.live.switch.ok":"Switched work environment","npc.live.switch.failed":"Couldn't switch work environment","npc.live.askFailed":"The question didn't go out","npc.live.askClosed":"The question was closed","npc.live.answerBelow":"Answer on the card below","npc.live.answerIn":"Answer in {chat}","npc.live.browse.running":"Looking through {chat}","npc.live.browse.ok":"Looked through {chat}","npc.live.browseAll.running":"Looking through the chats","npc.live.browseAll.ok":"Looked through the chats","npc.done.interrupted":"Interrupted · {duration}","npc.done.failed":"The turn failed · {duration}"},F7={"environment.title":"Work environment","environment.own":"Docker sandbox","environment.container":"Container","environment.image":"Image","environment.mount":"Workspace mount","environment.external":"External environments","envs.sandboxOf":"{name}'s sandbox","enterCard.title":"Request to enter {name}","envs.back":"All environments","envs.workingHere":{one:"{names} is working here",other:"{names} are working here"},"environment.state.preparing":"Preparing","environment.state.running":"Running","environment.state.stopped":"Stopped","environment.state.failed":"Failed to start","environment.state.unavailable":"Unavailable","environment.unavailable":"{why}, so a sandbox can't be started for this Bot (without one, it can't read or write files, run commands and so on).","environment.unavailable.missing":"Docker isn't installed here","environment.unavailable.stopped":"The Docker service isn't running here","environment.unavailable.denied":"No permission to use Docker here","environment.unavailable.failed":"Docker can't be used here","environment.start":"Start","environment.starting":"Starting…","environment.stop":"Stop","environment.stopping":"Stopping…","environment.stopTitle":"Stop {name}'s sandbox?","environment.stopBody":"Programs running in the sandbox will be closed. Installed software and workspace files are kept.","environment.stopConfirm":"Stop","environment.reset":"Reset…","environment.resetTitle":"Reset {name}'s sandbox?","environment.resetBody":"Software installed in the sandbox will be removed. Workspace files are kept.","environment.resetConfirm":"Reset","environment.resetBodyVm":"Software installed in the sandbox, and Docker's images, containers and volumes there, will be removed. Workspace files are kept.","environment.restartNote":"The new size takes effect when the sandbox next starts.","environment.restart":"Restart now","environment.restartTitle":"Restart {name}'s sandbox?","environment.restartBody":"Programs running in the sandbox will be closed. Installed software and workspace files are kept.","environment.restartConfirm":"Restart","environment.type":"Type","environment.type.container":"Container","environment.type.vm":"Virtual machine","environment.type.checking":"Checking whether this computer can run virtual machines…","environment.type.unavailable":"This computer can't run virtual machine sandboxes: {why}.","environment.type.why.no_kata":"Kata isn't installed","environment.type.why.no_kvm":"it has no KVM","environment.type.why.busy":"hardware virtualization is taken by other virtual machine software (such as VirtualBox)","environment.type.why.failed":"a trial virtual machine didn't start","environment.type.recheck":"Check again","environment.type.vmTitle":"Make {name}'s sandbox a virtual machine?","environment.type.vmBody":"The sandbox is made afresh, with Docker and Docker Compose inside: workspace files are kept, software installed in it is removed. The first switch builds its image, which can take a few minutes.","environment.type.containerTitle":"Make {name}'s sandbox a container?","environment.type.containerBody":"The sandbox is made afresh: workspace files are kept; software installed in it, and Docker's images, containers and volumes there, are removed.","environment.type.confirm":"Switch","environment.type.switching":"Switching…","environment.limits":"Resource limits","environment.limits.edit":"Change resource limits","environment.limits.none":"No limits","environment.limits.unlimited":"Unlimited","environment.limits.memory":"Memory {value}","environment.limits.cpu":"CPU {value}","environment.limits.cores":"{count} cores","environment.limits.oneCore":"1 core","environment.limits.memoryField":"Memory (GB)","environment.limits.cpuField":"CPU (cores)","environment.limits.machine":"This machine: {cpus} cores · {memory} GB","environment.limits.below":"Below the {usage} in use now. After saving, some programs in the sandbox may be ended.","environment.limits.failed":"Couldn't change the resource limits","environment.limits.vm":"Size","environment.limits.vmEdit":"Change the virtual machine's size","environment.limits.vmDefault":"Empty fields mean the default: 4 GB and 2 cores.","environment.limits.vmLater":"It is running: the new size takes effect when it next starts.","environment.usage.memory":"Memory","environment.usage.cpu":"CPU","environment.usage.disk":"Docker disk","environment.usage.machine":"{used} / {whole} (this machine)","environment.usage.host":"Takes {value} of this machine","error.typeInvalid":"A sandbox is a container or a virtual machine.","error.vmSizeInvalid":"A virtual machine can have 1–{memory} GB of memory and 1–{cpus} CPUs.","error.vmUnavailable":"This computer can't run virtual machine sandboxes right now.","error.limitsInvalid":"Memory can be 0.25–{memory} GB and CPU 0.1–{cpus} cores, or unlimited."},U7={"connection.lan":"LAN access","connection.localOnly":"This computer only","connection.localOnlyHint":"Jarvy accepts connections from this computer only. To use it from other devices on your network, restart it with {flag}.","connection.addresses":"Addresses","connection.copy":"Copy address","connection.root":"Security certificate","connection.download":"Download certificate","connection.fingerprint":"SHA-256 fingerprint","connection.fingerprintSha1":"SHA-1 fingerprint","connection.howTo":"Installation instructions","connection.howMac":"Mac: Open the certificate to add it to Keychain Access, double-click it, then under Trust set When using this certificate to Always Trust.","connection.howWindows":"Windows: Open the certificate, click Install Certificate, choose Place all certificates in the following store, then pick Trusted Root Certification Authorities. The Thumbprint on the certificate's Details tab is the SHA-1 fingerprint above.","connection.howIos":"iPhone and iPad: Download it in Safari, install it in Settings › General › VPN & Device Management, then turn on full trust in Settings › General › About › Certificate Trust Settings.","connection.howAndroid":"Android: Download it, then search Settings for CA certificate and install it. Where it lives varies by phone, usually under Security or Encryption & credentials.","connection.howRestart":"After installing, quit the browser completely and open it again so it picks up the certificate.","connection.allowHttp":"Allow HTTP access","connection.allowHttpHint":"Passwords and conversations travel in plain text; turn this on only on a network you trust.","connection.insecure":"This connection isn't encrypted. Others on the same network could see passwords and conversations.","connection.useHttps":"Switch to HTTPS"},$7={"secrets.add":"Add secret","secrets.empty":"No secrets yet","secrets.name":"Name","secrets.description":"Description","secrets.descriptionPlaceholder":"Optional, such as what it's for","secrets.value":"Value","secrets.newValue":"New value","secrets.newValuePlaceholder":"Leave empty to keep the current value","secrets.showValue":"Show value","secrets.hideValue":"Hide value","secrets.shortValue":"This value is shorter than 8 characters and may not be hidden when it appears in what Bots see.","secrets.noDescription":"No description","secrets.grantCount":{one:"Granted to {count} Bot",other:"Granted to {count} Bots"},"secrets.notGranted":"Not granted","secrets.unreadable":"Can't decrypt","secrets.unreadableHint":"This value was encrypted with a different master key and can't be read. Enter it again.","secrets.fingerprint":"Fingerprint","secrets.updated":"Updated {time}","secrets.usedCount":{one:"Used {count} time",other:"Used {count} times"},"secrets.neverUsed":"Never used","secrets.grants":"Bots that can use it","secrets.noBots":"No Bots yet.","secrets.addBots":"Add Bots","secrets.noGrants":"No Bot can use it yet.","secrets.searchBots":"Search Bots","secrets.noMatch":"No matching Bots","secrets.allGranted":"Every Bot can already use it.","secrets.revoke":"Remove {name}","secrets.onceTag":"This time only","secrets.edit":"Edit secret","secrets.uses":"Recent uses","secrets.noUses":"No uses yet.","secrets.deletedBot":"Deleted Bot","secrets.useCommand":"Command","secrets.useSsh":"SSH signature","secrets.delete":"Delete secret","secrets.deleteTitle":"Delete {name}?","secrets.deleteBody":"Bots that were granted it can no longer use it. Its use history is kept.","secrets.deleteConfirm":"Delete","secrets.masterKey":"Master key","secrets.keyFile":"Location","secrets.keyHint":"Copy this file too when you back up or move Jarvy; without it, secrets and API keys must be entered again.","secretCard.title":"Request to use the secret {name}","secretCard.valuePlaceholder":"Paste or type the value","secretCard.insecure":"This connection isn't encrypted, so others on the same network could see the value. Switch to HTTPS before entering it.","secretCard.exists":"This secret is already saved in Settings › Secrets.","secretCard.replace":"Replace value","secretCard.keepValue":"Use the saved value","secretCard.unreadable":"The saved value can't be decrypted. Enter it again.","secretCard.value":"Value","secretCard.valueHint":"It's saved encrypted in Settings › Secrets and never shown in the chat.","secretCard.always":"Always allow","secretCard.once":"This time only","secretCard.decline":"Decline","error.secretNameInvalid":"Use capital letters, digits and underscores, starting with a letter.","error.secretNameTaken":"Another secret already has this name.","error.secretValueMissing":"Enter a value.","error.secretValueTooLong":"The value is too long. The limit is 16 KB.","error.secretDescriptionInvalid":"The description must be a single line of up to 200 characters.","error.secretMissing":"Can't find this secret. It may have been deleted.","error.credentialUnreadable":"The saved API key can't be decrypted. Enter it again in Settings › Models.","access.secrets":"Secrets","access.searchSecrets":"Search secrets","access.searchMachines":"Search environments","access.noSecrets":"No secrets granted.","access.noMachines":"No external environments granted.","access.noMatch":"No matches","access.allSecrets":"Every secret is granted.","access.allMachines":"Every external environment is granted.","access.noSecretsYet":"No secrets yet.","access.newSecret":"New secret","access.noMachinesYet":"No external environments yet.","access.loadFailed":"Couldn't load access."},V7={"machines.add":"Add machine","machines.host":"Host","machines.hostPlaceholder":"192.168.1.20 or dev.example.com","machines.port":"Port","machines.user":"User","machines.name":"Name","machines.directory":"Start directory","machines.description":"Description","machines.descriptionPlaceholder":"Purpose, installed software, things to note","machines.directoryPlaceholder":"Home","machines.next":"Next","machines.scanning":"Connecting…","machines.fingerprint":"Host fingerprint","machines.fingerprintHint":"Check it against ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub on that machine before going on.","machines.password":"Password","machines.passwordHint":"Used to install the key Jarvy generates. If the machine doesn't support key login, the password is stored encrypted and used to log in.","machines.byPassword":"Password","machines.byKey":"Public key","machines.publicKey":"Public key","machines.keyHint":"Add it to ~/.ssh/authorized_keys for {user}, then verify.","machines.copy":"Copy","machines.copied":"Copied","machines.verify":"Verify and add","machines.verifying":"Verifying…","machines.login":"Login","machines.loginKey":"Key","machines.loginPassword":"Password","machines.passwordLogin":"This machine doesn't support key login, so the saved password is used. Enable PubkeyAuthentication to switch to key login.","machines.newPassword":"New password","machines.updatePassword":"Update password","machines.passwordUpdated":"Password updated.","machines.useKey":"Switch to key login","machines.usingKey":"Switched to key login. The saved password was deleted.","machines.stillPassword":"This machine still doesn't accept Jarvy's key.","machines.connect":"Connect and add","machines.connecting":"Adding…","machines.back":"Back","machines.check":"Check fingerprint","machines.checking":"Checking…","machines.unchanged":"The fingerprint hasn't changed.","machines.changed":"The machine now shows a different fingerprint. If it was reinstalled or replaced, check the new one and accept it; otherwise something may be posing as it.","machines.trust":"Accept new fingerprint","machines.delete":"Delete machine","machines.deleteTitle":"Delete {name}?","machines.deleteBody":"Jarvy's key is removed from the machine first. Bots working there go back to their default environment.","machines.deleteConfirm":"Delete","machines.forceTitle":"Can't reach {name}","machines.forceBody":"Jarvy's key stays in ~/.ssh/authorized_keys there, on the line ending in {comment}; you can remove it later. Delete anyway?","machines.forceConfirm":"Delete anyway","machineCard.title":"Request to add {name}","machineCard.existing":"This machine is already in Environments.","machineCard.add":"Connect and add","machineCard.allow":"Allow","machineCard.decline":"Decline","environment.awayMachine":"Using {name}","error.machineMissing":"This machine wasn't found. It may have been deleted.","error.machineNameTaken":"Another machine already has this name.","error.sshPasswordMissing":"Enter the password.","error.sshKeyUnreadable":"This machine's key can't be decrypted with the current master key. Delete the machine and add it again.","error.sshBadHost":"The host must be a host name or an IP address.","error.sshBadUser":"Enter a user name on that machine.","error.sshBadPort":"The port must be 1–65535.","error.sshBadDirectory":"The start directory must be an absolute path or start with ~/.","error.sshAuthFailed":"Incorrect user name or password.","error.sshPasswordRefused":"This machine doesn't support password login. Use a public key instead.","error.sshKeyRefused":"This machine didn't accept Jarvy's public key. Make sure it's in ~/.ssh/authorized_keys and that sshd has PubkeyAuthentication enabled.","error.sshKeyExpired":"This public key is no longer valid. Get a new one and add it to the machine.","error.sshUnreachable":"Can't reach this machine. Check the host, port and network.","error.sshHostKeyChanged":"The machine shows a different fingerprint from the accepted one, so Jarvy didn't connect.","error.sshUnsupported":"Only Linux and macOS are supported for now.","error.sshFailed":"SSH failed: {detail}"},G7={"tasks.title":"Scheduled tasks","tasks.empty":"No scheduled tasks","tasks.add":"New task","tasks.edit":"Edit","tasks.delete":"Delete","tasks.deleteTitle":"Delete “{name}”?","tasks.deleteBody":"It won't run again. To stop it for a while, turn it off instead.","tasks.toggle":"Turn {name} on or off","tasks.next":"Next {time}","tasks.paused":"Off","tasks.done":"Done","tasks.newTitle":"New task","tasks.editTitle":"Edit task","tasks.name":"Name","tasks.namePlaceholder":"Morning news","tasks.instruction":"What to do","tasks.instructionPlaceholder":"Read the front pages of the news sites I follow and send me the three stories worth reading, with a line on each.","tasks.when":"When","tasks.kind.once":"Once","tasks.kind.every":"Repeat","tasks.kind.daily":"Daily","tasks.kind.weekly":"Weekly","tasks.at":"Date and time","tasks.everyCount":"Every","tasks.unit.minutes":"minutes","tasks.unit.hours":"hours","tasks.time":"Time","tasks.weekday":"Day","tasks.minimum":"5 minutes at the least.","tasks.saveFailed":"Couldn't save the task","tasks.changeFailed":"Couldn't change the task","tasks.loadFailed":"Couldn't load the tasks","tasks.schedule.once":"Once, {time}","tasks.schedule.minutes":{one:"Every minute",other:"Every {count} minutes"},"tasks.schedule.hours":{one:"Every hour",other:"Every {count} hours"},"tasks.schedule.daily":"Daily at {time}","tasks.schedule.weekly":"Every {day} at {time}","error.taskTimePast":"That time has already passed. Pick a time in the future.","error.taskScheduleInvalid":"Check the schedule: every 5 minutes at the least, and a valid time of day.","error.taskInvalid":"Give the task a name and say what to do."},Y7={"ports.title":"Port forwarding","ports.empty":"No forwarded ports","ports.open":"Open {name}","ports.port":"Port {port}","ports.from":"Forwarded from port {port} in the sandbox","ports.link":"Link","ports.linkOther":"Other address","ports.copy":"Copy link","ports.state":"State","ports.state.live":"Running","ports.state.local":"Local only","ports.state.idle":"Not listening","ports.state.stopped":"Sandbox stopped","ports.state.unknown":"Unknown state","ports.hint.local":"The service listens only on 127.0.0.1 in the sandbox and can't be reached through the link. Ask the Bot to listen on 0.0.0.0.","ports.hint.idle":"No service in the sandbox listens on this port.","ports.hint.stopped":"The link works once the sandbox starts.","ports.stop":"Stop forwarding","ports.stopTitle":"Stop forwarding “{name}”?","ports.stopBody":"Its link stops working. The service keeps running in the sandbox.","ports.loadFailed":"Couldn't load the forwarded ports.","ports.changeFailed":"Couldn't stop forwarding the port.","ports.range":"Forwarding ports","ports.rangeHint":"When a Bot publishes a port, Jarvy forwards it from a port in this range. Ports already forwarded keep theirs.","ports.rangeFrom":"From","ports.rangeTo":"To","ports.rangeSaved":"Saved","error.portInvalid":"That port can't be forwarded.","error.portMissing":"That port isn't forwarded.","error.portRangeInvalid":"Use ports from 1024 to 65535, the first no larger than the last, at most 1000 of them.","error.portRangeOwn":"The range can't include Jarvy's own port.","error.portsExhausted":"No free port left in {from}–{to}. Widen the range in Settings › Network."},K7={"inputs.someone":"Someone","inputs.aChat":"a chat","inputs.message":"{person} · {chat}: {text}","inputs.task":"Task “{name}”: {text}","inputs.reaction":"{person} reacted {emoji} to: {text}","inputs.notice":"{person} updated the notice of {chat} (version {version})","inputs.summary":"{person} updated the summary of {chat} (version {version})","inputs.change":"{person} changed its {what}","inputs.onboard":"First start: {person} has just given it a model","inputs.followed":{one:"Its conversation was compacted; it follows {count} thread",other:"Its conversation was compacted; it follows {count} threads"},"inputs.instructions":"Its instructions changed: {parts}","inputs.more":{one:"{count} in all",other:"{count} in all"},"inputs.raw":"Raw text","inputs.replyTo":"Replying to {person}","inputs.taskTitle":"Scheduled task “{name}”","inputs.due":"due {time}","inputs.reacted":"{person} reacted {emoji}","inputs.unreadThreads":{one:"{count} unread",other:"{count} unread"},"inputs.unread":{one:"{count} unread: {list}",other:"{count} unread: {list}"},"inputs.unreadNotes":"Not read yet: {list}","inputs.version":"{title} (version {version})","inputs.place":"Environment: {name} · {directory}","inputs.sandbox":"Sandbox","inputs.unavailable":"File and command tools were unavailable then","inputs.what.name":"name","inputs.what.description":"description","inputs.what.persona":"persona","inputs.what.model":"model","inputs.what.thinking":"thinking level","inputs.what.run":"run state","inputs.what.environment":"working environment","inputs.what.access":"environment access"},X7={"botCard.agent":"Agent","botCard.state":"State","botCard.worksIn":"Works in","botCard.sandbox":"Sandbox","botCard.onMachine":"Machine {name}","botCard.message":"Message","botCard.info":"Bot info","botCard.open":"Open {name}'s card"},Q7={...L7,...B7,...I7,...q7,...P7,...H7,...F7,...U7,...$7,...V7,...G7,...Y7,...K7,...X7},Z7={"locale.name":"中文","locale.short":"中","common.close":"关闭","common.continue":"继续","common.failed":"操作失败,请重试。","common.listSeparator":",","login.subtitle":"登录以继续","login.form":"登录","login.username":"用户名","login.password":"密码","login.showPassword":"显示密码","login.hidePassword":"隐藏密码","login.submit":"登录","login.submitting":"正在登录…","login.wrong":"用户名或密码不正确。","login.tooMany":"尝试次数过多,请稍后再试。","login.offline":"无法连接到 Jarvy,请检查网络后重试。","login.themeLight":"切换为浅色主题","login.themeDark":"切换为深色主题","general.language":"语言","general.theme":"主题","general.light":"浅色","general.dark":"深色","about.tagline":"你和 AI Bot 一起工作的群聊,完整运行在你自己的电脑上。","about.version":"版本 {version}","about.source":"源代码","about.package":"npm 包","about.license":"许可证","about.notices":"第三方声明","status.signedIn":"已登录","status.signedOut":"未登录","status.configured":"已配置","status.notConfigured":"未配置","account.menu":"账户菜单","account.menuFor":"{name} 的账户菜单","account.toggleTheme":"切换主题","account.signOut":"退出登录","entry.menu":"会话操作","entry.pin":"置顶","entry.unpin":"取消置顶","entry.mute":"免打扰","entry.unmute":"取消免打扰","entry.botInfo":"Bot 信息","entry.channelInfo":"频道信息","entry.deleteBot":"删除 Bot","entry.deleteChannel":"删除频道","hint.reaction":"{actor} 用 {emoji} 回应了你的消息","hint.reactionInThread":"{actor} 用 {emoji} 回应了你在「{title}」中的消息","hint.threadSummary":"{actor} 更新了线程「{title}」的摘要","hint.summary":"{actor} 更新了线程摘要","hint.notice":"{actor} 更新了公告","app.connecting":"正在连接 Jarvy…","app.channelDeleted":"频道已删除","app.botDeleted":"{name} 已删除","app.notInChannel":{one:"{names} 不在本频道,没有收到通知",other:"{names} 不在本频道,没有收到通知"},"app.memberAdded":"{name} 已加入 #{channel}","app.sourceGone":"原消息已不存在","ui.closeNamed":"关闭{name}","ui.copied":"已复制","ui.copyFailed":"复制失败","ui.copyCode":"复制代码","ui.image":"[图片:{alt}]","ui.imageHidden":"外部图片已隐藏","app.deleteChannelTitle":"删除频道 #{name}","app.deleteChannelBody":"频道里的消息、线程和附件都会被删除,且无法恢复。","app.resizePane":"拖动调整侧栏宽度","common.cancel":"取消","common.save":"保存","common.create":"创建","common.delete":"删除","common.retry":"重试","common.back":"返回","common.add":"添加","common.saveFailed":"保存失败","common.openNav":"打开会话列表","common.you":"你","common.member":"成员","common.noMatch":"没有匹配的成员","common.searchMembers":"搜索成员","common.attachment":"[附件]","actions.reply":"回复这条消息","actions.react":"添加表情回应","actions.pickEmoji":"选择表情","actions.recent":"最近使用","actions.searchEmoji":"搜索表情","actions.noEmoji":"没有找到表情","actions.emoji.Smileys & Emotion":"表情和情绪","actions.emoji.People & Body":"人物和手势","actions.emoji.Animals & Nature":"动物和自然","actions.emoji.Food & Drink":"食物和饮料","actions.emoji.Travel & Places":"旅行和地点","actions.emoji.Activities":"活动","actions.emoji.Objects":"物品","actions.emoji.Symbols":"符号","actions.emoji.Flags":"旗帜","actions.fold":"折叠成一行","actions.unfold":"取消折叠","fold.folded":"已折叠","fold.more":"展开全文","fold.less":"收起","dialogs.candidates":"可添加的成员","dialogs.allInside":"所有成员都已在频道中","dialogs.addCount":"添加({count})","dialogs.addFailed":"添加成员失败","dialogs.optional":"可选","dialogs.deleteSection":"删除分组「{name}」?其中的频道会移到「频道」下。","dialogs.deleteFailed":"删除失败,请重试","dialogs.editSection":"编辑频道分组","dialogs.sectionName":"分组名称","dialogs.newSection":"新分组","api.offline":"无法连接到 Jarvy,请检查网络后重试。","api.historyFailed":"无法加载聊天记录,请重试。","error.autoconfigModel":"请填写模型 ID。","error.autoconfigSource":"所选的配置来源无效,请重新选择。","error.botMissing":"找不到这个 Bot,它可能已被删除。","error.agentUndeletable":"主 Bot 不能删除,但可以改名或停止。","error.chatAccessChanged":"你在这个聊天中的权限已变化,请刷新后重试。","error.computerFailed":"沙箱启动失败。","error.computerMissing":"这个 Bot 没有沙箱。","error.dockerUnavailable":"运行 Jarvy 的电脑上没有可用的 Docker。","error.fileTooLarge":"附件不能超过 {limit}。","error.connectionMissing":"找不到这个模型连接,它可能已被删除。","error.credentialChanged":"凭证已更改,请重试。","error.credentialScope":"凭证连接不匹配。","error.credentialsMissing":"请先配置此模型连接的凭证。","error.dataLocked":"Jarvy 已经在运行,或数据目录被其他程序占用。","error.discoveryFormat":"这个地址返回的不是所选协议的模型列表,请检查 API URL 和协议。","error.discoveryHttp":"获取模型失败:HTTP {status}。","error.discoveryKey":"请填写 API Key。","error.discoveryProtocol":"所选协议不支持获取模型列表,请手动添加模型。","error.discoveryUrl":"API URL 无效。","error.discoveryUrlMissing":"请填写 API URL。","error.historyMissing":"找不到这条 History 记录。","error.invalidCredential":"凭证格式无效。","error.invalidRun":"Bot 的状态刚刚变化,请刷新后重试。","error.loginInput":"请填写授权码或回调地址。","error.loginOption":"请选择登录方式。","error.loginStep":"登录步骤已变化,请重新开始。","error.loginFailed":"登录操作失败,请刷新后重试。","error.messageMissing":"找不到这条消息,它可能已被删除。","error.modelIncomplete":"请补全模型的上下文窗口和最大输出。","error.modelMissing":"找不到这个模型,它可能已被移除。","error.modelRequestFailed":"模型请求失败:{detail}","error.modelRequired":"请先为 Bot 选择模型。","error.modelSwitchUncertain":"模型切换未完成,请重新选择模型。","error.nameTaken":"名称已被其他成员使用。","error.providerNameTaken":"已有同名的 Provider。","error.resetCustom":"自定义 Provider 没有系统默认的模型,无法重置。","error.connectionInUse":"{bots} 正在使用这个 Provider 的模型,请先换成其他模型再删除。","error.questionClosed":"问题已结束。","error.questionExpired":"这个问题已忽略,Bot 不再等待回答。","error.runtimeFailed":"Bot 运行失败,请检查它的模型设置后重试。","error.sessionCorrupt":"Bot 启动失败(会话文件无法读取)。","error.sessionMismatch":"Bot 启动失败(会话文件不匹配)。","error.sessionMissing":"Bot 启动失败(会话文件缺失)。","error.sessionPath":"Bot 启动失败(会话文件路径无效)。","error.stopping":"Jarvy 正在关闭,请稍后再试。","error.thinkingFormat":"不支持此思考格式。","error.toolsMissing":"Bot 的工具加载失败,请重启 Bot 后重试。","error.unsafeReplay":"上次中断时 Bot 可能已经执行了操作,为避免重复,不会自动重试。","error.discoveryUnreachable":"无法连接 {host},请检查 API URL。","color.gray":"灰","color.blue":"蓝","color.green":"绿","color.amber":"琥珀","color.rose":"粉","color.violet":"紫","avatar.working":"工作中","avatar.openInfo":"查看 {name} 的 Bot 信息"},J7={"settings.title":"设置","settings.sections":"设置分类","settings.general":"通用","settings.models":"模型","settings.usage":"用量","settings.network":"网络","settings.secrets":"密钥","settings.about":"关于","group.custom":"自定义 API","group.subscription":"订阅服务","group.apiKey":"API Key","models.add":"添加 Provider","models.empty":"还没有模型连接","models.count":{one:"{count} 个模型",other:"{count} 个模型"},"models.none":"尚未添加模型","picker.back":"返回模型页面","picker.search":"搜索 Provider","picker.searchPlaceholder":"搜索 Provider…","picker.keyHint":{one:"API Key · {count} 个模型",other:"API Key · {count} 个模型"},"picker.loading":"正在加载 Provider…","picker.retry":"重试","picker.noMatch":"没有匹配的 Provider","editor.back":"返回 Provider 列表","editor.delete":"删除 Provider","editor.connection":"连接","editor.providerName":"Provider 名称","editor.name":"连接名称","editor.protocol":"API 协议","editor.url":"API URL","editor.defaultUrl":"使用 Provider 默认地址","editor.key":"API Key","editor.keyPlaceholder":"输入 API Key","editor.keySaved":"已保存,留空则不修改","editor.settings":"连接设置","editor.models":"模型列表","editor.selected":"已选 {selected} / {total}","editor.fetch":"获取模型列表","editor.fetching":"正在获取…","editor.fetched":{one:"获取到 {count} 个模型",other:"获取到 {count} 个模型"},"editor.noneReturned":"此端点没有返回模型","editor.fetchFailed":"获取模型列表失败","editor.loadingCatalog":"正在加载模型目录…","editor.autoSelected":"自动配置已选","editor.addManually":"手动添加","editor.filter":"筛选模型","editor.filterPlaceholder":"筛选模型…","editor.selectVisible":"全选当前结果","editor.empty":"还没有模型","editor.emptyCustom":"获取模型列表,或手动添加模型。","editor.emptyBuiltin":"可以手动添加模型。","editor.autoSummary":"{parts};保存后生效","editor.autoMatched":{one:"已配置 {count} 个",other:"已配置 {count} 个"},"editor.autoChoose":{one:"{count} 个需选择来源",other:"{count} 个需选择来源"},"editor.autoNone":{one:"{count} 个在目录中未找到",other:"{count} 个在目录中未找到"},"editor.autoFailed":{one:"{count} 个失败",other:"{count} 个失败"},"editor.confirmDelete":"删除「{name}」及其模型?","editor.deleteFailed":"删除失败","editor.saveFailed":"保存未完成","editor.saved":"已保存","editor.reset":"重置模型","editor.resetTitle":"将模型重置为系统默认?","editor.resetModels":{one:"{count} 个模型将恢复为系统默认设置。",other:"{count} 个模型将恢复为系统默认设置。"},"editor.resetRemoves":{one:"{count} 个不在系统默认中的模型将被移除:{names}。",other:"{count} 个不在系统默认中的模型将被移除:{names}。"},"editor.resetBots":{one:"{bots} 正在使用将被移除的模型,重置后需要重新选择模型。",other:"{bots} 正在使用将被移除的模型,重置后需要重新选择模型。"},"editor.resetKeeps":"API URL 和协议将恢复默认,登录信息和 API Key 会保留。未保存的修改将被丢弃。","editor.resetConfirm":"重置","editor.resetDone":"已重置为系统默认","editor.resetFailed":"重置失败","editor.saving":"正在保存…","editor.save":"保存","card.defaultProtocol":"使用 Provider 默认协议","card.modelId":"模型 ID","card.modelName":"模型名称","card.optional":"可选","card.newModel":"新模型","card.enterId":"填写模型 ID","card.use":"使用 {name}","card.remove":"移除 {name}","card.image":"图片","card.reasoning":"推理","card.capabilities":"能力","card.reasoningThinking":"推理 / 思考","card.imageInput":"图片输入","card.specs":"模型规格","card.hidePrices":"收起价格","card.editPrices":"编辑价格","card.context":"上下文窗口 · tokens","card.maxOutput":"最大输出 · tokens","card.costTitle":"每百万 tokens 价格","card.costInput":"输入","card.costOutput":"输出","card.costCacheRead":"缓存读取","card.costCacheWrite":"缓存写入","card.notProvided":"未提供","card.advanced":"高级设置","card.apiOverride":"指定 API 协议","card.headers":"请求头","card.headerSaved":"已保存,留空则不修改","card.addHeader":"添加请求头","card.removeHeader":"移除请求头","card.compat":"兼容参数 · compat","card.jsonObject":"请输入 JSON 对象","auto.run":"自动配置","auto.pending":"正在配置…","auto.failed":"自动配置失败","auto.tagChoose":"需选择配置来源","auto.tagNone":"目录中未找到","auto.official":"原厂","auto.matched":"已按 {source}{note} 填入配置{suffix}","auto.reseller":"(来自转售目录,非原厂)","auto.applied":";保存后生效。","auto.apiMismatch":"目录中此模型使用 {api} 协议,与当前协议不同,思考格式和兼容参数未填入。","auto.changeSource":"更换来源","auto.multiple":"同名模型有多个原厂来源,请选择:","auto.similar":"目录中没有 {modelId},以下是相似模型:","auto.notFound":"目录中没有找到此模型,请手动填写。","thinking.title":"思考","thinking.format":"思考格式","thinking.protocolDefault":"协议默认","thinking.onlyCompletions":"仅 OpenAI Chat Completions 协议使用","thinking.levels":"思考档位","thinking.level.off":"关闭","thinking.level.minimal":"极低","thinking.level.low":"低","thinking.level.medium":"中","thinking.level.high":"高","thinking.level.xhigh":"超高","thinking.level.max":"最高","thinking.levelName":"{level}档位","thinking.levelValue":"{level}档位发送值","thinking.supportedDefault":"支持(默认值)","thinking.unsupported":"不支持","thinking.supportedCustom":"支持,发送指定值","thinking.supported":"可选档位:{levels}","auth.title":"账户授权","auth.running":"正在授权","auth.openPage":"打开授权页面","auth.code":"验证码:{code}","auth.browser":"浏览器登录(OAuth)","auth.deviceCode":"设备码登录","auth.redirectFull":"完整回调地址","auth.redirectOrCode":"授权码或回调地址","auth.manualNote":"完成授权后若未自动返回,请粘贴回调地址。","auth.waiting":"等待授权完成…","auth.cancel":"取消授权","auth.configureCredential":"配置凭证","auth.signInAgain":"重新登录","auth.signIn":"登录账户","auth.removeCredential":"移除凭证","auth.signOut":"退出登录","auth.statusFailed":"无法获取登录状态","auth.refresh":"刷新状态","auth.antigravityRisk":"通过第三方应用使用 Antigravity 可能违反 Google 服务条款,账号有被停用的风险。","picker.loadFailed":"无法加载 Provider 列表","quota.title":"用量","quota.refresh":"刷新","quota.checking":"正在查询…","quota.unchecked":"刷新以查询当前用量。","quota.failed":"用量查询失败:{error}","quota.stale":"刷新失败,显示的是上次的结果。{error}","quota.unlimited":"当前套餐没有用量限制。","quota.noReport":"该订阅不提供用量数据。","quota.openPage":"查看用量","quota.checked":"{time}更新","quota.fromReply":"{time}随对话更新","quota.justNow":"刚刚","quota.minutesAgo":{one:"{count} 分钟前",other:"{count} 分钟前"},"quota.hoursAgo":{one:"{count} 小时前",other:"{count} 小时前"},"quota.hours":{one:"{count} 小时",other:"{count} 小时"},"quota.day":"每日","quota.week":"每周","quota.month":"每月","quota.credits":"余额","quota.premium":"高级请求","quota.chat":"对话","quota.completions":"代码补全","quota.named":"{name} · {window}","quota.left":"剩 {percent}","quota.summary":"{label}剩 {percent}","quota.creditsLeft":"余额 {amount}","quota.amountLeft":"剩 {left} / {total}","quota.resetsSoon":"即将重置","quota.resetsInMinutes":{one:"{count} 分钟后重置",other:"{count} 分钟后重置"},"quota.resetsInHours":{one:"{count} 小时后重置",other:"{count} 小时后重置"},"quota.resetsOn":"{date} 重置"},W7={"rail.label":"导航","rail.chats":"会话","rail.environments":"环境","home.talk":"和 {name} 聊天","home.recent":"最近的消息","home.openDm":"在私聊中打开","home.call.reply":"有新回复","home.call.ask":"在等你回答","home.call.error":"上一轮运行出错","home.failed":"这一轮出错了:{reason}","home.answerInDm":"去私聊中回答","sidebar.label":"会话列表","sidebar.create":"打开新建菜单","sidebar.createMenu":"新建菜单","sidebar.newChannel":"新建频道","sidebar.newSection":"新建频道分组","sidebar.newBot":"新建 Bot","sidebar.alerts":"{count} 条发给你的未读","sidebar.unread":"{count} 条未读","sidebar.said":"{name}:{text}","sidebar.atMe":"[有人@我]","sidebar.more":"{name} 的更多操作","sidebar.asking":"(等你回答)","sidebar.working":"(工作中)","sidebar.pinned":"已置顶","sidebar.muted":"免打扰","sidebar.hasUnread":"有未读","sidebar.editSection":"编辑分组:{name}","sidebar.search":"搜索会话和消息","sidebar.results":"搜索结果","sidebar.chats":"会话","sidebar.nav":"频道与私信","sidebar.followed":"我关注的线程","sidebar.channels":"频道","sidebar.dms":"私信","sidebar.noDms":"暂无私信","search.title":"搜索","search.paneLabel":"聊天内搜索","search.inThread":"本线程","search.inDm":"本私信","search.close":"关闭搜索","search.placeholder":"搜索消息","search.channelPlaceholder":"搜索本频道及其线程中的消息","search.prompt":"输入关键词","search.searching":"正在搜索…","search.noMessages":"没有找到消息","search.count":{one:"{count} 条,最新在前",other:"{count} 条,最新在前"},"search.countLatest":"显示最近 {count} 条","search.showAll":"查看全部 {count} 条","search.threads":"线程","search.channels":"频道(主题与公告)","search.messages":"消息","search.channel":"频道","member.unknown":"未知成员","member.deleted":"{name}(已删除)","members.view":"查看 {name}","members.remove":"移出 {name}","members.more":"{name} 的更多操作","members.menu":"成员操作","members.creator":"创建者","members.admin":"管理员","members.makeAdmin":"设为管理员","members.removeAdmin":"取消管理员","members.removeFromChannel":"移出频道","members.count":{one:"{count} 位成员",other:"{count} 位成员"},"members.people":"用户","members.removeTitle":"把 {name} 移出 #{channel}","members.removeBody":"移出后,对方将无法再收到此频道的消息。","members.removeConfirm":"移出","chat.area":"对话区域","chat.botDms":"{name} 与其他 Bot 的私信","chat.botStatus":"Bot 状态","chat.transcript":"聊天记录","chat.loading":"正在加载…","chat.empty":"暂无消息","chat.start":"与 {name} 开始对话","chat.loadingOlder":"正在加载更早的消息…","chat.toLatest":"回到最新消息","chat.unseen":{one:"{count} 条新消息",other:"{count} 条新消息"},"chat.toChannel":"发消息到 #{name}","chat.toBot":"发消息给 {name}…","chat.pickModel":"为这个 Bot 选择模型后才能发消息","chat.pick":"选择一个会话","channel.infoFor":"频道信息:{name}","channel.membersCount":{one:"成员 {count}",other:"成员 {count}"},"channel.members":"成员","channel.search":"搜索频道消息(Ctrl+F)","channel.threads":"线程","notice.title":"公告","notice.edit":"编辑公告","notice.content":"公告内容","notice.none":"暂无公告","notice.version":"第 {version} 版","chat.newBelow":"以下为新消息","chat.today":"今天","chat.yesterday":"昨天","channel.echo":"回复了线程「{title}」","channel.replies":{one:"{count} 条回复",other:"{count} 条回复"},"channel.threadDone":"已完成","channel.lastReply":"最后回复 {time}","channel.replyInThread":"在线程中回复","info.edit":"编辑{name}","info.memberList":"成员列表","info.back":"返回频道信息","info.addMembers":"添加成员","info.name":"名称","info.newChannel":"新频道","info.topic":"主题","info.noTopic":"暂无主题","info.section":"分组","info.menu":"频道","info.noSection":"无","mention.menu":"提及成员","mention.inThread":"线程中","mention.inChannel":"频道其他成员","mention.outside":"不在本频道中","mention.outsideList":"不在本频道中的成员","mention.searchOutside":"搜索不在本频道中的成员","mention.invites":"选择后会把对方加入本频道","quote.inline":"「{text}」","quote.by":"{name}:","quote.remove":"移除引用:{text}","quote.tooMany":"一条消息最多引用 {count} 段","quote.selection":"选中的文字","quote.copy":"复制","quote.quote":"在回复中引用","ref.label":"{name} 的消息:{text}","ref.dm":"私聊 · {title}","ref.open":"查看消息","composer.busy":"附件上传中,请稍后再添加。","composer.tooMany":"每条消息最多添加 {count} 个附件。","composer.size":"附件不能为空,也不能超过 {limit}。","composer.pasted":"粘贴图片","composer.removeFile":"移除附件:{name}","composer.uploading":"正在上传:{name}","composer.cancelUpload":"取消上传:{name}","composer.replying":"回复","composer.cancelReply":"取消回复","composer.drop":"松开以添加附件","composer.attach":"添加附件","composer.input":"输入消息","composer.send":"发送消息","files.preview":"预览 {name}","files.download":"下载 {name}","files.gone":"附件不存在或已被删除","files.readFailed":"无法打开文件({status})","files.readError":"无法打开文件","files.kindImage":"图片","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"文本","files.kindFile":"文件","files.downloadFile":"下载文件","files.showPreview":"预览","files.showSource":"源码","files.showText":"原文","files.openTab":"在新标签页中打开(隔离运行)","files.narrow":"收起预览","files.widen":"扩大预览","files.closePreview":"关闭附件预览","files.running":"脚本正在隔离环境中运行:可以联网,但无法读取 Jarvy 的数据。","files.scripts":{one:"这个 HTML 含有 {count} 段脚本{hosts},当前未运行。运行后脚本可以联网,但无法读取 Jarvy 的数据。",other:"这个 HTML 含有 {count} 段脚本{hosts},当前未运行。运行后脚本可以联网,但无法读取 Jarvy 的数据。"},"files.scriptHosts":"(引用 {hosts})","files.andMore":" 等","files.stop":"停止脚本","files.run":"运行脚本","files.downloadToView":"此文件请下载后查看","files.tooLarge":"文件超过 1 MB,无法在页面内预览。","files.unsupported":"此文件不支持在页面内预览。","files.reading":"正在读取文件…","files.runningTitle":"{name}(运行中)","files.previous":"上一个附件","files.choose":"选择预览文件","files.next":"下一个附件","question.failed":"提交失败","question.dismissed":"已忽略","request.outcome.allowed":"已允许","request.outcome.added":"已添加","request.outcome.once":"已允许本次","request.outcome.declined":"已拒绝","request.outcome.ignored":"已忽略","question.chose":"已选:{answer}","question.dismissLabel":"关闭问题,不回答","question.dismiss":"跳过","question.multiple":"可多选","question.note":"补充说明(可选)","question.own":"或者自己填写…","question.ownLabel":"自己填写回答","question.confirmCount":"确定({count})","question.confirm":"确定","question.send":"发送","directs.back":"返回列表","directs.between":"{name} 与 {other}","directs.readOnly":"只读","files.kindVideo":"视频","files.kindAudio":"音频","files.cantPlay":"当前浏览器无法播放","files.cantPlayHint":"下载后用播放器打开。","reactions.more":"+{count}"},e9={"threadSort.title":"排序","threadSort.current":"排序:{order}","threadSort.updated":"最近更新","threadSort.created":"创建时间","threadSort.status":"状态","threads.list":"线程列表","threads.closeList":"关闭线程列表","threads.byStatus":"按状态筛选","threads.openCount":"进行中 {count}","threads.doneCount":"已完成 {count}","threads.all":"全部","threads.loading":"正在加载…","threads.loadFailed":"无法加载线程","threads.none":"暂无线程","threads.following":"已关注","threads.filter":"筛选","threads.unreadCount":"未读 {count}","threads.unread":"未读","threads.noneUnread":"暂无未读线程","threads.noneOpen":"暂无进行中的线程","threads.noneDone":"暂无已完成的线程","threads.notFollowing":"未关注","threads.pick":"选择一个线程","threads.open":"进行中","thread.rename":"修改标题","thread.title":"线程标题","thread.toggleStatus":"切换状态","thread.summary":"摘要","thread.editSummary":"编辑摘要","thread.conclude":"完成并把摘要发到 #{channel}","thread.addSummary":"添加摘要","thread.sourceElsewhere":"原消息不在这个线程里","thread.label":"线程","thread.backToList":"返回线程列表","thread.inChannel":"在频道中查看","thread.search":"搜索线程消息(Ctrl+F)","thread.followingHint":"新回复会计入未读","thread.notFollowingHint":"新回复不会计入未读","thread.follow":"关注","thread.expand":"展开","thread.collapse":"收起到侧栏","thread.close":"关闭线程","thread.conclusion":"结论:","thread.concluded":"已完成,摘要已发到 #{channel}","thread.noReplies":"暂无回复","thread.toLatest":"回到最新回复","thread.reply":"回复线程"},t9={"usage.title":"用量","usage.range":"时间范围","usage.today":"今天","usage.days":"{count} 天","usage.all":"全部","usage.refresh":"刷新","usage.refreshLabel":"刷新用量","usage.retry":"重试","usage.loading":"正在加载用量…","usage.loadFailed":"用量加载失败","usage.empty":"这段时间没有模型调用","usage.model":"模型","usage.calls":"调用","usage.input":"输入","usage.output":"输出","usage.cacheRead":"缓存读取","usage.cacheWrite":"缓存写入","usage.cost":"费用","usage.total":"合计","usage.byModel":"按模型","usage.byBot":"按 Bot","usage.unpriced":"未设置价格","usage.notePartial":"合计费用不含未设置价格的模型。","usage.noteCosts":"费用不含未设置价格的模型。","activity.error":"运行出错","activity.running":"运行中","activity.reasoning":"思考中","activity.texting":"回复中","activity.toolCalling":"使用工具","activity.asking":"等你回答","activity.noModel":"未设置模型","activity.idle":"空闲","activity.stopped":"未运行","bot.saved":"已保存","bot.changeFailed":"修改失败","bot.color":"形象颜色","bot.contextHint":"截至 Bot 上次回复时,模型报告的上下文占用","bot.contextStale":"最近一次模型请求异常,当前显示的是上一次请求成功时的上下文占用。","bot.context":"上下文","bot.unknown":"未知","bot.tokens":"{used} / {window} tokens","bot.description":"描述","bot.descriptionPlaceholder":"这个 Bot 能帮你做什么?","bot.personaPlaceholder":"Bot 的性格、职责与行为偏好","bot.personaHint":"下次开始工作时生效。","bot.unsaved":"有未保存的修改","bot.saving":"正在保存…","agent.title":"主 Bot","agent.intro":"{name} 是你的主 Bot,替你打理 Jarvy 本身。在私信或频道里跟它说一声,它就能:","agent.create":"新建 Bot,修改它们的名字、描述和 Persona","agent.model":"给 Bot 选模型和思考强度","agent.run":"启动、停止 Bot,查看用量","agent.delete":"删除 Bot、频道、频道分组,或把成员移出频道,每次都先弹卡片请你确认","bot.aborting":"正在中断…","bot.abort":"中断当前任务","bot.starting":"正在启动…","bot.stopping":"正在停止…","bot.start":"启动","bot.stop":"停止","bot.workspace":"工作区","bot.copyWorkspace":"复制工作区路径","bot.tab.overview":"概览","bot.tab.profile":"设定","bot.tab.environment":"环境","bot.tab.tasks":"任务","bot.tab.access":"授权","bot.tab.activity":"活动","bot.subscriptions":"订阅","bot.noSubscriptions":"暂无订阅","bot.threadIn":"线程 · #{channel}","botModel.auto":"使用默认强度","botModel.off":"关闭思考","botModel.minimal":"最少思考","botModel.low":"少量思考","botModel.medium":"适中思考","botModel.high":"更多思考","botModel.xhigh":"高强度思考","botModel.max":"最高强度思考","botModel.loadFailed":"无法加载模型列表","botModel.switchFailed":"切换模型失败","botModel.pick":"选择 Bot 模型","botModel.broken":"这个模型已不可用,请重新选择","botModel.choose":"选择模型","botModel.filter":"筛选 Bot 模型","botModel.filterPlaceholder":"筛选模型…","botModel.list":"Bot 模型","botModel.noMatch":"没有匹配的模型","botModel.none":"暂无模型,请先在设置中添加","botModel.manage":"管理模型","botModel.thinking":"思考强度","botModel.pickThinking":"选择思考强度","botModel.loading":"正在加载模型…","botModel.switching":"正在切换…","botModel.pickFor":"为 {name} 选择模型","deleteBot.title":"删除 {name}","deleteBot.after":"删除后:","deleteBot.chats":{one:"它的 {count} 个私信、频道成员身份和订阅都会被删掉。",other:"它的 {count} 个私信、频道成员身份和订阅都会被删掉。"},"deleteBot.messages":"它在频道和线程里发过的消息会保留,发送者显示为「{name}」,名字可以重新使用。","deleteBot.history":"它的会话历史和未完成的任务都会被清除。","deleteBot.files":"同时删除工作区文件夹","deleteBot.filesHint":"工作区里可能有它生成的文件,不勾选则保留。","deleteBot.deleting":"正在删除…","deleteBot.working":"正在处理…","history.reasoning":"思考","history.text":"正文","history.empty":"(空)","history.image":"History 中的图片","history.toolCall":"工具调用","history.toolResult":"工具结果","history.error":"出错","history.related":"查看关联记录 #{id}","history.result":"结果","history.call":"调用","history.details":"结构化结果","history.view":"记录显示方式","history.content":"内容","history.json":"原始 JSON","history.contentLabel":"记录内容","history.tools":"工具定义","history.toolsRemoved":"移除的工具","history.stopReason":"结束原因","activity.detailFailed":"无法加载记录","activity.detailLoading":"正在加载记录…","activity.openChat":"打开聊天","activity.sentBy":"发送调用 #{id}","activity.roleSystem":"系统","activity.roleUser":"输入","activity.roleAssistant":"助手","activity.timeline":"Bot 活动时间线","activity.chatMessage":"聊天发言 {id}","activity.viewMessage":"查看聊天消息 {sequence} · {chat}","activity.attachmentOnly":"附件消息","activity.attachments":{one:"{count} 个附件",other:"{count} 个附件"},"activity.viewSentBy":"查看发送调用 #{id}","activity.historyRecord":"History 记录 #{id}","activity.viewHistory":"查看 History #{id} · {role}","activity.emptyMessage":"(空消息)","activity.loadFailed":"活动记录加载失败","activity.backToTimeline":"返回时间线","activity.newestFirst":"最新记录在前","activity.refresh":"刷新活动历史","activity.reading":"正在加载…","activity.columnChat":"聊天","activity.columnTime":"时间","activity.loading":"正在加载活动记录…","activity.empty":"还没有活动记录","activity.newer":"较新","activity.page":"第 {page} 页","activity.older":"较早","activity.historyDetail":"History 记录详情","activity.chatDetail":"聊天记录详情","activity.toolCall":"调用 {name}","activity.toolResult":"{name} · 执行结果","activity.toolFailed":"{name} · 执行出错","activity.images":{one:"{count} 张图片",other:"{count} 张图片"},"bot.newName":"新 Bot","bot.newNameN":"新 Bot {n}","agent.oversee":"查看所有会话和其它 Bot 的活动,经你允许后进入其它沙箱或机器;相关操作均记入「操作记录」","bot.tab.log":"操作记录","agentLog.title":"操作记录","agentLog.empty":"还没有操作记录","agentLog.more":"加载更多","agentLog.loadFailed":"操作记录加载失败","agentLog.outcome.done":"完成","agentLog.outcome.failed":"失败","agentLog.outcome.declined":"已拒绝","agentLog.outcome.dismissed":"未回应","agentLog.outcome.allowed":"已允许","agentLog.outcome.allowedOnce":"仅限本次","agentLog.tool.chats.browse":"查看会话列表","agentLog.tool.chats.info":"查看会话信息","agentLog.tool.messages.read":"阅读消息","agentLog.tool.messages.search":"搜索消息","agentLog.tool.threads.list":"查看线程列表","agentLog.tool.chats.join":"加入频道","agentLog.tool.environments.enter":"进入环境","agentLog.tool.bots.activity":"查看 Bot 活动","agentLog.tool.bots.create":"新建 Bot","agentLog.tool.bots.update":"修改 Bot","agentLog.tool.bots.start":"启动 Bot","agentLog.tool.bots.stop":"停止 Bot","agentLog.tool.bots.delete":"删除 Bot","agentLog.tool.chats.delete":"删除频道","agentLog.tool.chats.removeMembers":"移出成员","agentLog.tool.sections.delete":"删除频道分组","access.sandboxes":"其它 Bot 的沙箱","access.searchSandboxes":"搜索沙箱","access.noSandboxes":"还不能进入任何沙箱","access.allSandboxes":"已能进入所有沙箱","access.noOtherBots":"还没有其它 Bot","access.sandboxOf":"{name} 的沙箱"},n9={"npc.toolbar":"NPC 原型","npc.replay":"重播","npc.mood":"基础心情","npc.mood.normal":"普通","npc.mood.happy":"开心","npc.mood.sad":"难过","npc.mood.angry":"生气","npc.mood.dizzy":"晕","npc.poses":"动作","npc.pose.sleep":"睡觉","npc.pose.idle":"空闲","npc.pose.think":"思考","npc.pose.mutter":"自言自语","npc.pose.say":"对你说话","npc.pose.ask":"等你回答","npc.pose.read":"读文件","npc.pose.work":"改文件、跑命令","npc.pose.compact":"压缩上下文","npc.pose.busy":"重试","npc.pose.failed":"报错","npc.pose.done":"做完了","npc.pose.groom":"舔爪子","npc.expand":"展开过程","npc.collapse":"收起","npc.panel":"这一轮","npc.state.running":"进行中","npc.state.ok":"成功","npc.state.failed":"失败","npc.duration":"{value} 秒","npc.done":"做完了 · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"思考","npc.step.mutter":"自言自语","npc.step.read.running":"在读 {target}","npc.step.read.ok":"读了 {target}","npc.step.write.running":"在改 {target}","npc.step.write.ok":"改好了 {target}","npc.step.run.running":"在跑 {target}","npc.step.run.ok":"跑完了 {target}","npc.step.run.failed":"{target} 失败了","npc.step.compact.running":"在整理上下文","npc.step.compact.ok":"整理好了上下文","npc.step.ask.running":"在等你回答","npc.step.ask.ok":"你选了「{answer}」","npc.step.say.running":"在回复你","npc.step.say.ok":"回复了你","npc.step.post.running":"在发到 {chat}","npc.step.post.ok":"发到了 {chat}","npc.demo.think1":"fish 说线程面板打开时会跳一下。可能是滚动的时机不对。先看看 ThreadPane 是怎么滚动的。","npc.demo.think2":"它在回复还没量好高度时就滚了。改成布局之后再滚应该就好。回复数也要算进依赖里。","npc.demo.mutter1":"改好了,先跑一遍构建看看。","npc.demo.mutter2":"嗯……类型没过,ref 可能是空的。","npc.demo.channel":"研发","npc.demo.post":"线程面板打开时跳一下的问题修好了,构建通过,等 fish 确认。","npc.demo.question":"修好了。要不要顺便更新文档里的截图?","npc.demo.yes":"要,一起更新","npc.demo.no":"先不用","npc.demo.replyYes":"好了:线程面板现在打开就停在最新回复,不会再跳;文档里的截图也换成了新的。构建通过。","npc.demo.replyNo":"好了:线程面板现在打开就停在最新回复,不会再跳。构建通过,截图先没动。","npc.live.omitted":"……省略 {count} 字……","npc.live.tokens":"上下文:{before} → {after} tokens","npc.live.compact.running":"在整理上下文","npc.live.compact.ok":"整理好了上下文","npc.live.compact.failed":"整理上下文失败了","npc.live.retry.running":"在重试(第 {attempt}/{max} 次)","npc.live.retry.ok":"重试成功","npc.live.retry.failed":"重试失败了","npc.live.read.running":"在读 {target}","npc.live.read.ok":"读了 {target}","npc.live.read.failed":"没读到 {target}","npc.live.edit.running":"在改 {target}","npc.live.edit.ok":"改好了 {target}","npc.live.edit.failed":"没改成 {target}","npc.live.write.running":"在写 {target}","npc.live.write.ok":"写好了 {target}","npc.live.write.failed":"没写成 {target}","npc.live.run.running":"在跑 {target}","npc.live.run.ok":"跑完了 {target}","npc.live.run.failed":"{target} 失败了","npc.live.script.running":"在跑一段脚本","npc.live.script.ok":"跑完了一段脚本","npc.live.script.failed":"脚本出错了","npc.live.tool.running":"在用 {tool}","npc.live.tool.ok":"用了 {tool}","npc.live.tool.failed":"{tool} 出错了","npc.live.sendFailed":"消息没发出去","npc.live.switch.running":"在切换工作环境","npc.live.switch.ok":"切换了工作环境","npc.live.switch.failed":"没能切换工作环境","npc.live.askFailed":"问题没发出去","npc.live.askClosed":"问题关掉了","npc.live.answerBelow":"在下面的卡片里回答","npc.live.answerIn":"去 {chat} 里回答","npc.live.browse.running":"在翻看 {chat}","npc.live.browse.ok":"翻看了 {chat}","npc.live.browseAll.running":"在翻看聊天","npc.live.browseAll.ok":"翻看了聊天","npc.done.interrupted":"被打断了 · {duration}","npc.done.failed":"这一轮失败了 · {duration}"},a9={"environment.title":"工作环境","environment.own":"Docker 沙箱","environment.container":"容器","environment.image":"镜像","environment.mount":"工作区挂载点","environment.external":"外部环境","envs.sandboxOf":"{name} 的沙箱","enterCard.title":"请求进入 {name}","envs.back":"全部环境","envs.workingHere":{one:"{names} 正在这里工作",other:"{names} 正在这里工作"},"environment.state.preparing":"准备中","environment.state.running":"运行中","environment.state.stopped":"已停止","environment.state.failed":"启动失败","environment.state.unavailable":"不可用","environment.unavailable":"{why},无法为 Bot 启动沙箱(无沙箱时,Bot 无法进行文件读写和命令执行等操作)。","environment.unavailable.missing":"当前环境没有安装 Docker","environment.unavailable.stopped":"当前环境的 Docker 服务未启动","environment.unavailable.denied":"当前环境无 Docker 权限","environment.unavailable.failed":"当前环境的 Docker 无法使用","environment.start":"启动","environment.starting":"正在启动…","environment.stop":"停止","environment.stopping":"正在停止…","environment.stopTitle":"停止 {name} 的沙箱?","environment.stopBody":"沙箱中运行的程序将被关闭,已安装的软件和工作区文件会保留。","environment.stopConfirm":"停止","environment.reset":"重置…","environment.resetTitle":"重置 {name} 的沙箱?","environment.resetBody":"沙箱中安装的软件将被清除,工作区文件会保留。","environment.resetConfirm":"重置","environment.resetBodyVm":"沙箱中安装的软件,以及其中 Docker 的镜像、容器和数据卷将被清除,工作区文件会保留。","environment.restartNote":"新的大小在沙箱下次启动后生效。","environment.restart":"现在重启","environment.restartTitle":"重启 {name} 的沙箱?","environment.restartBody":"沙箱中运行的程序将被关闭,已安装的软件和工作区文件会保留。","environment.restartConfirm":"重启","environment.type":"类型","environment.type.container":"容器","environment.type.vm":"虚拟机","environment.type.checking":"正在检查这台电脑能否运行虚拟机…","environment.type.unavailable":"这台电脑不能运行虚拟机沙箱:{why}。","environment.type.why.no_kata":"没有安装 Kata","environment.type.why.no_kvm":"没有 KVM","environment.type.why.busy":"硬件虚拟化正被其他虚拟机软件(如 VirtualBox)占用","environment.type.why.failed":"试运行虚拟机没有成功","environment.type.recheck":"重新检查","environment.type.vmTitle":"把 {name} 的沙箱换成虚拟机?","environment.type.vmBody":"沙箱会重新创建,里面可以直接用 Docker 和 Docker Compose。工作区文件会保留,沙箱中安装的软件会清除。第一次切换要先构建镜像,可能需要几分钟。","environment.type.containerTitle":"把 {name} 的沙箱换成容器?","environment.type.containerBody":"沙箱会重新创建。工作区文件会保留,沙箱中安装的软件,以及其中 Docker 的镜像、容器和数据卷会清除。","environment.type.confirm":"切换","environment.type.switching":"正在切换…","environment.limits":"资源上限","environment.limits.edit":"修改资源上限","environment.limits.none":"不限制","environment.limits.unlimited":"不限制","environment.limits.memory":"内存 {value}","environment.limits.cpu":"CPU {value}","environment.limits.cores":"{count} 核","environment.limits.oneCore":"1 核","environment.limits.memoryField":"内存(GB)","environment.limits.cpuField":"CPU(核)","environment.limits.machine":"本机 {cpus} 核 · {memory} GB","environment.limits.below":"低于当前占用的 {usage}。保存后,沙箱中的部分程序可能被结束。","environment.limits.failed":"无法修改资源上限","environment.limits.vm":"虚拟机大小","environment.limits.vmEdit":"修改虚拟机大小","environment.limits.vmDefault":"留空则用默认大小:4 GB、2 核。","environment.limits.vmLater":"沙箱正在运行,新的大小在下次启动后生效。","environment.usage.memory":"内存","environment.usage.cpu":"CPU","environment.usage.disk":"Docker 磁盘","environment.usage.machine":"{used} / 本机 {whole}","environment.usage.host":"占用本机 {value}","error.typeInvalid":"沙箱类型只能是容器或虚拟机。","error.vmSizeInvalid":"虚拟机的内存可设为 1–{memory} GB,CPU 可设为 1–{cpus} 核。","error.vmUnavailable":"这台电脑现在不能运行虚拟机沙箱。","error.limitsInvalid":"内存可设为 0.25–{memory} GB,CPU 可设为 0.1–{cpus} 核,或不限制。"},i9={"connection.lan":"局域网访问","connection.localOnly":"仅限本机","connection.localOnlyHint":"Jarvy 目前只接受这台电脑上的访问。如需在局域网内的其他设备上使用,请用 {flag} 重新启动 Jarvy。","connection.addresses":"访问地址","connection.copy":"复制地址","connection.root":"安全证书","connection.download":"下载证书","connection.fingerprint":"SHA-256 指纹","connection.fingerprintSha1":"SHA-1 指纹","connection.howTo":"安装说明","connection.howMac":"Mac:打开证书将它添加到「钥匙串访问」,双击该证书,在「信任」中将「使用此证书时」设为「始终信任」。","connection.howWindows":"Windows:打开证书,点「安装证书」,选择「将所有的证书都放入下列存储」,再选「受信任的根证书颁发机构」。证书「详细信息」中的「指纹」就是上面的 SHA-1 指纹。","connection.howIos":"iPhone 和 iPad:在 Safari 中下载证书,前往「设置 › 通用 › VPN与设备管理」安装,再在「设置 › 通用 › 关于本机 › 证书信任设置」中针对它启用完全信任。","connection.howAndroid":"Android:下载证书后,在「设置」中搜索「CA 证书」并安装。不同手机的位置不同,通常在「安全」或「加密与凭据」里。","connection.howRestart":"装好后,完全退出浏览器再重新打开,新证书才会生效。","connection.allowHttp":"允许 HTTP 访问","connection.allowHttpHint":"密码和对话会明文传输,只在可信的网络中开启。","connection.insecure":"当前连接未加密,密码和对话内容可能被同一网络中的他人看到。","connection.useHttps":"切换到 HTTPS"},r9={"secrets.add":"添加密钥","secrets.empty":"还没有密钥","secrets.name":"名称","secrets.description":"说明","secrets.descriptionPlaceholder":"可选,例如用途","secrets.value":"值","secrets.newValue":"新值","secrets.newValuePlaceholder":"留空则不修改","secrets.showValue":"显示值","secrets.hideValue":"隐藏值","secrets.shortValue":"这个值少于 8 个字符,出现在 Bot 能看到的内容里时可能不会被隐藏。","secrets.noDescription":"无说明","secrets.grantCount":{one:"已授权 {count} 个 Bot",other:"已授权 {count} 个 Bot"},"secrets.notGranted":"未授权","secrets.unreadable":"无法解密","secrets.unreadableHint":"这个值是用另一个主密钥加密的,无法读取,请重新输入。","secrets.fingerprint":"指纹","secrets.updated":"更新于 {time}","secrets.usedCount":{one:"已使用 {count} 次",other:"已使用 {count} 次"},"secrets.neverUsed":"从未使用","secrets.grants":"可以使用的 Bot","secrets.noBots":"还没有 Bot。","secrets.addBots":"添加 Bot","secrets.noGrants":"还没有 Bot 可以使用它。","secrets.searchBots":"搜索 Bot","secrets.noMatch":"没有匹配的 Bot","secrets.allGranted":"所有 Bot 都已经可以使用它。","secrets.revoke":"移除 {name}","secrets.onceTag":"仅限本次","secrets.edit":"修改密钥","secrets.uses":"使用记录","secrets.noUses":"暂无使用记录。","secrets.deletedBot":"已删除的 Bot","secrets.useCommand":"命令","secrets.useSsh":"SSH 签名","secrets.delete":"删除密钥","secrets.deleteTitle":"删除 {name}?","secrets.deleteBody":"已授权的 Bot 将无法再使用它,使用记录会保留。","secrets.deleteConfirm":"删除","secrets.masterKey":"主密钥","secrets.keyFile":"保存位置","secrets.keyHint":"备份或迁移 Jarvy 时请一起复制这个文件,丢失后密钥和 API key 需要重新输入。","secretCard.title":"请求使用密钥 {name}","secretCard.valuePlaceholder":"粘贴或输入值","secretCard.insecure":"当前连接未加密,填写的值可能被同一网络中的他人看到。建议先切换到 HTTPS 再填写。","secretCard.exists":"这个密钥已保存在「设置 › 密钥」中。","secretCard.replace":"更换值","secretCard.keepValue":"使用已保存的值","secretCard.unreadable":"已保存的值无法解密,请重新输入。","secretCard.value":"值","secretCard.valueHint":"会加密保存到「设置 › 密钥」,不会出现在聊天里。","secretCard.always":"始终允许","secretCard.once":"仅限本次","secretCard.decline":"拒绝","error.secretNameInvalid":"名称只能包含大写字母、数字和下划线,且以字母开头。","error.secretNameTaken":"已有同名的密钥。","error.secretValueMissing":"请输入值。","error.secretValueTooLong":"值太长,最多 16 KB。","error.secretDescriptionInvalid":"说明只能有一行,最多 200 个字符。","error.secretMissing":"找不到这个密钥,它可能已被删除。","error.credentialUnreadable":"已保存的 API key 无法解密,请在「设置 › 模型」中重新输入。","access.secrets":"密钥","access.searchSecrets":"搜索密钥","access.searchMachines":"搜索外部环境","access.noSecrets":"未授权任何密钥。","access.noMachines":"未授权任何外部环境。","access.noMatch":"没有匹配的结果","access.allSecrets":"所有密钥都已授权。","access.allMachines":"所有外部环境都已授权。","access.noSecretsYet":"还没有密钥。","access.newSecret":"新建密钥","access.noMachinesYet":"还没有外部环境。","access.loadFailed":"无法读取授权情况。"},o9={"machines.add":"添加机器","machines.host":"地址","machines.hostPlaceholder":"192.168.1.20 或 dev.example.com","machines.port":"端口","machines.user":"用户名","machines.name":"名称","machines.directory":"起始目录","machines.description":"描述","machines.descriptionPlaceholder":"用途、已安装的软件、注意事项","machines.directoryPlaceholder":"用户主目录","machines.next":"下一步","machines.scanning":"正在连接…","machines.fingerprint":"主机指纹","machines.fingerprintHint":"继续之前,请在这台机器上运行 ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub 核对。","machines.password":"登录密码","machines.passwordHint":"用于安装 Jarvy 生成的密钥;机器不支持密钥登录时,密码将加密保存并用于登录。","machines.byPassword":"密码","machines.byKey":"公钥","machines.publicKey":"公钥","machines.keyHint":"添加到 {user} 的 ~/.ssh/authorized_keys 后验证。","machines.copy":"复制","machines.copied":"已复制","machines.verify":"验证并添加","machines.verifying":"正在验证…","machines.login":"登录方式","machines.loginKey":"密钥","machines.loginPassword":"密码","machines.passwordLogin":"该机器不支持密钥登录,当前使用已保存的密码。启用 PubkeyAuthentication 后可切换为密钥登录。","machines.newPassword":"新密码","machines.updatePassword":"更新密码","machines.passwordUpdated":"密码已更新。","machines.useKey":"切换为密钥登录","machines.usingKey":"已切换为密钥登录,保存的密码已删除。","machines.stillPassword":"该机器仍不接受 Jarvy 的密钥。","machines.connect":"连接并添加","machines.connecting":"正在添加…","machines.back":"上一步","machines.check":"检查指纹","machines.checking":"正在检查…","machines.unchanged":"指纹没有变化。","machines.changed":"这台机器现在出示的指纹和之前接受的不同。如果它重装过系统或换了机器,核对后可以接受新指纹;否则可能有人在冒充它。","machines.trust":"接受新指纹","machines.delete":"删除机器","machines.deleteTitle":"删除 {name}?","machines.deleteBody":"会先从这台机器上移除 Jarvy 的密钥。正在使用它的 Bot 会回到默认环境。","machines.deleteConfirm":"删除","machines.forceTitle":"无法连接 {name}","machines.forceBody":"Jarvy 的密钥会留在这台机器的 ~/.ssh/authorized_keys 里(以 {comment} 结尾的那一行),之后可以手动移除。仍要删除吗?","machines.forceConfirm":"仍然删除","machineCard.title":"请求添加机器 {name}","machineCard.existing":"这台机器已在「环境」中。","machineCard.add":"连接并添加","machineCard.allow":"允许","machineCard.decline":"拒绝","environment.awayMachine":"正在使用 {name}","error.machineMissing":"找不到这台机器,它可能已被删除。","error.machineNameTaken":"已有同名的机器。","error.sshPasswordMissing":"请输入密码。","error.sshKeyUnreadable":"这台机器的密钥无法用当前主密钥解密,请删除后重新添加。","error.sshBadHost":"地址需要是主机名或 IP 地址。","error.sshBadUser":"请填写这台机器上的用户名。","error.sshBadPort":"端口需要在 1–65535 之间。","error.sshBadDirectory":"起始目录需要是绝对路径,或以 ~/ 开头。","error.sshAuthFailed":"用户名或密码错误。","error.sshPasswordRefused":"该机器不支持密码登录,请改用公钥。","error.sshKeyRefused":"该机器未接受 Jarvy 的公钥。请确认已添加到 ~/.ssh/authorized_keys,且 sshd 已启用 PubkeyAuthentication。","error.sshKeyExpired":"公钥已失效,请重新获取并添加到机器。","error.sshUnreachable":"连接不上这台机器,请检查地址、端口和网络。","error.sshHostKeyChanged":"这台机器出示的指纹和之前接受的不同,已停止连接。","error.sshUnsupported":"目前只支持 Linux 和 macOS。","error.sshFailed":"SSH 连接失败:{detail}"},s9={"tasks.title":"定时任务","tasks.empty":"暂无定时任务","tasks.add":"新建任务","tasks.edit":"编辑","tasks.delete":"删除","tasks.deleteTitle":"删除「{name}」?","tasks.deleteBody":"删除后不会再运行。只想停一阵子的话,把它关掉就行。","tasks.toggle":"开启或关闭{name}","tasks.next":"下次 {time}","tasks.paused":"已关闭","tasks.done":"已完成","tasks.newTitle":"新建任务","tasks.editTitle":"编辑任务","tasks.name":"名称","tasks.namePlaceholder":"早间新闻","tasks.instruction":"要做什么","tasks.instructionPlaceholder":"看一遍我关注的新闻网站首页,挑三条值得看的发给我,每条附一句话。","tasks.when":"时间","tasks.kind.once":"一次","tasks.kind.every":"间隔","tasks.kind.daily":"每天","tasks.kind.weekly":"每周","tasks.at":"日期和时间","tasks.everyCount":"每隔","tasks.unit.minutes":"分钟","tasks.unit.hours":"小时","tasks.time":"时间","tasks.weekday":"星期","tasks.minimum":"最短 5 分钟。","tasks.saveFailed":"任务保存失败","tasks.changeFailed":"任务修改失败","tasks.loadFailed":"任务加载失败","tasks.schedule.once":"一次,{time}","tasks.schedule.minutes":{one:"每分钟",other:"每 {count} 分钟"},"tasks.schedule.hours":{one:"每小时",other:"每 {count} 小时"},"tasks.schedule.daily":"每天 {time}","tasks.schedule.weekly":"每{day} {time}","error.taskTimePast":"这个时间已经过了,请选一个以后的时间。","error.taskScheduleInvalid":"检查一下周期:最短每 5 分钟,时间要是有效的。","error.taskInvalid":"给任务起个名字,写上要做什么。"},l9={"ports.title":"端口转发","ports.empty":"暂无转发的端口","ports.open":"打开{name}","ports.port":"端口 {port}","ports.from":"转发自沙箱的 {port} 端口","ports.link":"链接","ports.linkOther":"其它地址","ports.copy":"复制链接","ports.state":"状态","ports.state.live":"运行中","ports.state.local":"仅本地监听","ports.state.idle":"未监听","ports.state.stopped":"沙箱已停止","ports.state.unknown":"状态未知","ports.hint.local":"服务仅监听沙箱内的 127.0.0.1,无法通过链接访问。请让 Bot 改为监听 0.0.0.0。","ports.hint.idle":"沙箱内暂无服务监听此端口。","ports.hint.stopped":"沙箱启动后即可通过链接访问。","ports.stop":"停止转发","ports.stopTitle":"停止转发「{name}」?","ports.stopBody":"链接将失效,沙箱内的服务不受影响。","ports.loadFailed":"无法加载转发的端口。","ports.changeFailed":"无法停止转发此端口。","ports.range":"转发端口范围","ports.rangeHint":"Bot 发布端口时,Jarvy 从此范围中分配端口进行转发。已转发的端口不受影响。","ports.rangeFrom":"起始","ports.rangeTo":"结束","ports.rangeSaved":"已保存","error.portInvalid":"此端口无法转发。","error.portMissing":"此端口未在转发。","error.portRangeInvalid":"端口范围须在 1024–65535 之间,起始不大于结束,最多 1000 个。","error.portRangeOwn":"范围不能包含 Jarvy 自己的端口。","error.portsExhausted":"{from}–{to} 中已无空闲端口,请在「设置 › 网络」中扩大范围。"},c9={"inputs.someone":"有人","inputs.aChat":"某个会话","inputs.message":"{person} · {chat}:{text}","inputs.task":"定时任务「{name}」:{text}","inputs.reaction":"{person} 回应了 {emoji}:{text}","inputs.notice":"{person} 更新了「{chat}」的公告(第 {version} 版)","inputs.summary":"{person} 更新了「{chat}」的摘要(第 {version} 版)","inputs.change":"{person} 修改了它的{what}","inputs.onboard":"首次启动:{person} 刚给它配好模型","inputs.followed":{one:"对话已压缩,它关注着 {count} 个线程",other:"对话已压缩,它关注着 {count} 个线程"},"inputs.instructions":"它的设定有变化:{parts}","inputs.more":{one:"等 {count} 条",other:"等 {count} 条"},"inputs.raw":"原始文本","inputs.replyTo":"回复 {person}","inputs.taskTitle":"定时任务「{name}」","inputs.due":"计划于 {time}","inputs.reacted":"{person} 回应了 {emoji}","inputs.unreadThreads":{one:"{count} 条未读",other:"{count} 条未读"},"inputs.unread":{one:"未读 {count} 条:{list}",other:"未读 {count} 条:{list}"},"inputs.unreadNotes":"还没读的公告和摘要:{list}","inputs.version":"{title}(第 {version} 版)","inputs.place":"工作环境:{name} · {directory}","inputs.sandbox":"沙箱","inputs.unavailable":"当时文件和命令工具不可用","inputs.what.name":"名称","inputs.what.description":"描述","inputs.what.persona":"设定","inputs.what.model":"模型","inputs.what.thinking":"思考强度","inputs.what.run":"运行状态","inputs.what.environment":"工作环境","inputs.what.access":"可用环境"},u9={"botCard.agent":"管家 Bot","botCard.state":"状态","botCard.worksIn":"工作环境","botCard.sandbox":"沙箱","botCard.onMachine":"机器 {name}","botCard.message":"发消息","botCard.info":"Bot 信息","botCard.open":"打开 {name} 的资料卡"},d9={...Z7,...J7,...W7,...e9,...t9,...n9,...a9,...i9,...r9,...o9,...s9,...l9,...c9,...u9},w4=["en","zh"],k4={en:Q7,zh:d9},Wc={en:"en",zh:"zh-CN"},S4="jarvy-locale";function f9(){var i;const e=localStorage.getItem(S4);if(e==="en"||e==="zh")return e;const n=((i=navigator.languages)!=null&&i.length?navigator.languages:[navigator.language]).map(r=>r.toLowerCase()).find(r=>/^(en|zh)\b/.test(r));return n!=null&&n.startsWith("zh")?"zh":"en"}let Ji=f9();document.documentElement.lang=Wc[Ji];const w0=new Set,Wi=()=>Ji;function C4(e){if(e!==Ji){Ji=e,localStorage.setItem(S4,e),document.documentElement.lang=Wc[e];for(const n of w0)n()}}function N4(){return w.useSyncExternalStore(e=>(w0.add(e),()=>{w0.delete(e)}),Wi)}const k0=(e,n)=>k4[e][n==="name"?"locale.name":"locale.short"];function E4(e,n){const i=k4[Ji][e];return typeof i=="string"?i:new Intl.PluralRules(Wc[Ji]).select(Number(n))==="one"?i.one:i.other}function v(e,n){const i=E4(e,n==null?void 0:n.count);return n?i.replace(/\{(\w+)\}/g,(r,l)=>l in n?String(n[l]):r):i}const ca=(e,n)=>new Date(e).toLocaleString(Wc[Ji],n),Ao=e=>ca(e,{hour:Ji==="zh"?"2-digit":"numeric",minute:"2-digit"}),_f=e=>{const n=new Date(e).getFullYear()===new Date().getFullYear();return ca(e,{year:n?void 0:"numeric",month:Ji==="zh"?"numeric":"short",day:"numeric"})},La=(e,n)=>new Intl.NumberFormat(Wc[Ji],n).format(e);function xg(e,n){return E4(e,n.count).split(/\{(\w+)\}/).map((i,r)=>o.jsx(w.Fragment,{children:r%2?n[i]??`{${i}}`:i},r))}class er extends Error{constructor(n,i,r,l){super(i),this.status=n,this.code=r,this.params=l}}async function Se(e,n={}){let i;try{i=await fetch(`/api${e}`,{...n,credentials:"same-origin",headers:{...n.body&&!(n.body instanceof Blob)?{"Content-Type":"application/json"}:{},...n.headers}})}catch{throw new Error(v("api.offline"))}const r=await i.json().catch(()=>({}));if(!i.ok)throw T4(i.status,r);return r}const T4=(e,n)=>{const i=typeof n=="object"&&n!==null?n:{};return new er(e,i.error===void 0?`HTTP ${e}`:String(i.error),typeof i.code=="string"?i.code:void 0,i.params)};function h9(e,n,i,r){return new Promise((l,c)=>{const d=new XMLHttpRequest;if(r!=null&&r.aborted){c(new DOMException("Upload cancelled","AbortError"));return}r==null||r.addEventListener("abort",()=>d.abort(),{once:!0}),d.onabort=()=>c(new DOMException("Upload cancelled","AbortError")),d.open("POST",`/api/chats/${e}/attachments`),d.setRequestHeader("Content-Type",n.type||"application/octet-stream"),d.setRequestHeader("X-File-Name",encodeURIComponent(n.name)),d.upload.onprogress=f=>{f.lengthComputable&&(i==null||i(f.loaded/f.total))},d.onerror=()=>c(new Error(v("api.offline"))),d.onload=()=>{let f={};try{f=JSON.parse(d.responseText)}catch{}d.status>=200&&d.status<300?l(f):c(T4(d.status,f))},d.send(n)})}async function m9(e,n=0){const i=[];let r=n;for(;;){const l=await Se(`/chats/${e}/messages?after=${r}&limit=1000`);if(i.push(...l.messages),!l.hasMore)return{messages:i};if(l.nextSequence<=r)throw new Error(v("api.historyFailed"));r=l.nextSequence}}const tt=e=>JSON.stringify(e),ue={me:()=>Se("/me"),search:(e,n)=>Se(`/search?q=${encodeURIComponent(e)}${n?`&in=${n}`:""}&limit=60`),login:(e,n)=>Se("/login",{method:"POST",body:tt({username:e,password:n})}),logout:()=>Se("/logout",{method:"POST"}),bots:()=>Se("/bots"),createBot:e=>Se("/bots",{method:"POST",body:tt({name:e})}),saveBot:(e,n)=>Se(`/bots/${e}`,{method:"PUT",body:tt(n)}),modelOptions:()=>Se("/model-options"),selectBotModel:(e,n,i,r,l)=>Se(`/bots/${e}/model`,{method:"PUT",body:tt({connectionId:n,modelId:i,thinkingLevel:r,language:l})}),answerQuestion:(e,n,i)=>Se(`/chats/${e}/questions/${n}`,{method:"POST",body:tt(i)}),setBotColor:(e,n)=>Se(`/bots/${e}/color`,{method:"PUT",body:tt({color:n})}),chats:()=>Se("/chats"),createChat:e=>Se("/chats",{method:"POST",body:tt({botId:e})}),deleteChat:e=>Se(`/chats/${e}`,{method:"DELETE"}),members:()=>Se("/members"),sections:()=>Se("/sections"),createSection:e=>Se("/sections",{method:"POST",body:tt(e)}),updateSection:(e,n)=>Se(`/sections/${e}`,{method:"PATCH",body:tt(n)}),deleteSection:e=>Se(`/sections/${e}`,{method:"DELETE"}),createChannel:e=>Se("/channels",{method:"POST",body:tt(e)}),updateChannel:(e,n)=>Se(`/chats/${e}`,{method:"PATCH",body:tt(n)}),addMember:(e,n)=>Se(`/chats/${e}/members`,{method:"POST",body:tt({memberId:n})}),removeMember:(e,n)=>Se(`/chats/${e}/members/${n}`,{method:"DELETE"}),setAdmin:(e,n,i)=>Se(`/chats/${e}/members/${n}/admin`,{method:"PUT",body:tt({admin:i})}),setNote:(e,n)=>Se(`/chats/${e}/note`,{method:"PUT",body:tt({text:n})}),markRead:(e,n)=>Se(`/chats/${e}/read`,{method:"POST",body:tt({sequence:n})}),messages:m9,latestMessages:(e,n)=>Se(`/chats/${e}/messages?tail=${n}`),olderMessages:(e,n,i)=>Se(`/chats/${e}/messages?before=${n}&limit=${i}`),send:(e,n,i,r,l=!1,c,d=[])=>Se(`/chats/${e}/messages`,{method:"POST",body:tt({content:n,attachmentIds:i,clientMessageId:r,...l?{alsoToChannel:l}:{},...c?{replyTo:c}:{},...d.length?{quotes:d}:{}})}),fold:(e,n)=>Se(`/messages/${e}/fold`,{method:"PUT",body:tt({folded:n})}),react:(e,n,i)=>Se(`/messages/${e}/reaction`,{method:"PUT",body:tt({emoji:n,on:i})}),pin:(e,n)=>Se(`/chats/${e}/pin`,{method:"PUT",body:tt({pinned:n})}),mute:(e,n)=>Se(`/chats/${e}/mute`,{method:"PUT",body:tt({muted:n})}),deleteBot:(e,n)=>Se(`/bots/${e}${n?"?files=delete":""}`,{method:"DELETE"}),chat:e=>Se(`/chats/${e}`),message:e=>Se(`/messages/${e}`),openThread:e=>Se(`/messages/${e}/thread`,{method:"POST"}),channelThreads:e=>Se(`/chats/${e}/threads`),followedThreads:({filter:e,sort:n,cursor:i})=>Se(`/threads?${new URLSearchParams({filter:e,sort:n,...i?{cursor:i}:{}})}`),followedThread:e=>Se(`/threads/${e}`),updateThread:(e,n)=>Se(`/chats/${e}`,{method:"PATCH",body:tt(n)}),follow:(e,n)=>Se(`/chats/${e}/follow`,{method:"PUT",body:tt({following:n})}),botDirects:e=>Se(`/members/${e}/dms`),tasks:e=>Se(`/bots/${e}/tasks`),createTask:(e,n)=>Se(`/bots/${e}/tasks`,{method:"POST",body:tt(n)}),updateTask:(e,n,i)=>Se(`/bots/${e}/tasks/${n}`,{method:"PUT",body:tt(i)}),setTaskOn:(e,n,i)=>Se(`/bots/${e}/tasks/${n}/${i?"resume":"pause"}`,{method:"POST"}),deleteTask:(e,n)=>Se(`/bots/${e}/tasks/${n}`,{method:"DELETE"}),botSubscriptions:e=>Se(`/members/${e}/subscriptions`),controlBot:(e,n)=>Se(`/bots/${e}/${n}`,{method:"POST"}),grantBotMachine:(e,n,i)=>Se(`/bots/${e}/environment`,{method:"PUT",body:tt({machineId:n,granted:i})}),grantBotSandbox:(e,n,i)=>Se(`/bots/${e}/environment`,{method:"PUT",body:tt({sandboxId:n,granted:i})}),agentActions:(e,n)=>Se(`/bots/${e}/actions${n?`?before=${n}`:""}`),machines:()=>Se("/environments"),scanMachine:e=>Se("/environments/scan",{method:"POST",body:tt(e)}),addMachine:e=>Se("/environments",{method:"POST",body:tt(e)}),prepareMachineKey:()=>Se("/environments/keys",{method:"POST"}),setMachinePassword:(e,n)=>Se(`/environments/${e}/password`,{method:"PUT",body:tt({password:n})}),updateMachine:(e,n)=>Se(`/environments/${e}`,{method:"PUT",body:tt(n)}),checkMachine:e=>Se(`/environments/${e}/check`,{method:"POST"}),trustMachine:(e,n)=>Se(`/environments/${e}/trust`,{method:"POST",body:tt({fingerprints:n})}),deleteMachine:(e,n=!1)=>Se(`/environments/${e}${n?"?force=1":""}`,{method:"DELETE"}),grantMachine:(e,n,i)=>Se(`/environments/${e}/grants/${n}`,{method:"PUT",body:tt({granted:i})}),fulfilMachine:(e,n,i)=>Se(`/environments/requests/${e}/${n}`,{method:"POST",body:tt(i)}),computer:(e,n)=>Se(`/bots/${e}/computer/${n}`,{method:"POST"}),setComputerType:(e,n)=>Se(`/bots/${e}/computer/type`,{method:"PUT",body:tt({type:n})}),vmSupport:()=>Se("/environments/vm"),checkVmSupport:()=>Se("/environments/vm/check",{method:"POST"}),setComputerLimits:(e,n)=>Se(`/bots/${e}/computer/limits`,{method:"PUT",body:tt(n)}),computerResources:e=>Se(`/bots/${e}/computer/resources`),connection:()=>Se("/connection"),setConnection:e=>Se("/connection",{method:"PUT",body:tt({allowHttp:e})}),setPortRange:e=>Se("/connection",{method:"PUT",body:tt({ports:e})}),ports:e=>Se(`/bots/${e}/ports`),unpublishPort:(e,n)=>Se(`/bots/${e}/ports/${n}`,{method:"DELETE"}),secrets:()=>Se("/secrets"),createSecret:e=>Se("/secrets",{method:"POST",body:tt(e)}),updateSecret:(e,n)=>Se(`/secrets/${e}`,{method:"PUT",body:tt(n)}),deleteSecret:e=>Se(`/secrets/${e}`,{method:"DELETE"}),grantSecret:(e,n,i)=>Se(`/secrets/${e}/grants/${n}`,{method:"PUT",body:tt({granted:i})}),secretUses:e=>Se(`/secrets/${e}/uses`),fulfilSecret:(e,n,i)=>Se(`/secrets/requests/${e}/${n}`,{method:"POST",body:tt(i)}),botStatus:e=>Se(`/bots/${e}/status`),uploadAttachment:h9,removeAttachment:e=>Se(`/attachments/${e}`,{method:"DELETE"}),authStatus:e=>Se(`/model-connections/${e}/auth`),authStart:e=>Se(`/model-connections/${e}/auth`,{method:"POST"}),authCancel:e=>Se(`/model-connections/${e}/auth`,{method:"DELETE"}),authInput:(e,n,i)=>Se(`/model-connections/${e}/auth/input`,{method:"POST",body:tt({promptId:n,value:i})}),authLogout:e=>Se(`/model-connections/${e}/auth/logout`,{method:"POST"}),modelCatalog:e=>Se(`/model-connections/${e}/catalog`),connectionQuota:(e,n=!1)=>Se(`/model-connections/${e}/quota${n?"?refresh=1":""}`),modelResetPlan:e=>Se(`/model-connections/${e}/reset`),resetModelConnection:e=>Se(`/model-connections/${e}/reset`,{method:"POST"}),providerModels:e=>Se(`/model-providers/${encodeURIComponent(e)}/models`),modelProviders:()=>Se("/model-providers"),autoconfigModel:e=>Se("/model-autoconfig",{method:"POST",body:tt(e)}),discoverModels:e=>Se("/model-discovery",{method:"POST",body:tt(e)}),modelConnections:()=>Se("/model-connections"),createModelConnection:e=>Se("/model-connections",{method:"POST",body:tt(e)}),updateModelConnection:(e,n)=>Se(`/model-connections/${e}`,{method:"PUT",body:tt(n)}),deleteModelConnection:e=>Se(`/model-connections/${e}`,{method:"DELETE"}),saveModelCredential:(e,n,i=!1)=>Se(`/model-connections/${e}/credential`,{method:"PUT",body:tt({apiKey:n,remove:i})}),saveConnectionModel:(e,n,i)=>Se(`/model-connections/${e}/models`,{method:i?"PUT":"POST",body:tt({model:n,originalId:i})}),deleteConnectionModel:(e,n)=>Se(`/model-connections/${e}/models`,{method:"DELETE",body:tt({modelId:n})})},Vx=4*1024**3,p9=["normal","happy","sad","angry","dizzy"],g9=["antigravity","kimi-coding","openai-codex","github-copilot","openrouter","anthropic","openai"];/**
50
+ * @license lucide-react v1.47.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const v9=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
55
+ * @license lucide-react v1.47.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */function y9(e,n,i=[]){if(n==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:v9(e),size:24,node:n,...i.length>0?{aliases:i}:{}}}/**
60
+ * @license lucide-react v1.47.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const x9=e=>{let n="",i=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){i=n.length>0;continue}n.length===0?n+=r.toLowerCase():n+=i?r.toUpperCase():r,i=!1}return n};/**
65
+ * @license lucide-react v1.47.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const b9=e=>{const n=x9(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
70
+ * @license lucide-react v1.47.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const S0=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim();/**
75
+ * @license lucide-react v1.47.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const hs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
80
+ * @license lucide-react v1.47.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */function Tp(e){return e!=null}function j9(e,n={}){var j,b;const i=n.attributeNames??{},r=k=>i[k]??k,l=e.size??e.width??hs.width,c=e.size??e.height??hs.height,d=((j=e.aliases)==null?void 0:j.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],f=[...e.name?[`lucide-${e.name}`]:[],...d],h=((b=n.className)==null?void 0:b.split(" ").filter(Boolean))??[],g=n.includeDefaultClasses===!1?S0(...h):S0("lucide",...f,...h),y=n.absoluteStrokeWidth?Number(n.strokeWidth??hs["stroke-width"])*Number(e.size??e.width??hs.width)/Number(n.size??n.width??hs.width):n.strokeWidth??hs["stroke-width"];return["svg",{...Object.entries(hs).reduce((k,[S,N])=>(k[r(S)]=N,k),{}),..."color"in n&&n.color&&{[r("stroke")]:n.color},..."size"in n&&Tp(n.size)&&{[r("width")]:n.size,[r("height")]:n.size},..."width"in n&&Tp(n.width)&&{[r("width")]:n.width},..."height"in n&&Tp(n.height)&&{[r("height")]:n.height},[r("stroke-width")]:y,...g&&{[r("class")]:g},[r("viewBox")]:`0 0 ${l} ${c}`,...n.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in n&&n.attributes},e.node.map(k=>{const[S,N,C]=k,M=n.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...N}:N;return C?[S,M,C]:[S,M]})]}/**
85
+ * @license lucide-react v1.47.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */function w9(e,n={}){return j9(e,{...n,attributeNames:{...n.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
90
+ * @license lucide-react v1.47.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const k9=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},S9=w.createContext({}),C9=()=>w.useContext(S9),N9=w.forwardRef(({color:e,size:n,width:i,height:r,strokeWidth:l,absoluteStrokeWidth:c,nonScalingStroke:d,className:f="",children:h,iconNode:g=[],icon:y={node:g,aliases:[],size:24},...m},j)=>{const{size:b=24,strokeWidth:k=2,absoluteStrokeWidth:S=!1,nonScalingStroke:N=!1,color:C="currentColor",className:M=""}=C9()??{},E=!!h||k9(m),[T,_,R=[]]=w9(y,{color:e??C,width:i??n??b,height:r??n??b,strokeWidth:l??k,absoluteStrokeWidth:c??S,nonScalingStroke:d??N,className:S0(M,f),hasA11yProp:E,attributes:m});return w.createElement(T,{ref:j,..._},[...R.map(([O,I])=>w.createElement(O,I)),...Array.isArray(h)?h:[h]])});/**
95
+ * @license lucide-react v1.47.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */function Re(e,n=[],i=[]){const r=typeof e=="string"?y9(e,n,i):e,l=w.forwardRef(({className:c,...d},f)=>w.createElement(N9,{ref:f,icon:r,className:c,...d}));return r.name&&(l.displayName=b9(r.name)),l}/**
100
+ * @license lucide-react v1.47.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const M4={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};M4.node;const E9=Re(M4);/**
105
+ * @license lucide-react v1.47.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const A4={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};A4.node;const T9=Re(A4);/**
110
+ * @license lucide-react v1.47.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const _4={name:"arrow-down-up",size:24,node:[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]};_4.node;const M9=Re(_4);/**
115
+ * @license lucide-react v1.47.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const R4={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};R4.node;const bg=Re(R4);/**
120
+ * @license lucide-react v1.47.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const O4={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};O4.node;const Uc=Re(O4);/**
125
+ * @license lucide-react v1.47.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const z4={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};z4.node;const A9=Re(z4);/**
130
+ * @license lucide-react v1.47.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const D4={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};D4.node;const _9=Re(D4);/**
135
+ * @license lucide-react v1.47.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const L4={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};L4.node;const R9=Re(L4);/**
140
+ * @license lucide-react v1.47.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const B4={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};B4.node;const C0=Re(B4);/**
145
+ * @license lucide-react v1.47.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const I4={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};I4.node;const O9=Re(I4);/**
150
+ * @license lucide-react v1.47.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const q4={name:"cat",size:24,node:[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]};q4.node;const z9=Re(q4);/**
155
+ * @license lucide-react v1.47.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const P4={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};P4.node;const D9=Re(P4);/**
160
+ * @license lucide-react v1.47.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const H4={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};H4.node;const Ba=Re(H4);/**
165
+ * @license lucide-react v1.47.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const F4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};F4.node;const _o=Re(F4);/**
170
+ * @license lucide-react v1.47.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const U4={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};U4.node;const jg=Re(U4);/**
175
+ * @license lucide-react v1.47.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const $4={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};$4.node;const _s=Re($4);/**
180
+ * @license lucide-react v1.47.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const V4={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};V4.node;const L9=Re(V4);/**
185
+ * @license lucide-react v1.47.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const G4={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};G4.node;const B9=Re(G4);/**
190
+ * @license lucide-react v1.47.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Y4={name:"container",size:24,node:[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]};Y4.node;const I9=Re(Y4);/**
195
+ * @license lucide-react v1.47.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const K4={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};K4.node;const eu=Re(K4);/**
200
+ * @license lucide-react v1.47.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const X4={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};X4.node;const q9=Re(X4);/**
205
+ * @license lucide-react v1.47.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const Q4={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};Q4.node;const wg=Re(Q4);/**
210
+ * @license lucide-react v1.47.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const Z4={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};Z4.node;const N0=Re(Z4);/**
215
+ * @license lucide-react v1.47.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const J4={name:"expand",size:24,node:[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]};J4.node;const P9=Re(J4);/**
220
+ * @license lucide-react v1.47.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const W4={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};W4.node;const df=Re(W4);/**
225
+ * @license lucide-react v1.47.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const ew={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};ew.node;const kg=Re(ew);/**
230
+ * @license lucide-react v1.47.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const tw={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};tw.node;const Sg=Re(tw);/**
235
+ * @license lucide-react v1.47.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const nw={name:"face-slightly-smiling-plus",size:24,node:[["path",{d:"M13.267 2.08a10 10 0 108.653 8.653",key:"1wbpyh"}],["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M9 10V9",key:"1lazqi"}]],aliases:["smile-plus"]};nw.node;const H9=Re(nw);/**
240
+ * @license lucide-react v1.47.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const aw={name:"face-slightly-smiling",size:24,node:[["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M9 10V9",key:"1lazqi"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["smile"]};aw.node;const F9=Re(aw);/**
245
+ * @license lucide-react v1.47.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const iw={name:"file-headphone",size:24,node:[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],aliases:["file-audio","file-audio-2"]};iw.node;const U9=Re(iw);/**
250
+ * @license lucide-react v1.47.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const rw={name:"file-play",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],aliases:["file-video"]};rw.node;const $9=Re(rw);/**
255
+ * @license lucide-react v1.47.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const ow={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};ow.node;const V9=Re(ow);/**
260
+ * @license lucide-react v1.47.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const sw={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};sw.node;const G9=Re(sw);/**
265
+ * @license lucide-react v1.47.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const lw={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};lw.node;const Y9=Re(lw);/**
270
+ * @license lucide-react v1.47.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const cw={name:"fold-vertical",size:24,node:[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]]};cw.node;const K9=Re(cw);/**
275
+ * @license lucide-react v1.47.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const uw={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};uw.node;const X9=Re(uw);/**
280
+ * @license lucide-react v1.47.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const dw={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};dw.node;const Q9=Re(dw);/**
285
+ * @license lucide-react v1.47.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const fw={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};fw.node;const Z9=Re(fw);/**
290
+ * @license lucide-react v1.47.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const hw={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};hw.node;const J9=Re(hw);/**
295
+ * @license lucide-react v1.47.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const mw={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};mw.node;const W9=Re(mw);/**
300
+ * @license lucide-react v1.47.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const pw={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};pw.node;const eN=Re(pw);/**
305
+ * @license lucide-react v1.47.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const gw={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};gw.node;const Cg=Re(gw);/**
310
+ * @license lucide-react v1.47.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const vw={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};vw.node;const ff=Re(vw);/**
315
+ * @license lucide-react v1.47.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const yw={name:"lightbulb",size:24,node:[["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",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};yw.node;const tN=Re(yw);/**
320
+ * @license lucide-react v1.47.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const xw={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};xw.node;const nN=Re(xw);/**
325
+ * @license lucide-react v1.47.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const bw={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};bw.node;const jw=Re(bw);/**
330
+ * @license lucide-react v1.47.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const ww={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};ww.node;const aN=Re(ww);/**
335
+ * @license lucide-react v1.47.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const kw={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};kw.node;const iN=Re(kw);/**
340
+ * @license lucide-react v1.47.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const Sw={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};Sw.node;const Cw=Re(Sw);/**
345
+ * @license lucide-react v1.47.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const Nw={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};Nw.node;const Ng=Re(Nw);/**
350
+ * @license lucide-react v1.47.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const Ew={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};Ew.node;const rN=Re(Ew);/**
355
+ * @license lucide-react v1.47.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const Tw={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};Tw.node;const oN=Re(Tw);/**
360
+ * @license lucide-react v1.47.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const Mw={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};Mw.node;const Aw=Re(Mw);/**
365
+ * @license lucide-react v1.47.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const _w={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};_w.node;const sN=Re(_w);/**
370
+ * @license lucide-react v1.47.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const Rw={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Rw.node;const Ow=Re(Rw);/**
375
+ * @license lucide-react v1.47.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const zw={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};zw.node;const lN=Re(zw);/**
380
+ * @license lucide-react v1.47.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const Dw={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Dw.node;const cN=Re(Dw);/**
385
+ * @license lucide-react v1.47.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const Lw={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};Lw.node;const uN=Re(Lw);/**
390
+ * @license lucide-react v1.47.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const Bw={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Bw.node;const Rf=Re(Bw);/**
395
+ * @license lucide-react v1.47.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const Iw={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};Iw.node;const dN=Re(Iw);/**
400
+ * @license lucide-react v1.47.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const qw={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};qw.node;const fN=Re(qw);/**
405
+ * @license lucide-react v1.47.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const Pw={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Pw.node;const E0=Re(Pw);/**
410
+ * @license lucide-react v1.47.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */const Hw={name:"plane",size:24,node:[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]};Hw.node;const hN=Re(Hw);/**
415
+ * @license lucide-react v1.47.0 - ISC
416
+ *
417
+ * This source code is licensed under the ISC license.
418
+ * See the LICENSE file in the root directory of this source tree.
419
+ */const Fw={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Fw.node;const Ir=Re(Fw);/**
420
+ * @license lucide-react v1.47.0 - ISC
421
+ *
422
+ * This source code is licensed under the ISC license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */const Uw={name:"quote",size:24,node:[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]};Uw.node;const mN=Re(Uw);/**
425
+ * @license lucide-react v1.47.0 - ISC
426
+ *
427
+ * This source code is licensed under the ISC license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */const $w={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};$w.node;const Of=Re($w);/**
430
+ * @license lucide-react v1.47.0 - ISC
431
+ *
432
+ * This source code is licensed under the ISC license.
433
+ * See the LICENSE file in the root directory of this source tree.
434
+ */const Vw={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};Vw.node;const pN=Re(Vw);/**
435
+ * @license lucide-react v1.47.0 - ISC
436
+ *
437
+ * This source code is licensed under the ISC license.
438
+ * See the LICENSE file in the root directory of this source tree.
439
+ */const Gw={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Gw.node;const Yw=Re(Gw);/**
440
+ * @license lucide-react v1.47.0 - ISC
441
+ *
442
+ * This source code is licensed under the ISC license.
443
+ * See the LICENSE file in the root directory of this source tree.
444
+ */const Kw={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Kw.node;const Rs=Re(Kw);/**
445
+ * @license lucide-react v1.47.0 - ISC
446
+ *
447
+ * This source code is licensed under the ISC license.
448
+ * See the LICENSE file in the root directory of this source tree.
449
+ */const Xw={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};Xw.node;const El=Re(Xw);/**
450
+ * @license lucide-react v1.47.0 - ISC
451
+ *
452
+ * This source code is licensed under the ISC license.
453
+ * See the LICENSE file in the root directory of this source tree.
454
+ */const Qw={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Qw.node;const gN=Re(Qw);/**
455
+ * @license lucide-react v1.47.0 - ISC
456
+ *
457
+ * This source code is licensed under the ISC license.
458
+ * See the LICENSE file in the root directory of this source tree.
459
+ */const Zw={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Zw.node;const vN=Re(Zw);/**
460
+ * @license lucide-react v1.47.0 - ISC
461
+ *
462
+ * This source code is licensed under the ISC license.
463
+ * See the LICENSE file in the root directory of this source tree.
464
+ */const Jw={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};Jw.node;const yN=Re(Jw);/**
465
+ * @license lucide-react v1.47.0 - ISC
466
+ *
467
+ * This source code is licensed under the ISC license.
468
+ * See the LICENSE file in the root directory of this source tree.
469
+ */const Ww={name:"shrink",size:24,node:[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]};Ww.node;const xN=Re(Ww);/**
470
+ * @license lucide-react v1.47.0 - ISC
471
+ *
472
+ * This source code is licensed under the ISC license.
473
+ * See the LICENSE file in the root directory of this source tree.
474
+ */const e3={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};e3.node;const bN=Re(e3);/**
475
+ * @license lucide-react v1.47.0 - ISC
476
+ *
477
+ * This source code is licensed under the ISC license.
478
+ * See the LICENSE file in the root directory of this source tree.
479
+ */const t3={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};t3.node;const n3=Re(t3);/**
480
+ * @license lucide-react v1.47.0 - ISC
481
+ *
482
+ * This source code is licensed under the ISC license.
483
+ * See the LICENSE file in the root directory of this source tree.
484
+ */const a3={name:"speech",size:24,node:[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]]};a3.node;const jN=Re(a3);/**
485
+ * @license lucide-react v1.47.0 - ISC
486
+ *
487
+ * This source code is licensed under the ISC license.
488
+ * See the LICENSE file in the root directory of this source tree.
489
+ */const i3={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};i3.node;const r3=Re(i3);/**
490
+ * @license lucide-react v1.47.0 - ISC
491
+ *
492
+ * This source code is licensed under the ISC license.
493
+ * See the LICENSE file in the root directory of this source tree.
494
+ */const o3={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};o3.node;const wN=Re(o3);/**
495
+ * @license lucide-react v1.47.0 - ISC
496
+ *
497
+ * This source code is licensed under the ISC license.
498
+ * See the LICENSE file in the root directory of this source tree.
499
+ */const s3={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s3.node;const hf=Re(s3);/**
500
+ * @license lucide-react v1.47.0 - ISC
501
+ *
502
+ * This source code is licensed under the ISC license.
503
+ * See the LICENSE file in the root directory of this source tree.
504
+ */const l3={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};l3.node;const zf=Re(l3);/**
505
+ * @license lucide-react v1.47.0 - ISC
506
+ *
507
+ * This source code is licensed under the ISC license.
508
+ * See the LICENSE file in the root directory of this source tree.
509
+ */const c3={name:"trophy",size:24,node:[["path",{d:"M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2",key:"pwuv1l"}],["path",{d:"M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2",key:"1y54w1"}],["path",{d:"M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3",key:"e30mpu"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3",key:"i0yafy"}]]};c3.node;const kN=Re(c3);/**
510
+ * @license lucide-react v1.47.0 - ISC
511
+ *
512
+ * This source code is licensed under the ISC license.
513
+ * See the LICENSE file in the root directory of this source tree.
514
+ */const u3={name:"unfold-vertical",size:24,node:[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]]};u3.node;const SN=Re(u3);/**
515
+ * @license lucide-react v1.47.0 - ISC
516
+ *
517
+ * This source code is licensed under the ISC license.
518
+ * See the LICENSE file in the root directory of this source tree.
519
+ */const d3={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};d3.node;const CN=Re(d3);/**
520
+ * @license lucide-react v1.47.0 - ISC
521
+ *
522
+ * This source code is licensed under the ISC license.
523
+ * See the LICENSE file in the root directory of this source tree.
524
+ */const f3={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};f3.node;const NN=Re(f3);/**
525
+ * @license lucide-react v1.47.0 - ISC
526
+ *
527
+ * This source code is licensed under the ISC license.
528
+ * See the LICENSE file in the root directory of this source tree.
529
+ */const h3={name:"utensils",size:24,node:[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],aliases:["fork-knife"]};h3.node;const EN=Re(h3);/**
530
+ * @license lucide-react v1.47.0 - ISC
531
+ *
532
+ * This source code is licensed under the ISC license.
533
+ * See the LICENSE file in the root directory of this source tree.
534
+ */const m3={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};m3.node;const TN=Re(m3);/**
535
+ * @license lucide-react v1.47.0 - ISC
536
+ *
537
+ * This source code is licensed under the ISC license.
538
+ * See the LICENSE file in the root directory of this source tree.
539
+ */const p3={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};p3.node;const Rl=Re(p3),g3={list:(e,n)=>Se(`/bots/${e}/activity${n===void 0?"":`?before=${encodeURIComponent(n)}`}`),message:(e,n)=>Se(`/bots/${e}/activity/messages/${n}`)};function v3(e){var n,i,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(i=v3(e[n]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}function MN(){for(var e,n,i=0,r="",l=arguments.length;i<l;i++)(e=arguments[i])&&(n=v3(e))&&(r&&(r+=" "),r+=n);return r}const Gx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yx=MN,Eg=(e,n)=>i=>{var r;if((n==null?void 0:n.variants)==null)return Yx(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(g=>{const y=i==null?void 0:i[g],m=c==null?void 0:c[g];if(y===null)return null;const j=Gx(y)||Gx(m);return l[g][j]}),f=i&&Object.entries(i).reduce((g,y)=>{let[m,j]=y;return j===void 0||(g[m]=j),g},{}),h=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((g,y)=>{let{class:m,className:j,...b}=y;return Object.entries(b).every(k=>{let[S,N]=k;return Array.isArray(N)?N.includes({...c,...f}[S]):{...c,...f}[S]===N})?[...g,m,j]:g},[]);return Yx(e,d,h,i==null?void 0:i.class,i==null?void 0:i.className)},y3=48,ir=(e,n=0)=>{const i=new Int32Array(e.length);for(let r=0;r<e.length;r++)i[r]=e.charCodeAt(r)-y3-n;return i},Df=e=>{const n=new Int32Array(e.length+1);for(let i=0;i<e.length;i++)n[i+1]=n[i]+e[i];return n},Ro=e=>{const n=new Int32Array(e.length);let i=0;for(let r=0;r<e.length;r++){const l=e.charCodeAt(r)-y3;i+=l>>>1^-(l&1),n[r]=i}return n},AN=384,_N=[],xs=Df(ir("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),RN=Df(ir(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),ON="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",zN=(()=>{const e=xs.length-1,n=new Int32Array(e);for(let l=e-1;l>=0;l--){let c=1,d=l+1;for(let f=xs[l];f<xs[l+1];f++)c+=n[d],d+=n[d];n[l]=c}const i=new Int32Array(xs[e]);let r=0;for(let l=0;l<e;l++){let c=l+1;for(let d=xs[l];d<xs[l+1];d++)i[r++]=c,c+=n[c]}return i})(),DN=ir("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),LN=Df(ir("123333359346463635126536711576")),BN=ir("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),IN=ir("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),qN=Ro("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),PN=(()=>{const e=new Int32Array(319).fill(-1),n=Ro("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),i=Ro("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<n.length;r++)e[n[r]]=i[r];return e})(),HN="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const n=e.split(" "),i=n.shift();for(let r=0;r<n.length;r++)n[r]=i+n[r];return n}),Kx=Ro("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),FN=Ro("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),UN=Ro("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),x3=new Int32Array(995),b3=new Int32Array(995),j3=new Int32Array(995);let T0="";const M0=new Int32Array(1038);{const e=new Map;let n=0,i=0;for(let r=0;r<Kx.length;r++)for(const l of HN[UN[r]]){let c=e.get(l);c===void 0&&(c=n++,e.set(l,c),M0[c*2]=T0.length,M0[c*2+1]=l.length,T0+=l),x3[i]=Kx[r],b3[i]=FN[r],j3[i]=c,i++}}const $N=Ro("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),VN=Df(ir("1::24444432:442:44:44>222222:44:4421322511111311111114")),GN=Ro("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),YN=ir("ij"),KN=ir("—"),XN=ir("1"),QN="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var ZN={GROUP_COUNT:AN,customValidatorNames:_N,edgeStart:xs,labelStart:RN,labelText:ON,edgeTarget:zN,nodeGroup:DN,nodeVlist:PN,vlistPat:LN,vlistOps:BN,vlistRef:IN,vlistGroup:qN,litAnchor:x3,litGroup:b3,litPool:j3,poolOffsets:M0,poolText:T0,adjGid:$N,adjStart:VN,adjTgt:GN,patGid:YN,patTgt:KN,postfixLookupGroups:XN,orderSensitiveModifiers:QN};const JN="line"in new Error,Vi=-1,ms=-1,Mp=(e,n,i)=>{let r=2166136261;for(let l=n;l<i;l++)r=Math.imul(r^e.charCodeAt(l),16777619);return r},Wd=(e,n,i)=>{const r=i-n;let l=Math.imul(r,2654435761)^e.charCodeAt(n);if(r>3){const c=r>>2,d=r>>1;l=Math.imul(l^e.charCodeAt(n+1)<<8^e.charCodeAt(n+2)<<16^e.charCodeAt(n+c),2246822507),l=Math.imul(l^e.charCodeAt(n+d)<<8^e.charCodeAt(n+d+c)<<16^e.charCodeAt(i-3),3266489909),l^=e.charCodeAt(i-2)<<8^e.charCodeAt(i-1)<<16;for(let f=n+3,h=i-4;f<n+8&&f<h;f++,h--)l=Math.imul(l^e.charCodeAt(f)^e.charCodeAt(h)<<8,16777619)}return l^l>>>15|0},WN=(e,n,i={})=>{const{GROUP_COUNT:r,edgeStart:l,labelStart:c,labelText:d,edgeTarget:f,nodeGroup:h,nodeVlist:g,vlistPat:y,vlistOps:m,vlistRef:j,vlistGroup:b,litAnchor:k,litGroup:S,litPool:N,poolOffsets:C,poolText:M,adjGid:E,adjStart:T,adjTgt:_,patGid:R,patTgt:O,postfixLookupGroups:I,customValidatorNames:P,orderSensitiveModifiers:z}=e,q=new Int32Array(r).fill(-1);for(let de=0;de<E.length;de++)q[E[de]]=de;let $=0;for(let de=0;de+1<T.length;de++){const ke=T[de+1]-T[de];ke>$&&($=ke)}let Q=32;for(;Q<2*(1+$+R.length);)Q<<=1;const Y=new Int32Array(j.length+1);for(let de=0;de<j.length;de++)Y[de+1]=Y[de]+y[j[de]+1]-y[j[de]];const H=new Uint8Array(r);for(let de=0;de<I.length;de++)H[I[de]]=1;const K=l.length-1,V=new Uint8Array(K);let X=0,Z=!0;for(let de=0;de<k.length;de++){V[k[de]]=1;const ke=C[N[de]*2+1];ke>X&&(X=ke);const je=M.charCodeAt(C[N[de]*2]);(je===91||je===40)&&(Z=!1)}let D=1;for(;D<k.length*2;)D<<=1;const se=new Int32Array(D).fill(-1);for(let de=0;de<k.length;de++){const ke=C[N[de]*2];let je=(Mp(M,ke,ke+C[N[de]*2+1])^Math.imul(k[de],2654435761)|0)&D-1;for(;se[je]!==-1;)je=je+1&D-1;se[je]=de}const ne=(de,ke,je,De)=>{let at=(Mp(ke,je,De)^Math.imul(de,2654435761)|0)&D-1;const et=De-je;for(;;){const st=se[at];if(st===-1)return-1;if(k[st]===de&&C[N[st]*2+1]===et){const yt=C[N[st]*2];let _t=!0;for(let Ye=0;Ye<et;Ye++)if(M.charCodeAt(yt+Ye)!==ke.charCodeAt(je+Ye)){_t=!1;break}if(_t)return S[st]}at=at+1&D-1}},B=i.cacheSize??8192,F=i.prefix??e.prefix??"",ee=F===""?"":F+":",W=ee.length,fe=(P??[]).map(de=>{throw new Error("cn: missing validator "+de)}),le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,be=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,we=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ve=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let re=0,Ce=-1,Ve=-1,Pe=-1,Ze=-1;const Fe=de=>de>=97&&de<=122||de>=65&&de<=90||de>=48&&de<=57||de===95,Ke=de=>/\s/.test(String.fromCharCode(de)),gt=(de,ke,je)=>{if(re=0,Ce=-1,je-ke<3)return;const De=de.charCodeAt(ke),at=de.charCodeAt(je-1);if(De===91&&at===93)re=1;else if(De===40&&at===41)re=2;else return;Pe=ke+1,Ze=je-1;let et=ke+1;if(Fe(de.charCodeAt(et))){for(et++;et<je-1;){const st=de.charCodeAt(et);if(!Fe(st)&&st!==45)break;et++}et<je-2&&de.charCodeAt(et)===58&&(Ce=ke+1,Ve=et,Pe=et+1)}},Ht=(de,ke,je,De)=>{if(je-ke!==De.length)return!1;for(let at=0;at<De.length;at++)if(de.charCodeAt(ke+at)!==De.charCodeAt(at))return!1;return!0},Jt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kn=de=>!!de&&!Number.isNaN(Number(de)),vn=(de,ke,je)=>{if(je-ke<11||!Ht(de,ke,ke+10,"@container"))return!1;if(de.charCodeAt(ke+10)===47)return je-ke>=12;const De=de.charCodeAt(ke+11);return De===115&&je-ke>=17&&Ht(de,ke+10,ke+16,"-size/")||De===110&&je-ke>=19&&Ht(de,ke+10,ke+18,"-normal/")},on=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ge="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(de=>de.split(" ")),Me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Xe=(de,ke,je,De)=>{if(de>=10){if(de>=25)return fe[de-25](ke.slice(je,De));const at=de-10;if(re!==on[at])return!1;if(Ce>=0){for(const et of ge[at])if(Ht(ke,Ce,Ve,et))return!0;return!1}switch(Me[at]){case 0:return!1;case 1:return!0;case 2:{const et=ke.slice(Pe,Ze);return le.test(et)&&!be.test(et)}case 3:return kn(ke.slice(Pe,Ze));case 4:return ve.test(ke.slice(Pe,Ze));default:return we.test(ke.slice(Pe,Ze))}}switch(de){case 0:return!0;case 1:return re===0;case 2:return re===1;case 3:return re===2;case 4:return Jt.test(ke.slice(je,De));case 5:return kn(ke.slice(je,De));case 6:{const at=ke.slice(je,De);return!!at&&Number.isInteger(Number(at))}case 7:return De>je&&ke.charCodeAt(De-1)===37&&kn(ke.slice(je,De-1));case 8:return tn.test(ke.slice(je,De));default:return vn(ke,je,De)}},Je=new Set(typeof z=="string"?z.split(" "):z),rt=(de,ke,je,De,at,et)=>{const st=Mp(ke,je,De)^(at?2654435769:0)|0;let yt=de.get(st);if(yt!==void 0)e:for(let nt=0;nt<yt.length;nt++){const xt=yt[nt];if(!(xt.imp!==at||xt.k.length!==De-je)){for(let Ge=0;Ge<xt.k.length;Ge++)if(xt.k.charCodeAt(Ge)!==ke.charCodeAt(je+Ge))continue e;return xt.id}}else de.set(st,yt=[]);const _t=ke.slice(je,De),Ye=et(_t);return yt.push({k:_t,imp:at,id:Ye}),Ye};let Wt=new Map,_n=new Map,dn=2;const Ln=4096,me=(de,ke)=>{const je=[];let De=0,at=0,et=0;for(let Ye=0;Ye<de.length;Ye++){const nt=de.charCodeAt(Ye);De===0&&at===0&&nt===58?(je.push(de.slice(et,Ye)),et=Ye+1):nt===91?De++:nt===93?De--:nt===40?at++:nt===41&&at--}je.push(de.slice(et));let st=je[0];if(je.length>1){const Ye=[];let nt=[];for(const xt of je)xt.charCodeAt(0)===91||Je.has(xt)?(nt.length&&(Ye.push(...nt.sort()),nt=[]),Ye.push(xt)):nt.push(xt);nt.length&&Ye.push(...nt.sort()),st=Ye.join(":")}const yt=ke?st+" !":st;let _t=_n.get(yt);return _t===void 0&&_n.set(yt,_t=dn++),_t};let Ee=new Map,_e=r;const Be=r+4096,ze=()=>_e++,dt=2097152,ta=8192,Rn=new Int32Array(ta),yn=new Array(ta).fill(null),lr=new Int32Array(ta),Ri=new Int32Array(ta),Xr=new Uint8Array(ta);let cr=0;const Yt=(de,ke,je,De,at,et,st,yt)=>{let _t=de;if(yn[de]!==null)if(yn[de|1]===null)_t=de|1;else if((cr++&3)===0)_t=de|cr>>2&1;else return;yn[_t]=ke.slice(je,De),Rn[_t]=at,lr[_t]=et,Ri[_t]=st,Xr[_t]=yt},xn=()=>yn.fill(null);let Kt=256,sn=[new Int32Array(Kt),new Int32Array(Kt),new Int32Array(Kt),new Int32Array(Kt)],[qa,Ca,mi,Na]=sn,Pa=new Uint8Array(Kt),da=new Uint8Array(Kt);const Wa=()=>{Kt*=2,sn=sn.map(ke=>{const je=new Int32Array(Kt);return je.set(ke),je}),[qa,Ca,mi,Na]=sn;const de=new Uint8Array(Kt);de.set(Pa),Pa=de,da=new Uint8Array(Kt)};let ft=64,na=new Int32Array(ft),Oi=new Int32Array(ft);const ur=new Int32Array(r);let fa=2048,ha=21,pi=new Float64Array(fa),$n=new Int32Array(fa),ma=0;const dr=(de,ke)=>{if(de===0&&ke<r)return ur[ke]===ma?1:(ur[ke]=ma,0);const je=de*2097152+ke+1;let De=Math.imul(je,2654435761)>>>ha;for(;$n[De]===ma;){if(pi[De]===je)return 1;De=De+1&fa-1}return pi[De]=je,$n[De]=ma,0},fr=(de,ke,je,De,at)=>{if(je-ke>=2&&de.charCodeAt(ke)===91&&de.charCodeAt(je-1)===93){let et=-1;for(let st=ke+1;st<je-1;st++)if(de.charCodeAt(st)===58){et=st;break}return et===-1||et===ke+1?Vi:rt(Ee,de,ke+1,et,0,ze)}if(De>=0&&h[De]>=0)return h[De];for(let et=at-1;et>=0;et--){const st=Oi[et];if(st>je)continue;const yt=na[et],_t=je-st;if(V[yt]===1&&_t>0&&_t<=X){const zt=de.charCodeAt(st);if(Z===!1||zt!==91&&zt!==40){const ga=ne(yt,de,st,je);if(ga>=0)return ga}}const Ye=g[yt];if(Ye<0)continue;const nt=j[Ye],xt=y[nt],Ge=y[nt+1];if(xt===Ge)continue;gt(de,st,je);const bn=Y[Ye]-xt;for(let zt=xt;zt<Ge;zt++)if(Xe(m[zt],de,st,je))return b[bn+zt]}return Vi},gi=de=>{const ke=de.length;let je=0,De=0,at=!1;(dn>Ln||Wt.size>Ln)&&(Wt=new Map,_n=new Map,dn=2,xn()),_e>Be&&(Ee=new Map,_e=r,xn());let et=0;for(;et<ke;){let Ye=de.charCodeAt(et);if(Ye===32||Ye>=9&&Ye<=13||Ye>=160&&Ke(Ye)){Ye!==32&&(at=!0),et++;continue}const nt=et;let xt=0;for(;et<ke;){if(Ye=de.charCodeAt(et),Ye<=32){if(Ye===32)break;if(Ye>=9&&Ye<=13){at=!0;break}}else if(Ye>=160&&Ke(Ye)){at=!0;break}xt=Math.imul(xt^Ye,16777619),et++}const Ge=et,bn=Ge-nt;je===Kt&&Wa();const zt=je++;qa[zt]=nt,Ca[zt]=Ge,De+=bn,xt^=Math.imul(bn,2654435761);const ga=xt^xt>>>15|0,fn=ga&8190;{let Et=-1;if(Rn[fn]===ga&&yn[fn]!==null&&yn[fn].length===bn?Et=fn:Rn[fn|1]===ga&&yn[fn|1]!==null&&yn[fn|1].length===bn&&(Et=fn|1),Et>=0){const In=yn[Et];let ni=!0;for(let Fa=0;Fa<bn;Fa++)if(In.charCodeAt(Fa)!==de.charCodeAt(nt+Fa)){ni=!1;break}if(ni){mi[zt]=lr[Et],Na[zt]=Ri[Et],Pa[zt]=Xr[Et];continue}}}let ln=nt;if(W!==0){if(Ge-nt<=W||!de.startsWith(ee,nt)){mi[zt]=Vi,Yt(fn,de,nt,Ge,ga,Vi,0,0);continue}ln=nt+W}let pr=0,eo=0,ti=-1,gr=-1;for(let Et=ln;Et<Ge;Et++){const In=de.charCodeAt(Et);if(pr===0&&eo===0){if(In===58){ti=Et;continue}if(In===47){gr=Et;continue}}In===91?pr++:In===93?pr--:In===40?eo++:In===41&&eo--}const Fo=ti>=ln?ti+1:ln;let U=Fo,pe=Ge,Ae=!1,lt=0;pe>U&&de.charCodeAt(pe-1)===33?(Ae=!0,pe--):pe>U&&de.charCodeAt(U)===33&&(Ae=!0,U++,lt=1);let ht=-1;gr>Fo&&(ht=gr+lt,ht>=pe&&(ht=-1));let hn=U;pe-U>1&&de.charCodeAt(U)===45&&(hn=U+1);let Ue=0,mt=0,Ft=0,Xt=-1,mn=0;(g[0]>=0||V[0]===1)&&(na[0]=0,Oi[0]=hn,mn=1);let Bn=ms,ia=0;for(let Et=hn;Et<pe;Et++)if(Et===ht&&(Bn=mt<Ft?ms:Ue,ia=mn),Ue!==ms){const In=de.charCodeAt(Et);let ni=-1;if(mt<Ft)d.charCodeAt(mt)===In?(mt++,mt===Ft&&(ni=Ue=Xt)):Ue=ms;else{const Fa=l[Ue],Vo=l[Ue+1];let vr=ms;for(let Gn=Fa;Gn<Vo;Gn++){const Go=c[Gn];if(d.charCodeAt(Go)===In){c[Gn+1]-Go===1?ni=vr=f[Gn]:(mt=Go+1,Ft=c[Gn+1],Xt=f[Gn],vr=Ue);break}}Ue=vr}if(ni>=0&&(g[ni]>=0||V[ni]===1)&&Et+1<pe&&de.charCodeAt(Et+1)===45){if(mn===ft){ft*=2;const Fa=new Int32Array(ft);Fa.set(na),na=Fa;const Vo=new Int32Array(ft);Vo.set(Oi),Oi=Vo}na[mn]=ni,Oi[mn]=Et+2,mn++}}ht===pe&&(Bn=mt<Ft?ms:Ue,ia=mn);const Hl=mt<Ft?ms:Ue;let Vn,va=!1;if(ht>=0)if(va=!0,Vn=fr(de,U,ht,Bn,ia),Vn!==Vi&&Vn<r&&H[Vn]){const Et=fr(de,U,pe,Hl,mn);Et!==Vi&&Et!==Vn&&(Vn=Et,va=!1)}else Vn===Vi&&(Vn=fr(de,U,pe,Hl,mn),va=!1);else Vn=fr(de,U,pe,Hl,mn);let Uo=0,$o=0;Vn===Vi?mi[zt]=Vi:($o=va?1:0,Uo=ln>=ti?Ae?1:0:rt(Wt,de,ln,ti,Ae?1:0,Et=>me(Et,Ae)),mi[zt]=Vn,Pa[zt]=$o,Na[zt]=Uo),Yt(fn,de,nt,Ge,ga,Vn,Uo,$o)}if(je===0)return"";if(je===1)return qa[0]===0&&Ca[0]===ke?de:de.slice(qa[0],Ca[0]);if(je*Q>fa){for(;je*Q>fa;)fa<<=1,ha--;pi=new Float64Array(fa),$n=new Int32Array(fa)}if(dn>=dt||_e>=dt)throw new Error("cn: too many distinct classes in one merge");ma=ma+1|0,ma===0&&(ur.fill(0),$n.fill(0),ma=1);let st=!1;for(let Ye=je-1;Ye>=0;Ye--){const nt=mi[Ye];if(nt===Vi){da[Ye]=1;continue}const xt=Na[Ye];if(dr(xt,nt)===1){da[Ye]=0,st=!0;continue}if(da[Ye]=1,nt<r){const Ge=q[nt];if(Ge>=0)for(let bn=T[Ge];bn<T[Ge+1];bn++)dr(xt,_[bn]);if(Pa[Ye]&1)for(let bn=0;bn<R.length;bn++)R[bn]===nt&&dr(xt,O[bn])}}if(!st&&!at&&ke===De+je-1)return de;let yt="",_t=0;for(;_t<je;){if(!da[_t]){_t++;continue}const Ye=qa[_t];let nt=Ca[_t],xt=_t+1;for(;xt<je&&da[xt]&&qa[xt]===nt+1&&de.charCodeAt(nt)===32;)nt=Ca[xt],xt++;yt.length>0&&(yt+=" "),yt+=de.slice(Ye,nt),_t=xt}return yt},pa=16384,Ea=new Int32Array(pa*2);let hr=0,nn=1,en=Object.create(null),On=Object.create(null),aa=new Map,Ho=new Map,Qr=0,Zr=0;const zi=()=>{hr^=pa,nn=nn+1|0,Zr=0},mr=de=>{let ke=en[de];if(ke!==void 0)return ke;const je=Wd(de,0,de.length),De=(je&16383)+hr,at=Ea[De]===(je^nn)||Ea[De^pa]===(je^nn-1);return at&&(ke=On[de],ke!==void 0)?(en[de]=ke,ke):(ke=gi(de),at?(en[de]=ke,++Qr>B&&(Qr=0,On=en,en=Object.create(null),zi())):(Ea[De]=je^nn,++Zr>pa&&zi()),ke)},Jr=de=>{let ke=aa.get(de);if(ke!==void 0)return ke;const je=Wd(de,0,de.length),De=(je&16383)+hr,at=Ea[De]===(je^nn)||Ea[De^pa]===(je^nn-1);return at&&(ke=Ho.get(de),ke!==void 0)?(aa.set(de,ke),ke):(ke=gi(de),at?(aa.set(de,ke),++Qr>B&&(Qr=0,Ho=aa,aa=new Map,zi())):(Ea[De]=je^nn,++Zr>pa&&zi()),ke)},Wr=de=>{const ke=Wd(de,0,de.length),je=(ke&16383)+hr;return Ea[je]===(ke^nn)||Ea[je^pa]===(ke^nn-1)?!0:(Ea[je]=ke^nn,++Zr>pa&&zi(),!1)},Ha=B===0?gi:JN?de=>{const ke=aa.get(de);return ke!==void 0?ke:Jr(de)}:mr;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Ha(arguments[0]):Ha(tE.apply(null,arguments))},mergeString:Ha,seenBefore:B===0?()=>!1:Wr,mergeUncached:gi}},mf=(e,n)=>{if(!e)return"";if(typeof e=="string")return e;let i="";if(typeof e.length=="number"&&(!n||Array.isArray(e))){const r=e;for(let l=0;l<r.length;l++){const c=r[l];if(!c)continue;const d=typeof c=="string"?c:mf(c,n);d&&(i&&(i+=" "),i+=d)}return i}if(n){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(i&&(i+=" "),i+=r)}return i},eE=(e,n)=>{let i="";for(let r=0;r<e.length;r++){const l=e[r];if(!l)continue;const c=typeof l=="string"?l:mf(l,n);c&&(i&&(i+=" "),i+=c)}return i},tE=function(){return eE(arguments,!1)},nE=256,Xx=16,aE=1024,Ap=4096,iE=(e,n)=>{const i=n===void 0?()=>!0:n.seenBefore,r=n===void 0?e:n.mergeUncached;let l=new Map,c=new Map,d=0,f=null,h=null,g=[],y=[],m=0;const j=(C,M,E)=>{h===null&&(h=new Array(Ap).fill(""),g=new Array(Ap).fill(""),y=new Array(Ap).fill(""));const T=Wd(C,0,C.length)&4094;if(h[T]===C&&g[T]===M)return y[T];if(h[T|1]===C&&g[T|1]===M)return y[T|1];const _=e(E?M+" "+C:C),R=h[T]===""?T:T|(h[T|1]===""?1:m++&1);return h[R]=C,g[R]=M,y[R]=_,_},b=(C,M,E,T)=>{let _=0;if(M){if(M!==C.a0)return!1;_=1}if(E){if(E!==(_===0?C.a0:C.a1))return!1;_++}if(T){if(T!==(_===0?C.a0:_===1?C.a1:C.a2))return!1;_++}return _===C.t},k=(C,M)=>{const E=C.a;let T=0;for(let _=0;_<M.length;_++){const R=M[_];if(R){if(R!==E[T])return!1;T++}}return T===C.t},S=(C,M)=>{const E=C.length,T=f===null?null:f.n;if(!M){if(T!==null&&k(T,C))return f=T,T.r;if(f!==null&&f!==T&&k(f,C))return f.r}let _="",R=-1,O=0,I=!1;for(let q=0;q<E;q++){let $=C[q];if($){if(typeof $!="string"){if($=C[q]=mf($,!0),!$)continue;I=!0}R<0&&(_=$,R=q),O++}}if(O===0)return"";if(O===1)return e(_);if(I){if(T!==null&&k(T,C))return f=T,T.r;if(f!==null&&f!==T&&k(f,C))return f.r}let P=l.get(_);P===void 0&&(P=c.get(_),P!==void 0&&l.set(_,P));let z=null;if(P!==void 0){if(P.skip>0){P.skip--,f=null;let $=_;for(let Q=R+1;Q<E;Q++){const Y=C[Q];Y&&($+=" "+Y)}return j($,"",!1)}const q=P.e;e:for(let $=0;$<q.length;$++){const Q=q[$];if(Q.t!==O)continue;const Y=Q.a;let H=1;for(let K=R+1;K<E;K++){const V=C[K];if(V&&V!==Y[H++])continue e}z=Q;break}z!==null&&(P.miss=0)}if(z===null){let q=_;const $=[_];for(let Y=R+1;Y<E;Y++){const H=C[Y];H&&(q+=" "+H,$.push(H))}if(!i(q))return r(q);z={r:e(q),t:$.length,a0:$[0],a1:$[1],a2:$[2]??"",a:$,n:null},P===void 0?l.set(_,P={e:[],miss:0,skip:0,at:0}):++P.miss>Xx&&(P.miss=Xx,P.skip=aE,P.e.length=0,P.at=0);const Q=P.e;Q.length<nE?Q.push(z):(Q[P.at]=z,P.at=P.at+1&255),++d>1e3&&(d=0,c=l,l=new Map)}return f!==null&&f!==z&&(f.n=z),f=z,z.r},N=C=>Array.isArray(C)?S(C.slice(),!1):e(mf(C,!0));return function(C,M,E){const T=arguments.length;if((T|1)===3){const O=f;if(O!==null){const I=O.n;if(I!==null&&b(I,C,M,E))return f=I,I.r;if(O!==I&&b(O,C,M,E))return O.r}if(T===2&&typeof M=="string"&&M!==""){const I=l.get(C);if(I!==void 0&&I.skip>0)return I.skip--,f=null,j(M,C,!0)}return S([C,M,E],!0)}if(T===1)return typeof C=="string"?e(C):N(C);const _=f;if(_!==null){const O=_.n;if(O!==null){const I=O.a;let P=0,z=!0;for(let q=0;q<T;q++){const $=arguments[q];if($){if($!==I[P]){z=!1;break}P++}}if(z&&P===O.t)return f=O,O.r}if(_!==O){const I=_.a;let P=0,z=!0;for(let q=0;q<T;q++){const $=arguments[q];if($){if($!==I[P]){z=!1;break}P++}}if(z&&P===_.t)return _.r}}const R=[];for(let O=0;O<T;O++)R.push(arguments[O]);return S(R,!0)}},Qx=WN(ZN),Dn=iE(Qx.mergeString,Qx);var Do=j4(),rE=Object.defineProperty,Tg=(e,n)=>rE(e,"name",{value:n,configurable:!0});function A0(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}Tg(A0,"setRef");function w3(...e){return n=>{let i=!1;const r=e.map(l=>{const c=A0(l,n);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let l=0;l<r.length;l++){const c=r[l];typeof c=="function"?c():A0(e[l],null)}}}}Tg(w3,"composeRefs");function It(...e){return w.useCallback(w3(...e),e)}Tg(It,"useComposedRefs");var oE=Object.defineProperty,Mi=(e,n)=>oE(e,"name",{value:n,configurable:!0});function tr(e){const n=w.forwardRef((i,r)=>{let{children:l,...c}=i,d=null,f=!1;const h=[];_0(l)&&typeof Td=="function"&&(l=Td(l._payload)),w.Children.forEach(l,j=>{var b;if(N3(j)){f=!0;const k=j;let S="child"in k.props?k.props.child:k.props.children;_0(S)&&typeof Td=="function"&&(S=Td(S._payload)),d=cE(k,S),h.push((b=d==null?void 0:d.props)==null?void 0:b.children)}else h.push(j)}),d?d=w.cloneElement(d,void 0,h):!f&&w.Children.count(l)===1&&w.isValidElement(l)&&(d=l);const g=d?C3(d):void 0,y=It(r,g);if(!d){if(l||l===0)throw new Error(f?fE(e):dE(e));return l}const m=S3(c,d.props??{});return d.type!==w.Fragment&&(m.ref=r?y:g),w.cloneElement(d,m)});return n.displayName=`${e}.Slot`,n}Mi(tr,"createSlot");var sE=tr("Slot"),k3=Symbol.for("radix.slottable");function lE(e){const n=Mi(i=>"child"in i?i.children(i.child):i.children,"Slottable");return n.displayName=`${e}.Slottable`,n.__radixId=k3,n}Mi(lE,"createSlottable");var cE=Mi((e,n)=>{if("child"in e.props){const i=e.props.child;return w.isValidElement(i)?w.cloneElement(i,void 0,e.props.children(i.props.children)):null}return w.isValidElement(n)?n:null},"getSlottableElementFromSlottable");function S3(e,n){const i={...n};for(const r in n){const l=e[r],c=n[r];/^on[A-Z]/.test(r)?l&&c?i[r]=(...f)=>{const h=c(...f);return l(...f),h}:l&&(i[r]=l):r==="style"?i[r]={...l,...c}:r==="className"&&(i[r]=[l,c].filter(Boolean).join(" "))}return{...e,...i}}Mi(S3,"mergeProps");function C3(e){var r,l;let n=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}Mi(C3,"getElementRef");function N3(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k3}Mi(N3,"isSlottable");var uE=Symbol.for("react.lazy");function _0(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===uE&&"_payload"in e&&E3(e._payload)}Mi(_0,"isLazyComponent");function E3(e){return typeof e=="object"&&e!==null&&"then"in e}Mi(E3,"isPromiseLike");var dE=Mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fE=Mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Td=Jc[" use ".trim().toString()],hE=Object.defineProperty,mE=(e,n)=>hE(e,"name",{value:n,configurable:!0}),pE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rn=pE.reduce((e,n)=>{const i=tr(`Primitive.${n}`),r=w.forwardRef((l,c)=>{const{asChild:d,...f}=l,h=d?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(h,{...f,ref:c})});return r.displayName=`Primitive.${n}`,{...e,[n]:r}},{});function T3(e,n){e&&Do.flushSync(()=>e.dispatchEvent(n))}mE(T3,"dispatchDiscreteCustomEvent");var gE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),vE=Object.defineProperty,fi=(e,n)=>vE(e,"name",{value:n,configurable:!0});function yE(e,n){const i=w.createContext(n);i.displayName=e+"Context";const r=fi(c=>{const{children:d,...f}=c,h=w.useMemo(()=>f,Object.values(f));return o.jsx(i.Provider,{value:h,children:d})},"Provider");r.displayName=e+"Provider";function l(c,d={}){const{optional:f=!1}=d,h=w.useContext(i);if(h)return h;if(n!==void 0)return n;if(!f)throw new Error(`\`${c}\` must be used within \`${e}\``)}return fi(l,"useContext"),[r,l]}fi(yE,"createContext");function Lo(e,n=[]){let i=[];function r(c,d){const f=w.createContext(d);f.displayName=c+"Context";const h=i.length;i=[...i,d];const g=fi(m=>{var C;const{scope:j,children:b,...k}=m,S=((C=j==null?void 0:j[e])==null?void 0:C[h])||f,N=w.useMemo(()=>k,Object.values(k));return o.jsx(S.Provider,{value:N,children:b})},"Provider");g.displayName=c+"Provider";function y(m,j,b={}){var C;const{optional:k=!1}=b,S=((C=j==null?void 0:j[e])==null?void 0:C[h])||f,N=w.useContext(S);if(N)return N;if(d!==void 0)return d;if(!k)throw new Error(`\`${m}\` must be used within \`${c}\``)}return fi(y,"useContext"),[g,y]}fi(r,"createContext");const l=fi(()=>{const c=i.map(d=>w.createContext(d));return fi(function(f){const h=(f==null?void 0:f[e])||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])},"useScope")},"createScope");return l.scopeName=e,[r,M3(l,...n)]}fi(Lo,"createContextScope");function M3(...e){const n=e[0];if(e.length===1)return n;const i=fi(()=>{const r=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return fi(function(c){const d=r.reduce((f,{useScope:h,scopeName:g})=>{const m=h(c)[`__scope${g}`];return{...f,...m}},{});return w.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return i.scopeName=n.scopeName,i}fi(M3,"composeContextScopes");var xE=Object.defineProperty,Un=(e,n)=>xE(e,"name",{value:n,configurable:!0});function A3(e){const n=e+"CollectionProvider",[i,r]=Lo(n),[l,c]=i(n,{collectionRef:{current:null},itemMap:new Map}),d=Un(S=>{const{scope:N,children:C}=S,M=w.useRef(null),E=w.useRef(new Map).current;return o.jsx(l,{scope:N,itemMap:E,collectionRef:M,children:C})},"CollectionProvider");d.displayName=n;const f=e+"CollectionSlot",h=tr(f),g=w.forwardRef((S,N)=>{const{scope:C,children:M}=S,E=c(f,C),T=It(N,E.collectionRef);return o.jsx(h,{ref:T,children:M})});g.displayName=f;const y=e+"CollectionItemSlot",m="data-radix-collection-item",j=tr(y),b=w.forwardRef((S,N)=>{const{scope:C,children:M,...E}=S,T=w.useRef(null),_=It(N,T),R=c(y,C);return w.useEffect(()=>(R.itemMap.set(T,{ref:T,...E}),()=>void R.itemMap.delete(T))),o.jsx(j,{[m]:"",ref:_,children:M})});b.displayName=y;function k(S){const N=c(e+"CollectionConsumer",S);return w.useCallback(()=>{const M=N.collectionRef.current;if(!M)return[];const E=Array.from(M.querySelectorAll(`[${m}]`));return Array.from(N.itemMap.values()).sort((R,O)=>E.indexOf(R.ref.current)-E.indexOf(O.ref.current))},[N.collectionRef,N.itemMap])}return Un(k,"useCollection"),[{Provider:d,Slot:g,ItemSlot:b},k,r]}Un(A3,"createCollection");var Zx=new WeakMap,Tn,Za,_p=(Za=class extends Map{constructor(i){super(i);zx(this,Tn);jp(this,Tn,[...super.keys()]),Zx.set(this,!0)}set(i,r){return Zx.get(this)&&(this.has(i)?oa(this,Tn)[oa(this,Tn).indexOf(i)]=i:oa(this,Tn).push(i)),super.set(i,r),this}insert(i,r,l){const c=this.has(r),d=oa(this,Tn).length,f=Mg(i);let h=f>=0?f:d+f;const g=h<0||h>=d?-1:h;if(g===this.size||c&&g===this.size-1||g===-1)return this.set(r,l),this;const y=this.size+(c?0:1);f<0&&h++;const m=[...oa(this,Tn)];let j,b=!1;for(let k=h;k<y;k++)if(h===k){let S=m[k];m[k]===r&&(S=m[k+1]),c&&this.delete(r),j=this.get(S),this.set(r,l)}else{!b&&m[k-1]===r&&(b=!0);const S=m[b?k:k-1],N=j;j=this.get(S),this.delete(S),this.set(S,N)}return this}with(i,r,l){const c=new Za(this);return c.insert(i,r,l),c}before(i){const r=oa(this,Tn).indexOf(i)-1;if(!(r<0))return this.entryAt(r)}setBefore(i,r,l){const c=oa(this,Tn).indexOf(i);return c===-1?this:this.insert(c,r,l)}after(i){let r=oa(this,Tn).indexOf(i);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(i,r,l){const c=oa(this,Tn).indexOf(i);return c===-1?this:this.insert(c+1,r,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return jp(this,Tn,[]),super.clear()}delete(i){const r=super.delete(i);return r&&oa(this,Tn).splice(oa(this,Tn).indexOf(i),1),r}deleteAt(i){const r=this.keyAt(i);return r!==void 0?this.delete(r):!1}at(i){const r=ef(oa(this,Tn),i);if(r!==void 0)return this.get(r)}entryAt(i){const r=ef(oa(this,Tn),i);if(r!==void 0)return[r,this.get(r)]}indexOf(i){return oa(this,Tn).indexOf(i)}keyAt(i){return ef(oa(this,Tn),i)}from(i,r){const l=this.indexOf(i);if(l===-1)return;let c=l+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(i,r){const l=this.indexOf(i);if(l===-1)return;let c=l+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(i,r){let l=0;for(const c of this){if(Reflect.apply(i,r,[c,l,this]))return c;l++}}findIndex(i,r){let l=0;for(const c of this){if(Reflect.apply(i,r,[c,l,this]))return l;l++}return-1}filter(i,r){const l=[];let c=0;for(const d of this)Reflect.apply(i,r,[d,c,this])&&l.push(d),c++;return new Za(l)}map(i,r){const l=[];let c=0;for(const d of this)l.push([d[0],Reflect.apply(i,r,[d,c,this])]),c++;return new Za(l)}reduce(...i){const[r,l]=i;let c=0,d=l??this.at(0);for(const f of this)c===0&&i.length===1?d=f:d=Reflect.apply(r,this,[d,f,c,this]),c++;return d}reduceRight(...i){const[r,l]=i;let c=l??this.at(-1);for(let d=this.size-1;d>=0;d--){const f=this.at(d);d===this.size-1&&i.length===1?c=f:c=Reflect.apply(r,this,[c,f,d,this])}return c}toSorted(i){const r=[...this.entries()].sort(i);return new Za(r)}toReversed(){const i=new Za;for(let r=this.size-1;r>=0;r--){const l=this.keyAt(r),c=this.get(l);i.set(l,c)}return i}toSpliced(...i){const r=[...this.entries()];return r.splice(...i),new Za(r)}slice(i,r){const l=new Za;let c=this.size-1;if(i===void 0)return l;i<0&&(i=i+this.size),r!==void 0&&r>0&&(c=r-1);for(let d=i;d<=c;d++){const f=this.keyAt(d),h=this.get(f);l.set(f,h)}return l}every(i,r){let l=0;for(const c of this){if(!Reflect.apply(i,r,[c,l,this]))return!1;l++}return!0}some(i,r){let l=0;for(const c of this){if(Reflect.apply(i,r,[c,l,this]))return!0;l++}return!1}},Tn=new WeakMap,Un(Za,"OrderedDict"),Za);function ef(e,n){if("at"in Array.prototype)return Array.prototype.at.call(e,n);const i=_3(e,n);return i===-1?void 0:e[i]}Un(ef,"at");function _3(e,n){const i=e.length,r=Mg(n),l=r>=0?r:i+r;return l<0||l>=i?-1:l}Un(_3,"toSafeIndex");function Mg(e){return e!==e||e===0?0:Math.trunc(e)}Un(Mg,"toSafeInteger");function bE(e){const n=e+"CollectionProvider",[i,r]=Lo(n),[l,c]=i(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new _p,setItemMap:Un(()=>{},"setItemMap")}),d=Un(({state:E,...T})=>E?o.jsx(h,{...T,state:E}):o.jsx(f,{...T}),"CollectionProvider");d.displayName=n;const f=Un(E=>{const T=N();return o.jsx(h,{...E,state:T})},"CollectionInit");f.displayName=n+"Init";const h=Un(E=>{const{scope:T,children:_,state:R}=E,O=w.useRef(null),[I,P]=w.useState(null),z=It(O,P),[q,$]=R;return w.useEffect(()=>{if(!I)return;const Q=z3(()=>{});return Q.observe(I,{childList:!0,subtree:!0}),()=>{Q.disconnect()}},[I]),o.jsx(l,{scope:T,itemMap:q,setItemMap:$,collectionRef:z,collectionRefObject:O,collectionElement:I,children:_})},"CollectionProviderImpl");h.displayName=n+"Impl";const g=e+"CollectionSlot",y=tr(g),m=w.forwardRef((E,T)=>{const{scope:_,children:R}=E,O=c(g,_),I=It(T,O.collectionRef);return o.jsx(y,{ref:I,children:R})});m.displayName=g;const j=e+"CollectionItemSlot",b="data-radix-collection-item",k=tr(j),S=w.forwardRef((E,T)=>{const{scope:_,children:R,...O}=E,I=w.useRef(null),[P,z]=w.useState(null),q=It(T,I,z),$=c(j,_),{setItemMap:Q}=$,Y=w.useRef(O);R3(Y.current,O)||(Y.current=O);const H=Y.current;return w.useEffect(()=>{const K=H;return Q(V=>P?V.has(P)?V.set(P,{...K,element:P}).toSorted(R0):(V.set(P,{...K,element:P}),V.toSorted(R0)):V),()=>{Q(V=>!P||!V.has(P)?V:(V.delete(P),new _p(V)))}},[P,H,Q]),o.jsx(k,{[b]:"",ref:q,children:R})});S.displayName=j;function N(){return w.useState(new _p)}Un(N,"useInitCollection");function C(E){const{itemMap:T}=c(e+"CollectionConsumer",E);return T}return Un(C,"useCollection"),[{Provider:d,Slot:m,ItemSlot:S},{createCollectionScope:r,useCollection:C,useInitCollection:N}]}Un(bE,"createCollection");function R3(e,n){if(e===n)return!0;if(typeof e!="object"||typeof n!="object"||e==null||n==null)return!1;const i=Object.keys(e),r=Object.keys(n);if(i.length!==r.length)return!1;for(const l of i)if(!Object.prototype.hasOwnProperty.call(n,l)||e[l]!==n[l])return!1;return!0}Un(R3,"shallowEqual");function O3(e,n){return!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Un(O3,"isElementPreceding");function R0(e,n){return!e[1].element||!n[1].element?0:O3(e[1].element,n[1].element)?-1:1}Un(R0,"sortByDocumentPosition");function z3(e){return new MutationObserver(i=>{for(const r of i)if(r.type==="childList"){e();return}})}Un(z3,"getChildListObserver");var jE=Object.defineProperty,Ol=(e,n)=>jE(e,"name",{value:n,configurable:!0}),D3=!!(typeof window<"u"&&window.document&&window.document.createElement);function At(e,n,{checkForDefaultPrevented:i=!0}={}){return Ol(function(l){if(e==null||e(l),i===!1||!l||!l.defaultPrevented)return n==null?void 0:n(l)},"handleEvent")}Ol(At,"composeEventHandlers");function wE(e){var n;if(!D3)throw new Error("Cannot access window outside of the DOM");return((n=e==null?void 0:e.ownerDocument)==null?void 0:n.defaultView)??window}Ol(wE,"getOwnerWindow");function O0(e){if(!D3)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ol(O0,"getOwnerDocument");function L3(e,n=!1){const{activeElement:i}=O0(e);if(!(i!=null&&i.nodeName))return null;if(B3(i)&&i.contentDocument)return L3(i.contentDocument.body,n);if(n){const r=i.getAttribute("aria-activedescendant");if(r){const l=O0(i).getElementById(r);if(l)return l}}return i}Ol(L3,"getActiveElement");function B3(e){return e.tagName==="IFRAME"}Ol(B3,"isFrame");var ea=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},kE=Object.defineProperty,SE=(e,n)=>kE(e,"name",{value:n,configurable:!0}),Jx=Jc[" useEffectEvent ".trim().toString()],Wx=Jc[" useInsertionEffect ".trim().toString()];function I3(e){if(typeof Jx=="function")return Jx(e);const n=w.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Wx=="function"?Wx(()=>{n.current=e}):ea(()=>{n.current=e}),w.useMemo(()=>((...i)=>{var r;return(r=n.current)==null?void 0:r.call(n,...i)}),[])}SE(I3,"useEffectEvent");var CE=Object.defineProperty,tu=(e,n)=>CE(e,"name",{value:n,configurable:!0}),NE=Jc[" useInsertionEffect ".trim().toString()]||ea;function $c({prop:e,defaultProp:n,onChange:i=tu(()=>{},"onChange"),caller:r}){const[l,c,d]=q3({defaultProp:n,onChange:i}),f=e!==void 0,h=f?e:l,g=w.useCallback(y=>{var m;if(f){const j=P3(y)?y(e):y;j!==e&&((m=d.current)==null||m.call(d,j))}else c(y)},[f,e,c,d]);return[h,g]}tu($c,"useControllableState");function q3({defaultProp:e,onChange:n}){const[i,r]=w.useState(e),l=w.useRef(i),c=w.useRef(n);return NE(()=>{c.current=n},[n]),w.useEffect(()=>{var d;l.current!==i&&((d=c.current)==null||d.call(c,i),l.current=i)},[i,l]),[i,r,c]}tu(q3,"useUncontrolledState");function P3(e){return typeof e=="function"}tu(P3,"isFunction");var eb=Symbol("RADIX:SYNC_STATE");function EE(e,n,i,r){const{prop:l,defaultProp:c,onChange:d,caller:f}=n,h=l!==void 0,g=I3(d),y=[{...i,state:c}];r&&y.push(r);const[m,j]=w.useReducer((N,C)=>{if(C.type===eb)return{...N,state:C.state};const M=e(N,C);return h&&!Object.is(M.state,N.state)&&g(M.state),M},...y),b=m.state,k=w.useRef(b);w.useEffect(()=>{k.current!==b&&(k.current=b,h||g(b))},[b,k,h]);const S=w.useMemo(()=>l!==void 0?{...m,state:l}:m,[m,l]);return w.useEffect(()=>{h&&!Object.is(l,m.state)&&j({type:eb,state:l})},[l,m.state,h]),[S,j]}tu(EE,"useControllableStateReducer");var TE=Object.defineProperty,qr=(e,n)=>TE(e,"name",{value:n,configurable:!0});function H3(e,n){return w.useReducer((i,r)=>n[i][r]??i,e)}qr(H3,"useStateMachine");var rr=qr(e=>{const{present:n,children:i}=e,r=F3(n),l=typeof i=="function"?i({present:r.isPresent}):w.Children.only(i),c=U3(r.ref,$3(l));return typeof i=="function"||r.isPresent?w.cloneElement(l,{ref:c}):null},"Presence");function F3(e){const[n,i]=w.useState(),r=w.useRef(null),l=w.useRef(e),c=w.useRef("none"),d=w.useRef(void 0),f=e?"mounted":"unmounted",[h,g]=H3(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{h==="mounted"?(c.current=d.current??wl(r.current),d.current=void 0):c.current="none"},[h]),ea(()=>{const y=r.current,m=l.current;if(m!==e){const b=c.current,k=wl(y);e?(d.current=k,g("MOUNT")):k==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(m&&b!==k?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,g]),ea(()=>{if(n){let y;const m=n.ownerDocument.defaultView??window,j=qr(k=>{const N=wl(r.current).includes(CSS.escape(k.animationName));if(k.target===n&&N&&(g("ANIMATION_END"),!l.current)){const C=n.style.animationFillMode;n.style.animationFillMode="forwards",y=m.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=C)})}},"handleAnimationEnd"),b=qr(k=>{k.target===n&&(c.current=wl(r.current))},"handleAnimationStart");return n.addEventListener("animationstart",b),n.addEventListener("animationcancel",j),n.addEventListener("animationend",j),()=>{m.clearTimeout(y),n.removeEventListener("animationstart",b),n.removeEventListener("animationcancel",j),n.removeEventListener("animationend",j)}}else g("ANIMATION_END")},[n,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:w.useCallback(y=>{if(y){const m=getComputedStyle(y);r.current=m,d.current=wl(m)}else r.current=null;i(y)},[])}}qr(F3,"usePresence");function z0(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}qr(z0,"setRef");function U3(...e){const n=w.useRef(e);return n.current=e,w.useCallback(i=>{const r=n.current;let l=!1;const c=r.map(d=>{const f=z0(d,i);return!l&&typeof f=="function"&&(l=!0),f});if(l)return()=>{for(let d=0;d<c.length;d++){const f=c[d];typeof f=="function"?f():z0(r[d],null)}}},[])}qr(U3,"useStableComposedRefs");function wl(e){return(e==null?void 0:e.animationName)||"none"}qr(wl,"getAnimationName");function $3(e){var r,l;let n=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}qr($3,"getElementRef");var ME=Object.defineProperty,AE=(e,n)=>ME(e,"name",{value:n,configurable:!0}),_E=Jc[" useId ".trim().toString()]||(()=>{}),RE=0;function ws(e){const[n,i]=w.useState(_E());return ea(()=>{e||i(r=>r??String(RE++))},[e]),e||(n?`radix-${n}`:"")}AE(ws,"useId");var OE=Object.defineProperty,zE=(e,n)=>OE(e,"name",{value:n,configurable:!0}),DE=w.createContext(void 0);function Ag(e){const n=w.useContext(DE);return e||n||"ltr"}zE(Ag,"useDirection");var LE=Object.defineProperty,BE=(e,n)=>LE(e,"name",{value:n,configurable:!0});function Wn(e){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useMemo(()=>((...i)=>{var r;return(r=n.current)==null?void 0:r.call(n,...i)}),[])}BE(Wn,"useCallbackRef");var IE=Object.defineProperty,Fn=(e,n)=>IE(e,"name",{value:n,configurable:!0}),D0="dismissableLayer.update",qE="dismissableLayer.pointerDownOutside",PE="dismissableLayer.focusOutside",tb,V3=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_g=w.forwardRef(Fn(function(n,i){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:g,...y}=n,m=w.useContext(V3),[j,b]=w.useState(null),k=(j==null?void 0:j.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=w.useState({}),N=It(i,b),C=Array.from(m.layers),[M]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=M?C.indexOf(M):-1,T=j?C.indexOf(j):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,R=T>=E,O=w.useRef(!1),I=Y3($=>{d==null||d($),h==null||h($),$.defaultPrevented||g==null||g()},{ownerDocument:k,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback($=>{if(!($ instanceof Node))return!1;const Q=[...m.branches].some(Y=>Y.contains($));return R&&!Q},[m.branches,R])}),P=K3($=>{if(l&&O.current)return;const Q=$.target;[...m.branches].some(H=>H.contains(Q))||(f==null||f($),h==null||h($),$.defaultPrevented||g==null||g())},k),z=j?T===C.length-1:!1,q=Wn($=>{$.key==="Escape"&&(c==null||c($),!$.defaultPrevented&&g&&($.preventDefault(),g()))});return w.useEffect(()=>{if(z)return k.addEventListener("keydown",q,{capture:!0}),()=>k.removeEventListener("keydown",q,{capture:!0})},[k,z,q]),w.useEffect(()=>{if(j)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(tb=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(j)),m.layers.add(j),L0(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(j),m.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=tb))}},[j,k,r,m]),w.useEffect(()=>()=>{j&&(m.layers.delete(j),m.layersWithOutsidePointerEventsDisabled.delete(j),L0())},[j,m]),w.useEffect(()=>{const $=Fn(()=>S({}),"handleUpdate");return document.addEventListener(D0,$),()=>document.removeEventListener(D0,$)},[]),o.jsx(rn.div,{...y,ref:N,style:{pointerEvents:_?R?"auto":"none":void 0,...n.style},onFocusCapture:At(n.onFocusCapture,P.onFocusCapture),onBlurCapture:At(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:At(n.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function G3(){const e=w.useContext(V3),[n,i]=w.useState(null);return w.useEffect(()=>{if(n)return e.dismissableSurfaces.add(n),()=>{e.dismissableSurfaces.delete(n)}},[n,e.dismissableSurfaces]),i}Fn(G3,"useDismissableLayerSurface");var HE=Fn(()=>!0,"IS_TRUE");function Y3(e,n){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:c,shouldHandlePointerDownOutside:d=HE}=n,f=Wn(e),h=w.useRef(!1),g=w.useRef(!1),y=w.useRef(new Map),m=w.useRef(()=>{});return w.useEffect(()=>{function j(){g.current=!1,l.current=!1,y.current.clear()}Fn(j,"resetOutsideInteraction");function b(){return Array.from(y.current.values()).some(Boolean)}Fn(b,"isOutsideInteractionIntercepted");function k(E){if(!g.current)return;const T=E.target;T instanceof Node&&[...c].some(R=>R.contains(T))||y.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{g.current&&m.current()},0)}Fn(k,"handleInteractionCapture");function S(E){g.current&&y.current.set(E.type,!1)}Fn(S,"handleInteractionBubble");const N=Fn(E=>{if(E.target&&!h.current){let T=function(){i.removeEventListener("click",m.current);const R=b();j(),R||Rg(qE,f,_,{discrete:!0})};if(Fn(T,"handleAndDispatchPointerDownOutsideEvent"),!d(E.target)){i.removeEventListener("click",m.current),j(),h.current=!1;return}const _={originalEvent:E};g.current=!0,l.current=r&&E.button===0,y.current.clear(),!r||E.button!==0?T():(i.removeEventListener("click",m.current),m.current=T,i.addEventListener("click",m.current,{once:!0}))}else i.removeEventListener("click",m.current),j();h.current=!1},"handlePointerDown"),C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of C)i.addEventListener(E,k,!0),i.addEventListener(E,S);const M=window.setTimeout(()=>{i.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(M),i.removeEventListener("pointerdown",N),i.removeEventListener("click",m.current);for(const E of C)i.removeEventListener(E,k,!0),i.removeEventListener(E,S)}},[i,f,r,l,c,d]),{onPointerDownCapture:Fn(()=>h.current=!0,"onPointerDownCapture")}}Fn(Y3,"usePointerDownOutside");function K3(e,n=globalThis==null?void 0:globalThis.document){const i=Wn(e),r=w.useRef(!1);return w.useEffect(()=>{const l=Fn(c=>{c.target&&!r.current&&Rg(PE,i,{originalEvent:c},{discrete:!1})},"handleFocus");return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,i]),{onFocusCapture:Fn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Fn(()=>r.current=!1,"onBlurCapture")}}Fn(K3,"useFocusOutside");function L0(){const e=new CustomEvent(D0);document.dispatchEvent(e)}Fn(L0,"dispatchUpdate");function Rg(e,n,i,{discrete:r}){const l=i.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&l.addEventListener(e,n,{once:!0}),r?T3(l,c):l.dispatchEvent(c)}Fn(Rg,"handleAndDispatchCustomEvent");var FE=Object.defineProperty,Sa=(e,n)=>FE(e,"name",{value:n,configurable:!0}),Rp="focusScope.autoFocusOnMount",Op="focusScope.autoFocusOnUnmount",nb={bubbles:!1,cancelable:!0},Og=w.forwardRef(Sa(function(n,i){const{loop:r=!1,trapped:l=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=n,[h,g]=w.useState(null),y=Wn(c),m=Wn(d),j=w.useRef(null),b=It(i,g),k=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(l){let N=function(T){if(k.paused||!h)return;const _=T.target;h.contains(_)?j.current=_:Rr(j.current,{select:!0})},C=function(T){if(k.paused||!h)return;const _=T.relatedTarget;_!==null&&(h.contains(_)||Rr(j.current,{select:!0}))},M=function(T){if(document.activeElement===document.body)for(const R of T)R.removedNodes.length>0&&Rr(h)};Sa(N,"handleFocusIn"),Sa(C,"handleFocusOut"),Sa(M,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",C);const E=new MutationObserver(M);return h&&E.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",C),E.disconnect()}}},[l,h,k.paused]),w.useEffect(()=>{if(h){ab.add(k);const N=document.activeElement;if(!h.contains(N)){const M=new CustomEvent(Rp,nb);h.addEventListener(Rp,y),h.dispatchEvent(M),M.defaultPrevented||(X3(ek(zg(h)),{select:!0}),document.activeElement===N&&Rr(h))}return()=>{h.removeEventListener(Rp,y),setTimeout(()=>{const M=new CustomEvent(Op,nb);h.addEventListener(Op,m),h.dispatchEvent(M),M.defaultPrevented||Rr(N??document.body,{select:!0}),h.removeEventListener(Op,m),ab.remove(k)},0)}}},[h,y,m,k]);const S=w.useCallback(N=>{if(!r&&!l||k.paused)return;const C=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,M=document.activeElement;if(C&&M){const E=N.currentTarget,[T,_]=Q3(E);T&&_?!N.shiftKey&&M===_?(N.preventDefault(),r&&Rr(T,{select:!0})):N.shiftKey&&M===T&&(N.preventDefault(),r&&Rr(_,{select:!0})):M===E&&N.preventDefault()}},[r,l,k.paused]);return o.jsx(rn.div,{tabIndex:-1,...f,ref:b,onKeyDown:S})},"FocusScope"));function X3(e,{select:n=!1}={}){const i=document.activeElement;for(const r of e)if(Rr(r,{select:n}),document.activeElement!==i)return}Sa(X3,"focusFirst");function Q3(e){const n=zg(e),i=B0(n,e),r=B0(n.reverse(),e);return[i,r]}Sa(Q3,"getTabbableEdges");function zg(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Sa(r=>{const l=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||l?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;i.nextNode();)n.push(i.currentNode);return n}Sa(zg,"getTabbableCandidates");function B0(e,n){const i=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(i?!r.checkVisibility({checkVisibilityCSS:!0}):Z3(r,{upTo:n})))return r}Sa(B0,"findVisible");function Z3(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Sa(Z3,"isHidden");function J3(e){return e instanceof HTMLInputElement&&"select"in e}Sa(J3,"isSelectableInput");function Rr(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&J3(e)&&n&&e.select()}}Sa(Rr,"focus");var ab=W3();function W3(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=I0(e,n),e.unshift(n)},remove(n){var i;e=I0(e,n),(i=e[0])==null||i.resume()}}}Sa(W3,"createFocusScopesStack");function I0(e,n){const i=[...e],r=i.indexOf(n);return r!==-1&&i.splice(r,1),i}Sa(I0,"arrayRemove");function ek(e){return e.filter(n=>n.tagName!=="A")}Sa(ek,"removeLinks");var UE=Object.defineProperty,$E=(e,n)=>UE(e,"name",{value:n,configurable:!0}),Dg=w.forwardRef($E(function(n,i){var h;const{container:r,...l}=n,[c,d]=w.useState(!1);ea(()=>d(!0),[]);const f=r||c&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return f?Do.createPortal(o.jsx(rn.div,{...l,ref:i}),f):null},"Portal")),VE=Object.defineProperty,Lg=(e,n)=>VE(e,"name",{value:n,configurable:!0}),Md=0,Gi=null;function GE(e){return nu(),e.children}Lg(GE,"FocusGuards");function nu(){w.useEffect(()=>{Gi||(Gi={start:q0(),end:q0()});const{start:e,end:n}=Gi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Md++,()=>{Md===1&&(Gi==null||Gi.start.remove(),Gi==null||Gi.end.remove(),Gi=null),Md=Math.max(0,Md-1)}},[])}Lg(nu,"useFocusGuards");function q0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Lg(q0,"createFocusGuard");var Xi=function(){return Xi=Object.assign||function(n){for(var i,r=1,l=arguments.length;r<l;r++){i=arguments[r];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(n[c]=i[c])}return n},Xi.apply(this,arguments)};function tk(e,n){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)n.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(i[r[l]]=e[r[l]]);return i}function YE(e,n,i){if(i||arguments.length===2)for(var r=0,l=n.length,c;r<l;r++)(c||!(r in n))&&(c||(c=Array.prototype.slice.call(n,0,r)),c[r]=n[r]);return e.concat(c||Array.prototype.slice.call(n))}var tf="right-scroll-bar-position",nf="width-before-scroll-bar",KE="with-scroll-bars-hidden",XE="--removed-body-scroll-bar-size";function zp(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function QE(e,n){var i=w.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(r){var l=i.value;l!==r&&(i.value=r,i.callback(r,l))}}}})[0];return i.callback=n,i.facade}var ZE=typeof window<"u"?w.useLayoutEffect:w.useEffect,ib=new WeakMap;function JE(e,n){var i=QE(null,function(r){return e.forEach(function(l){return zp(l,r)})});return ZE(function(){var r=ib.get(i);if(r){var l=new Set(r),c=new Set(e),d=i.current;l.forEach(function(f){c.has(f)||zp(f,null)}),c.forEach(function(f){l.has(f)||zp(f,d)})}ib.set(i,e)},[e]),i}function WE(e){return e}function eT(e,n){n===void 0&&(n=WE);var i=[],r=!1,l={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(c){var d=n(c,r);return i.push(d),function(){i=i.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(f){return c(f)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var f=i;i=[],f.forEach(c),d=i}var h=function(){var y=d;d=[],y.forEach(c)},g=function(){return Promise.resolve().then(h)};g(),i={push:function(y){d.push(y),g()},filter:function(y){return d=d.filter(y),i}}}};return l}function tT(e){e===void 0&&(e={});var n=eT(null);return n.options=Xi({async:!0,ssr:!1},e),n}var nk=function(e){var n=e.sideCar,i=tk(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=n.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Xi({},i))};nk.isSideCarExport=!0;function nT(e,n){return e.useMedium(n),nk}var ak=tT(),Dp=function(){},Lf=w.forwardRef(function(e,n){var i=w.useRef(null),r=w.useState({onScrollCapture:Dp,onWheelCapture:Dp,onTouchMoveCapture:Dp}),l=r[0],c=r[1],d=e.forwardProps,f=e.children,h=e.className,g=e.removeScrollBar,y=e.enabled,m=e.shards,j=e.sideCar,b=e.noRelative,k=e.noIsolation,S=e.inert,N=e.allowPinchZoom,C=e.as,M=C===void 0?"div":C,E=e.gapMode,T=tk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=j,R=JE([i,n]),O=Xi(Xi({},T),l);return w.createElement(w.Fragment,null,y&&w.createElement(_,{sideCar:ak,removeScrollBar:g,shards:m,noRelative:b,noIsolation:k,inert:S,setCallbacks:c,allowPinchZoom:!!N,lockRef:i,gapMode:E}),d?w.cloneElement(w.Children.only(f),Xi(Xi({},O),{ref:R})):w.createElement(M,Xi({},O,{className:h,ref:R}),f))});Lf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lf.classNames={fullWidth:nf,zeroRight:tf};var aT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=aT();return n&&e.setAttribute("nonce",n),e}function rT(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function oT(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var sT=function(){var e=0,n=null;return{add:function(i){e==0&&(n=iT())&&(rT(n,i),oT(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},lT=function(){var e=sT();return function(n,i){w.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},ik=function(){var e=lT(),n=function(i){var r=i.styles,l=i.dynamic;return e(r,l),null};return n},cT={left:0,top:0,right:0,gap:0},Lp=function(e){return parseInt(e||"",10)||0},uT=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],r=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[Lp(i),Lp(r),Lp(l)]},dT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cT;var n=uT(e),i=document.documentElement.clientWidth,r=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,r-i+n[2]-n[0])}},fT=ik(),Cl="data-scroll-locked",hT=function(e,n,i,r){var l=e.left,c=e.top,d=e.right,f=e.gap;return i===void 0&&(i="margin"),`
540
+ .`.concat(KE,` {
541
+ overflow: hidden `).concat(r,`;
542
+ padding-right: `).concat(f,"px ").concat(r,`;
543
+ }
544
+ body[`).concat(Cl,`] {
545
+ overflow: hidden `).concat(r,`;
546
+ overscroll-behavior: contain;
547
+ `).concat([n&&"position: relative ".concat(r,";"),i==="margin"&&`
548
+ padding-left: `.concat(l,`px;
549
+ padding-top: `).concat(c,`px;
550
+ padding-right: `).concat(d,`px;
551
+ margin-left:0;
552
+ margin-top:0;
553
+ margin-right: `).concat(f,"px ").concat(r,`;
554
+ `),i==="padding"&&"padding-right: ".concat(f,"px ").concat(r,";")].filter(Boolean).join(""),`
555
+ }
556
+
557
+ .`).concat(tf,` {
558
+ right: `).concat(f,"px ").concat(r,`;
559
+ }
560
+
561
+ .`).concat(nf,` {
562
+ margin-right: `).concat(f,"px ").concat(r,`;
563
+ }
564
+
565
+ .`).concat(tf," .").concat(tf,` {
566
+ right: 0 `).concat(r,`;
567
+ }
568
+
569
+ .`).concat(nf," .").concat(nf,` {
570
+ margin-right: 0 `).concat(r,`;
571
+ }
572
+
573
+ body[`).concat(Cl,`] {
574
+ `).concat(XE,": ").concat(f,`px;
575
+ }
576
+ `)},rb=function(){var e=parseInt(document.body.getAttribute(Cl)||"0",10);return isFinite(e)?e:0},mT=function(){w.useEffect(function(){return document.body.setAttribute(Cl,(rb()+1).toString()),function(){var e=rb()-1;e<=0?document.body.removeAttribute(Cl):document.body.setAttribute(Cl,e.toString())}},[])},pT=function(e){var n=e.noRelative,i=e.noImportant,r=e.gapMode,l=r===void 0?"margin":r;mT();var c=w.useMemo(function(){return dT(l)},[l]);return w.createElement(fT,{styles:hT(c,!n,l,i?"":"!important")})},P0=!1;if(typeof window<"u")try{var Ad=Object.defineProperty({},"passive",{get:function(){return P0=!0,!0}});window.addEventListener("test",Ad,Ad),window.removeEventListener("test",Ad,Ad)}catch{P0=!1}var vl=P0?{passive:!1}:!1,gT=function(e){return e.tagName==="TEXTAREA"},rk=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!gT(e)&&i[n]==="visible")},vT=function(e){return rk(e,"overflowY")},yT=function(e){return rk(e,"overflowX")},ob=function(e,n){var i=n.ownerDocument,r=n;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var l=ok(e,r);if(l){var c=sk(e,r),d=c[1],f=c[2];if(d>f)return!0}r=r.parentNode}while(r&&r!==i.body);return!1},xT=function(e){var n=e.scrollTop,i=e.scrollHeight,r=e.clientHeight;return[n,i,r]},bT=function(e){var n=e.scrollLeft,i=e.scrollWidth,r=e.clientWidth;return[n,i,r]},ok=function(e,n){return e==="v"?vT(n):yT(n)},sk=function(e,n){return e==="v"?xT(n):bT(n)},jT=function(e,n){return e==="h"&&n==="rtl"?-1:1},wT=function(e,n,i,r,l){var c=jT(e,window.getComputedStyle(n).direction),d=c*r,f=i.target,h=n.contains(f),g=!1,y=d>0,m=0,j=0;do{if(!f)break;var b=sk(e,f),k=b[0],S=b[1],N=b[2],C=S-N-c*k;(k||C)&&ok(e,f)&&(m+=C,j+=k);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!h&&f!==document.body||h&&(n.contains(f)||n===f));return(y&&Math.abs(m)<1||!y&&Math.abs(j)<1)&&(g=!0),g},_d=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sb=function(e){return[e.deltaX,e.deltaY]},lb=function(e){return e&&"current"in e?e.current:e},kT=function(e,n){return e[0]===n[0]&&e[1]===n[1]},ST=function(e){return`
577
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
578
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
579
+ `)},CT=0,yl=[];function NT(e){var n=w.useRef([]),i=w.useRef([0,0]),r=w.useRef(),l=w.useState(CT++)[0],c=w.useState(ik)[0],d=w.useRef(e);w.useEffect(function(){d.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=YE([e.lockRef.current],(e.shards||[]).map(lb),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var C=_d(S),M=i.current,E="deltaX"in S?S.deltaX:M[0]-C[0],T="deltaY"in S?S.deltaY:M[1]-C[1],_,R=S.target,O=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in S&&O==="h"&&R.type==="range")return!1;var I=window.getSelection(),P=I&&I.anchorNode,z=P?P===R||P.contains(R):!1;if(z)return!1;var q=ob(O,R);if(!q)return!0;if(q?_=O:(_=O==="v"?"h":"v",q=ob(O,R)),!q)return!1;if(!r.current&&"changedTouches"in S&&(E||T)&&(r.current=_),!_)return!0;var $=r.current||_;return wT($,N,S,$==="h"?E:T)},[]),h=w.useCallback(function(S){var N=S;if(!(!yl.length||yl[yl.length-1]!==c)){var C="deltaY"in N?sb(N):_d(N),M=n.current.filter(function(_){return _.name===N.type&&(_.target===N.target||N.target===_.shadowParent)&&kT(_.delta,C)})[0];if(M&&M.should){N.cancelable&&N.preventDefault();return}if(!M){var E=(d.current.shards||[]).map(lb).filter(Boolean).filter(function(_){return _.contains(N.target)}),T=E.length>0?f(N,E[0]):!d.current.noIsolation;T&&N.cancelable&&N.preventDefault()}}},[]),g=w.useCallback(function(S,N,C,M){var E={name:S,delta:N,target:C,should:M,shadowParent:ET(C)};n.current.push(E),setTimeout(function(){n.current=n.current.filter(function(T){return T!==E})},1)},[]),y=w.useCallback(function(S){i.current=_d(S),r.current=void 0},[]),m=w.useCallback(function(S){g(S.type,sb(S),S.target,f(S,e.lockRef.current))},[]),j=w.useCallback(function(S){g(S.type,_d(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return yl.push(c),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:j}),document.addEventListener("wheel",h,vl),document.addEventListener("touchmove",h,vl),document.addEventListener("touchstart",y,vl),function(){yl=yl.filter(function(S){return S!==c}),document.removeEventListener("wheel",h,vl),document.removeEventListener("touchmove",h,vl),document.removeEventListener("touchstart",y,vl)}},[]);var b=e.removeScrollBar,k=e.inert;return w.createElement(w.Fragment,null,k?w.createElement(c,{styles:ST(l)}):null,b?w.createElement(pT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ET(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const TT=nT(ak,NT);var Bf=w.forwardRef(function(e,n){return w.createElement(Lf,Xi({},e,{ref:n,sideCar:TT}))});Bf.classNames=Lf.classNames;var MT=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},xl=new WeakMap,Rd=new WeakMap,Od={},Bp=0,lk=function(e){return e&&(e.host||lk(e.parentNode))},AT=function(e,n){return n.map(function(i){if(e.contains(i))return i;var r=lk(i);return r&&e.contains(r)?r:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},_T=function(e,n,i,r){var l=AT(n,Array.isArray(e)?e:[e]);Od[i]||(Od[i]=new WeakMap);var c=Od[i],d=[],f=new Set,h=new Set(l),g=function(m){!m||f.has(m)||(f.add(m),g(m.parentNode))};l.forEach(g);var y=function(m){!m||h.has(m)||Array.prototype.forEach.call(m.children,function(j){if(f.has(j))y(j);else try{var b=j.getAttribute(r),k=b!==null&&b!=="false",S=(xl.get(j)||0)+1,N=(c.get(j)||0)+1;xl.set(j,S),c.set(j,N),d.push(j),S===1&&k&&Rd.set(j,!0),N===1&&j.setAttribute(i,"true"),k||j.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",j,C)}})};return y(n),f.clear(),Bp++,function(){d.forEach(function(m){var j=xl.get(m)-1,b=c.get(m)-1;xl.set(m,j),c.set(m,b),j||(Rd.has(m)||m.removeAttribute(r),Rd.delete(m)),b||m.removeAttribute(i)}),Bp--,Bp||(xl=new WeakMap,xl=new WeakMap,Rd=new WeakMap,Od={})}},Bg=function(e,n,i){i===void 0&&(i="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),l=MT(e);return l?(r.push.apply(r,Array.from(l.querySelectorAll("[aria-live], script"))),_T(r,l,i,"aria-hidden")):function(){return null}},RT=Object.defineProperty,Ai=(e,n)=>RT(e,"name",{value:n,configurable:!0}),Ig="Dialog",[ck,YU]=Lo(Ig),[OT,Vr]=ck(Ig),zT=Ai(e=>{const{__scopeDialog:n,children:i,open:r,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=w.useRef(null),h=w.useRef(null),[g,y]=$c({prop:r,defaultProp:l??!1,onChange:c,caller:Ig}),[m,j]=w.useState(0),[b,k]=w.useState(0);return o.jsx(OT,{scope:n,triggerRef:f,contentRef:h,contentId:ws(),titleId:ws(),descriptionId:ws(),titlePresent:m>0,descriptionPresent:b>0,setTitleCount:j,setDescriptionCount:k,open:g,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(S=>!S),[y]),modal:d,children:i})},"Dialog"),uk="DialogPortal",[DT,dk]=ck(uk,{forceMount:void 0}),LT=Ai(e=>{const{__scopeDialog:n,forceMount:i,children:r,container:l}=e,c=Vr(uk,n);return o.jsx(DT,{scope:n,forceMount:i,children:w.Children.map(r,d=>o.jsx(rr,{present:i||c.open,children:o.jsx(Dg,{asChild:!0,container:l,children:d})}))})},"DialogPortal"),H0="DialogOverlay",BT=w.forwardRef(Ai(function(n,i){const r=dk(H0,n.__scopeDialog),{forceMount:l=r.forceMount,...c}=n,d=Vr(H0,n.__scopeDialog);return d.modal?o.jsx(rr,{present:l||d.open,children:o.jsx(qT,{...c,ref:i})}):null},"DialogOverlay")),IT=tr("DialogOverlay.RemoveScroll"),qT=w.forwardRef(Ai(function(n,i){const{__scopeDialog:r,...l}=n,c=Vr(H0,r),d=G3(),f=It(i,d);return o.jsx(Bf,{as:IT,allowPinchZoom:!0,shards:[c.contentRef],children:o.jsx(rn.div,{"data-state":qg(c.open),...l,ref:f,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),Vc="DialogContent",PT=w.forwardRef(Ai(function(n,i){const r=dk(Vc,n.__scopeDialog),{forceMount:l=r.forceMount,...c}=n,d=Vr(Vc,n.__scopeDialog);return o.jsx(rr,{present:l||d.open,children:d.modal?o.jsx(HT,{...c,ref:i}):o.jsx(FT,{...c,ref:i})})},"DialogContent")),HT=w.forwardRef(Ai(function(n,i){const r=Vr(Vc,n.__scopeDialog),l=w.useRef(null),c=It(i,r.contentRef,l);return w.useEffect(()=>{const d=l.current;if(d)return Bg(d)},[]),o.jsx(fk,{...n,ref:c,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:At(n.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:At(n.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&d.preventDefault()}),onFocusOutside:At(n.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),FT=w.forwardRef(Ai(function(n,i){const r=Vr(Vc,n.__scopeDialog),l=w.useRef(!1),c=w.useRef(!1);return o.jsx(fk,{...n,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,h;(f=n.onCloseAutoFocus)==null||f.call(n,d),d.defaultPrevented||(l.current||(h=r.triggerRef.current)==null||h.focus(),d.preventDefault()),l.current=!1,c.current=!1},onInteractOutside:d=>{var g,y;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(l.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=r.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"DialogContentNonModal")),fk=w.forwardRef(Ai(function(n,i){const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=n,h=Vr(Vc,r);return nu(),o.jsx(o.Fragment,{children:o.jsx(Og,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:c,onUnmountAutoFocus:d,children:o.jsx(_g,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionPresent?h.descriptionId:void 0,"aria-labelledby":h.titlePresent?h.titleId:void 0,"data-state":qg(h.open),...f,ref:i,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})},"DialogContentImpl")),UT="DialogTitle",$T=w.forwardRef(Ai(function(n,i){const{__scopeDialog:r,...l}=n,c=Vr(UT,r),{setTitleCount:d}=c;return ea(()=>(d(f=>f+1),()=>d(f=>f-1)),[d]),o.jsx(rn.h2,{id:c.titleId,...l,ref:i})},"DialogTitle")),VT="DialogClose",GT=w.forwardRef(Ai(function(n,i){const{__scopeDialog:r,...l}=n,c=Vr(VT,r);return o.jsx(rn.button,{type:"button",...l,ref:i,onClick:At(n.onClick,()=>c.onOpenChange(!1))})},"DialogClose"));function qg(e){return e?"open":"closed"}Ai(qg,"getState");var YT=Object.defineProperty,KT=(e,n)=>YT(e,"name",{value:n,configurable:!0});function hk(e){const[n,i]=w.useState(void 0);return ea(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let d,f;if("borderBoxSize"in c){const h=c.borderBoxSize,g=Array.isArray(h)?h[0]:h;d=g.inlineSize,f=g.blockSize}else d=e.offsetWidth,f=e.offsetHeight;i({width:d,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else i(void 0)},[e]),n}KT(hk,"useSize");const XT=["top","right","bottom","left"],Oo=Math.min,Dr=Math.max,pf=Math.round,zd=Math.floor,Lr=e=>({x:e,y:e}),QT={left:"right",right:"left",bottom:"top",top:"bottom"};function mk(e,n,i){return Dr(e,Oo(n,i))}function Pr(e,n){return typeof e=="function"?e(n):e}function zo(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function Pg(e){return e==="x"?"y":"x"}function Hg(e){return e==="y"?"height":"width"}function Zi(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Fg(e){return Pg(Zi(e))}function ZT(e,n,i){i===void 0&&(i=!1);const r=zl(e),l=Fg(e),c=Hg(l);let d=l==="x"?r===(i?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(d=gf(d)),[d,gf(d)]}function JT(e){const n=gf(e);return[F0(e),n,F0(n)]}function F0(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cb=["left","right"],ub=["right","left"],WT=["top","bottom"],eM=["bottom","top"];function tM(e,n,i){switch(e){case"top":case"bottom":return i?n?ub:cb:n?cb:ub;case"left":case"right":return n?WT:eM;default:return[]}}function nM(e,n,i,r){const l=zl(e);let c=tM(zo(e),i==="start",r);return l&&(c=c.map(d=>d+"-"+l),n&&(c=c.concat(c.map(F0)))),c}function gf(e){const n=zo(e);return QT[n]+e.slice(n.length)}function aM(e){var n,i,r,l;return{top:(n=e.top)!=null?n:0,right:(i=e.right)!=null?i:0,bottom:(r=e.bottom)!=null?r:0,left:(l=e.left)!=null?l:0}}function pk(e){return typeof e!="number"?aM(e):{top:e,right:e,bottom:e,left:e}}function vf(e){const{x:n,y:i,width:r,height:l}=e;return{width:r,height:l,top:i,left:n,right:n+r,bottom:i+l,x:n,y:i}}function db(e,n,i){let{reference:r,floating:l}=e;const c=Zi(n),d=Fg(n),f=Hg(d),h=zo(n),g=c==="y",y=r.x+r.width/2-l.width/2,m=r.y+r.height/2-l.height/2,j=r[f]/2-l[f]/2;let b;switch(h){case"top":b={x:y,y:r.y-l.height};break;case"bottom":b={x:y,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-l.width,y:m};break;default:b={x:r.x,y:r.y}}const k=zl(n);return k&&(b[d]+=j*(k==="end"?1:-1)*(i&&g?-1:1)),b}async function iM(e,n){var i;n===void 0&&(n={});const{x:r,y:l,platform:c,rects:d,elements:f,strategy:h}=e,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:m="floating",altBoundary:j=!1,padding:b=0}=Pr(n,e),k=pk(b),N=f[j?m==="floating"?"reference":"floating":m],C=vf(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(N)))==null||i?N:N.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:g,rootBoundary:y,strategy:h})),M=m==="floating"?{x:r,y:l,width:d.floating.width,height:d.floating.height}:d.reference,E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),T=await(c.isElement==null?void 0:c.isElement(E))&&await(c.getScale==null?void 0:c.getScale(E))||{x:1,y:1},_=vf(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:E,strategy:h}):M);return{top:(C.top-_.top+k.top)/T.y,bottom:(_.bottom-C.bottom+k.bottom)/T.y,left:(C.left-_.left+k.left)/T.x,right:(_.right-C.right+k.right)/T.x}}const rM=50,oM=async(e,n,i)=>{const{placement:r="bottom",strategy:l="absolute",middleware:c=[],platform:d}=i,f=d.detectOverflow?d:{...d,detectOverflow:iM},h=await(d.isRTL==null?void 0:d.isRTL(n));let g=await d.getElementRects({reference:e,floating:n,strategy:l}),{x:y,y:m}=db(g,r,h),j=r,b=0;const k={};for(let S=0;S<c.length;S++){const N=c[S];if(!N)continue;const{name:C,fn:M}=N,{x:E,y:T,data:_,reset:R}=await M({x:y,y:m,initialPlacement:r,placement:j,strategy:l,middlewareData:k,rects:g,platform:f,elements:{reference:e,floating:n}});y=E??y,m=T??m,k[C]={...k[C],..._},R&&b<rM&&(b++,typeof R=="object"&&(R.placement&&(j=R.placement),R.rects&&(g=R.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:l}):R.rects),{x:y,y:m}=db(g,j,h)),S=-1)}return{x:y,y:m,placement:j,strategy:l,middlewareData:k}},sM=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:r,placement:l,rects:c,platform:d,elements:f,middlewareData:h}=n,{element:g,padding:y=0}=Pr(e,n)||{};if(g==null)return{};const m=pk(y),j={x:i,y:r},b=Fg(l),k=Hg(b),S=await d.getDimensions(g),N=b==="y",C=N?"top":"left",M=N?"bottom":"right",E=N?"clientHeight":"clientWidth",T=c.reference[k]+c.reference[b]-j[b]-c.floating[k],_=j[b]-c.reference[b],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let O=R?R[E]:0;(!O||!await(d.isElement==null?void 0:d.isElement(R)))&&(O=f.floating[E]||c.floating[k]);const I=T/2-_/2,P=O/2-S[k]/2-1,z=Oo(m[C],P),q=Oo(m[M],P),$=O-S[k]-q,Q=O/2-S[k]/2+I,Y=mk(z,Q,$),H=!h.arrow&&zl(l)!=null&&Q!==Y&&c.reference[k]/2-(Q<z?z:q)-S[k]/2<0,K=H?Q<z?Q-z:Q-$:0;return{[b]:j[b]+K,data:{[b]:Y,centerOffset:Q-Y-K,...H&&{alignmentOffset:K}},reset:H}}}),lM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,r;const{placement:l,middlewareData:c,rects:d,initialPlacement:f,platform:h,elements:g}=n,{mainAxis:y=!0,crossAxis:m=!0,fallbackPlacements:j,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:S=!0,...N}=Pr(e,n);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const C=zo(l),M=Zi(f),E=zo(f)===f,T=await(h.isRTL==null?void 0:h.isRTL(g.floating)),_=j||(E||!S?[gf(f)]:JT(f)),R=k!=="none";!j&&R&&_.push(...nM(f,S,k,T));const O=[f,..._],I=await h.detectOverflow(n,N),P=[];let z=((r=c.flip)==null?void 0:r.overflows)||[];if(y&&P.push(I[C]),m){const Y=ZT(l,d,T);P.push(I[Y[0]],I[Y[1]])}if(z=[...z,{placement:l,overflows:P}],!P.every(Y=>Y<=0)){var q,$;const Y=(((q=c.flip)==null?void 0:q.index)||0)+1,H=O[Y];if(H&&(!(m==="alignment"?M!==Zi(H):!1)||z.every(X=>Zi(X.placement)===M?X.overflows[0]>0:!0)))return{data:{index:Y,overflows:z},reset:{placement:H}};let K=($=z.filter(V=>V.overflows[0]<=0).sort((V,X)=>V.overflows[1]-X.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(b){case"bestFit":{var Q;const V=(Q=z.filter(X=>{if(R){const Z=Zi(X.placement);return Z===M||Z==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Z=>Z>0).reduce((Z,D)=>Z+D,0)]).sort((X,Z)=>X[1]-Z[1])[0])==null?void 0:Q[0];V&&(K=V);break}case"initialPlacement":K=f;break}if(l!==K)return{reset:{placement:K}}}return{}}}};function fb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function hb(e){return XT.some(n=>e[n]>=0)}const cM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i,platform:r}=n,{strategy:l="referenceHidden",...c}=Pr(e,n);switch(l){case"referenceHidden":{const d=await r.detectOverflow(n,{...c,elementContext:"reference"}),f=fb(d,i.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:hb(f)}}}case"escaped":{const d=await r.detectOverflow(n,{...c,altBoundary:!0}),f=fb(d,i.floating);return{data:{escapedOffsets:f,escaped:hb(f)}}}default:return{}}}}},gk=new Set(["left","top"]);async function uM(e,n){const{placement:i,platform:r,elements:l}=e,c=await(r.isRTL==null?void 0:r.isRTL(l.floating)),d=zo(i),f=zl(i),h=Zi(i)==="y",g=gk.has(d)?-1:1,y=c&&h?-1:1,m=Pr(n,e);let{mainAxis:j,crossAxis:b,alignmentAxis:k}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return f&&typeof k=="number"&&(b=f==="end"?k*-1:k),h?{x:b*y,y:j*g}:{x:j*g,y:b*y}}const dM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,r;const{x:l,y:c,placement:d,middlewareData:f}=n,h=await uM(n,e);return d===((i=f.offset)==null?void 0:i.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:d}}}}},fM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:r,placement:l,platform:c}=n,{mainAxis:d=!0,crossAxis:f=!1,limiter:h={fn:M=>{let{x:E,y:T}=M;return{x:E,y:T}}},...g}=Pr(e,n),y={x:i,y:r},m=await c.detectOverflow(n,g),j=Zi(l),b=Pg(j);let k=y[b],S=y[j];const N=(M,E)=>mk(E+m[M==="y"?"top":"left"],E,E-m[M==="y"?"bottom":"right"]);d&&(k=N(b,k)),f&&(S=N(j,S));const C=h.fn({...n,[b]:k,[j]:S});return{...C,data:{x:C.x-i,y:C.y-r,enabled:{[b]:d,[j]:f}}}}}},hM=function(e){return e===void 0&&(e={}),{options:e,fn(n){var i,r;const{x:l,y:c,placement:d,rects:f,middlewareData:h}=n,{offset:g=0,mainAxis:y=!0,crossAxis:m=!0}=Pr(e,n),j={x:l,y:c},b=Zi(d),k=Pg(b);let S=j[k],N=j[b];const C=Pr(g,n),M=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(i=C.mainAxis)!=null?i:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(y){const _=k==="y"?"height":"width",R=f.reference[k]-f.floating[_]+M.mainAxis,O=f.reference[k]+f.reference[_]-M.mainAxis;S<R?S=R:S>O&&(S=O)}if(m){var E,T;const _=k==="y"?"width":"height",R=gk.has(zo(d)),O=f.reference[b]-f.floating[_]+(R&&((E=h.offset)==null?void 0:E[b])||0)+(R?0:M.crossAxis),I=f.reference[b]+f.reference[_]+(R?0:((T=h.offset)==null?void 0:T[b])||0)-(R?M.crossAxis:0);N<O?N=O:N>I&&(N=I)}return{[k]:S,[b]:N}}}},mM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:i,rects:r,platform:l,elements:c}=n,{apply:d=()=>{},...f}=Pr(e,n),h=await l.detectOverflow(n,f),g=zo(i),y=zl(i),m=Zi(i)==="y",{width:j,height:b}=r.floating;let k,S;g==="top"||g==="bottom"?(k=g,S=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=g,k=y==="end"?"top":"bottom");const N=b-h.top-h.bottom,C=j-h.left-h.right,M=Oo(b-h[k],N),E=Oo(j-h[S],C),T=n.middlewareData.shift,_=!T;let R=M,O=E;T!=null&&T.enabled.x&&(O=C),T!=null&&T.enabled.y&&(R=N),_&&!y&&(m?O=j-2*Dr(h.left,h.right):R=b-2*Dr(h.top,h.bottom)),await d({...n,availableWidth:O,availableHeight:R});const I=await l.getDimensions(c.floating);return j!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function If(){return typeof window<"u"}function Dl(e){return vk(e)?(e.nodeName||"").toLowerCase():"#document"}function Da(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Gr(e){var n;return(n=(vk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function vk(e){return If()?e instanceof Node||e instanceof Da(e).Node:!1}function nr(e){return If()?e instanceof Element||e instanceof Da(e).Element:!1}function Bo(e){return If()?e instanceof HTMLElement||e instanceof Da(e).HTMLElement:!1}function mb(e){return!If()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Da(e).ShadowRoot}function qf(e){const{overflow:n,overflowX:i,overflowY:r,display:l}=ar(e);return/auto|scroll|overlay|hidden|clip/.test(n+r+i)&&l!=="inline"&&l!=="contents"}function pM(e){return/^(table|td|th)$/.test(Dl(e))}function Pf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gM=/transform|translate|scale|rotate|perspective|filter/,vM=/paint|layout|strict|content/,ps=e=>!!e&&e!=="none";let Ip;function Ug(e){const n=nr(e)?ar(e):e;return ps(n.transform)||ps(n.translate)||ps(n.scale)||ps(n.rotate)||ps(n.perspective)||!$g()&&(ps(n.backdropFilter)||ps(n.filter))||gM.test(n.willChange||"")||vM.test(n.contain||"")}function yM(e){let n=Ns(e);for(;Bo(n)&&!Gc(n);){if(Ug(n))return n;if(Pf(n))return null;n=Ns(n)}return null}function $g(){return Ip==null&&(Ip=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ip}function Gc(e){return/^(html|body|#document)$/.test(Dl(e))}function ar(e){return Da(e).getComputedStyle(e)}function Hf(e){return nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ns(e){if(Dl(e)==="html")return e;const n=e.assignedSlot||e.parentNode||mb(e)&&e.host||Gr(e);return mb(n)?n.host:n}function yk(e){const n=Ns(e);return Gc(n)?(e.ownerDocument||e).body:Bo(n)&&qf(n)?n:yk(n)}function Yc(e,n,i){var r;n===void 0&&(n=[]),i===void 0&&(i=!0);const l=yk(e),c=l===((r=e.ownerDocument)==null?void 0:r.body),d=Da(l);if(c){const f=U0(d);return n.concat(d,d.visualViewport||[],qf(l)?l:[],f&&i?Yc(f):[])}else return n.concat(l,Yc(l,[],i))}function U0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xk(e){const n=ar(e);let i=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const l=Bo(e),c=l?e.offsetWidth:i,d=l?e.offsetHeight:r,f=pf(i)!==c||pf(r)!==d;return f&&(i=c,r=d),{width:i,height:r,$:f}}function Vg(e){return nr(e)?e:e.contextElement}function Nl(e){const n=Vg(e);if(!Bo(n))return Lr(1);const i=n.getBoundingClientRect(),{width:r,height:l,$:c}=xk(n);let d=(c?pf(i.width):i.width)/r,f=(c?pf(i.height):i.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const xM=Lr(0);function bk(e){const n=Da(e);return!$g()||!n.visualViewport?xM:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function bM(e,n,i){return n===void 0&&(n=!1),!!i&&n&&i===Da(e)}function Es(e,n,i,r){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=e.getBoundingClientRect(),c=Vg(e);let d=Lr(1);n&&(r?nr(r)&&(d=Nl(r)):d=Nl(e));const f=bM(c,i,r)?bk(c):Lr(0);let h=(l.left+f.x)/d.x,g=(l.top+f.y)/d.y,y=l.width/d.x,m=l.height/d.y;if(c&&r){const j=Da(c),b=nr(r)?Da(r):r;let k=j,S=U0(k);for(;S&&b!==k;){const N=Nl(S),C=S.getBoundingClientRect(),M=ar(S),E=C.left+(S.clientLeft+parseFloat(M.paddingLeft))*N.x,T=C.top+(S.clientTop+parseFloat(M.paddingTop))*N.y;h*=N.x,g*=N.y,y*=N.x,m*=N.y,h+=E,g+=T,k=Da(S),S=U0(k)}}return vf({width:y,height:m,x:h,y:g})}function Ff(e,n){const i=Hf(e).scrollLeft;return n?n.left+i:Es(Gr(e)).left+i}function jk(e,n){const i=e.getBoundingClientRect(),r=i.left+n.scrollLeft-Ff(e,i),l=i.top+n.scrollTop;return{x:r,y:l}}function jM(e){let{elements:n,rect:i,offsetParent:r,strategy:l}=e;const c=l==="fixed",d=Gr(r),f=n?Pf(n.floating):!1;if(r===d||f&&c)return i;let h={scrollLeft:0,scrollTop:0},g=Lr(1);const y=Lr(0),m=Bo(r);if((m||!c)&&((Dl(r)!=="body"||qf(d))&&(h=Hf(r)),m)){const b=Es(r);g=Nl(r),y.x=b.x+r.clientLeft,y.y=b.y+r.clientTop}const j=d&&!m&&!c?jk(d,h):Lr(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-h.scrollLeft*g.x+y.x+j.x,y:i.y*g.y-h.scrollTop*g.y+y.y+j.y}}function wM(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function kM(e){const n=Hf(e),i=e.ownerDocument.body,r=Dr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=Dr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+Ff(e);const d=-n.scrollTop;return ar(i).direction==="rtl"&&(c+=Dr(e.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:d}}const SM=25;function CM(e,n,i){i===void 0&&(i="viewport");const r=i==="layoutViewport",l=Da(e),c=Gr(e),d=l.visualViewport;let f=c.clientWidth,h=c.clientHeight,g=0,y=0;if(d){const j=!$g()||n==="fixed";r?j||(g=-d.offsetLeft,y=-d.offsetTop):(f=d.width,h=d.height,j&&(g=d.offsetLeft,y=d.offsetTop))}if(Ff(c)<=0){const j=c.ownerDocument,b=j.body,k=getComputedStyle(b),S=j.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,N=Math.abs(c.clientWidth-b.clientWidth-S),C=getComputedStyle(c).scrollbarGutter==="stable both-edges"?N/2:N;C<=SM&&(f-=C)}return{width:f,height:h,x:g,y}}function NM(e,n){const i=Es(e,!0,n==="fixed"),r=i.top+e.clientTop,l=i.left+e.clientLeft,c=Nl(e),d=e.clientWidth*c.x,f=e.clientHeight*c.y,h=l*c.x,g=r*c.y;return{width:d,height:f,x:h,y:g}}function pb(e,n,i){let r;if(n==="viewport"||n==="layoutViewport")r=CM(e,i,n);else if(n==="document")r=kM(Gr(e));else if(nr(n))r=NM(n,i);else{const l=bk(e);r={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return vf(r)}function EM(e,n){const i=n.get(e);if(i)return i;let r=Yc(e,[],!1).filter(f=>nr(f)&&Dl(f)!=="body"),l=null;const c=ar(e).position==="fixed";let d=c?Ns(e):e;for(;nr(d)&&!Gc(d);){const f=ar(d),h=Ug(d),g=l?l.position:c?"fixed":"";!h&&(g==="fixed"||g==="absolute"&&f.position==="static")?r=r.filter(m=>m!==d):l=f,d=Ns(d)}return n.set(e,r),r}function TM(e){let{element:n,boundary:i,rootBoundary:r,strategy:l}=e;const d=[...i==="clippingAncestors"?Pf(n)?[]:EM(n,this._c):[].concat(i),r],f=pb(n,d[0],l);let h=f.top,g=f.right,y=f.bottom,m=f.left;for(let j=1;j<d.length;j++){const b=pb(n,d[j],l);h=Dr(b.top,h),g=Oo(b.right,g),y=Oo(b.bottom,y),m=Dr(b.left,m)}return{width:g-m,height:y-h,x:m,y:h}}function MM(e){const{width:n,height:i}=xk(e);return{width:n,height:i}}function AM(e,n,i){const r=Bo(n),l=Gr(n),c=i==="fixed",d=Es(e,!0,c,n);let f={scrollLeft:0,scrollTop:0};const h=Lr(0);if((r||!c)&&((Dl(n)!=="body"||qf(l))&&(f=Hf(n)),r)){const j=Es(n,!0,c,n);h.x=j.x+n.clientLeft,h.y=j.y+n.clientTop}!r&&l&&(h.x=Ff(l));const g=l&&!r&&!c?jk(l,f):Lr(0),y=d.left+f.scrollLeft-h.x-g.x,m=d.top+f.scrollTop-h.y-g.y;return{x:y,y:m,width:d.width,height:d.height}}function qp(e){return ar(e).position==="static"}function gb(e,n){if(!Bo(e)||ar(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Gr(e)===i&&(i=i.ownerDocument.body),i}function wk(e,n){const i=Da(e);if(Pf(e))return i;if(!Bo(e)){let l=Ns(e);for(;l&&!Gc(l);){if(nr(l)&&!qp(l))return l;l=Ns(l)}return i}let r=gb(e,n);for(;r&&pM(r)&&qp(r);)r=gb(r,n);return r&&Gc(r)&&qp(r)&&!Ug(r)?i:r||yM(e)||i}const _M=async function(e){const n=this.getOffsetParent||wk,i=this.getDimensions,r=await i(e.floating);return{reference:AM(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RM(e){return ar(e).direction==="rtl"}const OM={convertOffsetParentRelativeRectToViewportRelativeRect:jM,getDocumentElement:Gr,getClippingRect:TM,getOffsetParent:wk,getElementRects:_M,getClientRects:wM,getDimensions:MM,getScale:Nl,isElement:nr,isRTL:RM};function kk(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function zM(e,n,i){let r=null,l;const c=Gr(e);function d(){var y;clearTimeout(l),(y=r)==null||y.disconnect(),r=null}function f(y,m){y===void 0&&(y=!1),m===void 0&&(m=1),d();const j=e.getBoundingClientRect(),{left:b,top:k,width:S,height:N}=j;if(y||n(),!S||!N)return;const C=zd(k),M=zd(c.clientWidth-(b+S)),E=zd(c.clientHeight-(k+N)),T=zd(b),R={rootMargin:-C+"px "+-M+"px "+-E+"px "+-T+"px",threshold:Dr(0,Oo(1,m))||1};let O=!0;function I(P){const z=P[0].intersectionRatio;if(!kk(j,e.getBoundingClientRect()))return f();if(z!==m){if(!O)return f();z?f(!1,z):l=setTimeout(()=>{f(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(I,{...R,root:c.ownerDocument})}catch{r=new IntersectionObserver(I,R)}r.observe(e)}const h=Da(e),g=()=>f(i);return h.addEventListener("resize",g),f(!0),()=>{h.removeEventListener("resize",g),d()}}function DM(e,n,i,r){r===void 0&&(r={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,g=Vg(e),y=l||c?[...g?Yc(g):[],...n?Yc(n):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",i),c&&C.addEventListener("resize",i)});const m=g&&f?zM(g,i,c):null;let j=-1,b=null;d&&(b=new ResizeObserver(C=>{let[M]=C;M&&M.target===g&&b&&n&&(b.unobserve(n),cancelAnimationFrame(j),j=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(n)})),i()}),g&&!h&&b.observe(g),n&&b.observe(n));let k,S=h?Es(e):null;h&&N();function N(){const C=Es(e);S&&!kk(S,C)&&i(),S=C,k=requestAnimationFrame(N)}return i(),()=>{var C;y.forEach(M=>{l&&M.removeEventListener("scroll",i),c&&M.removeEventListener("resize",i)}),m==null||m(),(C=b)==null||C.disconnect(),b=null,h&&cancelAnimationFrame(k)}}const LM=dM,BM=fM,IM=lM,qM=mM,PM=cM,vb=sM,HM=hM,FM=(e,n,i)=>{const r=new Map,l=i??{},c={...OM,...l.platform,_c:r};return oM(e,n,{...l,platform:c})};var UM=typeof document<"u",$M=function(){},af=UM?w.useLayoutEffect:$M;function yf(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let i,r,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(r=i;r--!==0;)if(!yf(e[r],n[r]))return!1;return!0}if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!{}.hasOwnProperty.call(n,l[r]))return!1;for(r=i;r--!==0;){const c=l[r];if(!(c==="_owner"&&e.$$typeof)&&!yf(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function Sk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yb(e,n){const i=Sk(e);return Math.round(n*i)/i}function Pp(e){const n=w.useRef(e);return af(()=>{n.current=e}),n}function VM(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:l,elements:{reference:c,floating:d}={},transform:f=!0,whileElementsMounted:h,open:g}=e,[y,m]=w.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[j,b]=w.useState(r);yf(j,r)||b(r);const[k,S]=w.useState(null),[N,C]=w.useState(null),M=w.useCallback(X=>{X!==R.current&&(R.current=X,S(X))},[]),E=w.useCallback(X=>{X!==O.current&&(O.current=X,C(X))},[]),T=c||k,_=d||N,R=w.useRef(null),O=w.useRef(null),I=w.useRef(y),P=h!=null,z=Pp(h),q=Pp(l),$=Pp(g),Q=w.useCallback(()=>{if(!R.current||!O.current)return;const X={placement:n,strategy:i,middleware:j};q.current&&(X.platform=q.current),FM(R.current,O.current,X).then(Z=>{const D={...Z,isPositioned:$.current!==!1};Y.current&&!yf(I.current,D)&&(I.current=D,Do.flushSync(()=>{m(D)}))})},[j,n,i,q,$]);af(()=>{g===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(X=>({...X,isPositioned:!1})))},[g]);const Y=w.useRef(!1);af(()=>(Y.current=!0,()=>{Y.current=!1}),[]),af(()=>{if(T&&(R.current=T),_&&(O.current=_),T&&_){if(z.current)return z.current(T,_,Q);Q()}},[T,_,Q,z,P]);const H=w.useMemo(()=>({reference:R,floating:O,setReference:M,setFloating:E}),[M,E]),K=w.useMemo(()=>({reference:T,floating:_}),[T,_]),V=w.useMemo(()=>{const X={position:i,left:0,top:0};if(!K.floating)return X;const Z=yb(K.floating,y.x),D=yb(K.floating,y.y);return f?{...X,transform:"translate("+Z+"px, "+D+"px)",...Sk(K.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:Z,top:D}},[i,f,K.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:Q,refs:H,elements:K,floatingStyles:V}),[y,Q,H,K,V])}const GM=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:r,padding:l}=typeof e=="function"?e(i):e;return r&&n(r)?r.current!=null?vb({element:r.current,padding:l}).fn(i):{}:r?vb({element:r,padding:l}).fn(i):{}}}},YM=(e,n)=>{const i=LM(e);return{name:i.name,fn:i.fn,options:[e,n]}},KM=(e,n)=>{const i=BM(e);return{name:i.name,fn:i.fn,options:[e,n]}},XM=(e,n)=>({fn:HM(e).fn,options:[e,n]}),QM=(e,n)=>{const i=IM(e);return{name:i.name,fn:i.fn,options:[e,n]}},ZM=(e,n)=>{const i=qM(e);return{name:i.name,fn:i.fn,options:[e,n]}},JM=(e,n)=>{const i=PM(e);return{name:i.name,fn:i.fn,options:[e,n]}},WM=(e,n)=>{const i=GM(e);return{name:i.name,fn:i.fn,options:[e,n]}};var eA=Object.defineProperty,Mo=(e,n)=>eA(e,"name",{value:n,configurable:!0}),Ck="Popper",[Nk,Uf]=Lo(Ck),[tA,Ek]=Nk(Ck),nA=Mo(e=>{const{__scopePopper:n,children:i}=e,[r,l]=w.useState(null),[c,d]=w.useState(void 0);return o.jsx(tA,{scope:n,anchor:r,onAnchorChange:l,placementState:c,setPlacementState:d,children:i})},"Popper"),aA="PopperAnchor",iA=w.forwardRef(Mo(function(n,i){const{__scopePopper:r,virtualRef:l,...c}=n,d=Ek(aA,r),f=w.useRef(null),h=d.onAnchorChange,g=w.useCallback(S=>{f.current=S,S&&h(S)},[h]),y=It(i,g),m=w.useRef(null);w.useEffect(()=>{if(!l)return;const S=m.current;m.current=l.current,S!==m.current&&h(m.current)});const j=d.placementState&&$f(d.placementState),b=j==null?void 0:j[0],k=j==null?void 0:j[1];return l?null:o.jsx(rn.div,{"data-radix-popper-side":b,"data-radix-popper-align":k,...c,ref:y})},"PopperAnchor")),Tk="PopperContent",[rA,KU]=Nk(Tk),oA=w.forwardRef(Mo(function(n,i){var be,we,ve,re,Ce,Ve,Pe;const{__scopePopper:r,side:l="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:m=0,sticky:j="partial",hideWhenDetached:b=!1,updatePositionStrategy:k="optimized",onPlaced:S,...N}=n,C=Ek(Tk,r),[M,E]=w.useState(null),T=It(i,E),[_,R]=w.useState(null),O=hk(_),I=(O==null?void 0:O.width)??0,P=(O==null?void 0:O.height)??0,z=l+(d!=="center"?"-"+d:""),q=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(y)?y:[y],Q=$.length>0,Y={padding:q,boundary:$.filter(Mk),altBoundary:Q},{refs:H,floatingStyles:K,placement:V,isPositioned:X,middlewareData:Z}=VM({strategy:"fixed",placement:z,whileElementsMounted:Mo((...Ze)=>DM(...Ze,{animationFrame:k==="always"}),"whileElementsMounted"),elements:{reference:C.anchor},middleware:[YM({mainAxis:c+P,alignmentAxis:f}),g&&KM({mainAxis:!0,crossAxis:!1,limiter:j==="partial"?XM():void 0,...Y}),g&&QM({...Y}),ZM({...Y,apply:Mo(({elements:Ze,rects:Fe,availableWidth:Ke,availableHeight:gt})=>{const{width:Ht,height:Jt}=Fe.reference,tn=Ze.floating.style;tn.setProperty("--radix-popper-available-width",`${Ke}px`),tn.setProperty("--radix-popper-available-height",`${gt}px`),tn.setProperty("--radix-popper-anchor-width",`${Ht}px`),tn.setProperty("--radix-popper-anchor-height",`${Jt}px`)},"apply")}),_&&WM({element:_,padding:h}),sA({arrowWidth:I,arrowHeight:P}),b&&JM({strategy:"referenceHidden",...Y,boundary:Q?Y.boundary:void 0})]}),D=C.setPlacementState;ea(()=>(D(V),()=>{D(void 0)}),[V,D]);const[se,ne]=$f(V),B=Wn(S);ea(()=>{X&&(B==null||B())},[X,B]);const F=(be=Z.arrow)==null?void 0:be.x,ee=(we=Z.arrow)==null?void 0:we.y,W=((ve=Z.arrow)==null?void 0:ve.centerOffset)!==0,[fe,le]=w.useState();return ea(()=>{M&&le(window.getComputedStyle(M).zIndex)},[M]),o.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:X?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(re=Z.transformOrigin)==null?void 0:re.x,(Ce=Z.transformOrigin)==null?void 0:Ce.y].join(" "),...((Ve=Z.hide)==null?void 0:Ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:o.jsx(rA,{scope:r,placedSide:se,placedAlign:ne,onArrowChange:R,arrowX:F,arrowY:ee,shouldHideArrow:W,children:o.jsx(rn.div,{"data-side":se,"data-align":ne,...N,ref:T,style:{...N.style,animation:X?(Pe=N.style)==null?void 0:Pe.animation:"none"}})})})},"PopperContent"));function Mk(e){return e!==null}Mo(Mk,"isNotNull");var sA=Mo(e=>({name:"transformOrigin",options:e,fn(n){var N,C,M;const{placement:i,rects:r,middlewareData:l}=n,d=((N=l.arrow)==null?void 0:N.centerOffset)!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[g,y]=$f(i),m={start:"0%",center:"50%",end:"100%"}[y],j=(((C=l.arrow)==null?void 0:C.x)??0)+f/2,b=(((M=l.arrow)==null?void 0:M.y)??0)+h/2;let k="",S="";return g==="bottom"?(k=d?m:`${j}px`,S=`${-h}px`):g==="top"?(k=d?m:`${j}px`,S=`${r.floating.height+h}px`):g==="right"?(k=`${-h}px`,S=d?m:`${b}px`):g==="left"&&(k=`${r.floating.width+h}px`,S=d?m:`${b}px`),{data:{x:k,y:S}}}}),"transformOrigin");function $f(e){const[n,i="center"]=e.split("-");return[n,i]}Mo($f,"getSideAndAlignFromPlacement");var Ak=nA,_k=iA,Rk=oA,lA=Object.defineProperty,cA=(e,n)=>lA(e,"name",{value:n,configurable:!0}),uA=w.forwardRef(cA(function(n,i){return o.jsx(rn.label,{...n,ref:i,onMouseDown:r=>{var c;r.target.closest("button, input, select, textarea")||((c=n.onMouseDown)==null||c.call(n,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),dA=uA,fA=Object.defineProperty,hA=(e,n)=>fA(e,"name",{value:n,configurable:!0});function Ok(e){const n=w.useRef({value:e,previous:e});return w.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}hA(Ok,"usePrevious");var mA=Object.defineProperty,pA=(e,n)=>mA(e,"name",{value:n,configurable:!0});function xf(e,[n,i]){return Math.min(i,Math.max(n,e))}pA(xf,"clamp");var gA=Object.defineProperty,Io=(e,n)=>gA(e,"name",{value:n,configurable:!0}),Gg="Popover",[zk,XU]=Lo(Gg,[Uf]),Yg=Uf(),[vA,Ll]=zk(Gg),yA=Io(e=>{const{__scopePopover:n,children:i,open:r,defaultOpen:l,onOpenChange:c,modal:d=!1}=e,f=Yg(n),h=w.useRef(null),[g,y]=w.useState(!1),[m,j]=$c({prop:r,defaultProp:l??!1,onChange:c,caller:Gg});return o.jsx(Ak,{...f,children:o.jsx(vA,{scope:n,contentId:ws(),triggerRef:h,open:m,onOpenChange:j,onOpenToggle:w.useCallback(()=>j(b=>!b),[j]),hasCustomAnchor:g,onCustomAnchorAdd:w.useCallback(()=>y(!0),[]),onCustomAnchorRemove:w.useCallback(()=>y(!1),[]),modal:d,children:i})})},"Popover"),xA="PopoverTrigger",bA=w.forwardRef(Io(function(n,i){const{__scopePopover:r,...l}=n,c=Ll(xA,r),d=Yg(r),f=It(i,c.triggerRef),h=o.jsx(rn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":Kg(c.open),...l,ref:f,onClick:At(n.onClick,c.onOpenToggle)});return c.hasCustomAnchor?h:o.jsx(_k,{asChild:!0,...d,children:h})},"PopoverTrigger")),Dk="PopoverPortal",[jA,wA]=zk(Dk,{forceMount:void 0}),kA=Io(e=>{const{__scopePopover:n,forceMount:i,children:r,container:l}=e,c=Ll(Dk,n);return o.jsx(jA,{scope:n,forceMount:i,children:o.jsx(rr,{present:i||c.open,children:o.jsx(Dg,{asChild:!0,container:l,children:r})})})},"PopoverPortal"),Kc="PopoverContent",SA=w.forwardRef(Io(function(n,i){const r=wA(Kc,n.__scopePopover),{forceMount:l=r.forceMount,...c}=n,d=Ll(Kc,n.__scopePopover);return o.jsx(rr,{present:l||d.open,children:d.modal?o.jsx(NA,{...c,ref:i}):o.jsx(EA,{...c,ref:i})})},"PopoverContent")),CA=tr("PopoverContent.RemoveScroll"),NA=w.forwardRef(Io(function(n,i){const r=Ll(Kc,n.__scopePopover),l=w.useRef(null),c=It(i,l),d=w.useRef(!1);return w.useEffect(()=>{const f=l.current;if(f)return Bg(f)},[]),o.jsx(Bf,{as:CA,allowPinchZoom:!0,children:o.jsx(Lk,{...n,ref:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(n.onCloseAutoFocus,f=>{var h;f.preventDefault(),d.current||(h=r.triggerRef.current)==null||h.focus()}),onPointerDownOutside:At(n.onPointerDownOutside,f=>{const h=f.detail.originalEvent,g=h.button===0&&h.ctrlKey===!0,y=h.button===2||g;d.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:At(n.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),EA=w.forwardRef(Io(function(n,i){const r=Ll(Kc,n.__scopePopover),l=w.useRef(!1),c=w.useRef(!1);return o.jsx(Lk,{...n,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,h;(f=n.onCloseAutoFocus)==null||f.call(n,d),d.defaultPrevented||(l.current||(h=r.triggerRef.current)==null||h.focus(),d.preventDefault()),l.current=!1,c.current=!1},onInteractOutside:d=>{var g,y;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(l.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=r.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"PopoverContentNonModal")),Lk=w.forwardRef(Io(function(n,i){const{__scopePopover:r,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:m,...j}=n,b=Ll(Kc,r),k=Yg(r);return nu(),o.jsx(Og,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:c,onUnmountAutoFocus:d,children:o.jsx(_g,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(Rk,{"data-state":Kg(b.open),role:"dialog",id:b.contentId,...k,...j,ref:i,style:{...j.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Kg(e){return e?"open":"closed"}Io(Kg,"getState");var Vf=yA,Gf=bA,Yf=kA,Kf=SA,TA=Object.defineProperty,kt=(e,n)=>TA(e,"name",{value:n,configurable:!0});function Bk(e,n){return w.useReducer((i,r)=>n[i][r]??i,e)}kt(Bk,"useStateMachine");var Ik="ScrollArea",[qk,QU]=Lo(Ik),[MA,hi]=qk(Ik),AA=w.forwardRef(kt(function(n,i){const{__scopeScrollArea:r,type:l="hover",dir:c,scrollHideDelay:d=600,...f}=n,[h,g]=w.useState(null),[y,m]=w.useState(null),[j,b]=w.useState(null),[k,S]=w.useState(null),[N,C]=w.useState(null),[M,E]=w.useState(0),[T,_]=w.useState(0),[R,O]=w.useState(!1),[I,P]=w.useState(!1),z=It(i,g),q=Ag(c);return o.jsx(MA,{scope:r,type:l,dir:q,scrollHideDelay:d,scrollArea:h,viewport:y,onViewportChange:m,content:j,onContentChange:b,scrollbarX:k,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:O,scrollbarY:N,onScrollbarYChange:C,scrollbarYEnabled:I,onScrollbarYEnabledChange:P,onCornerWidthChange:E,onCornerHeightChange:_,children:o.jsx(rn.div,{dir:q,...f,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":M+"px","--radix-scroll-area-corner-height":T+"px",...n.style}})})},"ScrollArea")),_A="ScrollAreaViewport",RA=w.forwardRef(kt(function(n,i){const{__scopeScrollArea:r,children:l,nonce:c,...d}=n,f=hi(_A,r),h=w.useRef(null),g=It(i,h,f.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(OA,{nonce:c}),o.jsx(rn.div,{"data-radix-scroll-area-viewport":"",...d,ref:g,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...n.style},children:o.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})},"ScrollAreaViewport")),OA=w.memo(kt(function({nonce:n}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n})},"ScrollAreaViewportStyle"),(e,n)=>e.nonce===n.nonce),Yr="ScrollAreaScrollbar",zA=w.forwardRef(kt(function(n,i){const{forceMount:r,...l}=n,c=hi(Yr,n.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:f}=c,h=n.orientation==="horizontal";return w.useEffect(()=>(h?d(!0):f(!0),()=>{h?d(!1):f(!1)}),[h,d,f]),c.type==="hover"?o.jsx(DA,{...l,ref:i,forceMount:r}):c.type==="scroll"?o.jsx(LA,{...l,ref:i,forceMount:r}):c.type==="auto"?o.jsx(Pk,{...l,ref:i,forceMount:r}):c.type==="always"?o.jsx(Xg,{...l,ref:i,"data-state":"visible"}):null},"ScrollAreaScrollbar")),DA=w.forwardRef(kt(function(n,i){const{forceMount:r,...l}=n,c=hi(Yr,n.__scopeScrollArea),[d,f]=w.useState(!1);return w.useEffect(()=>{const h=c.scrollArea;let g=0;if(h){const y=kt(()=>{window.clearTimeout(g),f(!0)},"handlePointerEnter"),m=kt(()=>{g=window.setTimeout(()=>f(!1),c.scrollHideDelay)},"handlePointerLeave");return h.addEventListener("pointerenter",y),h.addEventListener("pointerleave",m),()=>{window.clearTimeout(g),h.removeEventListener("pointerenter",y),h.removeEventListener("pointerleave",m)}}},[c.scrollArea,c.scrollHideDelay]),o.jsx(rr,{present:r||d,children:o.jsx(Pk,{"data-state":d?"visible":"hidden",...l,ref:i})})},"ScrollAreaScrollbarHover")),LA=w.forwardRef(kt(function(n,i){const{forceMount:r,...l}=n,c=hi(Yr,n.__scopeScrollArea),d=n.orientation==="horizontal",f=iu(()=>g("SCROLL_END"),100),[h,g]=Bk("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(h==="idle"){const y=window.setTimeout(()=>g("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(y)}},[h,c.scrollHideDelay,g]),w.useEffect(()=>{const y=c.viewport,m=d?"scrollLeft":"scrollTop";if(y){let j=y[m];const b=kt(()=>{const k=y[m];j!==k&&(g("SCROLL"),f()),j=k},"handleScroll");return y.addEventListener("scroll",b),()=>y.removeEventListener("scroll",b)}},[c.viewport,d,g,f]),o.jsx(rr,{present:r||h!=="hidden",children:o.jsx(Xg,{"data-state":h==="hidden"?"hidden":"visible",...l,ref:i,onPointerEnter:At(n.onPointerEnter,()=>g("POINTER_ENTER")),onPointerLeave:At(n.onPointerLeave,()=>g("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Pk=w.forwardRef(kt(function(n,i){const r=hi(Yr,n.__scopeScrollArea),{forceMount:l,...c}=n,[d,f]=w.useState(!1),h=n.orientation==="horizontal",g=iu(()=>{if(r.viewport){const y=r.viewport.offsetWidth<r.viewport.scrollWidth,m=r.viewport.offsetHeight<r.viewport.scrollHeight;f(h?y:m)}},10);return Ts(r.viewport,g),Ts(r.content,g),o.jsx(rr,{present:l||d,children:o.jsx(Xg,{"data-state":d?"visible":"hidden",...c,ref:i})})},"ScrollAreaScrollbarAuto")),Xg=w.forwardRef(kt(function(n,i){const{orientation:r="vertical",...l}=n,c=hi(Yr,n.__scopeScrollArea),d=w.useRef(null),f=w.useRef(0),[h,g]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),y=Qg(h.viewport,h.content),m={...l,sizes:h,onSizesChange:g,hasThumb:y>0&&y<1,onThumbChange:kt(b=>d.current=b,"onThumbChange"),onThumbPointerUp:kt(()=>f.current=0,"onThumbPointerUp"),onThumbPointerDown:kt(b=>f.current=b,"onThumbPointerDown")};function j(b,k){return $k(b,f.current,h,k)}return kt(j,"getScrollPosition"),r==="horizontal"?o.jsx(BA,{...m,ref:i,onThumbPositionChange:()=>{if(c.viewport&&d.current){const b=c.viewport.scrollLeft,k=V0(b,h,c.dir);d.current.style.transform=`translate3d(${k}px, 0, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollLeft=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollLeft=j(b,c.dir))}}):r==="vertical"?o.jsx(IA,{...m,ref:i,onThumbPositionChange:()=>{if(c.viewport&&d.current){const b=c.viewport.scrollTop,k=V0(b,h);d.current.style.transform=`translate3d(0, ${k}px, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollTop=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollTop=j(b))}}):null},"ScrollAreaScrollbarVisible")),BA=w.forwardRef(kt(function(n,i){const{sizes:r,onSizesChange:l,...c}=n,d=hi(Yr,n.__scopeScrollArea),[f,h]=w.useState(),g=w.useRef(null),y=It(i,g,d.onScrollbarXChange);return w.useEffect(()=>{g.current&&h(getComputedStyle(g.current))},[g]),o.jsx(Fk,{"data-orientation":"horizontal",...c,ref:y,sizes:r,style:{bottom:0,left:d.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:d.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":au(r)+"px",...n.style},onThumbPointerDown:m=>n.onThumbPointerDown(m.x),onDragScroll:m=>n.onDragScroll(m.x),onWheelScroll:(m,j)=>{if(d.viewport){const b=d.viewport.scrollLeft+m.deltaX;n.onWheelScroll(b),Jg(b,j)&&m.preventDefault()}},onResize:()=>{g.current&&d.viewport&&f&&l({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:g.current.clientWidth,paddingStart:Xc(f.paddingLeft),paddingEnd:Xc(f.paddingRight)}})}})},"ScrollAreaScrollbarX")),IA=w.forwardRef(kt(function(n,i){const{sizes:r,onSizesChange:l,...c}=n,d=hi(Yr,n.__scopeScrollArea),[f,h]=w.useState(),g=w.useRef(null),y=It(i,g,d.onScrollbarYChange);return w.useEffect(()=>{g.current&&h(getComputedStyle(g.current))},[g]),o.jsx(Fk,{"data-orientation":"vertical",...c,ref:y,sizes:r,style:{top:0,right:d.dir==="ltr"?0:void 0,left:d.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":au(r)+"px",...n.style},onThumbPointerDown:m=>n.onThumbPointerDown(m.y),onDragScroll:m=>n.onDragScroll(m.y),onWheelScroll:(m,j)=>{if(d.viewport){const b=d.viewport.scrollTop+m.deltaY;n.onWheelScroll(b),Jg(b,j)&&m.preventDefault()}},onResize:()=>{g.current&&d.viewport&&f&&l({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:g.current.clientHeight,paddingStart:Xc(f.paddingTop),paddingEnd:Xc(f.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[qA,Hk]=qk(Yr),Fk=w.forwardRef(kt(function(n,i){const{__scopeScrollArea:r,sizes:l,hasThumb:c,onThumbChange:d,onThumbPointerUp:f,onThumbPointerDown:h,onThumbPositionChange:g,onDragScroll:y,onWheelScroll:m,onResize:j,...b}=n,k=hi(Yr,r),[S,N]=w.useState(null),C=It(i,N),M=w.useRef(null),E=w.useRef(""),T=k.viewport,_=l.content-l.viewport,R=Wn(m),O=Wn(g),I=iu(j,10);function P(z){if(M.current){const q=z.clientX-M.current.left,$=z.clientY-M.current.top;y({x:q,y:$})}}return kt(P,"handleDragScroll"),w.useEffect(()=>{const z=kt(q=>{const $=q.target;(S==null?void 0:S.contains($))&&R(q,_)},"handleWheel");return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[T,S,_,R]),w.useEffect(O,[l,O]),Ts(S,I),Ts(k.content,I),o.jsx(qA,{scope:r,scrollbar:S,hasThumb:c,onThumbChange:Wn(d),onThumbPointerUp:Wn(f),onThumbPositionChange:O,onThumbPointerDown:Wn(h),children:o.jsx(rn.div,{...b,ref:C,style:{position:"absolute",...b.style},onPointerDown:At(n.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),M.current=S.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k.viewport&&(k.viewport.style.scrollBehavior="auto"),P(z))}),onPointerMove:At(n.onPointerMove,P),onPointerUp:At(n.onPointerUp,z=>{const q=z.target;q.hasPointerCapture(z.pointerId)&&q.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=E.current,k.viewport&&(k.viewport.style.scrollBehavior=""),M.current=null})})})},"ScrollAreaScrollbarImpl")),$0="ScrollAreaThumb",PA=w.forwardRef(kt(function(n,i){const{forceMount:r,...l}=n,c=Hk($0,n.__scopeScrollArea);return o.jsx(rr,{present:r||c.hasThumb,children:o.jsx(HA,{ref:i,...l})})},"ScrollAreaThumb")),HA=w.forwardRef(kt(function(n,i){const{__scopeScrollArea:r,style:l,...c}=n,d=hi($0,r),f=Hk($0,r),{onThumbPositionChange:h}=f,g=It(i,f.onThumbChange),y=w.useRef(void 0),m=iu(()=>{y.current&&(y.current(),y.current=void 0)},100);return w.useEffect(()=>{const j=d.viewport;if(j){const b=kt(()=>{if(m(),!y.current){const k=$A(j,h);y.current=k,h()}},"handleScroll");return h(),j.addEventListener("scroll",b),()=>j.removeEventListener("scroll",b)}},[d.viewport,m,h]),o.jsx(rn.div,{"data-state":f.hasThumb?"visible":"hidden",...c,ref:g,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:At(n.onPointerDownCapture,j=>{const k=j.target.getBoundingClientRect(),S=j.clientX-k.left,N=j.clientY-k.top;f.onThumbPointerDown({x:S,y:N})}),onPointerUp:At(n.onPointerUp,f.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Uk="ScrollAreaCorner",FA=w.forwardRef(kt(function(n,i){const r=hi(Uk,n.__scopeScrollArea),l=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&l?o.jsx(UA,{...n,ref:i}):null},"ScrollAreaCorner")),UA=w.forwardRef(kt(function(n,i){const{__scopeScrollArea:r,...l}=n,c=hi(Uk,r),[d,f]=w.useState(0),[h,g]=w.useState(0),y=!!(d&&h),{onCornerWidthChange:m,onCornerHeightChange:j}=c;return Ts(c.scrollbarX,()=>{var k;const b=((k=c.scrollbarX)==null?void 0:k.offsetHeight)||0;c.onCornerHeightChange(b),g(b)}),Ts(c.scrollbarY,()=>{var k;const b=((k=c.scrollbarY)==null?void 0:k.offsetWidth)||0;c.onCornerWidthChange(b),f(b)}),w.useEffect(()=>()=>{m(0),j(0)},[m,j]),y?o.jsx(rn.div,{...l,ref:i,style:{width:d,height:h,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null},"ScrollAreaCornerImpl"));function Xc(e){return e?parseInt(e,10):0}kt(Xc,"toInt");function Qg(e,n){const i=e/n;return isNaN(i)?0:i}kt(Qg,"getThumbRatio");function au(e){const n=Qg(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-i)*n;return Math.max(r,18)}kt(au,"getThumbSize");function $k(e,n,i,r="ltr"){const l=au(i),c=l/2,d=n||c,f=l-d,h=i.scrollbar.paddingStart+d,g=i.scrollbar.size-i.scrollbar.paddingEnd-f,y=i.content-i.viewport,m=r==="ltr"?[0,y]:[y*-1,0];return Zg([h,g],m)(e)}kt($k,"getScrollPositionFromPointer");function V0(e,n,i="ltr"){const r=au(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,c=n.scrollbar.size-l,d=n.content-n.viewport,f=c-r,h=i==="ltr"?[0,d]:[d*-1,0],g=xf(e,h);return Zg([0,d],[0,f])(g)}kt(V0,"getThumbOffsetFromScroll");function Zg(e,n){return i=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const r=(n[1]-n[0])/(e[1]-e[0]);return n[0]+r*(i-e[0])}}kt(Zg,"linearScale");function Jg(e,n){return e>0&&e<n}kt(Jg,"isScrollingWithinScrollbarBounds");var $A=kt((e,n=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},r=0;return kt((function l(){const c={left:e.scrollLeft,top:e.scrollTop},d=i.left!==c.left,f=i.top!==c.top;(d||f)&&n(),i=c,r=window.requestAnimationFrame(l)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function iu(e,n){const i=Wn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(i,n)},[i,n])}kt(iu,"useDebounceCallback");function Ts(e,n){const i=Wn(n);ea(()=>{let r=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(i)});return l.observe(e),()=>{window.cancelAnimationFrame(r),l.unobserve(e)}}},[e,i])}kt(Ts,"useResizeObserver");var VA=AA,GA=RA,YA=FA,KA=Object.defineProperty,Pt=(e,n)=>KA(e,"name",{value:n,configurable:!0}),XA=[" ","Enter","ArrowUp","ArrowDown"],QA=[" ","Enter"],Tl="Select",[Xf,Wg,ZA]=A3(Tl),[Os,ZU]=Lo(Tl,[ZA,Uf]),e1=Uf(),[JA,qo]=Os(Tl),[WA,e_]=Os(Tl);function Vk(e){const{__scopeSelect:n,children:i,open:r,defaultOpen:l,onOpenChange:c,value:d,defaultValue:f,onValueChange:h,dir:g,name:y,autoComplete:m,disabled:j,required:b,form:k,internal_do_not_use_render:S}=e,N=e1(n),[C,M]=w.useState(null),[E,T]=w.useState(null),[_,R]=w.useState(!1),O=Ag(g),[I,P]=$c({prop:r,defaultProp:l??!1,onChange:c,caller:Tl}),[z,q]=$c({prop:d,defaultProp:f,onChange:h,caller:Tl}),$=w.useRef(null),Q=w.useRef(z);w.useEffect(()=>{const ne=k?C==null?void 0:C.ownerDocument.getElementById(k):C==null?void 0:C.form;if(ne instanceof HTMLFormElement){const B=Pt(()=>q(Q.current),"reset");return ne.addEventListener("reset",B),()=>ne.removeEventListener("reset",B)}},[k,C,q]);const Y=C?!!k||!!C.closest("form"):!0,[H,K]=w.useState(new Set),V=ws(),X=Array.from(H).map(ne=>ne.props.value).join(";"),Z=w.useCallback(ne=>{K(B=>new Set(B).add(ne))},[]),D=w.useCallback(ne=>{K(B=>{const F=new Set(B);return F.delete(ne),F})},[]),se={required:b,trigger:C,onTriggerChange:M,valueNode:E,onValueNodeChange:T,valueNodeHasChildren:_,onValueNodeHasChildrenChange:R,contentId:V,value:z,onValueChange:q,open:I,onOpenChange:P,dir:O,triggerPointerDownPosRef:$,disabled:j,name:y,autoComplete:m,form:k,nativeOptions:H,nativeSelectKey:X,isFormControl:Y};return o.jsx(Ak,{...N,children:o.jsx(JA,{scope:n,...se,children:o.jsx(Xf.Provider,{scope:n,children:o.jsx(WA,{scope:n,onNativeOptionAdd:Z,onNativeOptionRemove:D,children:Kk(S)?S(se):i})})})})}Pt(Vk,"SelectProvider");var t_=Pt(e=>{const{__scopeSelect:n,children:i,...r}=e;return o.jsx(Vk,{__scopeSelect:n,...r,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[i,l?o.jsx(N_,{__scopeSelect:n}):null]})})},"Select"),n_="SelectTrigger",a_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,disabled:l=!1,...c}=n,d=e1(r),f=qo(n_,r),h=f.disabled||l,g=It(i,f.onTriggerChange),y=Wg(r),m=w.useRef("touch"),[j,b,k]=t1(N=>{const C=y().filter(T=>!T.disabled),M=C.find(T=>T.value===f.value),E=n1(C,N,M);E!==void 0&&f.onValueChange(E.value)}),S=Pt(N=>{h||(f.onOpenChange(!0),k()),N&&(f.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})},"handleOpen");return o.jsx(_k,{asChild:!0,...d,children:o.jsx(rn.button,{type:"button",role:"combobox","aria-controls":f.open?f.contentId:void 0,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":ru(f.value)?"":void 0,...c,ref:g,onClick:At(c.onClick,N=>{N.currentTarget.focus(),m.current!=="mouse"&&S(N)}),onPointerDown:At(c.onPointerDown,N=>{m.current=N.pointerType;const C=N.target;C.hasPointerCapture(N.pointerId)&&C.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(S(N),N.preventDefault())}),onKeyDown:At(c.onKeyDown,N=>{const C=j.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&b(N.key),!(C&&N.key===" ")&&XA.includes(N.key)&&(S(),N.preventDefault())})})})},"SelectTrigger")),i_="SelectValue",r_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,className:l,style:c,children:d,placeholder:f="",...h}=n,g=qo(i_,r),{onValueNodeHasChildrenChange:y}=g,m=d!==void 0,j=It(i,g.onValueNodeChange);ea(()=>{y(m)},[y,m]);const b=ru(g.value);return o.jsx(rn.span,{...h,asChild:b?!1:h.asChild,ref:j,style:{pointerEvents:"none"},children:o.jsx(w.Fragment,{children:b?f:d},b?"placeholder":"value")})},"SelectValue")),o_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,children:l,...c}=n;return o.jsx(rn.span,{"aria-hidden":!0,...c,ref:i,children:l||"▼"})},"SelectIcon")),s_="SelectPortal",[l_,c_]=Os(s_,{forceMount:void 0}),u_=Pt(e=>{const{__scopeSelect:n,forceMount:i,...r}=e;return o.jsx(l_,{scope:e.__scopeSelect,forceMount:i,children:o.jsx(Dg,{asChild:!0,...r})})},"SelectPortal"),Ms="SelectContent",d_=w.forwardRef(Pt(function(n,i){const r=c_(Ms,n.__scopeSelect),{forceMount:l=r.forceMount,...c}=n,d=qo(Ms,n.__scopeSelect),[f,h]=w.useState();return ea(()=>{h(new DocumentFragment)},[]),o.jsx(rr,{present:l||d.open,children:({present:g})=>g?o.jsx(m_,{...c,ref:i}):o.jsx(f_,{...c,fragment:f})})},"SelectContent")),f_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,children:l,fragment:c}=n;return c?Do.createPortal(o.jsx(Gk,{scope:r,children:o.jsx(Xf.Slot,{scope:r,children:o.jsx("div",{ref:i,children:l})})}),c):null},"SelectContentFragment")),ki=10,[Gk,Qf]=Os(Ms),h_=tr("SelectContent.RemoveScroll"),m_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r}=n,{position:l="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:h,sideOffset:g,align:y,alignOffset:m,arrowPadding:j,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:C,...M}=n,E=qo(Ms,r),[T,_]=w.useState(null),[R,O]=w.useState(null),I=It(i,_),[P,z]=w.useState(null),[q,$]=w.useState(null),Q=Wg(r),[Y,H]=w.useState(!1),K=w.useRef(!1);w.useEffect(()=>{if(T)return Bg(T)},[T]),nu();const V=w.useCallback(le=>{const[be,...we]=Q().map(Ce=>Ce.ref.current),[ve]=we.slice(-1),re=document.activeElement;for(const Ce of le)if(Ce===re||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===be&&R&&(R.scrollTop=0),Ce===ve&&R&&(R.scrollTop=R.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==re))return},[Q,R]),X=w.useCallback(()=>V([P,T]),[V,P,T]);w.useEffect(()=>{Y&&X()},[Y,X]);const{onOpenChange:Z,triggerPointerDownPosRef:D}=E;w.useEffect(()=>{if(T){let le={x:0,y:0};const be=Pt(ve=>{var re,Ce;le={x:Math.abs(Math.round(ve.pageX)-(((re=D.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((Ce=D.current)==null?void 0:Ce.y)??0))}},"handlePointerMove"),we=Pt(ve=>{le.x<=10&&le.y<=10?ve.preventDefault():ve.composedPath().includes(T)||Z(!1),document.removeEventListener("pointermove",be),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",we,{capture:!0})}}},[T,Z,D]),w.useEffect(()=>{const le=Pt(()=>Z(!1),"close");return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[Z]);const[se,ne]=t1(le=>{const be=Q().filter(re=>!re.disabled),we=be.find(re=>re.ref.current===document.activeElement),ve=n1(be,le,we);ve&&setTimeout(()=>{var re;return(re=ve.ref.current)==null?void 0:re.focus()})}),B=w.useCallback((le,be,we)=>{const ve=!K.current&&!we;(E.value!==void 0&&E.value===be||ve)&&(z(le),ve&&(K.current=!0))},[E.value]),F=w.useCallback(()=>T==null?void 0:T.focus(),[T]),ee=w.useCallback((le,be,we)=>{const ve=!K.current&&!we;(E.value!==void 0&&E.value===be||ve)&&$(le)},[E.value]),W=l==="popper"?xb:p_,fe=W===xb?{side:h,sideOffset:g,align:y,alignOffset:m,arrowPadding:j,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:C}:{};return o.jsx(Gk,{scope:r,content:T,viewport:R,onViewportChange:O,itemRefCallback:B,selectedItem:P,onItemLeave:F,itemTextRefCallback:ee,focusSelectedItem:X,selectedItemText:q,position:l,isPositioned:Y,searchRef:se,children:o.jsx(Bf,{as:h_,allowPinchZoom:!0,children:o.jsx(Og,{asChild:!0,trapped:E.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:At(c,le=>{var be;(be=E.trigger)==null||be.focus({preventScroll:!0}),le.preventDefault()}),children:o.jsx(_g,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:o.jsx(W,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:le=>le.preventDefault(),...M,...fe,onPlaced:()=>H(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:At(M.onKeyDown,le=>{const be=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!be&&le.key.length===1&&ne(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let ve=Q().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(le.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const re=le.target,Ce=ve.indexOf(re);ve=ve.slice(Ce+1)}setTimeout(()=>V(ve)),le.preventDefault()}})})})})})})},"SelectContentImpl")),p_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,onPlaced:l,...c}=n,d=qo(Ms,r),f=Qf(Ms,r),[h,g]=w.useState(null),[y,m]=w.useState(null),j=It(i,m),b=Wg(r),k=w.useRef(!1),S=w.useRef(!0),{viewport:N,selectedItem:C,selectedItemText:M,focusSelectedItem:E}=f,T=w.useCallback(()=>{if(d.trigger&&d.valueNode&&h&&y&&N&&C&&M){const I=d.trigger.getBoundingClientRect(),P=y.getBoundingClientRect(),z=d.valueNode.getBoundingClientRect(),q=M.getBoundingClientRect();if(d.dir!=="rtl"){const re=q.left-P.left,Ce=z.left-re,Ve=I.left-Ce,Pe=I.width+Ve,Ze=Math.max(Pe,P.width),Fe=window.innerWidth-ki,Ke=xf(Ce,[ki,Math.max(ki,Fe-Ze)]);h.style.minWidth=Pe+"px",h.style.left=Ke+"px"}else{const re=P.right-q.right,Ce=window.innerWidth-z.right-re,Ve=window.innerWidth-I.right-Ce,Pe=I.width+Ve,Ze=Math.max(Pe,P.width),Fe=window.innerWidth-ki,Ke=xf(Ce,[ki,Math.max(ki,Fe-Ze)]);h.style.minWidth=Pe+"px",h.style.right=Ke+"px"}const $=b(),Q=window.innerHeight-ki*2,Y=N.scrollHeight,H=window.getComputedStyle(y),K=parseInt(H.borderTopWidth,10),V=parseInt(H.paddingTop,10),X=parseInt(H.borderBottomWidth,10),Z=parseInt(H.paddingBottom,10),D=K+V+Y+Z+X,se=Math.min(C.offsetHeight*5,D),ne=window.getComputedStyle(N),B=parseInt(ne.paddingTop,10),F=parseInt(ne.paddingBottom,10),ee=I.top+I.height/2-ki,W=Q-ee,fe=C.offsetHeight/2,le=C.offsetTop+fe,be=K+V+le,we=D-be;if(be<=ee){const re=$.length>0&&C===$[$.length-1].ref.current;h.style.bottom="0px";const Ce=y.clientHeight-N.offsetTop-N.offsetHeight,Ve=Math.max(W,fe+(re?F:0)+Ce+X),Pe=be+Ve;h.style.height=Pe+"px"}else{const re=$.length>0&&C===$[0].ref.current;h.style.top="0px";const Ve=Math.max(ee,K+N.offsetTop+(re?B:0)+fe)+we;h.style.height=Ve+"px",N.scrollTop=be-ee+N.offsetTop}h.style.margin=`${ki}px 0`,h.style.minHeight=se+"px",h.style.maxHeight=Q+"px",l==null||l(),requestAnimationFrame(()=>k.current=!0)}},[b,d.trigger,d.valueNode,h,y,N,C,M,d.dir,l]);ea(()=>T(),[T]);const[_,R]=w.useState();ea(()=>{y&&R(window.getComputedStyle(y).zIndex)},[y]);const O=w.useCallback(I=>{I&&S.current===!0&&(T(),E==null||E(),S.current=!1)},[T,E]);return o.jsx(g_,{scope:r,contentWrapper:h,shouldExpandOnScrollRef:k,onScrollButtonChange:O,children:o.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:o.jsx(rn.div,{...c,ref:j,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})},"SelectItemAlignedPosition")),xb=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,align:l="start",collisionPadding:c=ki,...d}=n,f=e1(r);return o.jsx(Rk,{...f,...d,ref:i,align:l,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[g_,v_]=Os(Ms,{}),bb="SelectViewport",y_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,nonce:l,...c}=n,d=Qf(bb,r),f=v_(bb,r),h=It(i,d.onViewportChange),g=w.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),o.jsx(Xf.Slot,{scope:r,children:o.jsx(rn.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:At(c.onScroll,y=>{const m=y.currentTarget,{contentWrapper:j,shouldExpandOnScrollRef:b}=f;if(b!=null&&b.current&&j){const k=Math.abs(g.current-m.scrollTop);if(k>0){const S=window.innerHeight-ki*2,N=parseFloat(j.style.minHeight),C=parseFloat(j.style.height),M=Math.max(N,C);if(M<S){const E=M+k,T=Math.min(S,E),_=E-T;j.style.height=T+"px",j.style.bottom==="0px"&&(m.scrollTop=_>0?_:0,j.style.justifyContent="flex-end")}}}g.current=m.scrollTop})})})]})},"SelectViewport")),x_="SelectGroup",[JU,WU]=Os(x_),G0="SelectItem",[b_,Yk]=Os(G0),j_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,value:l,disabled:c=!1,textValue:d,...f}=n,h=qo(G0,r),g=Qf(G0,r),y=h.value===l,[m,j]=w.useState(d??""),[b,k]=w.useState(!1),S=Wn(T=>{var _;return(_=g.itemRefCallback)==null?void 0:_.call(g,T,l,c)}),N=It(i,S),C=ws(),M=w.useRef("touch"),E=Pt(()=>{c||(h.onValueChange(l),h.onOpenChange(!1))},"handleSelect");return o.jsx(b_,{scope:r,value:l,disabled:c,textId:C,isSelected:y,onItemTextChange:w.useCallback(T=>{j(_=>_||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(Xf.ItemSlot,{scope:r,value:l,disabled:c,textValue:m,children:o.jsx(rn.div,{role:"option","aria-labelledby":C,"data-highlighted":b?"":void 0,"aria-selected":y&&b,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:N,onFocus:At(f.onFocus,()=>k(!0)),onBlur:At(f.onBlur,()=>k(!1)),onClick:At(f.onClick,()=>{M.current!=="mouse"&&E()}),onPointerUp:At(f.onPointerUp,()=>{M.current==="mouse"&&E()}),onPointerDown:At(f.onPointerDown,T=>{M.current=T.pointerType}),onPointerMove:At(f.onPointerMove,T=>{var _;M.current=T.pointerType,c?(_=g.onItemLeave)==null||_.call(g):M.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:At(f.onPointerLeave,T=>{var _;T.currentTarget===document.activeElement&&((_=g.onItemLeave)==null||_.call(g))}),onKeyDown:At(f.onKeyDown,T=>{var R;c||T.target!==T.currentTarget||((R=g.searchRef)==null?void 0:R.current)!==""&&T.key===" "||(QA.includes(T.key)&&E(),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),Dd="SelectItemText",w_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,className:l,style:c,...d}=n,f=qo(Dd,r),h=Qf(Dd,r),g=Yk(Dd,r),y=e_(Dd,r),[m,j]=w.useState(null),b=Wn(E=>{var T;return(T=h.itemTextRefCallback)==null?void 0:T.call(h,E,g.value,g.disabled)}),k=It(i,j,g.onItemTextChange,b),S=m==null?void 0:m.textContent,N=w.useMemo(()=>o.jsx("option",{value:g.value,disabled:g.disabled,children:S},g.value),[g.disabled,g.value,S]),{onNativeOptionAdd:C,onNativeOptionRemove:M}=y;return ea(()=>(C(N),()=>M(N)),[C,M,N]),o.jsxs(o.Fragment,{children:[o.jsx(rn.span,{id:g.textId,...d,ref:k}),g.isSelected&&f.valueNode&&!f.valueNodeHasChildren&&!ru(f.value)?Do.createPortal(d.children,f.valueNode):null]})},"SelectItemText")),k_="SelectItemIndicator",S_=w.forwardRef(Pt(function(n,i){const{__scopeSelect:r,...l}=n;return Yk(k_,r).isSelected?o.jsx(rn.span,{"aria-hidden":!0,...l,ref:i}):null},"SelectItemIndicator")),C_="SelectBubbleInput",N_=w.forwardRef(Pt(function({__scopeSelect:n,...i},r){const l=qo(C_,n),{value:c,onValueChange:d,required:f,disabled:h,name:g,autoComplete:y,form:m}=l,{nativeOptions:j,nativeSelectKey:b}=l,k=w.useRef(null),S=It(r,k),N=c??"",C=Ok(N),M=Array.from(j).some(E=>(E.props.value??"")==="");return w.useEffect(()=>{const E=k.current;if(!E)return;const T=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(T,"value").set;if(C!==N&&R){const O=new Event("change",{bubbles:!0});R.call(E,N),E.dispatchEvent(O)}},[C,N]),o.jsxs(rn.select,{"aria-hidden":!0,required:f,tabIndex:-1,name:g,autoComplete:y,disabled:h,form:m,onChange:E=>d(E.target.value),...i,style:{...gE,...i.style},ref:S,defaultValue:N,children:[ru(c)&&!M?o.jsx("option",{value:""}):null,Array.from(j)]},b)},"SelectBubbleInput"));function Kk(e){return typeof e=="function"}Pt(Kk,"isFunction");function ru(e){return e===""||e===void 0}Pt(ru,"shouldShowPlaceholder");function t1(e){const n=Wn(e),i=w.useRef(""),r=w.useRef(0),l=w.useCallback(d=>{const f=i.current+d;n(f),Pt((function h(g){i.current=g,window.clearTimeout(r.current),g!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}),"updateSearch")(f)},[n]),c=w.useCallback(()=>{i.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[i,l,c]}Pt(t1,"useTypeaheadSearch");function n1(e,n,i){const l=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,c=i?e.indexOf(i):-1;let d=Xk(e,Math.max(c,0));l.length===1&&(d=d.filter(g=>g!==i));const h=d.find(g=>g.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==i?h:void 0}Pt(n1,"findNextItem");function Xk(e,n){return e.map((i,r)=>e[(n+r)%e.length])}Pt(Xk,"wrapArray");const E_=Eg("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:e,variant:n="default",size:i="default",asChild:r=!1,...l}){const c=r?sE:"button";return o.jsx(c,{"data-slot":"button","data-variant":n,"data-size":i,className:Dn(E_({variant:n,size:i,className:e})),...l})}const Qk=100;function T_(e){const n=e.trim(),i=n.startsWith("<")&&n.endsWith(">")?A_(n):null;if(!(i!=null&&i.length))return null;const r=Zk(i,0,0)[0];for(;r.length&&!r[0].text.trim();)r.shift();for(;r.length&&!r.at(-1).text.trim();)r.pop();return r.length?r:null}function Zk(e,n,i){const r=[];let l=n;for(;l<e.length;){const c=e[l];if(c.kind==="close")return[r,l+1];if(c.kind==="text"){r.push(...M_(c.text,i)),l++;continue}if(c.kind==="self"){r.push(...jb(c,i)),l++;continue}const d=e[l+1],f=e[l+2],h=Jk(c.attrs);if((d==null?void 0:d.kind)==="close"&&d.name===c.name){r.push({depth:i,text:`<${c.name}${h} />`}),l+=2;continue}if((d==null?void 0:d.kind)==="text"&&(f==null?void 0:f.kind)==="close"&&f.name===c.name&&!d.text.includes(`
580
+ `)){const m=`<${c.name}${h}>${d.text.trim()}</${c.name}>`;if(m.length<=Qk){r.push({depth:i,text:m}),l+=3;continue}}r.push(...jb(c,i));const[g,y]=Zk(e,l+1,i+1);r.push(...g,{depth:i,text:`</${c.name}>`}),l=y}return[r,l]}function M_(e,n){const i=e.split(`
581
+ `);for(;i.length&&!i[0].trim();)i.shift();for(;i.length&&!i.at(-1).trim();)i.pop();return i.map(r=>({depth:n,text:r.trimEnd()}))}function Jk(e){return e.map(n=>` ${n}`).join("")}function jb(e,n){const i=Jk(e.attrs),r=e.kind==="self"?" />":">",l=`<${e.name}${i}${r}`;if(l.length<=Qk||!e.attrs.length)return[{depth:n,text:l}];const c=e.attrs.map(d=>` ${d}`);return c[c.length-1]=`${c[c.length-1]}${r}`,[{depth:n,text:`<${e.name}`},...c.map(d=>({depth:n,text:d}))]}function A_(e){const n=[],i=[];let r=0;for(;r<e.length;){const l=e.indexOf("<",r);if(l<0){n.push({kind:"text",text:e.slice(r)});break}l>r&&n.push({kind:"text",text:e.slice(r,l)});let c=l+1,d=null;for(;c<e.length;c++){const m=e[c];if(d)m===d&&(d=null);else if(m==='"'||m==="'")d=m;else if(m===">")break}if(c>=e.length)return null;const f=e.slice(l+1,c).trim(),h=f.startsWith("/"),g=f.endsWith("/"),y=(h?f.slice(1):g?f.slice(0,-1):f).trim().split(/[\s/]/,1)[0]??"";if(!/^[A-Za-z][\w.:-]*$/.test(y))return null;if(h){if(i.pop()!==y)return null;n.push({kind:"close",name:y,attrs:[]})}else g||i.push(y),n.push({kind:g?"self":"open",name:y,attrs:__(f.slice(y.length))});r=c+1}return i.length?null:n}function __(e){const n=[],i=/([\w.:-]+)\s*=\s*("(?:[^"]*)"|'(?:[^']*)')|([\w.:-]+)/g;for(const r of e.matchAll(i))n.push(r[0].replace(/\s*=\s*/,"="));return n}const R_=5*6e4,ks=e=>new Date(e).toDateString(),a1=(e,n)=>n===void 0||ks(e)!==ks(n),Wk=(e,n,i=n==null?void 0:n.createdAt)=>a1(e.createdAt,i)||(n==null?void 0:n.senderId)!==e.senderId||e.createdAt-n.createdAt>=R_;function O_(e){const n=new Date,i=new Date(e),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-1);if(ks(e)===ks(n.getTime()))return v("chat.today");if(ks(e)===r.toDateString())return v("chat.yesterday");const l=Wi()==="zh"?"long":"short";return i.getFullYear()===n.getFullYear()?ca(e,{weekday:"short",month:l,day:"numeric"}):ca(e,{year:"numeric",month:l,day:"numeric"})}const z_=e=>ca(e,{year:"numeric",month:Wi()==="zh"?"long":"short",day:"numeric",hour:Wi()==="zh"?"2-digit":"numeric",minute:"2-digit"}),i1=e=>ks(e)===ks(Date.now())?Ao(e):`${_f(e)} ${Ao(e)}`;function e5({time:e}){return o.jsx("div",{className:"jv-day",role:"separator",children:o.jsx("span",{children:O_(e)})})}function Y0({time:e,className:n}){return o.jsx("time",{className:n,dateTime:new Date(e).toISOString(),title:z_(e),children:Ao(e)})}function D_(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const L_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,B_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,I_={};function wb(e,n){return(I_.jsx?B_:L_).test(e)}const q_=/[ \t\n\f\r]/g;function P_(e){return typeof e=="object"?e.type==="text"?kb(e.value):!1:kb(e)}function kb(e){return e.replace(q_,"")===""}class ou{constructor(n,i,r){this.normal=i,this.property=n,r&&(this.space=r)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function t5(e,n){const i={},r={};for(const l of e)Object.assign(i,l.property),Object.assign(r,l.normal);return new ou(i,r,n)}function K0(e){return e.toLowerCase()}class Ia{constructor(n,i){this.attribute=i,this.property=n}}Ia.prototype.attribute="";Ia.prototype.booleanish=!1;Ia.prototype.boolean=!1;Ia.prototype.commaOrSpaceSeparated=!1;Ia.prototype.commaSeparated=!1;Ia.prototype.defined=!1;Ia.prototype.mustUseProperty=!1;Ia.prototype.number=!1;Ia.prototype.overloadedBoolean=!1;Ia.prototype.property="";Ia.prototype.spaceSeparated=!1;Ia.prototype.space=void 0;let H_=0;const ot=zs(),Mn=zs(),X0=zs(),Te=zs(),$t=zs(),Ss=zs(),Qa=zs();function zs(){return 2**++H_}const Q0=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:Mn,commaOrSpaceSeparated:Qa,commaSeparated:Ss,number:Te,overloadedBoolean:X0,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Hp=Object.keys(Q0);class r1 extends Ia{constructor(n,i,r,l){let c=-1;if(super(n,i),Sb(this,"space",l),typeof r=="number")for(;++c<Hp.length;){const d=Hp[c];Sb(this,Hp[c],(r&Q0[d])===Q0[d])}}}r1.prototype.defined=!0;function Sb(e,n,i){i&&(e[n]=i)}function Bl(e){const n={},i={};for(const[r,l]of Object.entries(e.properties)){const c=new r1(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),n[r]=c,i[K0(r)]=r,i[K0(c.attribute)]=r}return new ou(n,i,e.space)}const n5=Bl({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:$t,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Te,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:$t,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:Mn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function a5(e,n){return n in e?e[n]:n}function i5(e,n){return a5(e,n.toLowerCase())}const F_=Bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alpha:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:$t,autoFocus:ot,autoPlay:ot,blocking:$t,capture:null,charSet:null,checked:ot,cite:null,className:$t,closedBy:null,colorSpace:null,cols:Te,colSpan:Te,command:null,commandFor:null,content:null,contentEditable:Mn,controls:ot,controlsList:$t,coords:Te|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:X0,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:$t,height:Te,hidden:X0,high:Te,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:$t,itemRef:$t,itemScope:ot,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Te,pattern:null,ping:$t,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:$t,required:ot,reversed:ot,rows:Te,rowSpan:Te,sandbox:$t,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootCustomElementRegistry:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shadowRootSerializable:ot,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:Mn,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ot,disablePictureInPicture:ot,disableRemotePlayback:ot,exportParts:Ss,part:$t,prefix:null,property:null,results:Te,security:null,unselectable:null},space:"html",transform:i5}),U_=Bl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Qa,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ss,g2:Ss,glyphName:Ss,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:Qa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Te,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qa,rev:Qa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qa,requiredFeatures:Qa,requiredFonts:Qa,requiredFormats:Qa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:Qa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qa,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:a5}),r5=Bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),o5=Bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:i5}),s5=Bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),$_={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},V_=/[A-Z]/g,Cb=/-[a-z]/g,G_=/^data[-\w.:]+$/i;function Y_(e,n){const i=K0(n);let r=n,l=Ia;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&G_.test(n)){if(n.charAt(4)==="-"){const c=n.slice(5).replace(Cb,X_);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=n.slice(4);if(!Cb.test(c)){let d=c.replace(V_,K_);d.charAt(0)!=="-"&&(d="-"+d),n="data"+d}}l=r1}return new l(r,n)}function K_(e){return"-"+e.toLowerCase()}function X_(e){return e.charAt(1).toUpperCase()}const Q_=t5([n5,F_,r5,o5,s5],"html"),o1=t5([n5,U_,r5,o5,s5],"svg");function Z_(e){return e.join(" ").trim()}var bl={},Fp,Nb;function J_(){if(Nb)return Fp;Nb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
582
+ `,g="/",y="*",m="",j="comment",b="declaration";function k(N,C){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];C=C||{};var M=1,E=1;function T(Y){var H=Y.match(n);H&&(M+=H.length);var K=Y.lastIndexOf(h);E=~K?Y.length-K:E+Y.length}function _(){var Y={line:M,column:E};return function(H){return H.position=new R(Y),P(),H}}function R(Y){this.start=Y,this.end={line:M,column:E},this.source=C.source}R.prototype.content=N;function O(Y){var H=new Error(C.source+":"+M+":"+E+": "+Y);if(H.reason=Y,H.filename=C.source,H.line=M,H.column=E,H.source=N,!C.silent)throw H}function I(Y){var H=Y.exec(N);if(H){var K=H[0];return T(K),N=N.slice(K.length),H}}function P(){I(i)}function z(Y){var H;for(Y=Y||[];H=q();)H!==!1&&Y.push(H);return Y}function q(){var Y=_();if(!(g!=N.charAt(0)||y!=N.charAt(1))){for(var H=2;m!=N.charAt(H)&&(y!=N.charAt(H)||g!=N.charAt(H+1));)++H;if(H+=2,m===N.charAt(H-1))return O("End of comment missing");var K=N.slice(2,H-2);return E+=2,T(K),N=N.slice(H),E+=2,Y({type:j,comment:K})}}function $(){var Y=_(),H=I(r);if(H){if(q(),!I(l))return O("property missing ':'");var K=I(c),V=Y({type:b,property:S(H[0].replace(e,m)),value:K?S(K[0].replace(e,m)):m});return I(d),V}}function Q(){var Y=[];z(Y);for(var H;H=$();)H!==!1&&(Y.push(H),z(Y));return Y}return P(),Q()}function S(N){return N?N.replace(f,m):m}return Fp=k,Fp}var Eb;function W_(){if(Eb)return bl;Eb=1;var e=bl&&bl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bl,"__esModule",{value:!0}),bl.default=i;const n=e(J_());function i(r,l){let c=null;if(!r||typeof r!="string")return c;const d=(0,n.default)(r),f=typeof l=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:g,value:y}=h;f?l(g,y,h):y&&(c=c||{},c[g]=y)}),c}return bl}var _c={},Tb;function eR(){if(Tb)return _c;Tb=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(g){return!g||i.test(g)||e.test(g)},d=function(g,y){return y.toUpperCase()},f=function(g,y){return"".concat(y,"-")},h=function(g,y){return y===void 0&&(y={}),c(g)?g:(g=g.toLowerCase(),y.reactCompat?g=g.replace(l,f):g=g.replace(r,f),g.replace(n,d))};return _c.camelCase=h,_c}var Rc,Mb;function tR(){if(Mb)return Rc;Mb=1;var e=Rc&&Rc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(W_()),i=eR();function r(l,c){var d={};return!l||typeof l!="string"||(0,n.default)(l,function(f,h){f&&h&&(d[(0,i.camelCase)(f,c)]=h)}),d}return r.default=r,Rc=r,Rc}var nR=tR();const aR=vg(nR),l5=c5("end"),s1=c5("start");function c5(e){return n;function n(i){const r=i&&i.position&&i.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function iR(e){const n=s1(e),i=l5(e);if(n&&i)return{start:n,end:i}}function qc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ab(e.position):"start"in e||"end"in e?Ab(e):"line"in e||"column"in e?Z0(e):""}function Z0(e){return _b(e&&e.line)+":"+_b(e&&e.column)}function Ab(e){return Z0(e&&e.start)+"-"+Z0(e&&e.end)}function _b(e){return e&&typeof e=="number"?e:1}class ua extends Error{constructor(n,i,r){super(),typeof i=="string"&&(r=i,i=void 0);let l="",c={},d=!1;if(i&&("line"in i&&"column"in i?c={place:i}:"start"in i&&"end"in i?c={place:i}:"type"in i?c={ancestors:[i],place:i.position}:c={...i}),typeof n=="string"?l=n:!c.cause&&n&&(d=!0,l=n.message,c.cause=n),!c.ruleId&&!c.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?c.ruleId=r:(c.source=r.slice(0,h),c.ruleId=r.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=qc(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ua.prototype.file="";ua.prototype.name="";ua.prototype.reason="";ua.prototype.message="";ua.prototype.stack="";ua.prototype.column=void 0;ua.prototype.line=void 0;ua.prototype.ancestors=void 0;ua.prototype.cause=void 0;ua.prototype.fatal=void 0;ua.prototype.place=void 0;ua.prototype.ruleId=void 0;ua.prototype.source=void 0;const l1={}.hasOwnProperty,rR=new Map,oR=/[A-Z]/g,sR=new Set(["table","tbody","thead","tfoot","tr"]),lR=new Set(["td","th"]),u5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cR(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=vR(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gR(i,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?o1:Q_,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},c=d5(l,e,void 0);return c&&typeof c!="string"?c:l.create(e,l.Fragment,{children:c||void 0},void 0)}function d5(e,n,i){if(n.type==="element")return uR(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return dR(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return hR(e,n,i);if(n.type==="mdxjsEsm")return fR(e,n);if(n.type==="root")return mR(e,n,i);if(n.type==="text")return pR(e,n)}function uR(e,n,i){const r=e.schema;let l=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(l=o1,e.schema=l),e.ancestors.push(n);const c=h5(e,n.tagName,!1),d=yR(e,n);let f=u1(e,n);return sR.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!P_(h):!0})),f5(e,d,c,n),c1(d,f),e.ancestors.pop(),e.schema=r,e.create(n,c,d,i)}function dR(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Qc(e,n.position)}function fR(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Qc(e,n.position)}function hR(e,n,i){const r=e.schema;let l=r;n.name==="svg"&&r.space==="html"&&(l=o1,e.schema=l),e.ancestors.push(n);const c=n.name===null?e.Fragment:h5(e,n.name,!0),d=xR(e,n),f=u1(e,n);return f5(e,d,c,n),c1(d,f),e.ancestors.pop(),e.schema=r,e.create(n,c,d,i)}function mR(e,n,i){const r={};return c1(r,u1(e,n)),e.create(n,e.Fragment,r,i)}function pR(e,n){return n.value}function f5(e,n,i,r){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=r)}function c1(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function gR(e,n,i){return r;function r(l,c,d,f){const g=Array.isArray(d.children)?i:n;return f?g(c,d,f):g(c,d)}}function vR(e,n){return i;function i(r,l,c,d){const f=Array.isArray(c.children),h=s1(r);return n(l,c,d,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function yR(e,n){const i={};let r,l;for(l in n.properties)if(l!=="children"&&l1.call(n.properties,l)){const c=bR(e,l,n.properties[l]);if(c){const[d,f]=c;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&lR.has(n.tagName)?r=f:i[d]=f}}if(r){const c=i.style||(i.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return i}function xR(e,n){const i={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const f=d.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else Qc(e,n.position);else{const l=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else Qc(e,n.position);else c=r.value===null?!0:r.value;i[l]=c}return i}function u1(e,n){const i=[];let r=-1;const l=e.passKeys?new Map:rR;for(;++r<n.children.length;){const c=n.children[r];let d;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const g=l.get(h)||0;d=h+"-"+g,l.set(h,g+1)}}const f=d5(e,c,d);f!==void 0&&i.push(f)}return i}function bR(e,n,i){const r=Y_(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=r.commaSeparated?D_(i):Z_(i)),r.property==="style"){let l=typeof i=="object"?i:jR(e,String(i));return e.stylePropertyNameCase==="css"&&(l=wR(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&r.space?$_[r.property]||r.property:r.attribute,i]}}function jR(e,n){try{return aR(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const r=i,l=new ua("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=u5+"#cannot-parse-style-attribute",l}}function h5(e,n,i){let r;if(!i)r={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let c=-1,d;for(;++c<l.length;){const f=wb(l[c])?{type:"Identifier",name:l[c]}:{type:"Literal",value:l[c]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}r=d}else r=wb(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const l=r.value;return l1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qc(e)}function Qc(e,n){const i=new ua("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=u5+"#cannot-handle-mdx-estrees-without-createevaluater",i}function wR(e){const n={};let i;for(i in e)l1.call(e,i)&&(n[kR(i)]=e[i]);return n}function kR(e){let n=e.replace(oR,SR);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function SR(e){return"-"+e.toLowerCase()}const Up={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},CR={};function d1(e,n){const i=CR,r=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,l=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return m5(e,r,l)}function m5(e,n,i){if(NR(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Rb(e.children,n,i)}return Array.isArray(e)?Rb(e,n,i):""}function Rb(e,n,i){const r=[];let l=-1;for(;++l<e.length;)r[l]=m5(e[l],n,i);return r.join("")}function NR(e){return!!(e&&typeof e=="object")}const Ob=document.createElement("i");function f1(e){const n="&"+e+";";Ob.innerHTML=n;const i=Ob.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function Ja(e,n,i,r){const l=e.length;let c=0,d;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,i=i>0?i:0,r.length<1e4)d=Array.from(r),d.unshift(n,i),e.splice(...d);else for(i&&e.splice(n,i);c<r.length;)d=r.slice(c,c+1e4),d.unshift(n,0),e.splice(...d),c+=1e4,n+=1e4}function di(e,n){return e.length>0?(Ja(e,e.length,0,n),e):n}const zb={}.hasOwnProperty;function p5(e){const n={};let i=-1;for(;++i<e.length;)ER(n,e[i]);return n}function ER(e,n){let i;for(i in n){const l=(zb.call(e,i)?e[i]:void 0)||(e[i]={}),c=n[i];let d;if(c)for(d in c){zb.call(l,d)||(l[d]=[]);const f=c[d];TR(l[d],Array.isArray(f)?f:f?[f]:[])}}}function TR(e,n){let i=-1;const r=[];for(;++i<n.length;)(n[i].add==="after"?e:r).push(n[i]);Ja(e,0,0,r)}function g5(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ka=Po(/[A-Za-z]/),la=Po(/[\dA-Za-z]/),MR=Po(/[#-'*+\--9=?A-Z^-~]/);function bf(e){return e!==null&&(e<32||e===127)}const J0=Po(/\d/),AR=Po(/[\dA-Fa-f]/),_R=Po(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function wt(e){return e===-2||e===-1||e===32}const Zf=Po(new RegExp("\\p{P}|\\p{S}","u")),As=Po(/\s/);function Po(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function Il(e){const n=[];let i=-1,r=0,l=0;for(;++i<e.length;){const c=e.charCodeAt(i);let d="";if(c===37&&la(e.charCodeAt(i+1))&&la(e.charCodeAt(i+2)))l=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(i+1);c<56320&&f>56319&&f<57344?(d=String.fromCharCode(c,f),l=1):d="�"}else d=String.fromCharCode(c);d&&(n.push(e.slice(r,i),encodeURIComponent(d)),r=i+l+1,d=""),l&&(i+=l,l=0)}return n.join("")+e.slice(r)}function Mt(e,n,i,r){const l=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(h){return wt(h)?(e.enter(i),f(h)):n(h)}function f(h){return wt(h)&&c++<l?(e.consume(h),f):(e.exit(i),n(h))}}const RR={tokenize:OR};function OR(e){const n=e.attempt(this.parser.constructs.contentInitial,r,l);let i;return n;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Mt(e,n,"linePrefix")}function l(f){return e.enter("paragraph"),c(f)}function c(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Qe(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),d)}}const zR={tokenize:DR},Db={tokenize:LR};function DR(e){const n=this,i=[];let r=0,l,c,d;return f;function f(E){if(r<i.length){const T=i[r];return n.containerState=T[1],e.attempt(T[0].continuation,h,g)(E)}return g(E)}function h(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&M();const T=n.events.length;let _=T,R;for(;_--;)if(n.events[_][0]==="exit"&&n.events[_][1].type==="chunkFlow"){R=n.events[_][1].end;break}C(r);let O=T;for(;O<n.events.length;)n.events[O][1].end={...R},O++;return Ja(n.events,_+1,0,n.events.slice(T)),n.events.length=O,g(E)}return f(E)}function g(E){if(r===i.length){if(!l)return j(E);if(l.currentConstruct&&l.currentConstruct.concrete)return k(E);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Db,y,m)(E)}function y(E){return l&&M(),C(r),j(E)}function m(E){return n.parser.lazy[n.now().line]=r!==i.length,d=n.now().offset,k(E)}function j(E){return n.containerState={},e.attempt(Db,b,k)(E)}function b(E){return r++,i.push([n.currentConstruct,n.containerState]),j(E)}function k(E){if(E===null){l&&M(),C(0),e.consume(E);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:c}),S(E)}function S(E){if(E===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return Qe(E)?(e.consume(E),N(e.exit("chunkFlow")),r=0,n.interrupt=void 0,f):(e.consume(E),S)}function N(E,T){const _=n.sliceStream(E);if(T&&_.push(null),E.previous=c,c&&(c.next=E),c=E,l.defineSkip(E.start),l.write(_),n.parser.lazy[E.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<d&&(!l.events[R][1].end||l.events[R][1].end.offset>d))return;const O=n.events.length;let I=O,P,z;for(;I--;)if(n.events[I][0]==="exit"&&n.events[I][1].type==="chunkFlow"){if(P){z=n.events[I][1].end;break}P=!0}for(C(r),R=O;R<n.events.length;)n.events[R][1].end={...z},R++;Ja(n.events,I+1,0,n.events.slice(O)),n.events.length=R}}function C(E){let T=i.length;for(;T-- >E;){const _=i[T];n.containerState=_[1],_[0].exit.call(n,e)}i.length=E}function M(){l.write([null]),c=void 0,l=void 0,n.containerState._closeFlow=void 0}}function LR(e,n,i){return Mt(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ml(e){if(e===null||Vt(e)||As(e))return 1;if(Zf(e))return 2}function Jf(e,n,i){const r=[];let l=-1;for(;++l<e.length;){const c=e[l].resolveAll;c&&!r.includes(c)&&(n=c(n,i),r.push(c))}return n}const W0={name:"attention",resolveAll:BR,tokenize:IR};function BR(e,n){let i=-1,r,l,c,d,f,h,g,y;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(r=i;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[r][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[r][1].end},j={...e[i][1].start};Lb(m,-h),Lb(j,h),d={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:j},c={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[i][1].start}},l={type:h>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[r][1].end={...d.start},e[i][1].start={...f.end},g=[],e[r][1].end.offset-e[r][1].start.offset&&(g=di(g,[["enter",e[r][1],n],["exit",e[r][1],n]])),g=di(g,[["enter",l,n],["enter",d,n],["exit",d,n],["enter",c,n]]),g=di(g,Jf(n.parser.constructs.insideSpan.null,e.slice(r+1,i),n)),g=di(g,[["exit",c,n],["enter",f,n],["exit",f,n],["exit",l,n]]),e[i][1].end.offset-e[i][1].start.offset?(y=2,g=di(g,[["enter",e[i][1],n],["exit",e[i][1],n]])):y=0,Ja(e,r-1,i-r+3,g),i=r+g.length-y-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function IR(e,n){const i=this.parser.constructs.attentionMarkers.null,r=this.previous,l=Ml(r);let c;return d;function d(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const g=e.exit("attentionSequence"),y=Ml(h),m=!y||y===2&&l||i.includes(h),j=!l||l===2&&y||i.includes(r);return g._open=!!(c===42?m:m&&(l||!j)),g._close=!!(c===42?j:j&&(y||!m)),n(h)}}function Lb(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const qR={name:"autolink",tokenize:PR};function PR(e,n,i){let r=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(b){return ka(b)?(e.consume(b),d):b===64?i(b):g(b)}function d(b){return b===43||b===45||b===46||la(b)?(r=1,f(b)):g(b)}function f(b){return b===58?(e.consume(b),r=0,h):(b===43||b===45||b===46||la(b))&&r++<32?(e.consume(b),f):(r=0,g(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||bf(b)?i(b):(e.consume(b),h)}function g(b){return b===64?(e.consume(b),y):MR(b)?(e.consume(b),g):i(b)}function y(b){return la(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),r=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):j(b)}function j(b){if((b===45||la(b))&&r++<63){const k=b===45?j:m;return e.consume(b),k}return i(b)}}const su={partial:!0,tokenize:HR};function HR(e,n,i){return r;function r(c){return wt(c)?Mt(e,l,"linePrefix")(c):l(c)}function l(c){return c===null||Qe(c)?n(c):i(c)}}const v5={continuation:{tokenize:UR},exit:$R,name:"blockQuote",tokenize:FR};function FR(e,n,i){const r=this;return l;function l(d){if(d===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return i(d)}function c(d){return wt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(d))}}function UR(e,n,i){const r=this;return l;function l(d){return wt(d)?Mt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(v5,n,i)(d)}}function $R(e){e.exit("blockQuote")}const y5={name:"characterEscape",tokenize:VR};function VR(e,n,i){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),l}function l(c){return _R(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(c)}}const x5={name:"characterReference",tokenize:GR};function GR(e,n,i){const r=this;let l=0,c,d;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),g):(e.enter("characterReferenceValue"),c=31,d=la,y(m))}function g(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=AR,y):(e.enter("characterReferenceValue"),c=7,d=J0,y(m))}function y(m){if(m===59&&l){const j=e.exit("characterReferenceValue");return d===la&&!f1(r.sliceSerialize(j))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return d(m)&&l++<c?(e.consume(m),y):i(m)}}const Bb={partial:!0,tokenize:KR},Ib={concrete:!0,name:"codeFenced",tokenize:YR};function YR(e,n,i){const r=this,l={partial:!0,tokenize:_};let c=0,d=0,f;return h;function h(R){return g(R)}function g(R){const O=r.events[r.events.length-1];return c=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(R)}function y(R){return R===f?(d++,e.consume(R),y):d<3?i(R):(e.exit("codeFencedFenceSequence"),wt(R)?Mt(e,m,"whitespace")(R):m(R))}function m(R){return R===null||Qe(R)?(e.exit("codeFencedFence"),r.interrupt?n(R):e.check(Bb,S,T)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(R))}function j(R){return R===null||Qe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(R)):wt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,b,"whitespace")(R)):R===96&&R===f?i(R):(e.consume(R),j)}function b(R){return R===null||Qe(R)?m(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Qe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(R)):R===96&&R===f?i(R):(e.consume(R),k)}function S(R){return e.attempt(l,T,N)(R)}function N(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return c>0&&wt(R)?Mt(e,M,"linePrefix",c+1)(R):M(R)}function M(R){return R===null||Qe(R)?e.check(Bb,S,T)(R):(e.enter("codeFlowValue"),E(R))}function E(R){return R===null||Qe(R)?(e.exit("codeFlowValue"),M(R)):(e.consume(R),E)}function T(R){return e.exit("codeFenced"),n(R)}function _(R,O,I){let P=0;return z;function z(H){return R.enter("lineEnding"),R.consume(H),R.exit("lineEnding"),q}function q(H){return R.enter("codeFencedFence"),wt(H)?Mt(R,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):$(H)}function $(H){return H===f?(R.enter("codeFencedFenceSequence"),Q(H)):I(H)}function Q(H){return H===f?(P++,R.consume(H),Q):P>=d?(R.exit("codeFencedFenceSequence"),wt(H)?Mt(R,Y,"whitespace")(H):Y(H)):I(H)}function Y(H){return H===null||Qe(H)?(R.exit("codeFencedFence"),O(H)):I(H)}}}function KR(e,n,i){const r=this;return l;function l(d){return d===null?i(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?i(d):n(d)}}const $p={name:"codeIndented",tokenize:QR},XR={partial:!0,tokenize:ZR};function QR(e,n,i){const r=this;return l;function l(g){return e.enter("codeIndented"),Mt(e,c,"linePrefix",5)(g)}function c(g){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(g):i(g)}function d(g){return g===null?h(g):Qe(g)?e.attempt(XR,d,h)(g):(e.enter("codeFlowValue"),f(g))}function f(g){return g===null||Qe(g)?(e.exit("codeFlowValue"),d(g)):(e.consume(g),f)}function h(g){return e.exit("codeIndented"),n(g)}}function ZR(e,n,i){const r=this;return l;function l(d){return r.parser.lazy[r.now().line]?i(d):Qe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):Mt(e,c,"linePrefix",5)(d)}function c(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(d):Qe(d)?l(d):i(d)}}const JR={name:"codeText",previous:eO,resolve:WR,tokenize:tO};function WR(e){let n=e.length-4,i=3,r,l;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=i;++r<n;)if(e[r][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(r=i-1,n++;++r<=n;)l===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(l=r):(r===n||e[r][1].type==="lineEnding")&&(e[l][1].type="codeTextData",r!==l+2&&(e[l][1].end=e[r-1][1].end,e.splice(l+2,r-l-2),n-=r-l-2,r=l+2),l=void 0);return e}function eO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tO(e,n,i){let r=0,l,c;return d;function d(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),r++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(c=e.enter("codeTextSequence"),l=0,y(m)):Qe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),g(m))}function g(m){return m===null||m===32||m===96||Qe(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),g)}function y(m){return m===96?(e.consume(m),l++,y):l===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(c.type="codeTextData",g(m))}}class nO{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const r=i??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,i,r){const l=i||0;this.setCursor(Math.trunc(n));const c=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&Oc(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Oc(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Oc(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Oc(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Oc(this.left,i.reverse())}}}function Oc(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function b5(e){const n={};let i=-1,r,l,c,d,f,h,g;const y=new nO(e);for(;++i<y.length;){for(;i in n;)i=n[i];if(r=y.get(i),i&&r[1].type==="chunkFlow"&&y.get(i-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,aO(y,i)),i=n[i],g=!0);else if(r[1]._container){for(c=i,l=void 0;c--;)if(d=y.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),d[1].type="lineEnding",l=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;l&&(r[1].end={...y.get(l)[1].start},f=y.slice(l,i),f.unshift(r),y.splice(l,i-l+1,f))}}return Ja(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!g}function aO(e,n){const i=e.get(n)[1],r=e.get(n)[2];let l=n-1;const c=[];let d=i._tokenizer;d||(d=r.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,h=[],g={};let y,m,j=-1,b=i,k=0,S=0;const N=[S];for(;b;){for(;e.get(++l)[1]!==b;);c.push(l),b._tokenizer||(y=r.sliceStream(b),b.next||y.push(null),m&&d.defineSkip(b.start),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),b._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++j<f.length;)f[j][0]==="exit"&&f[j-1][0]==="enter"&&f[j][1].type===f[j-1][1].type&&f[j][1].start.line!==f[j][1].end.line&&(S=j+1,N.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(d.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),j=N.length;j--;){const C=f.slice(N[j],N[j+1]),M=c.pop();h.push([M,M+C.length-1]),e.splice(M,2,C)}for(h.reverse(),j=-1;++j<h.length;)g[k+h[j][0]]=k+h[j][1],k+=h[j][1]-h[j][0]-1;return g}const iO={resolve:oO,tokenize:sO},rO={partial:!0,tokenize:lO};function oO(e){return b5(e),e}function sO(e,n){let i;return r;function r(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?c(f):Qe(f)?e.check(rO,d,c)(f):(e.consume(f),l)}function c(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function d(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}}function lO(e,n,i){const r=this;return l;function l(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Mt(e,c,"linePrefix")}function c(d){if(d===null||Qe(d))return i(d);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(d):e.interrupt(r.parser.constructs.flow,i,n)(d)}}function j5(e,n,i,r,l,c,d,f,h){const g=h||Number.POSITIVE_INFINITY;let y=0;return m;function m(C){return C===60?(e.enter(r),e.enter(l),e.enter(c),e.consume(C),e.exit(c),j):C===null||C===32||C===41||bf(C)?i(C):(e.enter(r),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function j(C){return C===62?(e.enter(c),e.consume(C),e.exit(c),e.exit(l),e.exit(r),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===62?(e.exit("chunkString"),e.exit(f),j(C)):C===null||C===60||Qe(C)?i(C):(e.consume(C),C===92?k:b)}function k(C){return C===60||C===62||C===92?(e.consume(C),b):b(C)}function S(C){return!y&&(C===null||C===41||Vt(C))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(r),n(C)):y<g&&C===40?(e.consume(C),y++,S):C===41?(e.consume(C),y--,S):C===null||C===32||C===40||bf(C)?i(C):(e.consume(C),C===92?N:S)}function N(C){return C===40||C===41||C===92?(e.consume(C),S):S(C)}}function w5(e,n,i,r,l,c){const d=this;let f=0,h;return g;function g(b){return e.enter(r),e.enter(l),e.consume(b),e.exit(l),e.enter(c),y}function y(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?i(b):b===93?(e.exit(c),e.enter(l),e.consume(b),e.exit(l),e.exit(r),n):Qe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Qe(b)||f++>999?(e.exit("chunkString"),y(b)):(e.consume(b),h||(h=!wt(b)),b===92?j:m)}function j(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function k5(e,n,i,r,l,c){let d;return f;function f(j){return j===34||j===39||j===40?(e.enter(r),e.enter(l),e.consume(j),e.exit(l),d=j===40?41:j,h):i(j)}function h(j){return j===d?(e.enter(l),e.consume(j),e.exit(l),e.exit(r),n):(e.enter(c),g(j))}function g(j){return j===d?(e.exit(c),h(d)):j===null?i(j):Qe(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),Mt(e,g,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(j))}function y(j){return j===d||j===null||Qe(j)?(e.exit("chunkString"),g(j)):(e.consume(j),j===92?m:y)}function m(j){return j===d||j===92?(e.consume(j),y):y(j)}}function Pc(e,n){let i;return r;function r(l){return Qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i=!0,r):wt(l)?Mt(e,r,i?"linePrefix":"lineSuffix")(l):n(l)}}const cO={name:"definition",tokenize:dO},uO={partial:!0,tokenize:fO};function dO(e,n,i){const r=this;let l;return c;function c(b){return e.enter("definition"),d(b)}function d(b){return w5.call(r,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return Vt(b)?Pc(e,g)(b):g(b)}function g(b){return j5(e,y,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(uO,m,m)(b)}function m(b){return wt(b)?Mt(e,j,"whitespace")(b):j(b)}function j(b){return b===null||Qe(b)?(e.exit("definition"),r.parser.defined.push(l),n(b)):i(b)}}function fO(e,n,i){return r;function r(f){return Vt(f)?Pc(e,l)(f):i(f)}function l(f){return k5(e,c,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return wt(f)?Mt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||Qe(f)?n(f):i(f)}}const hO={name:"hardBreakEscape",tokenize:mO};function mO(e,n,i){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),l}function l(c){return Qe(c)?(e.exit("hardBreakEscape"),n(c)):i(c)}}const pO={name:"headingAtx",resolve:gO,tokenize:vO};function gO(e,n){let i=e.length-2,r=3,l,c;return e[r][1].type==="whitespace"&&(r+=2),i-2>r&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(r===i-1||i-4>r&&e[i-2][1].type==="whitespace")&&(i-=r+1===i?2:4),i>r&&(l={type:"atxHeadingText",start:e[r][1].start,end:e[i][1].end},c={type:"chunkText",start:e[r][1].start,end:e[i][1].end,contentType:"text"},Ja(e,r,i-r+1,[["enter",l,n],["enter",c,n],["exit",c,n],["exit",l,n]])),e}function vO(e,n,i){let r=0;return l;function l(y){return e.enter("atxHeading"),c(y)}function c(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&r++<6?(e.consume(y),d):y===null||Vt(y)?(e.exit("atxHeadingSequence"),f(y)):i(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||Qe(y)?(e.exit("atxHeading"),n(y)):wt(y)?Mt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),g(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function g(y){return y===null||y===35||Vt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),g)}}const yO=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qb=["pre","script","style","textarea"],xO={concrete:!0,name:"htmlFlow",resolveTo:wO,tokenize:kO},bO={partial:!0,tokenize:CO},jO={partial:!0,tokenize:SO};function wO(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function kO(e,n,i){const r=this;let l,c,d,f,h;return g;function g(B){return y(B)}function y(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),m}function m(B){return B===33?(e.consume(B),j):B===47?(e.consume(B),c=!0,S):B===63?(e.consume(B),l=3,r.interrupt?n:D):ka(B)?(e.consume(B),d=String.fromCharCode(B),N):i(B)}function j(B){return B===45?(e.consume(B),l=2,b):B===91?(e.consume(B),l=5,f=0,k):ka(B)?(e.consume(B),l=4,r.interrupt?n:D):i(B)}function b(B){return B===45?(e.consume(B),r.interrupt?n:D):i(B)}function k(B){const F="CDATA[";return B===F.charCodeAt(f++)?(e.consume(B),f===F.length?r.interrupt?n:$:k):i(B)}function S(B){return ka(B)?(e.consume(B),d=String.fromCharCode(B),N):i(B)}function N(B){if(B===null||B===47||B===62||Vt(B)){const F=B===47,ee=d.toLowerCase();return!F&&!c&&qb.includes(ee)?(l=1,r.interrupt?n(B):$(B)):yO.includes(d.toLowerCase())?(l=6,F?(e.consume(B),C):r.interrupt?n(B):$(B)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?i(B):c?M(B):E(B))}return B===45||la(B)?(e.consume(B),d+=String.fromCharCode(B),N):i(B)}function C(B){return B===62?(e.consume(B),r.interrupt?n:$):i(B)}function M(B){return wt(B)?(e.consume(B),M):z(B)}function E(B){return B===47?(e.consume(B),z):B===58||B===95||ka(B)?(e.consume(B),T):wt(B)?(e.consume(B),E):z(B)}function T(B){return B===45||B===46||B===58||B===95||la(B)?(e.consume(B),T):_(B)}function _(B){return B===61?(e.consume(B),R):wt(B)?(e.consume(B),_):E(B)}function R(B){return B===null||B===60||B===61||B===62||B===96?i(B):B===34||B===39?(e.consume(B),h=B,O):wt(B)?(e.consume(B),R):I(B)}function O(B){return B===h?(e.consume(B),h=null,P):B===null||Qe(B)?i(B):(e.consume(B),O)}function I(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Vt(B)?_(B):(e.consume(B),I)}function P(B){return B===47||B===62||wt(B)?E(B):i(B)}function z(B){return B===62?(e.consume(B),q):i(B)}function q(B){return B===null||Qe(B)?$(B):wt(B)?(e.consume(B),q):i(B)}function $(B){return B===45&&l===2?(e.consume(B),K):B===60&&l===1?(e.consume(B),V):B===62&&l===4?(e.consume(B),se):B===63&&l===3?(e.consume(B),D):B===93&&l===5?(e.consume(B),Z):Qe(B)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(bO,ne,Q)(B)):B===null||Qe(B)?(e.exit("htmlFlowData"),Q(B)):(e.consume(B),$)}function Q(B){return e.check(jO,Y,ne)(B)}function Y(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),H}function H(B){return B===null||Qe(B)?Q(B):(e.enter("htmlFlowData"),$(B))}function K(B){return B===45?(e.consume(B),D):$(B)}function V(B){return B===47?(e.consume(B),d="",X):$(B)}function X(B){if(B===62){const F=d.toLowerCase();return qb.includes(F)?(e.consume(B),se):$(B)}return ka(B)&&d.length<8?(e.consume(B),d+=String.fromCharCode(B),X):$(B)}function Z(B){return B===93?(e.consume(B),D):$(B)}function D(B){return B===62?(e.consume(B),se):B===45&&l===2?(e.consume(B),D):$(B)}function se(B){return B===null||Qe(B)?(e.exit("htmlFlowData"),ne(B)):(e.consume(B),se)}function ne(B){return e.exit("htmlFlow"),n(B)}}function SO(e,n,i){const r=this;return l;function l(d){return Qe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):i(d)}function c(d){return r.parser.lazy[r.now().line]?i(d):n(d)}}function CO(e,n,i){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(su,n,i)}}const NO={name:"htmlText",tokenize:EO};function EO(e,n,i){const r=this;let l,c,d;return f;function f(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),h}function h(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),_):D===63?(e.consume(D),E):ka(D)?(e.consume(D),I):i(D)}function g(D){return D===45?(e.consume(D),y):D===91?(e.consume(D),c=0,k):ka(D)?(e.consume(D),M):i(D)}function y(D){return D===45?(e.consume(D),b):i(D)}function m(D){return D===null?i(D):D===45?(e.consume(D),j):Qe(D)?(d=m,V(D)):(e.consume(D),m)}function j(D){return D===45?(e.consume(D),b):m(D)}function b(D){return D===62?K(D):D===45?j(D):m(D)}function k(D){const se="CDATA[";return D===se.charCodeAt(c++)?(e.consume(D),c===se.length?S:k):i(D)}function S(D){return D===null?i(D):D===93?(e.consume(D),N):Qe(D)?(d=S,V(D)):(e.consume(D),S)}function N(D){return D===93?(e.consume(D),C):S(D)}function C(D){return D===62?K(D):D===93?(e.consume(D),C):S(D)}function M(D){return D===null||D===62?K(D):Qe(D)?(d=M,V(D)):(e.consume(D),M)}function E(D){return D===null?i(D):D===63?(e.consume(D),T):Qe(D)?(d=E,V(D)):(e.consume(D),E)}function T(D){return D===62?K(D):E(D)}function _(D){return ka(D)?(e.consume(D),R):i(D)}function R(D){return D===45||la(D)?(e.consume(D),R):O(D)}function O(D){return Qe(D)?(d=O,V(D)):wt(D)?(e.consume(D),O):K(D)}function I(D){return D===45||la(D)?(e.consume(D),I):D===47||D===62||Vt(D)?P(D):i(D)}function P(D){return D===47?(e.consume(D),K):D===58||D===95||ka(D)?(e.consume(D),z):Qe(D)?(d=P,V(D)):wt(D)?(e.consume(D),P):K(D)}function z(D){return D===45||D===46||D===58||D===95||la(D)?(e.consume(D),z):q(D)}function q(D){return D===61?(e.consume(D),$):Qe(D)?(d=q,V(D)):wt(D)?(e.consume(D),q):P(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?i(D):D===34||D===39?(e.consume(D),l=D,Q):Qe(D)?(d=$,V(D)):wt(D)?(e.consume(D),$):(e.consume(D),Y)}function Q(D){return D===l?(e.consume(D),l=void 0,H):D===null?i(D):Qe(D)?(d=Q,V(D)):(e.consume(D),Q)}function Y(D){return D===null||D===34||D===39||D===60||D===61||D===96?i(D):D===47||D===62||Vt(D)?P(D):(e.consume(D),Y)}function H(D){return D===47||D===62||Vt(D)?P(D):i(D)}function K(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),n):i(D)}function V(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),X}function X(D){return wt(D)?Mt(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):Z(D)}function Z(D){return e.enter("htmlTextData"),d(D)}}const h1={name:"labelEnd",resolveAll:_O,resolveTo:RO,tokenize:OO},TO={tokenize:zO},MO={tokenize:DO},AO={tokenize:LO};function _O(e){let n=-1;const i=[];for(;++n<e.length;){const r=e[n][1];if(i.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const l=r.type==="labelImage"?4:2;r.type="data",n+=l}}return e.length!==i.length&&Ja(e,0,e.length,i),e}function RO(e,n){let i=e.length,r=0,l,c,d,f;for(;i--;)if(l=e[i][1],c){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[i][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(d){if(e[i][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(c=i,l.type!=="labelLink")){r=2;break}}else l.type==="labelEnd"&&(d=i);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},g={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",h,n],["enter",g,n]],f=di(f,e.slice(c+1,c+r+3)),f=di(f,[["enter",y,n]]),f=di(f,Jf(n.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),n)),f=di(f,[["exit",y,n],e[d-2],e[d-1],["exit",g,n]]),f=di(f,e.slice(d+1)),f=di(f,[["exit",h,n]]),Ja(e,c,e.length,f),e}function OO(e,n,i){const r=this;let l=r.events.length,c,d;for(;l--;)if((r.events[l][1].type==="labelImage"||r.events[l][1].type==="labelLink")&&!r.events[l][1]._balanced){c=r.events[l][1];break}return f;function f(j){return c?c._inactive?m(j):(d=r.parser.defined.includes(Ci(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(j),e.exit("labelMarker"),e.exit("labelEnd"),h):i(j)}function h(j){return j===40?e.attempt(TO,y,d?y:m)(j):j===91?e.attempt(MO,y,d?g:m)(j):d?y(j):m(j)}function g(j){return e.attempt(AO,y,m)(j)}function y(j){return n(j)}function m(j){return c._balanced=!0,i(j)}}function zO(e,n,i){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),l}function l(m){return Vt(m)?Pc(e,c)(m):c(m)}function c(m){return m===41?y(m):j5(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function d(m){return Vt(m)?Pc(e,h)(m):y(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?k5(e,g,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):y(m)}function g(m){return Vt(m)?Pc(e,y)(m):y(m)}function y(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function DO(e,n,i){const r=this;return l;function l(f){return w5.call(r,e,c,d,"reference","referenceMarker","referenceString")(f)}function c(f){return r.parser.defined.includes(Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function d(f){return i(f)}}function LO(e,n,i){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),l}function l(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),n):i(c)}}const BO={name:"labelStartImage",resolveAll:h1.resolveAll,tokenize:IO};function IO(e,n,i){const r=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):i(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(f):n(f)}}const qO={name:"labelStartLink",resolveAll:h1.resolveAll,tokenize:PO};function PO(e,n,i){const r=this;return l;function l(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(d):n(d)}}const Vp={name:"lineEnding",tokenize:HO};function HO(e,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mt(e,n,"linePrefix")}}const rf={name:"thematicBreak",tokenize:FO};function FO(e,n,i){let r=0,l;return c;function c(g){return e.enter("thematicBreak"),d(g)}function d(g){return l=g,f(g)}function f(g){return g===l?(e.enter("thematicBreakSequence"),h(g)):r>=3&&(g===null||Qe(g))?(e.exit("thematicBreak"),n(g)):i(g)}function h(g){return g===l?(e.consume(g),r++,h):(e.exit("thematicBreakSequence"),wt(g)?Mt(e,f,"whitespace")(g):f(g))}}const Oa={continuation:{tokenize:GO},exit:KO,name:"list",tokenize:VO},UO={partial:!0,tokenize:XO},$O={partial:!0,tokenize:YO};function VO(e,n,i){const r=this,l=r.events[r.events.length-1];let c=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,d=0;return f;function f(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:J0(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(rf,i,g)(b):g(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return J0(b)&&++d<10?(e.consume(b),h):(!r.interrupt||d<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),g(b)):i(b)}function g(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(su,r.interrupt?i:y,e.attempt(UO,j,m))}function y(b){return r.containerState.initialBlankLine=!0,c++,j(b)}function m(b){return wt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),j):i(b)}function j(b){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function GO(e,n,i){const r=this;return r.containerState._closeFlow=void 0,e.check(su,l,c);function l(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,n,"listItemIndent",r.containerState.size+1)(f)}function c(f){return r.containerState.furtherBlankLines||!wt(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($O,n,d)(f))}function d(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(Oa,n,i),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function YO(e,n,i){const r=this;return Mt(e,l,"listItemIndent",r.containerState.size+1);function l(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?n(c):i(c)}}function KO(e){e.exit(this.containerState.type)}function XO(e,n,i){const r=this;return Mt(e,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(c){const d=r.events[r.events.length-1];return!wt(c)&&d&&d[1].type==="listItemPrefixWhitespace"?n(c):i(c)}}const Pb={name:"setextUnderline",resolveTo:QO,tokenize:ZO};function QO(e,n){let i=e.length,r,l,c;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){r=i;break}e[i][1].type==="paragraph"&&(l=i)}else e[i][1].type==="content"&&e.splice(i,1),!c&&e[i][1].type==="definition"&&(c=i);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",c?(e.splice(l,0,["enter",d,n]),e.splice(c+1,0,["exit",e[r][1],n]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,n]),e}function ZO(e,n,i){const r=this;let l;return c;function c(g){let y=r.events.length,m;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){m=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),l=g,d(g)):i(g)}function d(g){return e.enter("setextHeadingLineSequence"),f(g)}function f(g){return g===l?(e.consume(g),f):(e.exit("setextHeadingLineSequence"),wt(g)?Mt(e,h,"lineSuffix")(g):h(g))}function h(g){return g===null||Qe(g)?(e.exit("setextHeadingLine"),n(g)):i(g)}}const JO={tokenize:WO};function WO(e){const n=this,i=e.attempt(su,r,e.attempt(this.parser.constructs.flowInitial,l,Mt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(iO,l)),"linePrefix")));return i;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function l(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const ez={resolveAll:C5()},tz=S5("string"),nz=S5("text");function S5(e){return{resolveAll:C5(e==="text"?az:void 0),tokenize:n};function n(i){const r=this,l=this.parser.constructs[e],c=i.attempt(l,d,f);return d;function d(y){return g(y)?c(y):f(y)}function f(y){if(y===null){i.consume(y);return}return i.enter("data"),i.consume(y),h}function h(y){return g(y)?(i.exit("data"),c(y)):(i.consume(y),h)}function g(y){if(y===null)return!0;const m=l[y];let j=-1;if(m)for(;++j<m.length;){const b=m[j];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function C5(e){return n;function n(i,r){let l=-1,c;for(;++l<=i.length;)c===void 0?i[l]&&i[l][1].type==="data"&&(c=l,l++):(!i[l]||i[l][1].type!=="data")&&(l!==c+2&&(i[c][1].end=i[l-1][1].end,i.splice(c+2,l-c-2),l=c+2),c=void 0);return e?e(i,r):i}}function az(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const r=e[i-1][1],l=n.sliceStream(r);let c=l.length,d=-1,f=0,h;for(;c--;){const g=l[c];if(typeof g=="string"){for(d=g.length;g.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(g===-2)h=!0,f++;else if(g!==-1){c++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const g={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...g.start},r.start.offset===r.end.offset?Object.assign(r,g):(e.splice(i,0,["enter",g,n],["exit",g,n]),i+=2)}i++}return e}const iz={42:Oa,43:Oa,45:Oa,48:Oa,49:Oa,50:Oa,51:Oa,52:Oa,53:Oa,54:Oa,55:Oa,56:Oa,57:Oa,62:v5},rz={91:cO},oz={[-2]:$p,[-1]:$p,32:$p},sz={35:pO,42:rf,45:[Pb,rf],60:xO,61:Pb,95:rf,96:Ib,126:Ib},lz={38:x5,92:y5},cz={[-5]:Vp,[-4]:Vp,[-3]:Vp,33:BO,38:x5,42:W0,60:[qR,NO],91:qO,92:[hO,y5],93:h1,95:W0,96:JR},uz={null:[W0,ez]},dz={null:[42,95]},fz={null:[]},hz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dz,contentInitial:rz,disable:fz,document:iz,flow:sz,flowInitial:oz,insideSpan:uz,string:lz,text:cz},Symbol.toStringTag,{value:"Module"}));function mz(e,n,i){let r={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const l={},c=[];let d=[],f=[];const h={attempt:O(_),check:O(R),consume:M,enter:E,exit:T,interrupt:O(R,{interrupt:!0})},g={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:e,previous:null,sliceSerialize:j,sliceStream:b,write:m};let y=n.tokenize.call(g,h);return n.resolveAll&&c.push(n),g;function m(q){return d=di(d,q),N(),d[d.length-1]!==null?[]:(I(n,0),g.events=Jf(c,g.events,g),g.events)}function j(q,$){return gz(b(q),$)}function b(q){return pz(d,q)}function k(){const{_bufferIndex:q,_index:$,line:Q,column:Y,offset:H}=r;return{_bufferIndex:q,_index:$,line:Q,column:Y,offset:H}}function S(q){l[q.line]=q.column,z()}function N(){let q;for(;r._index<d.length;){const $=d[r._index];if(typeof $=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<$.length;)C($.charCodeAt(r._bufferIndex));else C($)}}function C(q){y=y(q)}function M(q){Qe(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,z()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),g.previous=q}function E(q,$){const Q=$||{};return Q.type=q,Q.start=k(),g.events.push(["enter",Q,g]),f.push(Q),Q}function T(q){const $=f.pop();return $.end=k(),g.events.push(["exit",$,g]),$}function _(q,$){I(q,$.from)}function R(q,$){$.restore()}function O(q,$){return Q;function Q(Y,H,K){let V,X,Z,D;return Array.isArray(Y)?ne(Y):"tokenize"in Y?ne([Y]):se(Y);function se(W){return fe;function fe(le){const be=le!==null&&W[le],we=le!==null&&W.null,ve=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(we)?we:we?[we]:[]];return ne(ve)(le)}}function ne(W){return V=W,X=0,W.length===0?K:B(W[X])}function B(W){return fe;function fe(le){return D=P(),Z=W,W.partial||(g.currentConstruct=W),W.name&&g.parser.constructs.disable.null.includes(W.name)?ee():W.tokenize.call($?Object.assign(Object.create(g),$):g,h,F,ee)(le)}}function F(W){return q(Z,D),H}function ee(W){return D.restore(),++X<V.length?B(V[X]):K}}}function I(q,$){q.resolveAll&&!c.includes(q)&&c.push(q),q.resolve&&Ja(g.events,$,g.events.length-$,q.resolve(g.events.slice($),g)),q.resolveTo&&(g.events=q.resolveTo(g.events,g))}function P(){const q=k(),$=g.previous,Q=g.currentConstruct,Y=g.events.length,H=Array.from(f);return{from:Y,restore:K};function K(){r=q,g.previous=$,g.currentConstruct=Q,g.events.length=Y,f=H,z()}}function z(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}function pz(e,n){const i=n.start._index,r=n.start._bufferIndex,l=n.end._index,c=n.end._bufferIndex;let d;if(i===l)d=[e[i].slice(r,c)];else{if(d=e.slice(i,l),r>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(r):d.shift()}c>0&&d.push(e[l].slice(0,c))}return d}function gz(e,n){let i=-1;const r=[];let l;for(;++i<e.length;){const c=e[i];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
583
+ `;break}case-3:{d=`\r
584
+ `;break}case-2:{d=n?" ":" ";break}case-1:{if(!n&&l)continue;d=" ";break}default:d=String.fromCharCode(c)}l=c===-2,r.push(d)}return r.join("")}function vz(e){const r={constructs:p5([hz,...(e||{}).extensions||[]]),content:l(RR),defined:[],document:l(zR),flow:l(JO),lazy:{},string:l(tz),text:l(nz)};return r;function l(c){return d;function d(f){return mz(r,c,f)}}}function yz(e){for(;!b5(e););return e}const Hb=/[\0\t\n\r]/g;function xz(){let e=1,n="",i=!0,r;return l;function l(c,d,f){const h=[];let g,y,m,j,b;for(c=n+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),m=0,n="",i&&(c.charCodeAt(0)===65279&&m++,i=void 0);m<c.length;){if(Hb.lastIndex=m,g=Hb.exec(c),j=g&&g.index!==void 0?g.index:c.length,b=c.charCodeAt(j),!g){n=c.slice(m);break}if(b===10&&m===j&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),m<j&&(h.push(c.slice(m,j)),e+=j-m),b){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}m=j+1}return f&&(r&&h.push(-5),n&&h.push(n),h.push(null)),h}}const bz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jz(e){return e.replace(bz,wz)}function wz(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const l=i.charCodeAt(1),c=l===120||l===88;return g5(i.slice(c?2:1),c?16:10)}return f1(i)||e}const N5={}.hasOwnProperty;function kz(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),Sz(i)(yz(vz(i).document().write(xz()(e,n,!0))))}function Sz(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(gt),autolinkProtocol:P,autolinkEmail:P,atxHeading:c(Pe),blockQuote:c(we),characterEscape:P,characterReference:P,codeFenced:c(ve),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(ve,d),codeText:c(re,d),codeTextData:P,data:P,codeFlowValue:P,definition:c(Ce),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Ve),hardBreakEscape:c(Ze),hardBreakTrailing:c(Ze),htmlFlow:c(Fe,d),htmlFlowData:P,htmlText:c(Fe,d),htmlTextData:P,image:c(Ke),label:d,link:c(gt),listItem:c(Jt),listItemValue:j,listOrdered:c(Ht,m),listUnordered:c(Ht),paragraph:c(tn),reference:B,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Pe),strong:c(kn),thematicBreak:c(on)},exit:{atxHeading:h(),atxHeadingSequence:_,autolink:h(),autolinkEmail:be,autolinkProtocol:le,blockQuote:h(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:W,characterReference:fe,codeFenced:h(N),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:z,codeIndented:h(C),codeText:h(H),codeTextData:z,data:z,definition:h(),definitionDestinationString:T,definitionLabelString:M,definitionTitleString:E,emphasis:h(),hardBreakEscape:h($),hardBreakTrailing:h($),htmlFlow:h(Q),htmlFlowData:z,htmlText:h(Y),htmlTextData:z,image:h(V),label:Z,labelText:X,lineEnding:q,link:h(K),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:F,resourceDestinationString:D,resourceTitleString:se,resource:ne,setextHeading:h(I),setextHeadingLineSequence:O,setextHeadingText:R,strong:h(),thematicBreak:h()}};E5(n,(e||{}).mdastExtensions||[]);const i={};return r;function r(ge){let Me={type:"root",children:[]};const Xe={stack:[Me],tokenStack:[],config:n,enter:f,exit:g,buffer:d,resume:y,data:i},Je=[];let rt=-1;for(;++rt<ge.length;)if(ge[rt][1].type==="listOrdered"||ge[rt][1].type==="listUnordered")if(ge[rt][0]==="enter")Je.push(rt);else{const Wt=Je.pop();rt=l(ge,Wt,rt)}for(rt=-1;++rt<ge.length;){const Wt=n[ge[rt][0]];N5.call(Wt,ge[rt][1].type)&&Wt[ge[rt][1].type].call(Object.assign({sliceSerialize:ge[rt][2].sliceSerialize},Xe),ge[rt][1])}if(Xe.tokenStack.length>0){const Wt=Xe.tokenStack[Xe.tokenStack.length-1];(Wt[1]||Fb).call(Xe,void 0,Wt[0])}for(Me.position={start:To(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:To(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<n.transforms.length;)Me=n.transforms[rt](Me)||Me;return Me}function l(ge,Me,Xe){let Je=Me-1,rt=-1,Wt=!1,_n,dn,Ln,me;for(;++Je<=Xe;){const Ee=ge[Je];switch(Ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ee[0]==="enter"?rt++:rt--,me=void 0;break}case"lineEndingBlank":{Ee[0]==="enter"&&(_n&&!me&&!rt&&!Ln&&(Ln=Je),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!rt&&Ee[0]==="enter"&&Ee[1].type==="listItemPrefix"||rt===-1&&Ee[0]==="exit"&&(Ee[1].type==="listUnordered"||Ee[1].type==="listOrdered")){if(_n){let _e=Je;for(dn=void 0;_e--;){const Be=ge[_e];if(Be[1].type==="lineEnding"||Be[1].type==="lineEndingBlank"){if(Be[0]==="exit")continue;dn&&(ge[dn][1].type="lineEndingBlank",Wt=!0),Be[1].type="lineEnding",dn=_e}else if(!(Be[1].type==="linePrefix"||Be[1].type==="blockQuotePrefix"||Be[1].type==="blockQuotePrefixWhitespace"||Be[1].type==="blockQuoteMarker"||Be[1].type==="listItemIndent"))break}Ln&&(!dn||Ln<dn)&&(_n._spread=!0),_n.end=Object.assign({},dn?ge[dn][1].start:Ee[1].end),ge.splice(dn||Je,0,["exit",_n,Ee[2]]),Je++,Xe++}if(Ee[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},Ee[1].start),end:void 0};_n=_e,ge.splice(Je,0,["enter",_e,Ee[2]]),Je++,Xe++,Ln=void 0,me=!0}}}return ge[Me][1]._spread=Wt,Xe}function c(ge,Me){return Xe;function Xe(Je){f.call(this,ge(Je),Je),Me&&Me.call(this,Je)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ge,Me,Xe){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([Me,Xe||void 0]),ge.position={start:To(Me.start),end:void 0}}function h(ge){return Me;function Me(Xe){ge&&ge.call(this,Xe),g.call(this,Xe)}}function g(ge,Me){const Xe=this.stack.pop(),Je=this.tokenStack.pop();if(Je)Je[0].type!==ge.type&&(Me?Me.call(this,ge,Je[0]):(Je[1]||Fb).call(this,ge,Je[0]));else throw new Error("Cannot close `"+ge.type+"` ("+qc({start:ge.start,end:ge.end})+"): it’s not open");Xe.position.end=To(ge.end)}function y(){return d1(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function j(ge){if(this.data.expectingFirstListItemValue){const Me=this.stack[this.stack.length-2];Me.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.lang=ge}function k(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.meta=ge}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.value=ge.replace(/(\r?\n|\r)$/g,"")}function M(ge){const Me=this.resume(),Xe=this.stack[this.stack.length-1];Xe.label=Me,Xe.identifier=Ci(this.sliceSerialize(ge)).toLowerCase()}function E(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.title=ge}function T(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.url=ge}function _(ge){const Me=this.stack[this.stack.length-1];if(!Me.depth){const Xe=this.sliceSerialize(ge).length;Me.depth=Xe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function O(ge){const Me=this.stack[this.stack.length-1];Me.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ge){const Xe=this.stack[this.stack.length-1].children;let Je=Xe[Xe.length-1];(!Je||Je.type!=="text")&&(Je=vn(),Je.position={start:To(ge.start),end:void 0},Xe.push(Je)),this.stack.push(Je)}function z(ge){const Me=this.stack.pop();Me.value+=this.sliceSerialize(ge),Me.position.end=To(ge.end)}function q(ge){const Me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Xe=Me.children[Me.children.length-1];Xe.position.end=To(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(Me.type)&&(P.call(this,ge),z.call(this,ge))}function $(){this.data.atHardBreak=!0}function Q(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.value=ge}function Y(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.value=ge}function H(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.value=ge}function K(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Me=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Me,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function V(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Me=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Me,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function X(ge){const Me=this.sliceSerialize(ge),Xe=this.stack[this.stack.length-2];Xe.label=jz(Me),Xe.identifier=Ci(Me).toLowerCase()}function Z(){const ge=this.stack[this.stack.length-1],Me=this.resume(),Xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Xe.type==="link"){const Je=ge.children;Xe.children=Je}else Xe.alt=Me}function D(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.url=ge}function se(){const ge=this.resume(),Me=this.stack[this.stack.length-1];Me.title=ge}function ne(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function F(ge){const Me=this.resume(),Xe=this.stack[this.stack.length-1];Xe.label=Me,Xe.identifier=Ci(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function ee(ge){this.data.characterReferenceType=ge.type}function W(ge){const Me=this.sliceSerialize(ge),Xe=this.data.characterReferenceType;let Je;Xe?(Je=g5(Me,Xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Je=f1(Me);const rt=this.stack[this.stack.length-1];rt.value+=Je}function fe(ge){const Me=this.stack.pop();Me.position.end=To(ge.end)}function le(ge){z.call(this,ge);const Me=this.stack[this.stack.length-1];Me.url=this.sliceSerialize(ge)}function be(ge){z.call(this,ge);const Me=this.stack[this.stack.length-1];Me.url="mailto:"+this.sliceSerialize(ge)}function we(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function Ke(){return{type:"image",title:null,url:"",alt:null}}function gt(){return{type:"link",title:null,url:"",children:[]}}function Ht(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function Jt(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function tn(){return{type:"paragraph",children:[]}}function kn(){return{type:"strong",children:[]}}function vn(){return{type:"text",value:""}}function on(){return{type:"thematicBreak"}}}function To(e){return{line:e.line,column:e.column,offset:e.offset}}function E5(e,n){let i=-1;for(;++i<n.length;){const r=n[i];Array.isArray(r)?E5(e,r):Cz(e,r)}}function Cz(e,n){let i;for(i in n)if(N5.call(n,i))switch(i){case"canContainEols":{const r=n[i];r&&e[i].push(...r);break}case"transforms":{const r=n[i];r&&e[i].push(...r);break}case"enter":case"exit":{const r=n[i];r&&Object.assign(e[i],r);break}}}function Fb(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+qc({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+qc({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+qc({start:n.start,end:n.end})+") is still open")}function Nz(e){const n=this;n.parser=i;function i(r){return kz(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Ez(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function Tz(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
585
+ `}]}function Mz(e,n){const i=n.value?n.value+`
586
+ `:"",r={},l=n.lang?n.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:i}]};return n.meta&&(c.data={meta:n.meta}),e.patch(n,c),c=e.applyData(n,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(n,c),c}function Az(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function _z(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Rz(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),l=Il(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,f+=1,e.footnoteCounts.set(r,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+l,id:i+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(n,h);const g={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,g),e.applyData(n,g)}function Oz(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function zz(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function T5(e,n){const i=n.referenceType;let r="]";if(i==="collapsed"?r+="[]":i==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const l=e.all(n),c=l[0];c&&c.type==="text"?c.value="["+c.value:l.unshift({type:"text",value:"["});const d=l[l.length-1];return d&&d.type==="text"?d.value+=r:l.push({type:"text",value:r}),l}function Dz(e,n){const i=String(n.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return T5(e,n);const l={src:Il(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(l.title=r.title);const c={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,c),e.applyData(n,c)}function Lz(e,n){const i={src:Il(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,r),e.applyData(n,r)}function Bz(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const r={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,r),e.applyData(n,r)}function Iz(e,n){const i=String(n.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return T5(e,n);const l={href:Il(r.url||"")};r.title!==null&&r.title!==void 0&&(l.title=r.title);const c={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,c),e.applyData(n,c)}function qz(e,n){const i={href:Il(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const r={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Pz(e,n,i){const r=e.all(n),l=i?Hz(i):M5(n),c={},d=[];if(typeof n.checked=="boolean"){const y=r[0];let m;y&&y.type==="element"&&y.tagName==="p"?m=y:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const y=r[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
587
+ `}),y.type==="element"&&y.tagName==="p"&&!l?d.push(...y.children):d.push(y)}const h=r[r.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
588
+ `});const g={type:"element",tagName:"li",properties:c,children:d};return e.patch(n,g),e.applyData(n,g)}function Hz(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let r=-1;for(;!n&&++r<i.length;)n=M5(i[r])}return n}function M5(e){const n=e.spread;return n??e.children.length>1}function Fz(e,n){const i={},r=e.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++l<r.length;){const d=r[l];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const c={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(r,!0)};return e.patch(n,c),e.applyData(n,c)}function Uz(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function $z(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function Vz(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Gz(e,n){const i=e.all(n),r=i.shift(),l=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],d),l.push(d)}if(i.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=s1(n.children[1]),h=l5(n.children[n.children.length-1]);f&&h&&(d.position={start:f,end:h}),l.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,c),e.applyData(n,c)}function Yz(e,n,i){const r=i?i.children:void 0,c=(r?r.indexOf(n):1)===0?"th":"td",d=i&&i.type==="table"?i.align:void 0,f=d?d.length:n.children.length;let h=-1;const g=[];for(;++h<f;){const m=n.children[h],j={},b=d?d[h]:void 0;b&&(j.align=b);let k={type:"element",tagName:c,properties:j,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),g.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(n,y),e.applyData(n,y)}function Kz(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const Ub=9,$b=32;function Xz(e){const n=String(e),i=/\r?\n|\r/g;let r=i.exec(n),l=0;const c=[];for(;r;)c.push(Vb(n.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=i.exec(n);return c.push(Vb(n.slice(l),l>0,!1)),c.join("")}function Vb(e,n,i){let r=0,l=e.length;if(n){let c=e.codePointAt(r);for(;c===Ub||c===$b;)r++,c=e.codePointAt(r)}if(i){let c=e.codePointAt(l-1);for(;c===Ub||c===$b;)l--,c=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function Qz(e,n){const i={type:"text",value:Xz(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function Zz(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const Jz={blockquote:Ez,break:Tz,code:Mz,delete:Az,emphasis:_z,footnoteReference:Rz,heading:Oz,html:zz,imageReference:Dz,image:Lz,inlineCode:Bz,linkReference:Iz,link:qz,listItem:Pz,list:Fz,paragraph:Uz,root:$z,strong:Vz,table:Gz,tableCell:Kz,tableRow:Yz,text:Qz,thematicBreak:Zz,toml:Ld,yaml:Ld,definition:Ld,footnoteDefinition:Ld};function Ld(){}const A5=-1,Wf=0,Hc=1,jf=2,m1=3,p1=4,g1=5,v1=6,_5=7,R5=8,{defineProperty:Wz}=Object,O5=typeof self=="object"?self:globalThis,Gb=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new O5[e](n)},eD=(e,n)=>{const i=(l,c)=>(e.set(c,l),l),r=l=>{if(e.has(l))return e.get(l);const[c,d]=n[l];switch(c){case Wf:case A5:return i(d,l);case Hc:{const f=i([],l);for(const h of d)f.push(r(h));return f}case jf:{const f=i({},l);for(const[h,g]of d){const y=r(h),m=r(g);y==="__proto__"?Wz(f,y,{value:m,configurable:!0,enumerable:!0,writable:!0}):f[y]=m}return f}case m1:return i(new Date(d),l);case p1:{const{source:f,flags:h}=d;return i(new RegExp(f,h),l)}case g1:{const f=i(new Map,l);for(const[h,g]of d)f.set(r(h),r(g));return f}case v1:{const f=i(new Set,l);for(const h of d)f.add(r(h));return f}case _5:{const{name:f,message:h}=d;return i(typeof O5[f]=="function"?Gb(f,h):new Error(h),l)}case R5:return i(BigInt(d),l);case"BigInt":return i(Object(BigInt(d)),l);case"ArrayBuffer":return i(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return i(new DataView(f),d)}case"-0":return-0}return i(Gb(c,d),l)};return r},Yb=e=>eD(new Map,e)(0),bs="",{toString:tD}={},{keys:nD,is:aD}=Object,zc=e=>{const n=typeof e;if(n!=="object"||!e)return[Wf,n];const i=tD.call(e).slice(8,-1);switch(i){case"Array":return[Hc,bs];case"Object":return[jf,bs];case"Date":return[m1,bs];case"RegExp":return[p1,bs];case"Map":return[g1,bs];case"Set":return[v1,bs];case"DataView":return[Hc,i]}return i.includes("Array")?[Hc,i]:e instanceof Error?[_5,e.name||"Error"]:[jf,i]},Bd=([e,n])=>e===Wf&&(n==="function"||n==="symbol"),iD=(e,n,i,r)=>{const l=(d,f)=>{const h=r.push(d)-1;return i.set(f,h),h},c=d=>{if(i.has(d))return i.get(d);let[f,h]=zc(d);switch(f){case Wf:{let y=d;switch(h){case"bigint":f=R5,y=d.toString();break;case"number":if(!d&&aD(d,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return l([A5],d)}return l([f,y],d)}case Hc:{if(h){let j=d;return h==="DataView"?j=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(j=new Uint8Array(d)),l([h,[...j]],d)}const y=[],m=l([f,y],d);for(const j of d)y.push(c(j));return m}case jf:{if(h)switch(h){case"BigInt":return l([h,d.toString()],d);case"Boolean":case"Number":case"String":return l([h,d.valueOf()],d)}if(n&&"toJSON"in d)return c(d.toJSON());const y=[],m=l([f,y],d);for(const j of nD(d))(e||!Bd(zc(d[j])))&&y.push([c(j),c(d[j])]);return m}case m1:return l([f,isNaN(d.getTime())?bs:d.toISOString()],d);case p1:{const{source:y,flags:m}=d;return l([f,{source:y,flags:m}],d)}case g1:{const y=[],m=l([f,y],d);for(const[j,b]of d)(e||!(Bd(zc(j))||Bd(zc(b))))&&y.push([c(j),c(b)]);return m}case v1:{const y=[],m=l([f,y],d);for(const j of d)(e||!Bd(zc(j)))&&y.push(c(j));return m}}const{message:g}=d;return l([f,{name:h,message:g}],d)};return c},Kb=(e,{json:n,lossy:i}={})=>{const r=[];return iD(!(n||i),!!n,new Map,r)(e),r},wf=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Yb(Kb(e,n)):structuredClone(e):(e,n)=>Yb(Kb(e,n));function rD(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function oD(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function sD(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||rD,r=e.options.footnoteBackLabel||oD,l=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const g=e.footnoteById.get(e.footnoteOrder[h]);if(!g)continue;const y=e.all(g),m=String(g.identifier).toUpperCase(),j=Il(m.toLowerCase());let b=0;const k=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++b<=S;){k.length>0&&k.push({type:"text",value:" "});let M=typeof i=="string"?i:i(h,b);typeof M=="string"&&(M={type:"text",value:M}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+j+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,b),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const M=N.children[N.children.length-1];M&&M.type==="text"?M.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:n+"fn-"+j},children:e.wrap(y,!0)};e.patch(g,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...wf(d),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
589
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
590
+ `}]}}const eh=(function(e){if(e==null)return dD;if(typeof e=="function")return th(e);if(typeof e=="object")return Array.isArray(e)?lD(e):cD(e);if(typeof e=="string")return uD(e);throw new Error("Expected function, string, or object as test")});function lD(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=eh(e[i]);return th(r);function r(...l){let c=-1;for(;++c<n.length;)if(n[c].apply(this,l))return!0;return!1}}function cD(e){const n=e;return th(i);function i(r){const l=r;let c;for(c in e)if(l[c]!==n[c])return!1;return!0}}function uD(e){return th(n);function n(i){return i&&i.type===e}}function th(e){return n;function n(i,r,l){return!!(fD(i)&&e.call(this,i,typeof r=="number"?r:void 0,l||void 0))}}function dD(){return!0}function fD(e){return e!==null&&typeof e=="object"&&"type"in e}const z5=[],hD=!0,eg=!1,mD="skip";function D5(e,n,i,r){let l;typeof n=="function"&&typeof i!="function"?(r=i,i=n):l=n;const c=eh(l),d=r?-1:1;f(e,void 0,[])();function f(h,g,y){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return j;function j(){let b=z5,k,S,N;if((!n||c(h,g,y[y.length-1]||void 0))&&(b=pD(i(h,y)),b[0]===eg))return b;if("children"in h&&h.children){const C=h;if(C.children&&b[0]!==mD)for(S=(r?C.children.length:-1)+d,N=y.concat(C);S>-1&&S<C.children.length;){const M=C.children[S];if(k=f(M,S,N)(),k[0]===eg)return k;S=typeof k[1]=="number"?k[1]:S+d}}return b}}}function pD(e){return Array.isArray(e)?e:typeof e=="number"?[hD,e]:e==null?z5:[e]}function y1(e,n,i,r){let l,c,d;typeof n=="function"&&typeof i!="function"?(c=void 0,d=n,l=i):(c=n,d=i,l=r),D5(e,c,f,l);function f(h,g){const y=g[g.length-1],m=y?y.children.indexOf(h):void 0;return d(h,m,y)}}const tg={}.hasOwnProperty,gD={};function vD(e,n){const i=n||gD,r=new Map,l=new Map,c=new Map,d={...Jz,...i.handlers},f={all:g,applyData:xD,definitionById:r,footnoteById:l,footnoteCounts:c,footnoteOrder:[],handlers:d,one:h,options:i,patch:yD,wrap:jD};return y1(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const m=y.type==="definition"?r:l,j=String(y.identifier).toUpperCase();m.has(j)||m.set(j,y)}}),f;function h(y,m){const j=y.type,b=f.handlers[j];if(tg.call(f.handlers,j)&&b)return b(f,y,m);if(f.options.passThrough&&f.options.passThrough.includes(j)){if("children"in y){const{children:S,...N}=y,C=wf(N);return C.children=f.all(y),C}return wf(y)}return(f.options.unknownHandler||bD)(f,y,m)}function g(y){const m=[];if("children"in y){const j=y.children;let b=-1;for(;++b<j.length;){const k=f.one(j[b],y);if(k){if(b&&j[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Xb(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=Xb(S.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function yD(e,n){e.position&&(n.position=iR(e))}function xD(e,n){let i=n;if(e&&e.data){const r=e.data.hName,l=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(i.type==="element")i.tagName=r;else{const d="children"in i?i.children:[i];i={type:"element",tagName:r,properties:{},children:d}}i.type==="element"&&c&&Object.assign(i.properties,wf(c)),"children"in i&&i.children&&l!==null&&l!==void 0&&(i.children=l)}return i}function bD(e,n){const i=n.data||{},r="value"in n&&!(tg.call(i,"hProperties")||tg.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function jD(e,n){const i=[];let r=-1;for(n&&i.push({type:"text",value:`
591
+ `});++r<e.length;)r&&i.push({type:"text",value:`
592
+ `}),i.push(e[r]);return n&&e.length>0&&i.push({type:"text",value:`
593
+ `}),i}function Xb(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function Qb(e,n){const i=vD(e,n),r=i.one(e,void 0),l=sD(i),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return l&&c.children.push({type:"text",value:`
594
+ `},l),c}function wD(e,n){return e&&"run"in e?async function(i,r){const l=Qb(i,{file:r,...n});await e.run(l,r)}:function(i,r){return Qb(i,{file:r,...e||n})}}function Zb(e){if(e)throw e}var Gp,Jb;function kD(){if(Jb)return Gp;Jb=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,l=function(g){return typeof Array.isArray=="function"?Array.isArray(g):n.call(g)==="[object Array]"},c=function(g){if(!g||n.call(g)!=="[object Object]")return!1;var y=e.call(g,"constructor"),m=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!y&&!m)return!1;var j;for(j in g);return typeof j>"u"||e.call(g,j)},d=function(g,y){i&&y.name==="__proto__"?i(g,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):g[y.name]=y.newValue},f=function(g,y){if(y==="__proto__")if(e.call(g,y)){if(r)return r(g,y).value}else return;return g[y]};return Gp=function h(){var g,y,m,j,b,k,S=arguments[0],N=1,C=arguments.length,M=!1;for(typeof S=="boolean"&&(M=S,S=arguments[1]||{},N=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});N<C;++N)if(g=arguments[N],g!=null)for(y in g)m=f(S,y),j=f(g,y),S!==j&&(M&&j&&(c(j)||(b=l(j)))?(b?(b=!1,k=m&&l(m)?m:[]):k=m&&c(m)?m:{},d(S,{name:y,newValue:h(M,k,j)})):typeof j<"u"&&d(S,{name:y,newValue:j}));return S},Gp}var SD=kD();const Yp=vg(SD);function ng(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CD(){const e=[],n={run:i,use:r};return n;function i(...l){let c=-1;const d=l.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...l);function f(h,...g){const y=e[++c];let m=-1;if(h){d(h);return}for(;++m<l.length;)(g[m]===null||g[m]===void 0)&&(g[m]=l[m]);l=g,y?ND(y,f)(...g):d(null,...g)}}function r(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function ND(e,n){let i;return r;function r(...d){const f=e.length>d.length;let h;f&&d.push(l);try{h=e.apply(this,d)}catch(g){const y=g;if(f&&i)throw y;return l(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(c,l):h instanceof Error?l(h):c(h))}function l(d,...f){i||(i=!0,n(d,...f))}function c(d){l(null,d)}}const Yi={basename:ED,dirname:TD,extname:MD,join:AD,sep:"/"};function ED(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');lu(e);let i=0,r=-1,l=e.length,c;if(n===void 0||n.length===0||n.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(c){i=l+1;break}}else r<0&&(c=!0,r=l+1);return r<0?"":e.slice(i,r)}if(n===e)return"";let d=-1,f=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(c){i=l+1;break}}else d<0&&(c=!0,d=l+1),f>-1&&(e.codePointAt(l)===n.codePointAt(f--)?f<0&&(r=l):(f=-1,r=d));return i===r?r=d:r<0&&(r=e.length),e.slice(i,r)}function TD(e){if(lu(e),e.length===0)return".";let n=-1,i=e.length,r;for(;--i;)if(e.codePointAt(i)===47){if(r){n=i;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function MD(e){lu(e);let n=e.length,i=-1,r=0,l=-1,c=0,d;for(;n--;){const f=e.codePointAt(n);if(f===47){if(d){r=n+1;break}continue}i<0&&(d=!0,i=n+1),f===46?l<0?l=n:c!==1&&(c=1):l>-1&&(c=-1)}return l<0||i<0||c===0||c===1&&l===i-1&&l===r+1?"":e.slice(l,i)}function AD(...e){let n=-1,i;for(;++n<e.length;)lu(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":_D(i)}function _D(e){lu(e);const n=e.codePointAt(0)===47;let i=RD(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function RD(e,n){let i="",r=0,l=-1,c=0,d=-1,f,h;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(l===d-1||c===1))if(l!==d-1&&c===2){if(i.length<2||r!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",r=0):(i=i.slice(0,h),r=i.length-1-i.lastIndexOf("/")),l=d,c=0;continue}}else if(i.length>0){i="",r=0,l=d,c=0;continue}}n&&(i=i.length>0?i+"/..":"..",r=2)}else i.length>0?i+="/"+e.slice(l+1,d):i=e.slice(l+1,d),r=d-l-1;l=d,c=0}else f===46&&c>-1?c++:c=-1}return i}function lu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OD={cwd:zD};function zD(){return"/"}function ag(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function DD(e){if(typeof e=="string")e=new URL(e);else if(!ag(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return LD(e)}function LD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const r=n.codePointAt(i+2);if(r===70||r===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(n)}const Kp=["history","path","basename","stem","extname","dirname"];class L5{constructor(n){let i;n?ag(n)?i={path:n}:typeof n=="string"||BD(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":OD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Kp.length;){const c=Kp[r];c in i&&i[c]!==void 0&&i[c]!==null&&(this[c]=c==="history"?[...i[c]]:i[c])}let l;for(l in i)Kp.includes(l)||(this[l]=i[l])}get basename(){return typeof this.path=="string"?Yi.basename(this.path):void 0}set basename(n){Qp(n,"basename"),Xp(n,"basename"),this.path=Yi.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Yi.dirname(this.path):void 0}set dirname(n){Wb(this.basename,"dirname"),this.path=Yi.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Yi.extname(this.path):void 0}set extname(n){if(Xp(n,"extname"),Wb(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yi.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){ag(n)&&(n=DD(n)),Qp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Yi.basename(this.path,this.extname):void 0}set stem(n){Qp(n,"stem"),Xp(n,"stem"),this.path=Yi.join(this.dirname||"",n+(this.extname||""))}fail(n,i,r){const l=this.message(n,i,r);throw l.fatal=!0,l}info(n,i,r){const l=this.message(n,i,r);return l.fatal=void 0,l}message(n,i,r){const l=new ua(n,i,r);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Xp(e,n){if(e&&e.includes(Yi.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Yi.sep+"`")}function Qp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Wb(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function BD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ID=(function(e){const r=this.constructor.prototype,l=r[e],c=function(){return l.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),qD={}.hasOwnProperty;class x1 extends ID{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CD()}copy(){const n=new x1;let i=-1;for(;++i<this.attachers.length;){const r=this.attachers[i];n.use(...r)}return n.data(Yp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(Wp("data",this.frozen),this.namespace[n]=i,this):qD.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Wp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const l=i.call(n,...r);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=Id(n),r=this.parser||this.Parser;return Zp("parse",r),r(String(i),i)}process(n,i){const r=this;return this.freeze(),Zp("process",this.parser||this.Parser),Jp("process",this.compiler||this.Compiler),i?l(void 0,i):new Promise(l);function l(c,d){const f=Id(n),h=r.parse(f);r.run(h,f,function(y,m,j){if(y||!m||!j)return g(y);const b=m,k=r.stringify(b,j);FD(k)?j.value=k:j.result=k,g(y,j)});function g(y,m){y||!m?d(y):c?c(m):i(void 0,m)}}}processSync(n){let i=!1,r;return this.freeze(),Zp("processSync",this.parser||this.Parser),Jp("processSync",this.compiler||this.Compiler),this.process(n,l),tj("processSync","process",i),r;function l(c,d){i=!0,Zb(c),r=d}}run(n,i,r){ej(n),this.freeze();const l=this.transformers;return!r&&typeof i=="function"&&(r=i,i=void 0),r?c(void 0,r):new Promise(c);function c(d,f){const h=Id(i);l.run(n,h,g);function g(y,m,j){const b=m||n;y?f(y):d?d(b):r(void 0,b,j)}}}runSync(n,i){let r=!1,l;return this.run(n,i,c),tj("runSync","run",r),l;function c(d,f){Zb(d),l=f,r=!0}}stringify(n,i){this.freeze();const r=Id(i),l=this.compiler||this.Compiler;return Jp("stringify",l),ej(n),l(n,r)}use(n,...i){const r=this.attachers,l=this.namespace;if(Wp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):d(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function c(g){if(typeof g=="function")h(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[y,...m]=g;h(y,m)}else d(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function d(g){if(!("plugins"in g)&&!("settings"in g))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(g.plugins),g.settings&&(l.settings=Yp(!0,l.settings,g.settings))}function f(g){let y=-1;if(g!=null)if(Array.isArray(g))for(;++y<g.length;){const m=g[y];c(m)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function h(g,y){let m=-1,j=-1;for(;++m<r.length;)if(r[m][0]===g){j=m;break}if(j===-1)r.push([g,...y]);else if(y.length>0){let[b,...k]=y;const S=r[j][1];ng(S)&&ng(b)&&(b=Yp(!0,S,b)),r[j]=[g,b,...k]}}}}const PD=new x1().freeze();function Zp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ej(e){if(!ng(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tj(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Id(e){return HD(e)?e:new L5(e)}function HD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FD(e){return typeof e=="string"||UD(e)}function UD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $D="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nj=[],aj={allowDangerousHtml:!0},VD=/^(https?|ircs?|mailto|xmpp)$/i,GD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YD(e){const n=KD(e),i=XD(e);return QD(n.runSync(n.parse(i),i),e)}function KD(e){const n=e.rehypePlugins||nj,i=e.remarkPlugins||nj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aj}:aj;return PD().use(Nz).use(i).use(wD,r).use(n)}function XD(e){const n=e.children||"",i=new L5;return typeof n=="string"&&(i.value=n),i}function QD(e,n){const i=n.allowedElements,r=n.allowElement,l=n.components,c=n.disallowedElements,d=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||ZD;for(const y of GD)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+$D+y.id,void 0);return y1(e,g),cR(e,{Fragment:o.Fragment,components:l,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function g(y,m,j){if(y.type==="raw"&&j&&typeof m=="number")return d?j.children.splice(m,1):j.children[m]={type:"text",value:y.value},m;if(y.type==="element"){let b;for(b in Up)if(Object.hasOwn(Up,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],S=Up[b];(S===null||S.includes(y.tagName))&&(y.properties[b]=h(String(k||""),b,y))}}if(y.type==="element"){let b=i?!i.includes(y.tagName):c?c.includes(y.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(y,m,j)),b&&j&&typeof m=="number")return f&&y.children?j.children.splice(m,1,...y.children):j.children.splice(m,1),m}}}function ZD(e){const n=e.indexOf(":"),i=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return n===-1||l!==-1&&n>l||i!==-1&&n>i||r!==-1&&n>r||VD.test(e.slice(0,n))?e:""}function JD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function B5(e,n,i){const l=eh((i||{}).ignore||[]),c=WD(n);let d=-1;for(;++d<c.length;)D5(e,"text",f);function f(g,y){let m=-1,j;for(;++m<y.length;){const b=y[m],k=j?j.children:void 0;if(l(b,k?k.indexOf(b):void 0,j))return;j=b}if(j)return h(g,y)}function h(g,y){const m=y[y.length-1],j=c[d][0],b=c[d][1];let k=0;const N=m.children.indexOf(g);let C=!1,M=[];j.lastIndex=0;let E=j.exec(g.value);for(;E;){const T=E.index,_={index:E.index,input:E.input,stack:[...y,g]};let R=b(...E,_);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?j.lastIndex=T+1:(k!==T&&M.push({type:"text",value:g.value.slice(k,T)}),Array.isArray(R)?M.push(...R):R&&M.push(R),k=T+E[0].length,C=!0),!j.global)break;E=j.exec(g.value)}return C?(k<g.value.length&&M.push({type:"text",value:g.value.slice(k)}),m.children.splice(N,1,...M)):M=[g],N+M.length}}function WD(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<i.length;){const l=i[r];n.push([eL(l[0]),tL(l[1])])}return n}function eL(e){return typeof e=="string"?new RegExp(JD(e),"g"):e}function tL(e){return typeof e=="function"?e:function(){return e}}function nL(e){B5(e,[/\r?\n|\r/g,aL])}function aL(){return{type:"break"}}function iL(){return function(e){nL(e)}}const rL=/[\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]/,oL=/https?:\/\/[^\s<\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]+/g;function sL(e){var r;const n=((r=e.children)==null?void 0:r.length)===1?e.children[0]:void 0;if((n==null?void 0:n.type)!=="text"||!n.value)return;const i=n.value;return e.url===i||e.url===`http://${i}`||e.url===`mailto:${i}`?i:void 0}function I5(e,n){return{type:"link",url:e,children:[{type:"text",value:n}]}}function lL(e){const n=[];let i=0;for(const r of e.matchAll(oL))r.index>i&&n.push({type:"text",value:e.slice(i,r.index)}),n.push(I5(r[0],r[0])),i=r.index+r[0].length;return i<e.length&&n.push({type:"text",value:e.slice(i)}),n}function q5(e){const n=e.children;if(n)for(let i=0;i<n.length;i++){const r=n[i];if(r.type!=="link"){q5(r);continue}const l=sL(r),c=l===void 0?-1:l.search(rL);if(l===void 0||c<=0)continue;const d=l.slice(0,c),f=r.url.slice(0,r.url.length-l.length),h=lL(l.slice(c));n.splice(i,1,I5(f+d,d),...h),i+=h.length}}function cL(){return e=>q5(e)}const uL=new RegExp("(?<![A-Za-z0-9_/#.@-])m\\d{1,9}(?![A-Za-z0-9_-]|\\.[A-Za-z0-9])","g");function dL(e){const n=[];let i=0;for(const r of e.matchAll(uL))r.index>i&&n.push({type:"text",value:e.slice(i,r.index)}),n.push({type:"link",url:`#ref-${r[0]}`,children:[{type:"text",value:r[0]}]}),i=r.index+r[0].length;return n.length?(i<e.length&&n.push({type:"text",value:e.slice(i)}),n):null}function P5(e){const n=e.children;if(!(!n||e.type==="link"||e.type==="linkReference"))for(let i=0;i<n.length;i++){const r=n[i];if(r.type!=="text"){P5(r);continue}const l=r.value?dL(r.value):null;l&&(n.splice(i,1,...l),i+=l.length-1)}}function fL(){return e=>P5(e)}function ij(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,l=i.indexOf(n);for(;l!==-1;)r++,l=i.indexOf(n,l+n.length);return r}const e0="phrasing",t0=["autolink","link","image","label"];function hL(){return{transforms:[bL],enter:{literalAutolink:pL,literalAutolinkEmail:n0,literalAutolinkHttp:n0,literalAutolinkWww:n0},exit:{literalAutolink:xL,literalAutolinkEmail:yL,literalAutolinkHttp:gL,literalAutolinkWww:vL}}}function mL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:e0,notInConstruct:t0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:e0,notInConstruct:t0},{character:":",before:"[ps]",after:"\\/",inConstruct:e0,notInConstruct:t0}]}}function pL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function n0(e){this.config.enter.autolinkProtocol.call(this,e)}function gL(e){this.config.exit.autolinkProtocol.call(this,e)}function vL(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function yL(e){this.config.exit.autolinkEmail.call(this,e)}function xL(e){this.exit(e)}function bL(e){B5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wL]],{ignore:["link","linkReference"]})}function jL(e,n,i,r,l){let c="";if(!H5(l)||(/^w/i.test(n)&&(i=n+i,n="",c="http://"),!kL(i)))return!1;const d=SL(i+r);if(!d[0])return!1;const f={type:"link",title:null,url:c+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function wL(e,n,i,r){return!H5(r,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function kL(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function SL(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],r=i.indexOf(")");const l=ij(e,"(");let c=ij(e,")");for(;r!==-1&&l>c;)e+=i.slice(0,r+1),i=i.slice(r+1),r=i.indexOf(")"),c++;return[e,i]}function H5(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||As(i)||Zf(i))&&(!n||i!==47)}F5.peek=OL;function CL(){this.buffer()}function NL(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function EL(){this.buffer()}function TL(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ML(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Ci(this.sliceSerialize(e)).toLowerCase(),i.label=n}function AL(e){this.exit(e)}function _L(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Ci(this.sliceSerialize(e)).toLowerCase(),i.label=n}function RL(e){this.exit(e)}function OL(){return"["}function F5(e,n,i,r){const l=i.createTracker(r);let c=l.move("[^");const d=i.enter("footnoteReference"),f=i.enter("reference");return c+=l.move(i.safe(i.associationId(e),{after:"]",before:c})),f(),d(),c+=l.move("]"),c}function zL(){return{enter:{gfmFootnoteCallString:CL,gfmFootnoteCall:NL,gfmFootnoteDefinitionLabelString:EL,gfmFootnoteDefinition:TL},exit:{gfmFootnoteCallString:ML,gfmFootnoteCall:AL,gfmFootnoteDefinitionLabelString:_L,gfmFootnoteDefinition:RL}}}function DL(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:F5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(r,l,c,d){const f=c.createTracker(d);let h=f.move("[^");const g=c.enter("footnoteDefinition"),y=c.enter("label");return h+=f.move(c.safe(c.associationId(r),{before:h,after:"]"})),y(),h+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),h+=f.move((n?`
595
+ `:" ")+c.indentLines(c.containerFlow(r,f.current()),n?U5:LL))),g(),h}}function LL(e,n,i){return n===0?e:U5(e,n,i)}function U5(e,n,i){return(i?"":" ")+e}const BL=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$5.peek=FL;function IL(){return{canContainEols:["delete"],enter:{strikethrough:PL},exit:{strikethrough:HL}}}function qL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:BL}],handlers:{delete:$5}}}function PL(e){this.enter({type:"delete",children:[]},e)}function HL(e){this.exit(e)}function $5(e,n,i,r){const l=i.createTracker(r),c=i.enter("strikethrough");let d=l.move("~~");return d+=i.containerPhrasing(e,{...l.current(),before:d,after:"~"}),d+=l.move("~~"),c(),d}function FL(){return"~"}function UL(e){return e.length}function $L(e,n){const i=n||{},r=(i.align||[]).concat(),l=i.stringLength||UL,c=[],d=[],f=[],h=[];let g=0,y=-1;for(;++y<e.length;){const S=[],N=[];let C=-1;for(e[y].length>g&&(g=e[y].length);++C<e[y].length;){const M=VL(e[y][C]);if(i.alignDelimiters!==!1){const E=l(M);N[C]=E,(h[C]===void 0||E>h[C])&&(h[C]=E)}S.push(M)}d[y]=S,f[y]=N}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<g;)c[m]=rj(r[m]);else{const S=rj(r);for(;++m<g;)c[m]=S}m=-1;const j=[],b=[];for(;++m<g;){const S=c[m];let N="",C="";S===99?(N=":",C=":"):S===108?N=":":S===114&&(C=":");let M=i.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-C.length);const E=N+"-".repeat(M)+C;i.alignDelimiters!==!1&&(M=N.length+M+C.length,M>h[m]&&(h[m]=M),b[m]=M),j[m]=E}d.splice(1,0,j),f.splice(1,0,b),y=-1;const k=[];for(;++y<d.length;){const S=d[y],N=f[y];m=-1;const C=[];for(;++m<g;){const M=S[m]||"";let E="",T="";if(i.alignDelimiters!==!1){const _=h[m]-(N[m]||0),R=c[m];R===114?E=" ".repeat(_):R===99?_%2?(E=" ".repeat(_/2+.5),T=" ".repeat(_/2-.5)):(E=" ".repeat(_/2),T=E):T=" ".repeat(_)}i.delimiterStart!==!1&&!m&&C.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&M==="")&&(i.delimiterStart!==!1||m)&&C.push(" "),i.alignDelimiters!==!1&&C.push(E),C.push(M),i.alignDelimiters!==!1&&C.push(T),i.padding!==!1&&C.push(" "),(i.delimiterEnd!==!1||m!==g-1)&&C.push("|")}k.push(i.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
596
+ `)}function VL(e){return e==null?"":String(e)}function rj(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function GL(e,n,i,r){const l=i.enter("blockquote"),c=i.createTracker(r);c.move("> "),c.shift(2);const d=i.indentLines(i.containerFlow(e,c.current()),YL);return l(),d}function YL(e,n,i){return">"+(i?"":" ")+e}function KL(e,n){return oj(e,n.inConstruct,!0)&&!oj(e,n.notInConstruct,!1)}function oj(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function sj(e,n,i,r){let l=-1;for(;++l<i.unsafe.length;)if(i.unsafe[l].character===`
597
+ `&&KL(i.stack,i.unsafe[l]))return/[ \t]/.test(r.before)?"":" ";return`\\
598
+ `}function XL(e,n){const i=String(e);let r=i.indexOf(n),l=r,c=0,d=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===l?++c>d&&(d=c):c=1,l=r+n.length,r=i.indexOf(n,l);return d}function QL(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ZL(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function JL(e,n,i,r){const l=ZL(i),c=e.value||"",d=l==="`"?"GraveAccent":"Tilde";if(QL(e,i)){const m=i.enter("codeIndented"),j=i.indentLines(c,WL);return m(),j}const f=i.createTracker(r),h=l.repeat(Math.max(XL(c,l)+1,3)),g=i.enter("codeFenced");let y=f.move(h);if(e.lang){const m=i.enter(`codeFencedLang${d}`);y+=f.move(i.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=i.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(i.safe(e.meta,{before:y,after:`
599
+ `,encode:["`"],...f.current()})),m()}return y+=f.move(`
600
+ `),c&&(y+=f.move(c+`
601
+ `)),y+=f.move(h),g(),y}function WL(e,n,i){return(i?"":" ")+e}function b1(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function eB(e,n,i,r){const l=b1(i),c=l==='"'?"Quote":"Apostrophe",d=i.enter("definition");let f=i.enter("label");const h=i.createTracker(r);let g=h.move("[");return g+=h.move(i.safe(i.associationId(e),{before:g,after:"]",...h.current()})),g+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(i.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=i.enter("destinationRaw"),g+=h.move(i.safe(e.url,{before:g,after:e.title?" ":`
602
+ `,...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),g+=h.move(" "+l),g+=h.move(i.safe(e.title,{before:g,after:l,...h.current()})),g+=h.move(l),f()),d(),g}function tB(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Zc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kf(e,n,i){const r=Ml(e),l=Ml(n);return r===void 0?l===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}V5.peek=nB;function V5(e,n,i,r){const l=tB(i),c=i.enter("emphasis"),d=i.createTracker(r),f=d.move(l);let h=d.move(i.containerPhrasing(e,{after:l,before:f,...d.current()}));const g=h.charCodeAt(0),y=kf(r.before.charCodeAt(r.before.length-1),g,l);y.inside&&(h=Zc(g)+h.slice(1));const m=h.charCodeAt(h.length-1),j=kf(r.after.charCodeAt(0),m,l);j.inside&&(h=h.slice(0,-1)+Zc(m));const b=d.move(l);return c(),i.attentionEncodeSurroundingInfo={after:j.outside,before:y.outside},f+h+b}function nB(e,n,i){return i.options.emphasis||"*"}function aB(e,n){let i=!1;return y1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return i=!0,eg}),!!((!e.depth||e.depth<3)&&d1(e)&&(n.options.setext||i))}function iB(e,n,i,r){const l=Math.max(Math.min(6,e.depth||1),1),c=i.createTracker(r);if(aB(e,i)){const y=i.enter("headingSetext"),m=i.enter("phrasing"),j=i.containerPhrasing(e,{...c.current(),before:`
603
+ `,after:`
604
+ `});return m(),y(),j+`
605
+ `+(l===1?"=":"-").repeat(j.length-(Math.max(j.lastIndexOf("\r"),j.lastIndexOf(`
606
+ `))+1))}const d="#".repeat(l),f=i.enter("headingAtx"),h=i.enter("phrasing");c.move(d+" ");let g=i.containerPhrasing(e,{before:"# ",after:`
607
+ `,...c.current()});return/^[\t ]/.test(g)&&(g=Zc(g.charCodeAt(0))+g.slice(1)),g=g?d+" "+g:d,i.options.closeAtx&&(g+=" "+d),h(),f(),g}G5.peek=rB;function G5(e){return e.value||""}function rB(){return"<"}Y5.peek=oB;function Y5(e,n,i,r){const l=b1(i),c=l==='"'?"Quote":"Apostrophe",d=i.enter("image");let f=i.enter("label");const h=i.createTracker(r);let g=h.move("![");return g+=h.move(i.safe(e.alt,{before:g,after:"]",...h.current()})),g+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(i.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=i.enter("destinationRaw"),g+=h.move(i.safe(e.url,{before:g,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),g+=h.move(" "+l),g+=h.move(i.safe(e.title,{before:g,after:l,...h.current()})),g+=h.move(l),f()),g+=h.move(")"),d(),g}function oB(){return"!"}K5.peek=sB;function K5(e,n,i,r){const l=e.referenceType,c=i.enter("imageReference");let d=i.enter("label");const f=i.createTracker(r);let h=f.move("![");const g=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),d();const y=i.stack;i.stack=[],d=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return d(),i.stack=y,c(),l==="full"||!g||g!==m?h+=f.move(m+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function sB(){return"!"}X5.peek=lB;function X5(e,n,i){let r=e.value||"",l="`",c=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(r);)l+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<i.unsafe.length;){const d=i.unsafe[c],f=i.compilePattern(d);let h;if(d.atBreak)for(;h=f.exec(r);){let g=h.index;r.charCodeAt(g)===10&&r.charCodeAt(g-1)===13&&g--,r=r.slice(0,g)+" "+r.slice(h.index+1)}}return l+r+l}function lB(){return"`"}function Q5(e,n){const i=d1(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Z5.peek=cB;function Z5(e,n,i,r){const l=b1(i),c=l==='"'?"Quote":"Apostrophe",d=i.createTracker(r);let f,h;if(Q5(e,i)){const y=i.stack;i.stack=[],f=i.enter("autolink");let m=d.move("<");return m+=d.move(i.containerPhrasing(e,{before:m,after:">",...d.current()})),m+=d.move(">"),f(),i.stack=y,m}f=i.enter("link"),h=i.enter("label");let g=d.move("[");return g+=d.move(i.containerPhrasing(e,{before:g,after:"](",...d.current()})),g+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),g+=d.move("<"),g+=d.move(i.safe(e.url,{before:g,after:">",...d.current()})),g+=d.move(">")):(h=i.enter("destinationRaw"),g+=d.move(i.safe(e.url,{before:g,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=i.enter(`title${c}`),g+=d.move(" "+l),g+=d.move(i.safe(e.title,{before:g,after:l,...d.current()})),g+=d.move(l),h()),g+=d.move(")"),f(),g}function cB(e,n,i){return Q5(e,i)?"<":"["}J5.peek=uB;function J5(e,n,i,r){const l=e.referenceType,c=i.enter("linkReference");let d=i.enter("label");const f=i.createTracker(r);let h=f.move("[");const g=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),d();const y=i.stack;i.stack=[],d=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return d(),i.stack=y,c(),l==="full"||!g||g!==m?h+=f.move(m+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function uB(){return"["}function j1(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function dB(e){const n=j1(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function fB(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function W5(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function hB(e,n,i,r){const l=i.enter("list"),c=i.bulletCurrent;let d=e.ordered?fB(i):j1(i);const f=e.ordered?d==="."?")":".":dB(i);let h=n&&i.bulletLastUsed?d===i.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),W5(i)===d&&y){let m=-1;for(;++m<e.children.length;){const j=e.children[m];if(j&&j.type==="listItem"&&j.children&&j.children[0]&&j.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(d=f),i.bulletCurrent=d;const g=i.containerFlow(e,r);return i.bulletLastUsed=d,i.bulletCurrent=c,l(),g}function mB(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function pB(e,n,i,r){const l=mB(i);let c=i.bulletCurrent||j1(i);n&&n.type==="list"&&n.ordered&&(c=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+c);let d=c.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=i.createTracker(r);f.move(c+" ".repeat(d-c.length)),f.shift(d);const h=i.enter("listItem"),g=i.indentLines(i.containerFlow(e,f.current()),y);return h(),g;function y(m,j,b){return j?(b?"":" ".repeat(d))+m:(b?c:c+" ".repeat(d-c.length))+m}}function gB(e,n,i,r){const l=i.enter("paragraph"),c=i.enter("phrasing"),d=i.containerPhrasing(e,r);return c(),l(),d}const vB=eh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yB(e,n,i,r){return(e.children.some(function(d){return vB(d)})?i.containerPhrasing:i.containerFlow).call(i,e,r)}function xB(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}eS.peek=bB;function eS(e,n,i,r){const l=xB(i),c=i.enter("strong"),d=i.createTracker(r),f=d.move(l+l);let h=d.move(i.containerPhrasing(e,{after:l,before:f,...d.current()}));const g=h.charCodeAt(0),y=kf(r.before.charCodeAt(r.before.length-1),g,l);y.inside&&(h=Zc(g)+h.slice(1));const m=h.charCodeAt(h.length-1),j=kf(r.after.charCodeAt(0),m,l);j.inside&&(h=h.slice(0,-1)+Zc(m));const b=d.move(l+l);return c(),i.attentionEncodeSurroundingInfo={after:j.outside,before:y.outside},f+h+b}function bB(e,n,i){return i.options.strong||"*"}function jB(e,n,i,r){return i.safe(e.value,r)}function wB(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function kB(e,n,i){const r=(W5(i)+(i.options.ruleSpaces?" ":"")).repeat(wB(i));return i.options.ruleSpaces?r.slice(0,-1):r}const tS={blockquote:GL,break:sj,code:JL,definition:eB,emphasis:V5,hardBreak:sj,heading:iB,html:G5,image:Y5,imageReference:K5,inlineCode:X5,link:Z5,linkReference:J5,list:hB,listItem:pB,paragraph:gB,root:yB,strong:eS,text:jB,thematicBreak:kB};function SB(){return{enter:{table:CB,tableData:lj,tableHeader:lj,tableRow:EB},exit:{codeText:TB,table:NB,tableData:a0,tableHeader:a0,tableRow:a0}}}function CB(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function NB(e){this.exit(e),this.data.inTable=void 0}function EB(e){this.enter({type:"tableRow",children:[]},e)}function a0(e){this.exit(e)}function lj(e){this.enter({type:"tableCell",children:[]},e)}function TB(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,MB));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function MB(e,n){return n==="|"?n:e}function AB(e){const n=e||{},i=n.tableCellPadding,r=n.tablePipeAlign,l=n.stringLength,c=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
608
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:j,table:d,tableCell:h,tableRow:f}};function d(b,k,S,N){return g(y(b,S,N),b.align)}function f(b,k,S,N){const C=m(b,S,N),M=g([C]);return M.slice(0,M.indexOf(`
609
+ `))}function h(b,k,S,N){const C=S.enter("tableCell"),M=S.enter("phrasing"),E=S.containerPhrasing(b,{...N,before:c,after:c});return M(),C(),E}function g(b,k){return $L(b,{align:k,alignDelimiters:r,padding:i,stringLength:l})}function y(b,k,S){const N=b.children;let C=-1;const M=[],E=k.enter("table");for(;++C<N.length;)M[C]=m(N[C],k,S);return E(),M}function m(b,k,S){const N=b.children;let C=-1;const M=[],E=k.enter("tableRow");for(;++C<N.length;)M[C]=h(N[C],b,k,S);return E(),M}function j(b,k,S){let N=tS.inlineCode(b,k,S);return S.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function _B(){return{exit:{taskListCheckValueChecked:cj,taskListCheckValueUnchecked:cj,paragraph:OB}}}function RB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zB}}}function cj(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function OB(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const r=i.children[0];if(r&&r.type==="text"){const l=n.children;let c=-1,d;for(;++c<l.length;){const f=l[c];if(f.type==="paragraph"){d=f;break}}d===i&&(r.value=r.value.slice(1),r.value.length===0?i.children.shift():i.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,i.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function zB(e,n,i,r){const l=e.children[0],c=typeof e.checked=="boolean"&&l&&l.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=i.createTracker(r);c&&f.move(d);let h=tS.listItem(e,n,i,{...r,...f.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(y){return y+d}}function DB(){return[hL(),zL(),IL(),SB(),_B()]}function LB(e){return{extensions:[mL(),DL(e),qL(),AB(e),RB()]}}const BB={tokenize:UB,partial:!0},nS={tokenize:$B,partial:!0},aS={tokenize:VB,partial:!0},iS={tokenize:GB,partial:!0},IB={tokenize:YB,partial:!0},rS={name:"wwwAutolink",tokenize:HB,previous:sS},oS={name:"protocolAutolink",tokenize:FB,previous:lS},Kr={name:"emailAutolink",tokenize:PB,previous:cS},or={};function qB(){return{text:or}}let gs=48;for(;gs<123;)or[gs]=Kr,gs++,gs===58?gs=65:gs===91&&(gs=97);or[43]=Kr;or[45]=Kr;or[46]=Kr;or[95]=Kr;or[72]=[Kr,oS];or[104]=[Kr,oS];or[87]=[Kr,rS];or[119]=[Kr,rS];function PB(e,n,i){const r=this;let l,c;return d;function d(m){return!ig(m)||!cS.call(r,r.previous)||w1(r.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return ig(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(IB,y,g)(m):m===45||m===95||la(m)?(c=!0,e.consume(m),h):y(m)}function g(m){return e.consume(m),l=!0,h}function y(m){return c&&l&&ka(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function HB(e,n,i){const r=this;return l;function l(d){return d!==87&&d!==119||!sS.call(r,r.previous)||w1(r.events)?i(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(BB,e.attempt(nS,e.attempt(aS,c),i),i)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(d)}}function FB(e,n,i){const r=this;let l="",c=!1;return d;function d(m){return(m===72||m===104)&&lS.call(r,r.previous)&&!w1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(ka(m)&&l.length<5)return l+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const j=l.toLowerCase();if(j==="http"||j==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),c?g:(c=!0,h)):i(m)}function g(m){return m===null||bf(m)||Vt(m)||As(m)||Zf(m)?i(m):e.attempt(nS,e.attempt(aS,y),i)(m)}function y(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function UB(e,n,i){let r=0;return l;function l(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),l):d===46&&r===3?(e.consume(d),c):i(d)}function c(d){return d===null?i(d):n(d)}}function $B(e,n,i){let r,l,c;return d;function d(g){return g===46||g===95?e.check(iS,h,f)(g):g===null||Vt(g)||As(g)||g!==45&&Zf(g)?h(g):(c=!0,e.consume(g),d)}function f(g){return g===95?r=!0:(l=r,r=void 0),e.consume(g),d}function h(g){return l||r||!c?i(g):n(g)}}function VB(e,n){let i=0,r=0;return l;function l(d){return d===40?(i++,e.consume(d),l):d===41&&r<i?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(iS,n,c)(d):d===null||Vt(d)||As(d)?n(d):(e.consume(d),l)}function c(d){return d===41&&r++,e.consume(d),l}}function GB(e,n,i){return r;function r(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),r):f===38?(e.consume(f),c):f===93?(e.consume(f),l):f===60||f===null||Vt(f)||As(f)?n(f):i(f)}function l(f){return f===null||f===40||f===91||Vt(f)||As(f)?n(f):r(f)}function c(f){return ka(f)?d(f):i(f)}function d(f){return f===59?(e.consume(f),r):ka(f)?(e.consume(f),d):i(f)}}function YB(e,n,i){return r;function r(c){return e.consume(c),l}function l(c){return la(c)?i(c):n(c)}}function sS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Vt(e)}function lS(e){return!ka(e)}function cS(e){return!(e===47||ig(e))}function ig(e){return e===43||e===45||e===46||e===95||la(e)}function w1(e){let n=e.length,i=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){i=!0;break}if(r._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const KB={tokenize:nI,partial:!0};function XB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:WB,continuation:{tokenize:eI},exit:tI}},text:{91:{name:"gfmFootnoteCall",tokenize:JB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:QB,resolveTo:ZB}}}}function QB(e,n,i){const r=this;let l=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;l--;){const h=r.events[l][1];if(h.type==="labelImage"){d=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!d||!d._balanced)return i(h);const g=Ci(r.sliceSerialize({start:d.end,end:r.now()}));return g.codePointAt(0)!==94||!c.includes(g.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function ZB(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[i+1],e[i+2],["enter",r,n],e[i+3],e[i+4],["enter",l,n],["exit",l,n],["enter",c,n],["enter",d,n],["exit",d,n],["exit",c,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(i,e.length-i+1,...f),e}function JB(e,n,i){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(m){if(c>999||m===93&&!d||m===null||m===91||Vt(m))return i(m);if(m===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return l.includes(Ci(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return Vt(m)||(d=!0),c++,e.consume(m),m===92?y:g}function y(m){return m===91||m===92||m===93?(e.consume(m),c++,g):g(m)}}function WB(e,n,i){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,f;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):i(k)}function y(k){if(d>999||k===93&&!f||k===null||k===91||Vt(k))return i(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=Ci(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),j}return Vt(k)||(f=!0),d++,e.consume(k),k===92?m:y}function m(k){return k===91||k===92||k===93?(e.consume(k),d++,y):y(k)}function j(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(c)||l.push(c),Mt(e,b,"gfmFootnoteDefinitionWhitespace")):i(k)}function b(k){return n(k)}}function eI(e,n,i){return e.check(su,n,e.attempt(KB,n,i))}function tI(e){e.exit("gfmFootnoteDefinition")}function nI(e,n,i){const r=this;return Mt(e,l,"gfmFootnoteDefinitionIndent",5);function l(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?n(c):i(c)}}function aI(e){let i=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:l};return i==null&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function l(d,f){let h=-1;for(;++h<d.length;)if(d[h][0]==="enter"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._close){let g=h;for(;g--;)if(d[g][0]==="exit"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._open&&d[h][1].end.offset-d[h][1].start.offset===d[g][1].end.offset-d[g][1].start.offset){d[h][1].type="strikethroughSequence",d[g][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[g][1].start),end:Object.assign({},d[h][1].end)},m={type:"strikethroughText",start:Object.assign({},d[g][1].end),end:Object.assign({},d[h][1].start)},j=[["enter",y,f],["enter",d[g][1],f],["exit",d[g][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&Ja(j,j.length,0,Jf(b,d.slice(g+1,h),f)),Ja(j,j.length,0,[["exit",m,f],["enter",d[h][1],f],["exit",d[h][1],f],["exit",y,f]]),Ja(d,g-1,h-g+3,j),h=g+j.length-2;break}}for(h=-1;++h<d.length;)d[h][1].type==="strikethroughSequenceTemporary"&&(d[h][1].type="data");return d}function c(d,f,h){const g=this.previous,y=this.events;let m=0;return j;function j(k){return g===126&&y[y.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const S=Ml(g);if(k===126)return m>1?h(k):(d.consume(k),m++,b);if(m<2&&!i)return h(k);const N=d.exit("strikethroughSequenceTemporary"),C=Ml(k);return N._open=!C||C===2&&!!S,N._close=!S||S===2&&!!C,f(k)}}}class iI{constructor(){this.map=[],this.index=new Map}add(n,i,r){rI(this,n,i,r)}consume(n){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let i=this.map.length;const r=[];for(;i>0;)i-=1,r.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];r.push(n.slice()),n.length=0;let l=r.pop();for(;l;){for(const c of l)n.push(c);l=r.pop()}this.map.length=0,this.index.clear()}}function rI(e,n,i,r){if(i===0&&r.length===0)return;const l=e.index.get(n);if(l){l[1]+=i,l[2].push(...r);return}const c=[n,i,r];e.map.push(c),e.index.set(n,c)}function oI(e,n){let i=!1;const r=[];for(;n<e.length;){const l=e[n];if(i){if(l[0]==="enter")l[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return r}function sI(){return{flow:{null:{name:"table",tokenize:lI,resolveAll:cI}}}}function lI(e,n,i){const r=this;let l=0,c=0,d;return f;function f(z){let q=r.events.length-1;for(;q>-1;){const{type:Y}=r.events[q][1];if(Y==="lineEnding"||Y==="linePrefix")q--;else break}const $=q>-1?r.events[q][1].type:null,Q=$==="tableHead"||$==="tableRow"?R:h;return Q===R&&r.parser.lazy[r.now().line]?i(z):Q(z)}function h(z){return e.enter("tableHead"),e.enter("tableRow"),g(z)}function g(z){return z===124||(d=!0,c+=1),y(z)}function y(z){return z===null?i(z):Qe(z)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),b):i(z):wt(z)?Mt(e,y,"whitespace")(z):(c+=1,d&&(d=!1,l+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||Vt(z)?(e.exit("data"),y(z)):(e.consume(z),z===92?j:m)}function j(z){return z===92||z===124?(e.consume(z),m):m(z)}function b(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?i(z):(e.enter("tableDelimiterRow"),d=!1,wt(z)?Mt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?N(z):z===124?(d=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),S):_(z)}function S(z){return wt(z)?Mt(e,N,"whitespace")(z):N(z)}function N(z){return z===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):z===45?(c+=1,C(z)):z===null||Qe(z)?T(z):_(z)}function C(z){return z===45?(e.enter("tableDelimiterFiller"),M(z)):_(z)}function M(z){return z===45?(e.consume(z),M):z===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(z))}function E(z){return wt(z)?Mt(e,T,"whitespace")(z):T(z)}function T(z){return z===124?k(z):z===null||Qe(z)?!d||l!==c?_(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(z)):_(z)}function _(z){return i(z)}function R(z){return e.enter("tableRow"),O(z)}function O(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),O):z===null||Qe(z)?(e.exit("tableRow"),n(z)):wt(z)?Mt(e,O,"whitespace")(z):(e.enter("data"),I(z))}function I(z){return z===null||z===124||Vt(z)?(e.exit("data"),O(z)):(e.consume(z),z===92?P:I)}function P(z){return z===92||z===124?(e.consume(z),I):I(z)}}function cI(e,n){let i=-1,r=!0,l=0,c=[0,0,0,0],d=[0,0,0,0],f=!1,h=0,g,y,m;const j=new iI;for(;++i<e.length;){const b=e[i],k=b[1];b[0]==="enter"?k.type==="tableHead"?(f=!1,h!==0&&(uj(j,n,h,g,y),y=void 0,h=0),g={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},j.add(i,0,[["enter",g,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,c=[0,0,0,0],d=[0,i+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},j.add(i,0,[["enter",y,n]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],m=qd(j,n,c,l,void 0,m),c=[0,0,0,0]),d[2]=i)):k.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],m=qd(j,n,c,l,void 0,m)),c=d,d=[c[1],i,0,0])):k.type==="tableHead"?(f=!0,h=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=i,c[1]!==0?(d[0]=d[1],m=qd(j,n,c,l,i,m)):d[1]!==0&&(m=qd(j,n,d,l,i,m)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=i)}for(h!==0&&uj(j,n,h,g,y),j.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=oI(n.events,i))}return e}function qd(e,n,i,r,l,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(c.end=Object.assign({},kl(n.events,i[0])),e.add(i[0],0,[["exit",c,n]]));const h=kl(n.events,i[1]);if(c={type:d,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",c,n]]),i[2]!==0){const g=kl(n.events,i[2]),y=kl(n.events,i[3]),m={type:f,start:Object.assign({},g),end:Object.assign({},y)};if(e.add(i[2],0,[["enter",m,n]]),r!==2){const j=n.events[i[2]],b=n.events[i[3]];if(j[1].end=Object.assign({},b[1].end),j[1].type="chunkText",j[1].contentType="text",i[3]>i[2]+1){const k=i[2]+1,S=i[3]-i[2]-1;e.add(k,S,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return l!==void 0&&(c.end=Object.assign({},kl(n.events,l)),e.add(l,0,[["exit",c,n]]),c=void 0),c}function uj(e,n,i,r,l){const c=[],d=kl(n.events,i);l&&(l.end=Object.assign({},d),c.push(["exit",l,n])),r.end=Object.assign({},d),c.push(["exit",r,n]),e.add(i+1,0,c)}function kl(e,n){const i=e[n],r=i[0]==="enter"?"start":"end";return i[1][r]}const uI={name:"tasklistCheck",tokenize:fI};function dI(){return{text:{91:uI}}}function fI(e,n,i){const r=this;return l;function l(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return Vt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),d):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),d):i(h)}function d(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Qe(h)?n(h):wt(h)?e.check({tokenize:hI},n,i)(h):i(h)}}function hI(e,n,i){return Mt(e,r,"whitespace");function r(l){return l===null?i(l):n(l)}}function mI(e){return p5([qB(),XB(),aI(e),sI(),dI()])}const pI={};function gI(e){const n=this,i=e||pI,r=n.data(),l=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);l.push(mI(i)),c.push(DB()),d.push(LB(i))}function Sf(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e,localStorage.setItem("jarvy-theme",e)}const vI={add:Ir,"chat-bubble":Ng,window:E9,close:Rl,"chevron-left":jg,"chevron-right":_s,"chevron-down":_o,gear:gN,"person-add":CN,"arrow-bracket-to-left":aN,"arrow-up":A9,copy:eu,check:Ba,"cloud-download":wg,bell:R9,"bell-slash":_9,image:eN,paperclip:Rf,"smiley-plus":H9,info:Cg,people:NN,pencil:fN,file:G9,"file-video":$9,"file-audio":U9,folder:X9,"layout-sidebar-left":uN,sun:wN,moon:cN,"arrows-expand":P9,"arrows-contract":xN,"arrow-u-up-right":pN,"list-bullets":nN,eye:Sg,"eye-slash":kg,pin:E0,megaphone:iN,trash:hf,search:Rs,quote:mN,fold:K9,unfold:SN,more:N0};function qe({name:e}){const n=vI[e]??Cg;return o.jsx(n,{className:"ui-icon","aria-hidden":"true",focusable:"false"})}function vt({icon:e,label:n,className:i="",...r}){return o.jsx("button",{type:"button",className:`ui-iconbtn ${i}`,"aria-label":n,title:n,...r,children:o.jsx(qe,{name:e})})}function Al({title:e,onClose:n,children:i,className:r=""}){const l=w.useRef(null),c=w.useId();return w.useEffect(()=>{const d=l.current,f=document.activeElement;return d.showModal(),()=>{d.close(),f==null||f.focus({preventScroll:!0})}},[]),Do.createPortal(o.jsxs("dialog",{ref:l,className:`ui-small-dialog ${r}`,"aria-labelledby":c,onCancel:d=>{d.preventDefault(),n()},children:[o.jsx(vt,{icon:"close",label:v("ui.closeNamed",{name:e}),className:"ui-dialog-close",onClick:n}),o.jsxs("div",{className:"ui-dialog-body",children:[o.jsx("h1",{id:c,children:e}),i]})]}),document.body)}async function ql(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select();try{return document.execCommand("copy")}finally{n.remove()}}function yI({children:e}){const n=w.useRef(null),[i,r]=w.useState("idle");w.useEffect(()=>{if(i==="idle")return;const c=setTimeout(()=>r("idle"),1500);return()=>clearTimeout(c)},[i]);const l=async()=>{var c;return r(await ql((((c=n.current)==null?void 0:c.textContent)??"").replace(/\n$/,""))?"copied":"failed")};return o.jsxs("figure",{className:"ui-code-figure",children:[o.jsx("pre",{ref:n,children:e}),o.jsx(vt,{icon:i==="copied"?"check":"copy",label:v(i==="copied"?"ui.copied":i==="failed"?"ui.copyFailed":"ui.copyCode"),onClick:()=>void l()})]})}const xI=[gI,cL,fL,iL],uS=w.createContext({});function bI({href:e,children:n}){var r;const i=w.useContext(uS);return e==="#mention"||e==="#mention-me"?o.jsx("span",{className:"jv-mention","data-me":e==="#mention-me"||void 0,children:n}):i.quote&&(e!=null&&e.startsWith("#quote-"))?i.quote(Number(e.slice(7))):e!=null&&e.startsWith("#ref-")?((r=i.ref)==null?void 0:r.call(i,e.slice(5)))??o.jsx(o.Fragment,{children:n}):o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const jI={a:bI,img:({alt:e})=>o.jsx("span",{children:v("ui.image",{alt:e||v("ui.imageHidden")})}),pre:({children:e})=>o.jsx(yI,{children:e})},Pl=w.memo(function({text:n,renderQuote:i,renderRef:r}){return N4(),o.jsx(uS.Provider,{value:{quote:i,ref:r},children:o.jsx(YD,{remarkPlugins:xI,skipHtml:!0,components:jI,children:n})})}),Or=(e,n)=>{var i;return((i=e.people.find(r=>r.id===n))==null?void 0:i.name)??v("inputs.someone")},Cs=(e,n)=>{var i;return((i=e.chats.find(r=>r.id===n))==null?void 0:i.title)??v("inputs.aChat")},dj={name:"inputs.what.name",description:"inputs.what.description",persona:"inputs.what.persona",model:"inputs.what.model",thinking:"inputs.what.thinking",run:"inputs.what.run",environment:"inputs.what.environment",access:"inputs.what.access"},dS=e=>dj[e]?v(dj[e]):e;function of(e,n){switch(e.kind){case"message":return v("inputs.message",{person:Or(n,e.from),chat:Cs(n,e.chat),text:e.text||v("activity.attachments",{count:e.files.length})});case"task":return v("inputs.task",{name:e.name,text:e.text});case"reaction":return v("inputs.reaction",{person:Or(n,e.by),emoji:e.emoji,text:e.text});case"update":return v(e.what==="summary"?"inputs.summary":"inputs.notice",{person:Or(n,e.by),chat:Cs(n,e.chat),version:e.version});case"change":return v("inputs.change",{person:Or(n,e.by),what:dS(e.what)});case"onboard":return v("inputs.onboard",{person:Or(n,e.by)});case"followed":return v("inputs.followed",{count:e.total});case"instructions":return v("inputs.instructions",{parts:e.parts.join(", ")});case"other":return e.text}}function wI(e){return of(e.first,{chats:e.chat?[e.chat]:[],people:e.person?[e.person]:[]}).replace(/\s+/g," ").trim()}function Pd({at:e}){return e===void 0?null:o.jsx("time",{dateTime:new Date(e).toISOString(),children:i1(e)})}function kI({item:e,names:n}){return e.kind==="message"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsxs("h4",{children:[o.jsx("strong",{children:Or(n,e.from)}),o.jsx("span",{children:Cs(n,e.chat)}),o.jsx(Pd,{at:e.at})]}),e.replyTo&&o.jsxs("blockquote",{className:"jv-input-quote",children:[o.jsx("span",{children:v("inputs.replyTo",{person:Or(n,e.replyTo.from)})}),e.replyTo.text]}),e.text&&o.jsx("div",{className:"jv-input-body",children:o.jsx(Pl,{text:e.text})}),e.files.length>0&&o.jsx("ul",{className:"jv-input-files",children:e.files.map((i,r)=>o.jsxs("li",{children:[o.jsx(Rf,{}),i.name,i.size&&o.jsx("small",{children:i.size})]},r))})]}):e.kind==="task"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsxs("h4",{children:[o.jsx("strong",{children:v("inputs.taskTitle",{name:e.name})}),o.jsx("span",{children:e.schedule}),e.due!==void 0&&o.jsx("span",{children:v("inputs.due",{time:i1(e.due)})})]}),o.jsx("p",{className:"jv-input-text",children:e.text})]}):e.kind==="reaction"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsxs("h4",{children:[o.jsx("strong",{children:v("inputs.reacted",{person:Or(n,e.by),emoji:e.emoji})}),o.jsx("span",{children:Cs(n,e.chat)}),o.jsx(Pd,{at:e.at})]}),o.jsx("blockquote",{className:"jv-input-quote",children:e.text})]}):e.kind==="change"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsxs("h4",{children:[o.jsx("strong",{children:v("inputs.change",{person:Or(n,e.by),what:dS(e.what)})}),o.jsx(Pd,{at:e.at})]}),e.value!==null&&o.jsx("p",{className:"jv-input-text",children:e.value})]}):e.kind==="followed"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsx("h4",{children:o.jsx("strong",{children:of(e,n)})}),o.jsx("ul",{className:"jv-input-threads",children:e.threads.map(i=>o.jsxs("li",{children:[o.jsx("span",{children:Cs(n,i.chat)}),i.unread>0&&o.jsx("small",{children:v("inputs.unreadThreads",{count:i.unread})})]},i.chat))})]}):e.kind==="instructions"||e.kind==="other"?o.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[o.jsx("h4",{children:o.jsx("strong",{children:e.kind==="other"?`<${e.name}>`:of(e,n)})}),o.jsx("pre",{className:"jv-input-code",children:e.text})]}):o.jsx("section",{className:"jv-input-item","data-kind":e.kind,children:o.jsxs("h4",{children:[o.jsx("strong",{children:of(e,n)}),o.jsx(Pd,{at:e.at})]})})}function SI({input:e}){const{unread:n,unreadNotes:i,place:r}=e;return o.jsxs("div",{className:"jv-input",children:[e.items.map((l,c)=>o.jsx(kI,{item:l,names:e},c)),(n||i||r)&&o.jsxs("footer",{className:"jv-input-tail",children:[n&&o.jsx("p",{children:v("inputs.unread",{count:n.total,list:n.chats.map(l=>`${l.title??Cs(e,l.id)} ${l.count}`).join(" · ")})}),i&&o.jsx("p",{children:v("inputs.unreadNotes",{list:i.map(l=>v("inputs.version",{title:l.title??Cs(e,l.id),version:l.version})).join(" · ")})}),r&&o.jsx("p",{children:v("inputs.place",{name:r.kind==="sandbox"?v("inputs.sandbox"):r.name,directory:r.directory})}),(r==null?void 0:r.unavailable)&&o.jsx("p",{className:"jv-input-problem",children:v("inputs.unavailable")})]})]})}const k1=e=>ca(e,{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function js({value:e}){return o.jsx("pre",{className:"jv-history-json",children:JSON.stringify(e,null,2)})}function fS({blocks:e,links:n,onSelect:i}){return o.jsx(o.Fragment,{children:e.map((r,l)=>{if(r.type==="text"||r.type==="reasoning")return o.jsxs("section",{className:"jv-history-block",children:[o.jsx("h4",{children:v(r.type==="reasoning"?"history.reasoning":"history.text")}),o.jsx(CI,{text:r.text})]},l);if(r.type==="image")return o.jsxs("section",{className:"jv-history-block",children:[o.jsxs("h4",{children:[v("files.kindImage")," · ",r.mime_type]}),o.jsx("img",{className:"jv-history-image",src:`data:${r.mime_type};base64,${r.data}`,alt:v("history.image")})]},l);if(r.type==="tool_call"||r.type==="tool_result"){const c=n.filter(d=>d.tool_call_id===r.tool_call_id);return o.jsxs("section",{className:"jv-history-block",children:[o.jsxs("h4",{children:[v(r.type==="tool_call"?"history.toolCall":"history.toolResult")," · ",o.jsx("strong",{children:r.name}),r.type==="tool_result"&&r.is_error&&o.jsx("span",{className:"jv-history-error-tag",children:v("history.error")})]}),o.jsxs("div",{className:"jv-history-call",children:[o.jsx("code",{children:r.tool_call_id}),c.map(d=>o.jsxs("button",{type:"button",onClick:()=>i(d.id),"aria-label":v("history.related",{id:d.id}),children:[v(d.role==="tool"?"history.result":"history.call")," #",d.id]},d.id))]}),r.type==="tool_call"?o.jsx(js,{value:r.arguments}):o.jsxs(o.Fragment,{children:[o.jsx(fS,{blocks:r.result.content,links:[],onSelect:i}),r.result.details!==void 0&&o.jsxs("details",{children:[o.jsx("summary",{children:v("history.details")}),o.jsx(js,{value:r.result.details})]})]})]},l)}})})}function CI({text:e}){const n=T_(e);return n?o.jsx("div",{className:"jv-history-text jv-history-markup",children:n.map((i,r)=>o.jsx("div",{style:{paddingLeft:`${i.depth*2}ch`},children:i.text||" "},r))}):o.jsx("pre",{className:"jv-history-text",children:e||v("history.empty")})}const NI={content:"history.content",raw:"inputs.raw",json:"history.json"};function EI({detail:e,onSelect:n}){const[i,r]=w.useState("content"),{record:l,links:c,input:d}=e,f=d?["content","raw","json"]:["content","json"];return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-history-detail-head",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["#",l.id," ",o.jsx("span",{children:l.role})]}),o.jsx("p",{children:k1(l.timestamp)})]}),o.jsx("div",{role:"tablist","aria-label":v("history.view"),children:f.map(h=>o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":i===h,onClick:()=>r(h),children:v(NI[h])},h))})]}),o.jsx("div",{className:"jv-history-detail-scroll",role:"tabpanel","aria-label":v(i==="json"?"history.json":i==="raw"?"inputs.raw":"history.contentLabel"),children:i==="json"?o.jsx(js,{value:l}):d&&i==="content"?o.jsx(SI,{input:d}):o.jsxs(o.Fragment,{children:[l.model&&o.jsxs("div",{className:"jv-history-model",children:[o.jsx("span",{children:v("usage.model")}),o.jsx("strong",{children:l.model.id}),o.jsx("small",{children:l.model.provider})]}),o.jsx(fS,{blocks:l.message.content,links:c,onSelect:n}),l.message.tools&&o.jsxs("details",{className:"jv-history-fold",children:[o.jsxs("summary",{children:[v("history.tools")," · ",l.message.tools.length]}),o.jsx(js,{value:l.message.tools})]}),l.message.tools_removed!==void 0&&o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:v("history.toolsRemoved")}),o.jsx(js,{value:l.message.tools_removed})]}),l.message.stop_reason&&o.jsxs("p",{className:"jv-history-note",children:[v("history.stopReason")," · ",l.message.stop_reason]}),l.message.error&&o.jsx("pre",{className:"jv-history-failure",children:l.message.error}),o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:"Usage"}),o.jsx(js,{value:l.usage})]}),o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:"Extra"}),o.jsx(js,{value:l.extra})]})]})})]})}const fj={system:"activity.roleSystem",user:"activity.roleUser",assistant:"activity.roleAssistant",tool:"history.toolResult"},TI=new Set(["user","system"]),hj=e=>ca(e,{year:"numeric",month:"long",day:"numeric"}),MI=e=>[e.preview,...e.tools.map(n=>v(n.kind==="call"?"activity.toolCall":n.error?"activity.toolFailed":"activity.toolResult",{name:n.name})),e.images?v("activity.images",{count:e.images}):""].filter(Boolean).join(" "),AI=e=>ca(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function _I({items:e,onSelect:n}){return o.jsx("ol",{className:"jv-activity-timeline","aria-label":v("activity.timeline"),children:e.map((i,r)=>{const{record:l}=i,c=hj(l.timestamp);return o.jsxs(w.Fragment,{children:[(r===0||hj(e[r-1].record.timestamp)!==c)&&o.jsx("li",{className:"jv-activity-day",children:o.jsx("span",{children:c})}),o.jsxs("li",{className:`jv-activity-row is-${i.kind}`,"data-kind":i.kind,children:[o.jsxs("div",{className:"jv-activity-time",children:[o.jsx("time",{dateTime:new Date(l.timestamp).toISOString(),title:`${k1(l.timestamp)}.${String(l.timestamp%1e3).padStart(3,"0")}`,children:AI(l.timestamp)}),o.jsx("span",{className:"jv-activity-dot"})]}),i.kind==="chat"?o.jsxs("article",{className:"jv-activity-card jv-activity-chat","aria-label":v("activity.chatMessage",{id:i.record.id}),children:[o.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>n({kind:"chat",id:i.record.id}),"aria-label":v("activity.viewMessage",{sequence:i.record.sequence,chat:i.record.chatTitle}),children:[o.jsxs("span",{className:"jv-activity-card-head",children:[o.jsx(oN,{}),o.jsx("strong",{title:i.record.chatTitle,children:i.record.chatTitle}),o.jsxs("span",{children:["#",i.record.sequence]})]}),o.jsx("span",{className:"jv-activity-preview",children:i.record.preview||v("activity.attachmentOnly")}),i.record.attachmentCount>0&&o.jsxs("span",{className:"jv-activity-attachment",children:[o.jsx(Rf,{}),v("activity.attachments",{count:i.record.attachmentCount})]})]}),i.record.source&&o.jsxs("button",{type:"button",className:"jv-activity-source",onClick:()=>n({kind:"history",id:i.record.source.historyId}),"aria-label":v("activity.viewSentBy",{id:i.record.source.historyId}),children:[v("activity.sentBy",{id:i.record.source.historyId}),o.jsx(Uc,{})]})]}):o.jsx("article",{className:"jv-activity-card jv-activity-history","data-input":TI.has(i.record.role)||void 0,"aria-label":v("activity.historyRecord",{id:i.record.id}),children:o.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>n({kind:"history",id:i.record.id}),"aria-label":v("activity.viewHistory",{id:i.record.id,role:i.record.role}),children:[o.jsxs("span",{className:"jv-activity-card-head",children:[o.jsx("strong",{children:fj[i.record.role]?v(fj[i.record.role]):i.record.role}),i.record.input&&i.record.input.count>1&&o.jsx("em",{className:"jv-activity-more",children:v("inputs.more",{count:i.record.input.count})}),o.jsxs("span",{children:["#",i.record.id]})]}),o.jsx("span",{className:"jv-activity-preview",children:(i.record.input?wI(i.record.input):MI(i.record))||v("activity.emptyMessage")})]})})]})]},`${i.kind}:${l.id}`)})})}const RI={read:(e,n)=>Se(`/bots/${e}/history/${n}`)},mj={agent_undeletable:"error.agentUndeletable",autoconfig_model:"error.autoconfigModel",autoconfig_source:"error.autoconfigSource",bot_missing:"error.botMissing",chat_access_changed:"error.chatAccessChanged",computer_failed:"error.computerFailed",computer_missing:"error.computerMissing",docker_unavailable:"error.dockerUnavailable",file_too_large:"error.fileTooLarge",connection_in_use:"error.connectionInUse",connection_missing:"error.connectionMissing",credential_changed:"error.credentialChanged",credential_unreadable:"error.credentialUnreadable",credential_scope:"error.credentialScope",credentials_missing:"error.credentialsMissing",data_locked:"error.dataLocked",discovery_format:"error.discoveryFormat",discovery_http:"error.discoveryHttp",discovery_key:"error.discoveryKey",discovery_protocol:"error.discoveryProtocol",discovery_url:"error.discoveryUrl",discovery_url_missing:"error.discoveryUrlMissing",discovery_unreachable:"error.discoveryUnreachable",machine_missing:"error.machineMissing",machine_name_taken:"error.machineNameTaken",ssh_auth_failed:"error.sshAuthFailed",ssh_bad_directory:"error.sshBadDirectory",ssh_bad_host:"error.sshBadHost",ssh_bad_port:"error.sshBadPort",ssh_bad_user:"error.sshBadUser",ssh_failed:"error.sshFailed",ssh_host_key_changed:"error.sshHostKeyChanged",ssh_key_unreadable:"error.sshKeyUnreadable",ssh_password_missing:"error.sshPasswordMissing",ssh_unreachable:"error.sshUnreachable",ssh_unsupported:"error.sshUnsupported",ssh_password_refused:"error.sshPasswordRefused",ssh_key_refused:"error.sshKeyRefused",ssh_key_expired:"error.sshKeyExpired",history_missing:"error.historyMissing",invalid_credential:"error.invalidCredential",invalid_run:"error.invalidRun",limits_invalid:"error.limitsInvalid",login_input:"error.loginInput",login_option:"error.loginOption",login_step:"error.loginStep",message_missing:"error.messageMissing",model_incomplete:"error.modelIncomplete",model_missing:"error.modelMissing",model_request_failed:"error.modelRequestFailed",model_required:"error.modelRequired",model_switch_uncertain:"error.modelSwitchUncertain",name_taken:"error.nameTaken",provider_name_taken:"error.providerNameTaken",reset_custom:"error.resetCustom",port_invalid:"error.portInvalid",port_missing:"error.portMissing",port_range_invalid:"error.portRangeInvalid",port_range_own:"error.portRangeOwn",ports_exhausted:"error.portsExhausted",question_closed:"error.questionClosed",question_expired:"error.questionExpired",secret_description_invalid:"error.secretDescriptionInvalid",secret_missing:"error.secretMissing",secret_name_invalid:"error.secretNameInvalid",secret_name_taken:"error.secretNameTaken",secret_value_missing:"error.secretValueMissing",secret_value_too_long:"error.secretValueTooLong",runtime_failed:"error.runtimeFailed",session_corrupt:"error.sessionCorrupt",session_mismatch:"error.sessionMismatch",session_missing:"error.sessionMissing",session_path:"error.sessionPath",stopping:"error.stopping",task_invalid:"error.taskInvalid",task_schedule_invalid:"error.taskScheduleInvalid",task_time_past:"error.taskTimePast",thinking_format:"error.thinkingFormat",tools_missing:"error.toolsMissing",unsafe_replay:"error.unsafeReplay",type_invalid:"error.typeInvalid",vm_size_invalid:"error.vmSizeInvalid",vm_unavailable:"error.vmUnavailable"},hS=(e,n)=>{const i=e&&Object.hasOwn(mj,e)?mj[e]:void 0;return i?v(i,n):null};function Gt(e,n="common.failed"){return e instanceof er?hS(e.code,e.params)??(e.status<500?e.message:v(n)):e instanceof Error&&e.message?e.message:v(n)}const mS=e=>hS(e.errorCode,e.errorParams)??e.error??"";function OI({botId:e,selected:n,onSelect:i,onOpenChat:r}){const[l,c]=w.useState(null),[d,f]=w.useState(!0),[h,g]=w.useState(""),[y,m]=w.useState(0);if(w.useEffect(()=>{let k=!0;return f(!0),g(""),c(null),(n.kind==="history"?RI.read(e,n.id).then(N=>({kind:"history",data:N})):g3.message(e,n.id).then(N=>({kind:"chat",data:N}))).then(N=>{k&&c(N)}).catch(N=>{k&&g(Gt(N,"activity.detailFailed"))}).finally(()=>{k&&f(!1)}),()=>{k=!1}},[e,n.kind,n.id,y]),d)return o.jsx("p",{className:"jv-activity-state",role:"status",children:v("activity.detailLoading")});if(h)return o.jsxs("div",{className:"jv-activity-state",children:[o.jsx("p",{role:"alert",children:h}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>m(k=>k+1),children:v("common.retry")})]});if(!l)return null;if(l.kind==="history")return o.jsx(EI,{detail:l.data,onSelect:k=>i({kind:"history",id:k})},l.data.record.id);const{chat:j,message:b}=l.data;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-activity-message-head",children:[o.jsxs("div",{children:[o.jsx("h3",{children:j.title}),o.jsx("p",{children:k1(b.createdAt)})]}),o.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>r(j.id),children:[v("activity.openChat"),o.jsx(Uc,{})]})]}),o.jsxs("div",{className:"jv-activity-message-body",children:[b.content&&o.jsx(Pl,{text:b.content}),b.attachments.length>0&&o.jsx("div",{className:"jv-activity-message-files",children:b.attachments.map(k=>o.jsxs("a",{href:`/api/attachments/${k.id}`,download:k.name,children:[o.jsx(Rf,{}),k.name]},k.id))}),b.source&&o.jsxs(Ne,{className:"jv-activity-message-source",variant:"outline",size:"sm",onClick:()=>i({kind:"history",id:b.source.historyId}),children:[v("activity.sentBy",{id:b.source.historyId}),o.jsx(Uc,{})]})]})]})}function zI({botId:e,onOpenChat:n}){const[i,r]=w.useState([void 0]),l=i.at(-1),[c,d]=w.useState({items:[],nextBefore:null}),[f,h]=w.useState(!0),[g,y]=w.useState(""),[m,j]=w.useState(0),[b,k]=w.useState(null),S=w.useRef(null),N=w.useRef(0),C=w.useRef(null);w.useEffect(()=>{let T=!0;return h(!0),y(""),d({items:[],nextBefore:null}),S.current&&(S.current.scrollTop=0),g3.list(e,l).then(_=>{T&&d(_)}).catch(_=>{T&&y(Gt(_,"activity.loadFailed"))}).finally(()=>{T&&h(!1)}),()=>{T=!1}},[e,l,m]);const M=T=>{var _;b||(N.current=((_=S.current)==null?void 0:_.scrollTop)??0,C.current=document.activeElement),k(T)},E=()=>{k(null),requestAnimationFrame(()=>{var T;S.current&&(S.current.scrollTop=N.current),(T=C.current)==null||T.focus({preventScroll:!0})})};return o.jsxs("div",{className:"jv-activity",children:[o.jsxs("div",{className:"jv-activity-list",hidden:b!==null,children:[o.jsxs("div",{className:"jv-activity-toolbar",children:[o.jsx("span",{children:v("activity.newestFirst")}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f,onClick:()=>{r([void 0]),j(T=>T+1)},"aria-label":v("activity.refresh"),children:[o.jsx(Of,{}),v(f?"activity.reading":"usage.refresh")]})]}),o.jsxs("div",{className:"jv-activity-columns","aria-hidden":"true",children:[o.jsx("span",{children:v("activity.columnChat")}),o.jsx("span",{children:v("activity.columnTime")}),o.jsx("span",{children:"History"})]}),o.jsx("div",{className:"jv-activity-scroll",ref:S,children:f?o.jsx("p",{className:"jv-activity-state",role:"status",children:v("activity.loading")}):g?o.jsxs("div",{className:"jv-activity-state",children:[o.jsx("p",{role:"alert",children:g}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>j(T=>T+1),children:v("common.retry")})]}):c.items.length?o.jsx(_I,{items:c.items,onSelect:M}):o.jsx("div",{className:"jv-activity-state jv-activity-empty",children:o.jsx("p",{children:v("activity.empty")})})}),o.jsxs("div",{className:"jv-activity-pagination",children:[o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f||i.length===1,onClick:()=>r(T=>T.slice(0,-1)),children:[o.jsx(jg,{}),v("activity.newer")]}),o.jsx("span",{children:v("activity.page",{page:i.length})}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f||c.nextBefore===null,onClick:()=>r(T=>[...T,c.nextBefore]),children:[v("activity.older"),o.jsx(_s,{})]})]})]}),b&&o.jsxs("section",{className:"jv-activity-detail","aria-label":v(b.kind==="history"?"activity.historyDetail":"activity.chatDetail"),children:[o.jsx("div",{className:"jv-activity-toolbar",children:o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",onClick:E,children:[o.jsx(bg,{}),v("activity.backToTimeline")]})}),o.jsx(OI,{botId:e,selected:b,onSelect:M,onOpenChat:n})]})]})}const pS={list:(e,n)=>Se(`/bots/${e}/usage?since=${n}`),overview:e=>Se(`/usage?since=${e}`)},DI=["today","7d","30d","all"],LI=e=>e==="today"?v("usage.today"):e==="all"?v("usage.all"):v("usage.days",{count:e==="7d"?7:30}),Hd=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"],["cacheRead","usage.cacheRead"],["cacheWrite","usage.cacheWrite"]];function BI(e){if(e==="all")return 0;const n=new Date;return n.setHours(0,0,0,0),n.setDate(n.getDate()-(e==="7d"?6:e==="30d"?29:0)),n.getTime()}const rg=e=>La(e,e<1e4?void 0:{notation:"compact",maximumFractionDigits:1}),II=e=>e>0&&e<.01?"< $0.01":`$${e.toFixed(2)}`,og=e=>o.jsx("td",{"data-label":v("usage.cost"),className:e===null?"jv-usage-unpriced":void 0,title:e===null?void 0:`$${e.toFixed(4)}`,children:e===null?v("usage.unpriced"):II(e)});function gS(e,n){const[i,r]=w.useState("today"),[l,c]=w.useState(null),[d,f]=w.useState(""),[h,g]=w.useState(0);return w.useEffect(()=>{let y=!0;return c(null),f(""),e(BI(i)).then(m=>{y&&c(m)}).catch(m=>{y&&f(Gt(m,"usage.loadFailed"))}),()=>{y=!1}},[n,i,h]),{range:i,setRange:r,data:l,error:d,reload:()=>g(y=>y+1)}}function vS({range:e,setRange:n,busy:i,reload:r}){return o.jsxs("div",{className:"jv-usage-toolbar",children:[o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":v("usage.range"),children:DI.map(l=>o.jsx("button",{type:"button",role:"tab","aria-selected":e===l,onClick:()=>n(l),children:LI(l)},l))}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:r,"aria-label":v("usage.refreshLabel"),children:[o.jsx(Of,{}),v("usage.refresh")]})]})}function yS({loading:e,error:n,empty:i,reload:r}){return n?o.jsxs("div",{className:"jv-usage-state",children:[o.jsx("p",{role:"alert",children:n}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:v("usage.retry")})]}):e?o.jsx("p",{className:"jv-usage-state",role:"status",children:v("usage.loading")}):i?o.jsx("div",{className:"jv-usage-state jv-usage-empty",children:o.jsx("p",{children:v("usage.empty")})}):null}function xS({models:e,note:n=!0}){const i=e.filter(l=>l.cost!==null),r=Object.fromEntries(Hd.map(([l])=>[l,e.reduce((c,d)=>c+d[l],0)]));return o.jsxs(o.Fragment,{children:[o.jsxs("table",{className:"jv-usage-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:v("usage.model")}),Hd.map(([l,c])=>o.jsx("th",{scope:"col",children:v(c)},l)),o.jsx("th",{scope:"col",children:v("usage.cost")})]})}),o.jsx("tbody",{children:e.map(l=>o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsxs("span",{className:"jv-usage-model",children:[o.jsx("strong",{children:l.model}),o.jsx("span",{children:l.provider})]})}),Hd.map(([c,d])=>o.jsx("td",{"data-label":v(d),title:La(l[c]),children:rg(l[c])},c)),og(l.cost)]},`${l.provider}/${l.model}`))}),e.length>1&&o.jsx("tfoot",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsx("strong",{children:v("usage.total")})}),Hd.map(([l,c])=>o.jsx("td",{"data-label":v(c),title:La(r[l]),children:rg(r[l])},l)),og(i.length?i.reduce((l,c)=>l+c.cost,0):null)]})})]}),n&&i.length>0&&i.length<e.length&&o.jsx("p",{className:"jv-usage-note",children:v("usage.notePartial")})]})}function qI({botId:e}){const{range:n,setRange:i,data:r,error:l,reload:c}=gS(d=>pS.list(e,d).then(f=>f.models),e);return o.jsxs("div",{className:"jv-usage",children:[o.jsx(vS,{range:n,setRange:i,busy:!r&&!l,reload:c}),o.jsxs("div",{className:"jv-usage-scroll",children:[o.jsx(yS,{loading:!r,error:l,empty:!(r!=null&&r.length),reload:c}),r&&r.length>0&&!l&&o.jsx(xS,{models:r})]})]})}const Ni={gray:{hex:9146265,label:"color.gray"},blue:{hex:2000636,label:"color.blue"},green:{hex:3129195,label:"color.green"},amber:{hex:16093970,label:"color.amber"},rose:{hex:15881087,label:"color.rose"},violet:{hex:9067766,label:"color.violet"}},bS=e=>{var n;return`#${(((n=Ni[e])==null?void 0:n.hex)??Ni.gray.hex).toString(16).padStart(6,"0")}`},PI={open:1,happy:0,eyeScale:1,kind:0,lid:0,lidTilt:0,smile:0,blush:0,mouth:0,mouthOpen:1,earL:.22,earR:.22,tilt:0,lift:0,squash:1,yaw:0,look:[0,0],spin:0},HI={body:.85,waist:.1,ears:1,earSize:1.1,earX:.3,earY:.26,earW:.16,earH:.32,earBlend:.03,earThick:.06,eyeGap:.205,eyeSize:1.22},pj={lit:.55,rim:.5},FI="attribute vec2 p; void main(){ gl_Position = vec4(p, 0., 1.); }",UI=`
610
+ precision highp float;
611
+ uniform vec2 uRes, uLook;
612
+ uniform vec3 uColor, uInk;
613
+ uniform float uSquash, uEarL, uEarR, uOpen, uHappy, uTilt, uLift, uZoom, uShadow, uYaw, uSpin;
614
+ uniform float uEars, uEarSize, uBody, uEyeGap, uEyeSize, uWaist, uEarX, uEarY, uEarW, uEarH, uEarBlend;
615
+ uniform float uKind, uEyeScale, uLid, uLidTilt, uSmile, uBlush, uMouth, uMouthOpen, uEarThick;
616
+ uniform float uLit, uRim;
617
+
618
+ float smin(float a, float b, float k){ float h = max(k - abs(a - b), 0.) / k; return min(a, b) - h * h * k * .25; }
619
+ float sdEllipsoid(vec3 p, vec3 r){ float k0 = length(p / r), k1 = length(p / (r * r)); return k0 * (k0 - 1.) / k1; }
620
+ float sdTri(vec2 p, vec2 q){
621
+ p.x = abs(p.x);
622
+ vec2 a = p - q * clamp(dot(p, q) / dot(q, q), 0., 1.);
623
+ vec2 b = p - q * vec2(clamp(p.x / q.x, 0., 1.), 1.);
624
+ float s = -sign(q.y);
625
+ vec2 d = min(vec2(dot(a, a), s * (p.x * q.y - p.y * q.x)), vec2(dot(b, b), s * (p.y - q.y)));
626
+ return -sqrt(d.x) * sign(d.y);
627
+ }
628
+ float sdPill(vec2 q, float a, float r){ return length(vec2(q.x, q.y - clamp(q.y, -a, a))) - r; }
629
+ float sdSeg(vec2 p, vec2 a, vec2 b){ vec2 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / dot(ba, ba), 0., 1.); return length(pa - ba * h); }
630
+ float sdStar5(vec2 p, float r, float rf){
631
+ const vec2 k1 = vec2(.809016994375, -.587785252292);
632
+ const vec2 k2 = vec2(-k1.x, k1.y);
633
+ p.x = abs(p.x);
634
+ p -= 2. * max(dot(k1, p), 0.) * k1; p -= 2. * max(dot(k2, p), 0.) * k2;
635
+ p.x = abs(p.x); p.y -= r;
636
+ vec2 ba = rf * vec2(-k1.y, k1.x) - vec2(0., 1.);
637
+ float h = clamp(dot(p, ba) / dot(ba, ba), 0., r);
638
+ return length(p - ba * h) * sign(p.y * ba.x - p.x * ba.y);
639
+ }
640
+ mat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
641
+ float fill(float d){ return 1. - smoothstep(-.0035, .0035, d); }
642
+
643
+ // An ear: a fin standing on the head, thick down the middle and thin at both edges, thinner toward the tip — so from the
644
+ // side it is a pointed rhombus, not a slab. Melted in at the base, so it grows out of the ball instead of sitting on it.
645
+ float sdEar(vec3 q, float ang){
646
+ q.xy = rot(ang) * q.xy;
647
+ float h = uEarH * uEarSize, w = uEarW * uEarSize, round_ = .030 * uEarSize;
648
+ float d2 = sdTri(q.xy - vec2(0., h), vec2(w, -h));
649
+ float up = clamp((q.y + h * .05) / (h * 1.45), 0., 1.), across = clamp(abs(q.x) / w, 0., 1.);
650
+ float half_ = uEarThick * uEarSize * (1. - .45 * up) * (1. - .55 * across * across);
651
+ vec2 e = vec2(d2, abs(q.z) - half_);
652
+ return min(max(e.x, e.y), 0.) + length(max(e, 0.)) - round_;
653
+ }
654
+
655
+ // Down to body space: lifted, tilted about the bottom edge, then squashed at a constant volume, so a squat ball widens.
656
+ vec3 toBody(vec3 p){
657
+ p.y -= uLift;
658
+ p.xz = rot(uYaw + uSpin) * p.xz;
659
+ float floorY = -.58 * uBody;
660
+ p.y -= floorY; p.xy = rot(uTilt) * p.xy; p.y += floorY;
661
+ float widen = 1. / sqrt(max(uSquash, .55));
662
+ p.x *= widen; p.z *= widen; p.y = (p.y - floorY) * uSquash + floorY;
663
+ return p;
664
+ }
665
+ float map(vec3 p){
666
+ vec3 b = toBody(p);
667
+ vec3 bp = b;
668
+ bp.x /= (1. + uWaist * clamp(-b.y, 0., 1.));
669
+ float d = sdEllipsoid(bp, vec3(.58, .58 * uBody, .55));
670
+ if (uEars > .5){
671
+ float el = sdEar(bp - vec3(-uEarX, uEarY, -.01), uEarL);
672
+ float er = sdEar(bp - vec3(uEarX, uEarY, -.01), -uEarR);
673
+ d = smin(d, min(el, er), uEarBlend);
674
+ }
675
+ return d;
676
+ }
677
+ vec3 normal(vec3 p){ vec2 e = vec2(.0015, 0.); return normalize(vec3(map(p + e.xyy) - map(p - e.xyy), map(p + e.yxy) - map(p - e.yxy), map(p + e.yyx) - map(p - e.yyx))); }
678
+ float ao(vec3 p, vec3 n){ float o = 0., s = 1.; for (int i = 1; i <= 5; i++){ float h = .02 + .05 * float(i); o += (h - map(p + n * h)) * s; s *= .7; } return clamp(1. - 1.5 * o, 0., 1.); }
679
+
680
+ // One eye. 0 pill (with lids, or a smile arc), 1 squeezed chevron, 2 star, 3 spiral, 4 closed in content.
681
+ float eye(vec2 q, float side){
682
+ q /= uEyeScale;
683
+ float open = max(uOpen, .10), H = .105 * open, d;
684
+ if (uKind < .5){
685
+ float dPill = sdPill(vec2(q.x, q.y / open), .055, .05) * min(open, 1.);
686
+ // Lids: the top cut slants (inner corner low = cross, high = worried); the bottom cut is a curve (a smiling eye).
687
+ dPill = max(dPill, q.y - (H - 2. * H * uLid + uLidTilt * side * q.x));
688
+ vec2 c = vec2(0., -H - .10 + uSmile * .14);
689
+ dPill = max(dPill, -(length(q - c) - .10));
690
+ vec2 qa = q - vec2(0., -.04);
691
+ float dArc = max(abs(length(qa) - .062 * uEyeSize) - .019, -qa.y + .004);
692
+ d = mix(dPill * uEyeSize, dArc, uHappy);
693
+ } else if (uKind < 1.5){
694
+ vec2 tip = vec2(-side * .045, 0.);
695
+ d = min(sdSeg(q, tip, vec2(side * .04, .062)), sdSeg(q, tip, vec2(side * .04, -.062))) - .02;
696
+ } else if (uKind < 2.5){
697
+ d = sdStar5(q * rot(side * .12), .092, .48) - .012;
698
+ } else if (uKind < 3.5){
699
+ float r = length(q), a = atan(q.y, q.x) * side, k = .036;
700
+ d = max(abs(fract(r / k - a / 6.2831853) - .5) * k - .0095, r - .088);
701
+ } else {
702
+ vec2 qa = q - vec2(0., .035);
703
+ d = max(abs(length(qa) - .062 * uEyeSize) - .019, qa.y + .004);
704
+ }
705
+ return d * uEyeScale;
706
+ }
707
+
708
+ // Every mouth is a white line, the same pen as the eyes: no filled cavity, no tongue.
709
+ // 1 cat ω, 2 a smile, 3 an O (a yawn), 4 a short line, 5 wavy (a wry face), 6 a frown
710
+ float mouth(vec2 q){
711
+ if (uMouth < .5) return 0.;
712
+ float w = .0145, d = 1.;
713
+ if (uMouth < 1.5){
714
+ float r = .034;
715
+ float a = max(abs(length(q - vec2(-r, .012)) - r) - w, q.y - .012);
716
+ float b = max(abs(length(q - vec2(r, .012)) - r) - w, q.y - .012);
717
+ d = min(a, b);
718
+ } else if (uMouth < 2.5){
719
+ vec2 c = vec2(0., .048 * uMouthOpen);
720
+ float R = .062 * uMouthOpen;
721
+ d = max(abs(length(q - c) - R) - w, max(q.y - c.y + .004, abs(q.x) - R * .92));
722
+ } else if (uMouth < 3.5){
723
+ d = abs(length(q / vec2(.060, .080 * uMouthOpen)) - 1.) * .060 - .018;
724
+ } else if (uMouth < 4.5){
725
+ d = sdSeg(q, vec2(-.032, 0.), vec2(.032, 0.)) - w;
726
+ } else if (uMouth < 5.5){
727
+ d = max(abs(q.y - .011 * sin(q.x * 95.)) - .0125, abs(q.x) - .05);
728
+ } else {
729
+ d = max(abs(length(q - vec2(0., -.05)) - .05) - w, -(q.y + .022));
730
+ }
731
+ return fill(d);
732
+ }
733
+
734
+ // The face is painted on the ball's surface, so it sits on the curve rather than floating in front of it.
735
+ vec3 paintFace(vec3 b, vec3 base){
736
+ if (b.z < 0.) return base;
737
+ float ink = 0., blush = 0.;
738
+ for (int i = 0; i < 2; i++){
739
+ float side = i == 0 ? -1. : 1.;
740
+ vec2 q = b.xy - (vec2(side * uEyeGap, .01) + uLook);
741
+ ink = max(ink, fill(eye(q, side)));
742
+ vec2 qb = (b.xy - vec2(side * (uEyeGap + .092), .01 - .142) - uLook * .4) / vec2(.080, .050);
743
+ blush = max(blush, 1. - smoothstep(.75, 1.02, length(qb)));
744
+ }
745
+ base = mix(base, mix(uColor, vec3(1., .56, .72), .86), blush * uBlush);
746
+ base = mix(base, uInk, max(ink, mouth(b.xy - vec2(uLook.x * .7, .01 - .215 + uLook.y * .5))));
747
+ return base;
748
+ }
749
+
750
+ void main(){
751
+ vec2 uv = (gl_FragCoord.xy - .5 * uRes) / uRes.y;
752
+ vec3 ro = vec3(0., .30, 3.4), ta = vec3(0., -.02, 0.);
753
+ vec3 ww = normalize(ta - ro), uu = normalize(cross(ww, vec3(0., 1., 0.))), vv = cross(uu, ww);
754
+ vec3 rd = normalize(uv.x * uu + uv.y * vv + 2.45 * uZoom * ww);
755
+ float t = 0., near = 9.; bool hit = false;
756
+ for (int i = 0; i < 110; i++){
757
+ float d = map(ro + rd * t);
758
+ near = min(near, d);
759
+ if (d < .0008){ hit = true; break; }
760
+ t += d * .8; if (t > 6.) break;
761
+ }
762
+ vec4 col = vec4(0.);
763
+ float tf = (-.585 - ro.y) / rd.y;
764
+ if (tf > 0. && uShadow > 0.){
765
+ vec3 g = ro + rd * tf;
766
+ // Off the ground, the shadow tightens and fades, so a hop reads as a hop rather than as floating.
767
+ float up = clamp(uLift / .35, 0., 1.), wide = 1. - .38 * up;
768
+ float s = exp(-pow(length(vec2(g.x / (.95 * wide), g.z / (.8 * wide))) / (.58 * wide), 2.) * 2.0);
769
+ col = vec4(0., 0., 0., .20 * s * uShadow * (1. - .55 * up));
770
+ }
771
+ if (hit){
772
+ vec3 p = ro + rd * t, n = normal(p);
773
+ vec3 L = normalize(vec3(-.5, .8, .75));
774
+ // One solid colour, deepened toward the bottom edge and in the hollows, then a soft light from the upper left and a
775
+ // rim that catches the far edge — with the outline, that is what makes a flat colour read as a round body.
776
+ vec3 base = uColor * mix(.94, 1., smoothstep(-.62, .30, p.y)) * mix(.90, 1., ao(p, n));
777
+ float lam = clamp((dot(n, L) + .45) / 1.45, 0., 1.);
778
+ vec3 soft = uColor * mix(vec3(.80, .83, .93), vec3(1.), smoothstep(.08, .86, lam)) * mix(.88, 1., ao(p, n));
779
+ base = mix(base, soft, uLit);
780
+ base += uColor * uRim * pow(1. - max(dot(n, -rd), 0.), 3.2) * .55;
781
+ base = paintFace(toBody(p), base);
782
+ // The crease where the ears meet the head turns edge-on when the head turns, and takes the outline with it.
783
+ base = mix(base, uColor * vec3(.55, .57, .65), (1. - smoothstep(.10, .17, max(dot(n, -rd), 0.))) * .85);
784
+ col = vec4(base, 1.);
785
+ }
786
+ if (!hit && near < 9.){
787
+ // The outline is a band of even width just outside the silhouette, so it does not vanish where the surface turns away
788
+ // fast; a near miss inside the band paints the line over the shadow. Its width is a fixed share of the picture, so
789
+ // the DM figure gets a clear edge and a 22 px avatar a hairline, as in the design study.
790
+ float w = .003 * t;
791
+ float edge = 1. - smoothstep(w * .55, w, near);
792
+ if (edge > 0.) col = vec4(mix(col.rgb, uColor * vec3(.55, .57, .65), edge), max(col.a, edge));
793
+ }
794
+ gl_FragColor = vec4(col.rgb * col.a, col.a);
795
+ }`;function jS(e,n){const i=2.45*n/3.4,r=.92,l=r/e.squash;return{x:.5-l*Math.sin(e.tilt)*i,y:.5-.39*n/.92-(l*Math.cos(e.tilt)+e.lift-r)*i,scale:n/.92,angle:-e.tilt}}const gj=e=>[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255],$I=256,VI=/swiftshader|llvmpipe|softpipe|software|basic render/i;function GI(e){const n=String(e.getParameter(e.RENDERER)??"");if(n!=="WebKit WebGL")return n;const i=e.getExtension("WEBGL_debug_renderer_info");return i?String(e.getParameter(i.UNMASKED_RENDERER_WEBGL)??""):n}function wS({gpu:e=!1}={}){var y;const n=document.createElement("canvas"),i=n.getContext("webgl",{premultipliedAlpha:!0,preserveDrawingBuffer:!0,antialias:!1,failIfMajorPerformanceCaveat:e});if(!i)return;if(e&&VI.test(GI(i))){(y=i.getExtension("WEBGL_lose_context"))==null||y.loseContext();return}const r=(m,j)=>{const b=i.createShader(m);if(i.shaderSource(b,j),i.compileShader(b),!i.getShaderParameter(b,i.COMPILE_STATUS))throw new Error(i.getShaderInfoLog(b)??"shader");return b},l=i.createProgram();i.attachShader(l,r(i.VERTEX_SHADER,FI)),i.attachShader(l,r(i.FRAGMENT_SHADER,UI)),i.linkProgram(l),i.useProgram(l),i.bindBuffer(i.ARRAY_BUFFER,i.createBuffer()),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),i.STATIC_DRAW);const c=i.getAttribLocation(l,"p");i.enableVertexAttribArray(c),i.vertexAttribPointer(c,2,i.FLOAT,!1,0,0);const d=m=>i.getUniformLocation(l,m),f=gj(16777215),h=[document.createElement("canvas"),document.createElement("canvas")],g=(m,j,b,k,S)=>{n.width!==m&&(n.width=n.height=m),i.viewport(0,0,m,m),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.uniform2f(d("uRes"),m,m),i.uniform3fv(d("uColor"),gj(j)),i.uniform3fv(d("uInk"),f),i.uniform2fv(d("uLook"),b.look);for(const[N,C]of[["uSquash",b.squash],["uEarL",b.earL],["uEarR",b.earR],["uOpen",b.open],["uHappy",b.happy],["uTilt",b.tilt],["uLift",b.lift],["uKind",b.kind],["uEyeScale",b.eyeScale],["uLid",b.lid],["uLidTilt",b.lidTilt],["uSmile",b.smile],["uBlush",b.blush],["uMouth",b.mouth],["uMouthOpen",b.mouthOpen],["uYaw",-b.yaw],["uSpin",b.spin]])i.uniform1f(d(N),C);for(const[N,C]of Object.entries(HI))i.uniform1f(d("u"+N[0].toUpperCase()+N.slice(1)),C);i.uniform1f(d("uZoom"),S),i.uniform1f(d("uShadow"),k?1:0),i.uniform1f(d("uLit"),pj.lit),i.uniform1f(d("uRim"),pj.rim),i.drawArrays(i.TRIANGLES,0,3)};return{paint(m,j,b,k,{shadow:S=!0,zoom:N=.9}={}){let C=j*2;for(;C<$I;)C*=2;g(C,b,k,S,N);let M=n;for(let E=0;C>j*2;C/=2,E^=1){const T=h[E],_=T.getContext("2d");T.width!==C/2?T.width=T.height=C/2:_.clearRect(0,0,C/2,C/2),_.drawImage(M,0,0,C,C,0,0,C/2,C/2),M=T}m.drawImage(M,0,0,C,C,0,0,j,j)},dispose(){var m;(m=i.getExtension("WEBGL_lose_context"))==null||m.loseContext()}}}const YI={normal:{},happy:{happy:1,blush:1,earL:.16,earR:.16},sad:{lid:.28,lidTilt:-.62,look:[0,-.02],earL:.62,earR:.62,mouth:6,squash:.97},angry:{lid:.4,lidTilt:1.1,earL:.56,earR:.56,mouth:4,look:[0,-.01]},dizzy:{kind:3,mouth:5,tilt:.08,earL:.1,earR:.46}},sg=e=>({...PI,...YI[e]}),KI={sleep:"zz",busy:"sweat",ask:"ask",stretch:"sparkle"},kS={sleep:{kind:4,earL:.36,earR:.36,look:[0,-.02]},think:{lid:.16,earL:.16,earR:.46},work:{open:.55,earL:.14,earR:.14},busy:{kind:1,mouth:5,earL:.5,earR:.5},read:{lid:.34},turn:{mouth:2,mouthOpen:.8,earL:.1,earR:.1},ask:{eyeScale:1.08,earL:.12,earR:.38},yawn:{kind:4,mouth:5,earL:.42,earR:.42},stretch:{kind:2,mouth:2,mouthOpen:.8,blush:.8,earL:.06,earR:.06},groom:{kind:4}},XI=kS.sleep??{},vj={rest:.2,turn:.02,ask:.08,read:.12},yj=Math.PI*2,Dc=(e,n,i)=>e+(n-e)*i;let QI=class{constructor(){He(this,"x",0);He(this,"v",0);He(this,"last",0)}kick(n){this.v+=n}step(n){const i=this.last?Math.min(.05,Math.max(0,(n-this.last)/1e3)):0;this.last=n;const r=9.5;return this.v+=(-180*this.x-r*this.v)*i,this.x+=this.v*i,this.x}};class ZI{constructor(){He(this,"squash",new QI);He(this,"start",0);He(this,"motion",null);He(this,"motionAt",0);He(this,"lookX",0);He(this,"lookY",0);He(this,"yaw",0);He(this,"lift",0);He(this,"tilt",0)}frame(n,i){const r=i.motion,l=!!i.reduced,c=r==="sleep",d=i.faceX??0,f=(r==="turn"||r==="ask"||r==="read"?vj[r]:vj.rest)*d;this.start||(this.start=n,this.yaw=f),r!==this.motion&&(this.motion&&!l&&this.squash.kick(c?-.4:.6),this.motion=r,this.motionAt=n);const h=(n-this.start)/1e3,g=(n-this.motionAt)/1e3,y={...sg(i.mood),...kS[r]},m=(M,E)=>l?0:Math.sin(h*M)*E,j=!c&&i.mood==="dizzy",b=r==="idle"?1:c?.25:.45;this.lookX=Dc(this.lookX,(j?0:i.lookX*b)*.055,.18),this.lookY=Dc(this.lookY,(j?0:i.lookY*b)*.045,.15),this.yaw=Dc(this.yaw,f,.07);let k=(c?1.05:1)+(l?0:Math.sin(yj*h/(c?4.4:3.4))*(c?.014:.008)),S=0,N=y.tilt,C=y.look;if(r==="think")C=[m(.9,.045)+.03,.04],N+=.06+m(1.3,.03);else if(r==="work"||r==="busy"){const M=r==="busy"||i.fast,E=l?0:Math.abs(Math.sin(yj*h*(M?1.9:1.5)));k+=.032*(1-E),S=.013*E,C=M?[m(6.5,.012)+m(2.3,.005),-.03]:[m(1.9,.02),-.03],r==="busy"&&(N+=m(1.6,.02))}else if(r==="read")C=[l?0:g*.55%1*.09-.045,-.045],N+=m(.7,.02);else if(r==="ask")C=[0,.03],N+=.14+m(1.1,.03);else if(r==="yawn"){const M=l?0:Math.sin(Math.PI*Math.min(1,g%3.2/1.8));k+=.05*M,S=.02*M}else if(r==="stretch"){const M=l?0:Math.sin(Math.PI*Math.min(1,g%3.6/1.8));k-=.04*M,S=.03*M}else r==="groom"&&(N-=.1,C=[.04,-.03]);return this.lift=Dc(this.lift,S,.2),this.tilt=Dc(this.tilt,N,.2),{...y,squash:k*y.squash+this.squash.step(n),lift:this.lift,tilt:this.tilt,yaw:this.yaw,look:[this.lookX+C[0],this.lookY+C[1]]}}shake(){this.squash.kick(-2.2)}}const JI=40,WI=30,eq=.05,i0=new Map;let Fd;function SS(e,n,i){const r=n/100;e.save(),e.translate(i.x*n,i.y*n),e.rotate(i.angle),e.scale(i.scale,i.scale),e.fillStyle="#f2b830",e.strokeStyle="#c98d12",e.lineWidth=1.6*r,e.lineJoin="round",e.beginPath(),e.moveTo(-13*r,6*r),e.lineTo(-13*r,-2*r),e.lineTo(-6*r,3*r),e.lineTo(0,-7*r),e.lineTo(6*r,3*r),e.lineTo(13*r,-2*r),e.lineTo(13*r,6*r),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#fff6dc";for(const[l,c]of[[-13,-2],[0,-7],[13,-2]])e.beginPath(),e.arc(l*r,c*r,2.2*r,0,Math.PI*2),e.fill();e.restore()}function tq(e,n,i,r,l,c){var m;if(Fd===void 0){const j=wS();Fd=j?{figure:j,out:document.createElement("canvas")}:null}if(!Fd)return"";const{figure:d,out:f}=Fd,h=c?{...sg(n),...XI}:sg(n),g=r?.92:.9;f.width=f.height=i;const y=f.getContext("2d");return y?(r||y.translate(0,eq*i),d.paint(y,i,((m=Ni[e])==null?void 0:m.hex)??Ni.gray.hex,h,{shadow:r,zoom:g}),l&&SS(y,i,jS(h,g)),f.toDataURL("image/png")):""}function nq(e,n,i,r,l=!1,c=!1){const d=Math.round(i*Math.min(3,Math.max(1,r))),f=i>=JI,h=l&&i>=WI,g=`${e}:${n}:${d}:${h}:${c}`;let y=i0.get(g);return y||(y=Promise.resolve().then(()=>tq(e,n,d,f,h,c)),i0.set(g,y),y.catch(()=>i0.delete(g))),y}function aq(e){let n;const i=()=>{e(),r()},r=()=>{n=matchMedia(`(resolution: ${devicePixelRatio}dppx)`),n.addEventListener("change",i,{once:!0})};return r(),()=>n==null?void 0:n.removeEventListener("change",i)}function _i({color:e,mood:n="normal",size:i=36,badge:r,crown:l=!1,asleep:c=!1}){const[d,f]=w.useState(),h=w.useSyncExternalStore(aq,()=>devicePixelRatio||1);return w.useEffect(()=>{let g=!0;return nq(e,n,i,h,l,c).then(y=>{g&&f(y)}).catch(()=>{}),()=>{g=!1}},[e,n,i,h,l,c]),o.jsxs("span",{className:"jv-bot-avatar",style:{"--jv-avatar-size":`${i}px`,"--jv-avatar-color":bS(e)},"aria-hidden":"true",children:[d?o.jsx("img",{src:d,alt:""}):o.jsx("span",{className:"jv-bot-avatar-tile"}),r==="working"&&o.jsxs("span",{className:"jv-typing",title:v("avatar.working"),children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]}),r==="asking"&&o.jsx("span",{className:"jv-typing jv-asking",title:v("activity.asking"),children:"?"})]})}const CS=zT;function NS({className:e,children:n,showCloseButton:i=!0,...r}){return o.jsxs(LT,{children:[o.jsx(BT,{"data-slot":"dialog-overlay",className:"fixed inset-0 z-[80] bg-black/50"}),o.jsxs(PT,{"data-slot":"dialog-content",className:Dn("fixed top-1/2 left-1/2 z-[81] flex max-h-[calc(100dvh-24px)] w-[min(720px,calc(100vw-24px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border bg-background text-foreground shadow-lg outline-none",e),...r,children:[n,i&&o.jsx(GT,{className:"absolute top-4 right-4 rounded-sm p-1 text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring","aria-label":v("common.close"),children:o.jsx(Rl,{className:"size-4"})})]})]})}function ES({className:e,...n}){return o.jsx($T,{"data-slot":"dialog-title",className:Dn("text-lg font-semibold",e),...n})}const iq={running:"activity.running",idle:"activity.idle",stop:"activity.stopped"};function rq({bot:e,status:n,onSaved:i}){const[r,l]=w.useState(null),[c,d]=w.useState(!1),[f,h]=w.useState(""),g=(n==null?void 0:n.status)??"stop";async function y(j){l(j),h("");try{await ue.controlBot(e.id,j)}catch(b){h(Gt(b,"common.failed"))}finally{l(null)}}async function m(j){if(j!==e.color){d(!0),h("");try{i(await ue.setBotColor(e.id,j))}catch(b){h(Gt(b,"bot.changeFailed"))}finally{d(!1)}}}return o.jsxs("header",{className:"jv-bot-head",children:[o.jsx(_i,{color:e.color,mood:e.mood,size:56,crown:e.agent}),o.jsxs("div",{className:"jv-bot-identity",children:[o.jsx(ES,{children:e.name}),e.description&&o.jsx("span",{children:e.description}),o.jsx("div",{className:"jv-bot-colors",role:"radiogroup","aria-label":v("bot.color"),children:Object.keys(Ni).map(j=>o.jsx("button",{type:"button",role:"radio","aria-checked":e.color===j,"aria-label":v(Ni[j].label),title:v(Ni[j].label),disabled:c,style:{background:bS(j)},onClick:()=>void m(j)},j))})]}),o.jsxs("div",{className:"jv-bot-run",children:[o.jsx("span",{className:"jv-status","data-ok":g!=="stop"||void 0,"data-busy":g==="running"||void 0,children:v(iq[g])}),g==="running"&&o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:!!r,onClick:()=>void y("abort"),children:v(r==="abort"?"bot.aborting":"bot.abort")}),o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:!!r||!e.connectionId,onClick:()=>void y(g==="stop"?"start":"stop"),children:v(r==="start"?"bot.starting":r==="stop"?"bot.stopping":g==="stop"?"bot.start":"bot.stop")})]}),f&&o.jsx("p",{className:"jv-note-error jv-bot-head-error",role:"alert",children:f})]})}const Hr=t_,Fr=r_;function Ur({className:e,children:n,...i}){return o.jsxs(a_,{"data-slot":"select-trigger",className:Dn("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50",e),...i,children:[n,o.jsx(o_,{asChild:!0,children:o.jsx(_o,{className:"size-4 opacity-50"})})]})}function $r({className:e,children:n,container:i,...r}){return o.jsx(u_,{container:i??void 0,children:o.jsx(d_,{"data-slot":"select-content",position:"popper",sideOffset:5,className:Dn("z-[100] max-h-[min(300px,70dvh)] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border bg-popover bg-background p-1 text-foreground shadow-md",e),...r,children:o.jsx(y_,{children:n})})})}function za({className:e,children:n,...i}){return o.jsxs(j_,{"data-slot":"select-item",className:Dn("relative flex cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50",e),...i,children:[o.jsx(w_,{children:n}),o.jsx(S_,{"data-slot":"select-indicator",className:"absolute right-2",children:o.jsx(Ba,{className:"size-4"})})]})}function An(){const[e,n]=w.useState(null),[i,r]=w.useState(""),l=w.useCallback(async(c,d,f)=>{n(c),r("");try{return await d(),!0}catch(h){return r(Gt(h,f)),!1}finally{n(null)}},[]);return{busy:e!==null,doing:e,error:i,setError:r,run:l}}const xj={auto:"botModel.auto",off:"botModel.off",minimal:"botModel.minimal",low:"botModel.low",medium:"botModel.medium",high:"botModel.high",xhigh:"botModel.xhigh",max:"botModel.max"},oq=(e,n)=>JSON.stringify([e,n]);function TS({bot:e,connections:n,onSaved:i,onManage:r}){const[l,c]=w.useState([]),[d,f]=w.useState(!0),[h,g]=w.useState(""),[y,m]=w.useState(0),{busy:j,error:b,run:k}=An(),[S,N]=w.useState(!1),[C,M]=w.useState(""),[E,T]=w.useState(-1),_=w.useRef(null),R=w.useRef(null),[O,I]=w.useState(null),P=w.useId();w.useEffect(()=>{let ne=!0;return f(!0),g(""),ue.modelOptions().then(B=>{ne&&c(B.connections)}).catch(B=>{ne&&g(Gt(B,"botModel.loadFailed"))}).finally(()=>{ne&&f(!1)}),()=>{ne=!1}},[n,y]);const z=l.flatMap(ne=>ne.models.map(B=>({...B,connectionId:ne.id,connectionName:ne.name,key:oq(ne.id,B.id)}))).sort((ne,B)=>ne.name.localeCompare(B.name,void 0,{numeric:!0})),q=z.find(ne=>ne.connectionId===e.connectionId&&ne.id===e.modelId),$=n.find(ne=>ne.id===e.connectionId),Q=$==null?void 0:$.models.find(ne=>ne.id===e.modelId),Y=z.filter(ne=>`${ne.name} ${ne.id} ${ne.connectionName}`.toLocaleLowerCase().includes(C.trim().toLocaleLowerCase())),H=l.map(ne=>({...ne,models:Y.filter(B=>B.connectionId===ne.id)})).filter(ne=>ne.models.length),K=H.flatMap(ne=>ne.models),V=z.length>8,X=e.thinkingLevel==="auto"?`auto${e.effectiveThinkingLevel?` · ${e.effectiveThinkingLevel}`:""}`:e.effectiveThinkingLevel??e.thinkingLevel;function Z(ne){N(ne),M(""),T(-1)}async function D(ne,B,F){Z(!1),await k("choose",async()=>i(await ue.selectBotModel(e.id,ne,B,F,Wi())),"botModel.switchFailed")}function se(ne){var B;if(ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const F=ne.key==="ArrowDown"?Math.min(E+1,K.length-1):Math.max(E-1,0);T(F),(B=document.getElementById(`${P}-${F}`))==null||B.scrollIntoView({block:"nearest"})}else if(ne.key==="Enter"&&K[E]){ne.preventDefault();const F=K[E];D(F.connectionId,F.id,e.thinkingLevel)}}return o.jsxs("div",{className:"jv-bot-model jv-ui","aria-busy":j||d,ref:ne=>I((ne==null?void 0:ne.closest("[data-slot=dialog-content]"))??null),children:[o.jsxs("div",{className:"jv-bot-model-fields",children:[o.jsxs("div",{className:"jv-bot-model-field",children:[o.jsx("span",{className:"jv-field-label",children:v("usage.model")}),o.jsxs(Vf,{open:S,onOpenChange:Z,children:[o.jsxs(Gf,{className:"jv-model-trigger","aria-label":v("botModel.pick"),"aria-haspopup":"listbox",disabled:j||d||!!h,children:[o.jsx("span",{children:(q==null?void 0:q.name)??(Q==null?void 0:Q.name)??v(e.connectionId?"botModel.broken":"botModel.choose")}),j?o.jsx(jw,{className:"animate-spin"}):o.jsx(_o,{})]}),o.jsx(Yf,{container:O,children:o.jsxs(Kf,{className:"jv-model-menu jv-ui",align:"start",sideOffset:6,collisionPadding:12,collisionBoundary:O,onOpenAutoFocus:ne=>{var B;ne.preventDefault(),(B=V?_.current:R.current)==null||B.focus()},onKeyDown:se,children:[V&&o.jsxs("div",{className:"jv-model-search",children:[o.jsx(Rs,{}),o.jsx("input",{ref:_,role:"combobox","aria-label":v("botModel.filter"),"aria-expanded":"true","aria-controls":P,"aria-activedescendant":E>=0?`${P}-${E}`:void 0,placeholder:v("botModel.filterPlaceholder"),value:C,onChange:ne=>{M(ne.target.value),T(-1)},autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{ref:R,id:P,role:"listbox","aria-label":v("botModel.list"),tabIndex:-1,"aria-activedescendant":E>=0?`${P}-${E}`:void 0,className:"jv-model-options",children:[H.map(ne=>o.jsxs("div",{role:"group","aria-label":ne.name,children:[o.jsx("div",{className:"jv-model-group-label",children:ne.name}),ne.models.map(B=>{const F=K.indexOf(B),ee=B.connectionId===e.connectionId&&B.id===e.modelId;return o.jsxs("button",{type:"button",role:"option",tabIndex:-1,id:`${P}-${F}`,"aria-selected":ee,"data-active":F===E||void 0,title:B.id,onClick:()=>void D(B.connectionId,B.id,e.thinkingLevel),children:[o.jsx("span",{className:"jv-option-check",children:ee&&o.jsx(Ba,{})}),o.jsx("span",{children:B.name})]},B.key)})]},ne.id)),!K.length&&o.jsx("p",{className:"jv-menu-empty",children:v(z.length?"botModel.noMatch":"botModel.none")})]}),o.jsx("button",{type:"button",className:"jv-menu-manage",onClick:()=>{Z(!1),r()},children:v("botModel.manage")})]})})]}),(q||$)&&o.jsx("span",{className:"jv-field-note",children:(q==null?void 0:q.connectionName)??($==null?void 0:$.displayName)})]}),o.jsxs("div",{className:"jv-bot-model-field",children:[o.jsx("span",{className:"jv-field-label",children:v("botModel.thinking")}),o.jsxs(Hr,{value:e.thinkingLevel==="auto"?"auto":e.effectiveThinkingLevel??e.thinkingLevel,disabled:j||d||!q||!!h,onValueChange:ne=>{e.connectionId&&D(e.connectionId,e.modelId,ne)},children:[o.jsx(Ur,{className:"jv-thinking-trigger","aria-label":v("botModel.pickThinking"),children:o.jsx(Fr,{children:X})}),o.jsx($r,{className:"jv-select-menu jv-thinking-menu",align:"end",children:["auto",...(q==null?void 0:q.thinking.levels)??[]].map(ne=>{const B=q==null?void 0:q.thinkingLevelMap[ne],F=B&&B!==ne?B:ne;return o.jsx(za,{value:ne,children:o.jsxs("span",{className:"jv-thinking-option",children:[o.jsxs("span",{children:[F,B&&B!==ne&&o.jsxs("small",{children:[" (",ne,")"]})]}),o.jsx("small",{children:xj[ne]&&v(xj[ne])})]})},ne)})})]})]})]}),d&&o.jsx("p",{className:"jv-field-note",role:"status",children:v("botModel.loading")}),j&&o.jsx("p",{className:"jv-field-note",role:"status",children:v("botModel.switching")}),h&&o.jsxs("p",{className:"jv-model-error",role:"alert",children:[h," ",o.jsx("button",{type:"button",onClick:()=>m(ne=>ne+1),children:v("common.retry")})]}),b&&o.jsx("p",{className:"jv-model-error",role:"alert",children:b})]})}function sq(){const[e,n]=w.useState(!1),i=r=>l=>{l.pointerType==="mouse"&&n(r)};return o.jsxs(Vf,{open:e,onOpenChange:n,children:[o.jsx(Gf,{className:"jv-context-stale",title:"","aria-label":v("bot.contextStale"),onPointerEnter:i(!0),onPointerLeave:i(!1),children:o.jsx(zf,{"aria-hidden":"true"})}),o.jsx(Yf,{children:o.jsx(Kf,{className:"jv-context-tip jv-ui",side:"top",align:"end",sideOffset:6,collisionPadding:12,onOpenAutoFocus:r=>r.preventDefault(),children:v("bot.contextStale")})})]})}function lq({bot:e,status:n,connections:i,chats:r,onSaved:l,onManageModels:c,onOpenSubscription:d}){const[f,h]=w.useState(!1),[g,y]=w.useState(null);w.useEffect(()=>{let j=!0;return ue.botSubscriptions(e.id).then(b=>{j&&y(b.chats)}).catch(()=>{}),()=>{j=!1}},[e.id]),w.useEffect(()=>{if(!f)return;const j=setTimeout(()=>h(!1),1500);return()=>clearTimeout(j)},[f]);const m=n==null?void 0:n.context;return o.jsxs(o.Fragment,{children:[e.agent&&o.jsxs("section",{className:"jv-section","aria-label":v("agent.title"),children:[o.jsx("h3",{className:"jv-section-title",children:v("agent.title")}),o.jsxs("div",{className:"jv-panel jv-agent-about",children:[o.jsx("p",{children:v("agent.intro",{name:e.name})}),o.jsx("ul",{children:["agent.create","agent.model","agent.run","agent.delete","agent.oversee"].map(j=>o.jsx("li",{children:v(j)},j))})]})]}),o.jsxs("section",{className:"jv-section","aria-label":v("usage.model"),children:[o.jsx("h3",{className:"jv-section-title",children:v("usage.model")}),o.jsxs("div",{className:"jv-panel",children:[o.jsx(TS,{bot:e,connections:i,onSaved:l,onManage:c}),m&&o.jsxs("div",{className:"jv-context",title:v("bot.contextHint"),children:[o.jsxs("div",{className:"jv-context-label",children:[o.jsx("span",{children:v("bot.context")}),o.jsxs("span",{"data-stale":m.stale&&m.tokens!==null||void 0,children:[m.stale&&m.tokens!==null&&o.jsx(sq,{}),m.tokens===null?v("bot.unknown"):v("bot.tokens",{used:La(m.tokens),window:La(m.contextWindow)})]})]}),m.tokens!==null&&o.jsx("div",{className:"jv-context-bar",children:o.jsx("span",{style:{width:`${Math.min(100,Math.max(1,m.tokens/m.contextWindow*100))}%`}})})]})]})]}),o.jsxs("section",{className:"jv-section","aria-label":v("bot.workspace"),children:[o.jsx("h3",{className:"jv-section-title",children:v("bot.workspace")}),o.jsx("div",{className:"jv-list",children:o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("code",{title:e.workspacePath,children:e.workspacePath})}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":v(f?"ui.copied":"bot.copyWorkspace"),onClick:()=>void ql(e.workspacePath).then(j=>h(j)),children:f?o.jsx(Ba,{}):o.jsx(eu,{})})]})})]}),g&&o.jsxs("section",{className:"jv-section","aria-label":v("bot.subscriptions"),children:[o.jsx("h3",{className:"jv-section-title",children:v("bot.subscriptions")}),o.jsx("div",{className:"jv-list",children:g.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:v("bot.noSubscriptions")})})}):g.map(j=>{var b;return o.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>d(j),children:[o.jsx("span",{className:"jv-row-icon",children:j.type==="thread"?o.jsx(Aw,{}):o.jsx(J9,{})}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:j.title}),o.jsx("span",{children:j.type==="thread"?v("bot.threadIn",{channel:((b=r.find(k=>k.id===j.parentId))==null?void 0:b.title)??""}):v("info.menu")})]}),o.jsx(_s,{className:"jv-row-chevron"})]},j.id)})})]})]})}function Nt({className:e,type:n,...i}){return o.jsx("input",{type:n,"data-slot":"input",className:Dn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...i})}function _l({className:e,...n}){return o.jsx("textarea",{"data-slot":"textarea",className:Dn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...n})}function cq({bot:e,onSaved:n}){const[i,r]=w.useState(e.name),[l,c]=w.useState(e.description),[d,f]=w.useState(e.systemPrompt),[h,g]=w.useState(!1),[y,m]=w.useState(null),j=i!==e.name||l!==e.description||d!==e.systemPrompt;async function b(S){S.preventDefault(),g(!0),m(null);try{n(await ue.saveBot(e.id,{name:i,description:l,systemPrompt:d})),m({kind:"ok",text:v("bot.saved")})}catch(N){m({kind:"error",text:Gt(N,"common.saveFailed")})}finally{g(!1)}}const k=(y==null?void 0:y.kind)==="error"||!j?y:null;return o.jsxs("form",{className:"jv-bot-profile",onSubmit:S=>void b(S),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("info.name")}),o.jsx(Nt,{id:"jarvy-bot-name",required:!0,maxLength:80,value:i,onChange:S=>r(S.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("bot.description")}),o.jsx(_l,{id:"jarvy-bot-description",maxLength:1e3,rows:2,value:l,onChange:S=>c(S.target.value),placeholder:v("bot.descriptionPlaceholder")})]}),o.jsxs("label",{className:"jv-field jv-bot-persona",children:[o.jsx("span",{children:"Persona"}),o.jsx(_l,{id:"jarvy-bot-persona",maxLength:16e3,value:d,onChange:S=>f(S.target.value),placeholder:v("bot.personaPlaceholder")}),o.jsx("small",{className:"jv-hint",children:v("bot.personaHint")})]}),o.jsxs("div",{className:"jv-form-footer",children:[k?o.jsx("p",{className:k.kind==="error"?"jv-note-error":"jv-note-ok",role:k.kind==="error"?"alert":"status",children:k.text}):j?o.jsx("p",{className:"jv-hint",children:v("bot.unsaved")}):o.jsx("span",{}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:h||!j,children:v(h?"bot.saving":"common.save")})]})]})}const zr=2**30,uq=2**20,Br=(e,n=2)=>String(Number(e.toFixed(n))),Cf=e=>e<zr?`${Math.round(e/uq)} MB`:`${Br(e/zr,1)} GB`,MS=e=>e===1?v("environment.limits.oneCore"):v("environment.limits.cores",{count:Br(e)});function dq({usage:e,limits:n,capacity:i}){var d,f;const r=n.memory??(i==null?void 0:i.memory)??null,l=n.cpus??(i==null?void 0:i.cpus)??null,c=(h,g,y)=>g===null?h:y?v("environment.usage.machine",{used:h,whole:g}):`${h} / ${g}`;return o.jsxs(o.Fragment,{children:[o.jsx(r0,{label:v("environment.usage.memory"),share:r&&e.memory/r,host:(d=e.host)==null?void 0:d.memory,text:c(Cf(e.memory),r===null?null:`${Br(r/zr,n.memory===null?1:2)} GB`,n.memory===null)}),o.jsx(r0,{label:v("environment.usage.cpu"),share:l&&e.cpu/100/l,text:c(Br(e.cpu/100),l===null?null:MS(l),n.cpus===null)}),e.disk&&o.jsx(r0,{label:v("environment.usage.disk"),share:e.disk.used/e.disk.size,host:(f=e.host)==null?void 0:f.disk,text:c(Cf(e.disk.used),`${Br(e.disk.size/zr)} GB`,!1)})]})}function r0({label:e,text:n,share:i,host:r}){const[l,c]=w.useState(!1),d=o.jsxs(o.Fragment,{children:[o.jsx("span",{children:e}),o.jsx("span",{className:"jv-env-value",children:n}),i!==null&&o.jsx("span",{className:"jv-env-bar","aria-hidden":"true",children:o.jsx("span",{style:{width:`${Math.min(100,Math.max(1,i*100))}%`},"data-high":i>.9||void 0})})]});if(r==null)return o.jsx("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-meter",children:d});const f=h=>g=>{g.pointerType==="mouse"&&c(h)};return o.jsxs(Vf,{open:l,onOpenChange:c,children:[o.jsx(Gf,{className:"jv-list-row jv-env-fact jv-env-meter",onPointerEnter:f(!0),onPointerLeave:f(!1),children:d}),o.jsx(Yf,{children:o.jsx(Kf,{className:"jv-env-tip jv-ui",side:"top",align:"end",sideOffset:4,collisionPadding:12,onOpenAutoFocus:h=>h.preventDefault(),children:v("environment.usage.host",{value:Cf(r)})})})]})}function fq({memory:e,cpus:n}){if(e===null&&n===null)return v("environment.limits.none");const i=v("environment.limits.unlimited");return`${v("environment.limits.memory",{value:e===null?i:`${Br(e/zr)} GB`})} · ${v("environment.limits.cpu",{value:n===null?i:MS(n)})}`}function hq({bot:e,onSaved:n}){const i=e.environment.computer,r=i.state==="running",l=i.type==="vm",c=l?{memory:1,cpus:1}:{memory:.25,cpus:.1},d=P=>l?P==="memory"?"4":"2":v("environment.limits.unlimited"),[f,h]=w.useState(null),[g,y]=w.useState(!1),[m,j]=w.useState(""),[b,k]=w.useState(""),{busy:S,error:N,setError:C,run:M}=An();w.useEffect(()=>{let P=!0;const z=()=>void ue.computerResources(e.id).then($=>{P&&h($)}).catch(()=>{});z();const q=r?setInterval(z,1e4):void 0;return()=>{P=!1,clearInterval(q)}},[e.id,r]);const E=r?(f==null?void 0:f.usage)??null:null,T=(f==null?void 0:f.capacity)??null;function _(){j(i.limits.memory===null?"":Br(i.limits.memory/zr)),k(i.limits.cpus===null?"":Br(i.limits.cpus)),C(""),y(!0)}const R={memory:m.trim()?Math.round(Number(m)*zr):null,cpus:b.trim()?Number(b):null},O=!l&&E&&R.memory!==null&&R.memory<E.memory,I=P=>{P.preventDefault(),M("save",async()=>{n(await ue.setComputerLimits(e.id,R)),y(!1)},"environment.limits.failed")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"jv-list-row jv-env-fact jv-env-limits","aria-expanded":g,onClick:()=>g?y(!1):_(),children:[o.jsx("span",{children:v(l?"environment.limits.vm":"environment.limits")}),o.jsx("span",{className:"jv-env-value",children:fq(i.limits)}),o.jsx(_s,{className:"jv-row-chevron"})]}),E&&o.jsx(dq,{usage:E,limits:i.limits,capacity:T}),g&&o.jsx("div",{className:"jv-list-row jv-static-row jv-env-details",children:o.jsxs("form",{className:"jv-env-limits-form","aria-label":v(l?"environment.limits.vmEdit":"environment.limits.edit"),onSubmit:I,children:[o.jsxs("div",{className:"jv-env-limit-fields",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("environment.limits.memoryField")}),o.jsx(Nt,{type:"number",inputMode:"decimal",min:c.memory,max:T?Number((T.memory/zr).toFixed(2)):void 0,step:"any",placeholder:d("memory"),value:m,onChange:P=>{j(P.target.value),C("")}})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("environment.limits.cpuField")}),o.jsx(Nt,{type:"number",inputMode:"decimal",min:c.cpus,max:T==null?void 0:T.cpus,step:"any",placeholder:d("cpus"),value:b,onChange:P=>{k(P.target.value),C("")}})]})]}),T&&o.jsx("small",{className:"jv-hint",children:v("environment.limits.machine",{cpus:T.cpus,memory:Br(T.memory/zr,1)})}),l&&o.jsx("small",{className:"jv-hint",children:v("environment.limits.vmDefault")}),l&&r&&o.jsx("small",{className:"jv-hint",children:v("environment.limits.vmLater")}),O&&o.jsx("p",{className:"jv-env-warn",role:"status",children:v("environment.limits.below",{usage:Cf(E.memory)})}),N&&o.jsx("p",{className:"jv-note-error",role:"alert",children:N}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!1),children:v("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",size:"sm",disabled:S,children:v("common.save")})]})]})})]})}const mq=["container","vm"];function pq({bot:e,disabled:n,onSaved:i}){const r=e.environment.computer,[l,c]=w.useState(null),[d,f]=w.useState(null),{doing:h,error:g,run:y}=An();w.useEffect(()=>{let k=!0;const S=C=>void C().then(M=>{k&&c(M)}).catch(()=>{});l||S(ue.vmSupport);const N=(l==null?void 0:l.state)==="checking"||(l==null?void 0:l.state)==="unknown"?setTimeout(()=>S(ue.vmSupport),2e3):void 0;return()=>{k=!1,clearTimeout(N)}},[l]);const m=r.type==="vm"||(l==null?void 0:l.state)==="available",j=(l==null?void 0:l.state)==="checking"||(l==null?void 0:l.state)==="unknown"?v("environment.type.checking"):(l==null?void 0:l.state)==="unavailable"&&r.type!=="vm"?v("environment.type.unavailable",{why:v(`environment.type.why.${l.reason??"failed"}`)}):null,b=k=>void y("switch",async()=>{i(await ue.setComputerType(e.id,k)),f(null)},"common.failed");return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-type",children:[o.jsx("span",{children:v("environment.type")}),o.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":v("environment.type"),children:mq.map(k=>o.jsx("button",{type:"button",role:"radio","aria-checked":r.type===k,disabled:n||!!h||k==="vm"&&!m,onClick:()=>{k!==r.type&&f(k)},children:v(`environment.type.${k}`)},k))})]}),(j||d||g)&&o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[j&&!d&&o.jsxs("p",{className:"jv-env-type-note",children:[j,(l==null?void 0:l.state)==="unavailable"&&o.jsx(Ne,{type:"button",variant:"link",size:"sm",disabled:!!h,onClick:()=>void y("check",async()=>c(await ue.checkVmSupport())),children:v("environment.type.recheck")})]}),d&&o.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":v(`environment.type.${d}Title`,{name:e.name}),children:[o.jsx("strong",{children:v(`environment.type.${d}Title`,{name:e.name})}),o.jsx("p",{children:v(`environment.type.${d}Body`)}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(null),children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:!!h,onClick:()=>b(d),children:v(h==="switch"?"environment.type.switching":"environment.type.confirm")})]})]}),g&&o.jsx("p",{className:"jv-note-error",role:"alert",children:g})]})]})}const lg={preparing:"environment.state.preparing",running:"environment.state.running",stopped:"environment.state.stopped",failed:"environment.state.failed",unavailable:"environment.state.unavailable"},gq=e=>e==="missing"||e==="stopped"||e==="denied"?e:"failed";function AS({bot:e,onSaved:n,heading:i=!0}){const{doing:r,error:l,run:c}=An(),[d,f]=w.useState(null),{computer:h,current:g,currentName:y}=e.environment,m=(N,C,M)=>c(N,async()=>n(await C()),M),j=N=>void m(N,()=>ue.computer(e.id,N),"common.failed"),b=h==null?void 0:h.state,k=(h==null?void 0:h.type)==="vm",S=b?lg[b]:null;return o.jsxs("section",{className:"jv-section","aria-label":v("environment.title"),children:[i&&o.jsx("h3",{className:"jv-section-title",children:v("environment.title")}),h&&b&&S&&o.jsxs("div",{className:"jv-list jv-env-sandbox",children:[o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:v("environment.own")}),g==="ssh"&&o.jsx("span",{className:"jv-env-away",children:v("environment.awayMachine",{name:y??""})})]}),o.jsx("span",{className:"jv-status","data-ok":b==="running"||void 0,"data-busy":b==="preparing"||void 0,children:v(S)})]}),b!=="unavailable"&&o.jsx(pq,{bot:e,disabled:!!r||b==="preparing",onSaved:n}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:v("environment.container")}),o.jsx("code",{children:h.container})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:v("environment.image")}),o.jsx("code",{children:h.image})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:v("environment.mount")}),o.jsx("code",{children:h.mount})]}),b!=="unavailable"&&o.jsx(hq,{bot:e,onSaved:n}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[h.restartNeeded&&b==="running"&&!d&&o.jsx("p",{children:v("environment.restartNote")}),b==="unavailable"?o.jsx("p",{children:v("environment.unavailable",{why:v(`environment.unavailable.${gq(h.error)}`)})}):!d&&o.jsxs("div",{className:"jv-env-actions",children:[h.restartNeeded&&b==="running"&&o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:!!r,onClick:()=>f("restart"),children:v("environment.restart")}),o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:!!r||b==="preparing",onClick:()=>b==="running"?f("stop"):j("start"),children:v(r==="start"?"environment.starting":r==="stop"?"environment.stopping":b==="running"?"environment.stop":"environment.start")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:!!r||b==="preparing",onClick:()=>f("reset"),children:v("environment.reset")})]}),d&&o.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":v(`environment.${d}Title`,{name:e.name}),children:[o.jsx("strong",{children:v(`environment.${d}Title`,{name:e.name})}),o.jsx("p",{children:v(d==="reset"&&k?"environment.resetBodyVm":`environment.${d}Body`)}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(null),children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{const N=d;f(null),j(N)},children:v(`environment.${d}Confirm`)})]})]})]})]}),l&&o.jsx("p",{className:"jv-note-error",role:"alert",children:l})]})}function sf({items:e,grantedIds:n,texts:i,rows:r,onGrant:l}){const[c,d]=w.useState(!1),[f,h]=w.useState(""),[g,y]=w.useState([]),{busy:m,error:j,run:b}=An(),k=n.map(O=>e.find(I=>I.id===O)).filter(O=>!!O),S=e.filter(O=>!n.includes(O.id)),N=f.trim().toLowerCase(),C=S.filter(O=>{var I;return O.name.toLowerCase().includes(N)||!!((I=O.detail)!=null&&I.toLowerCase().includes(N))}),M=()=>{d(!1),h(""),y([])},E=O=>y(I=>I.includes(O)?I.filter(P=>P!==O):[...I,O]),T=O=>b("grant",O),_=()=>T(async()=>{await l(g,!0),M()}),R=O=>r?o.jsxs("span",{className:"jv-grant-text",children:[o.jsx("strong",{className:O.mono?"jv-mono":void 0,children:O.name}),O.detail&&o.jsx("span",{children:O.detail})]}):o.jsx("span",{className:"jv-secret-bot-name",children:O.name});return o.jsxs("section",{className:"jv-secret-grants","aria-label":i.heading,children:[o.jsxs("div",{className:"jv-secret-grants-head",children:[o.jsxs("h4",{className:"jv-secret-heading",children:[i.heading,k.length>0&&o.jsxs("span",{children:[" · ",k.length]})]}),!c&&o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",disabled:m,onClick:()=>d(!0),children:[o.jsx(Ir,{}),i.add]})]}),k.length>0?o.jsx("ul",{className:"jv-secret-granted","data-rows":r||void 0,children:k.map(O=>o.jsxs("li",{children:[O.icon,R(O),O.once&&o.jsx("span",{className:"jv-secret-once",children:v("secrets.onceTag")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-secret-revoke",disabled:m,"aria-label":v("secrets.revoke",{name:O.name}),onClick:()=>void T(()=>l([O.id],!1)),children:o.jsx(Rl,{})})]},O.id))}):!c&&o.jsx("p",{className:"jv-hint",children:i.none}),c&&o.jsxs("div",{className:"jv-secret-picker",children:[e.length>0&&o.jsxs("label",{className:"jv-search",children:[o.jsx(Rs,{"aria-hidden":"true"}),o.jsx("input",{type:"search",autoFocus:!0,value:f,placeholder:i.search,"aria-label":i.search,onChange:O=>h(O.target.value),onKeyDown:O=>{O.key==="Enter"&&!O.nativeEvent.isComposing&&(O.preventDefault(),C.length===1&&E(C[0].id))}})]}),o.jsxs("div",{className:"jv-secret-options",role:"listbox","aria-multiselectable":"true","aria-label":i.add,"data-rows":r||void 0,children:[C.map(O=>o.jsxs("button",{type:"button",role:"option","aria-selected":g.includes(O.id),className:"jv-secret-option",onClick:()=>E(O.id),children:[O.icon,R(O),g.includes(O.id)&&o.jsx(Ba,{"aria-hidden":"true"})]},O.id)),C.length===0&&(e.length?o.jsx("p",{className:"jv-hint",children:S.length?i.noMatch:i.all}):o.jsx("div",{className:"jv-hint jv-grant-nothing",children:i.nothing}))]}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:M,children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:m||!g.length,onClick:()=>void _(),children:g.length?v("dialogs.addCount",{count:g.length}):v("common.add")})]})]}),j&&o.jsx("p",{className:"jv-note-error",role:"alert",children:j})]})}function vq({secret:e,bots:n,onChanged:i}){return o.jsx(_S,{grantedIds:e.grants.map(r=>r.botId),onceIds:new Set(e.grants.filter(r=>r.scope==="once").map(r=>r.botId)),bots:n,onGrant:async(r,l)=>{let c=e;for(const d of r)c=await ue.grantSecret(e.id,d,l);i(c)}})}function _S({grantedIds:e,onceIds:n,bots:i,onGrant:r}){const l=n??new Set;return o.jsx(sf,{grantedIds:e,onGrant:r,items:i.map(c=>({id:c.id,name:c.name,once:l.has(c.id),icon:o.jsx(_i,{color:c.color,mood:c.mood,size:20,crown:c.agent})})),texts:{heading:v("secrets.grants"),add:v("secrets.addBots"),search:v("secrets.searchBots"),none:v("secrets.noGrants"),nothing:v("secrets.noBots"),noMatch:v("secrets.noMatch"),all:v("secrets.allGranted")}})}function nh({value:e,visible:n,onChange:i,onVisible:r,placeholder:l,required:c,warnShort:d=!0}){return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"jv-secret-input",children:[o.jsx(Nt,{type:n?"text":"password",autoComplete:"new-password",spellCheck:!1,required:c,className:"jv-mono",placeholder:l,value:e,onChange:f=>i(f.target.value)}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":v(n?"secrets.hideValue":"secrets.showValue"),onClick:()=>r(!n),children:n?o.jsx(kg,{}):o.jsx(Sg,{})})]}),d&&e.length>0&&e.length<8&&o.jsx("span",{className:"jv-field-hint jv-secret-short",children:v("secrets.shortValue")})]})}function S1({publicKey:e}){const[n,i]=w.useState(!1);return w.useEffect(()=>{if(!n)return;const r=setTimeout(()=>i(!1),1500);return()=>clearTimeout(r)},[n]),o.jsxs("div",{className:"jv-machine-key",children:[o.jsx("code",{children:e}),o.jsxs("button",{type:"button",className:"ui-button jv-machine-copy","aria-label":v("machines.copy"),onClick:()=>void ql(e).then(i),children:[n?o.jsx(Ba,{"aria-hidden":"true"}):o.jsx(eu,{"aria-hidden":"true"}),o.jsx("span",{children:v(n?"machines.copied":"machines.copy")})]})]})}function RS(e){const[n,i]=w.useState(null),[r,l]=w.useState(null);return w.useEffect(()=>{if(!e||n)return;let c=!0;return ue.prepareMachineKey().then(d=>{c&&i(d)}).catch(d=>{c&&l(Gt(d))}),()=>{c=!1}},[e,n]),{key:n,error:r,renew:()=>{i(null),l(null)}}}const cg=e=>`${e.user}@${e.host}${e.port===22?"":`:${e.port}`}`;function yq({machine:e,bots:n,onChanged:i,onDeleted:r}){const[l,c]=w.useState(e.name),[d,f]=w.useState(e.directory),[h,g]=w.useState(e.description),[y,m]=w.useState(null),[j,b]=w.useState(null),{busy:k,doing:S,error:N,setError:C,run:M}=An(),[E,T]=w.useState(""),[_,R]=w.useState(!1),[O,I]=w.useState(null),P=Q=>{Q.preventDefault(),M("save",async()=>{const Y=await ue.updateMachine(e.id,{name:l.trim(),directory:d.trim(),description:h.trim()});i(Y),c(Y.name),f(Y.directory),g(Y.description)})},z=Q=>void M("delete",async()=>{try{await ue.deleteMachine(e.id,Q),r()}catch(Y){throw!Q&&Y instanceof er&&Y.code!=="machine_missing"&&b("force"),Y}}),q=l.trim()!==e.name||d.trim()!==e.directory||h.trim()!==e.description,$=j==="force";return o.jsx("div",{className:"jv-list jv-machine-detail",children:o.jsxs("div",{className:"jv-list-row jv-static-row jv-secret-details",children:[o.jsxs("form",{className:"jv-secret-edit jv-machine-edit",onSubmit:P,"aria-label":e.name,children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.name")}),o.jsx(Nt,{required:!0,maxLength:40,value:l,onChange:Q=>c(Q.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.directory")}),o.jsx(Nt,{className:"jv-mono",required:!0,maxLength:1e3,spellCheck:!1,value:d,onChange:Q=>f(Q.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-description",children:[o.jsx("span",{children:v("machines.description")}),o.jsx(_l,{maxLength:2e3,rows:3,placeholder:v("machines.descriptionPlaceholder"),value:h,onChange:Q=>g(Q.target.value)})]}),o.jsx("div",{className:"jv-secret-actions",children:o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:k||!q||!l.trim(),children:v("common.save")})})]}),o.jsxs("div",{className:"jv-machine-part",children:[o.jsxs("section",{className:"jv-secret-grants","aria-label":v("machines.fingerprint"),children:[o.jsx("h4",{className:"jv-secret-heading",children:v("machines.fingerprint")}),o.jsxs("div",{className:"jv-machine-key jv-machine-fingerprint",children:[o.jsx("div",{className:"jv-machine-codes",children:(y!=null&&y.changed?y.hostKeys.fingerprints:e.fingerprints).map(Q=>o.jsx("code",{"data-new":(y==null?void 0:y.changed)||void 0,children:Q},Q))}),y!=null&&y.changed?o.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:k,onClick:()=>void M("trust",async()=>{i(await ue.trustMachine(e.id,y.hostKeys.fingerprints)),m(null)}),children:v("machines.trust")}):o.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:k,onClick:()=>void M("check",async()=>{const Q=await ue.checkMachine(e.id);m(Q),i(Q.machine)}),children:v(S==="check"?"machines.checking":"machines.check")})]}),y&&o.jsx("p",{className:"jv-hint","data-warn":y.changed||void 0,children:v(y.changed?"machines.changed":"machines.unchanged")})]}),o.jsxs("section",{className:"jv-secret-grants","aria-label":v("machines.login"),children:[o.jsxs("div",{className:"jv-secret-grants-head",children:[o.jsx("h4",{className:"jv-secret-heading",children:v("machines.login")}),o.jsx("span",{className:"jv-row-meta",children:v(e.login==="password"?"machines.loginPassword":"machines.loginKey")})]}),e.publicKey&&o.jsx(S1,{publicKey:e.publicKey}),e.login==="password"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"jv-hint",children:v("machines.passwordLogin")}),o.jsxs("form",{className:"jv-machine-password",autoComplete:"off","aria-label":v("machines.updatePassword"),onSubmit:Q=>{Q.preventDefault(),M("password",async()=>{i(await ue.setMachinePassword(e.id,E)),T(""),I(v("machines.passwordUpdated"))})},children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.newPassword")}),o.jsx(nh,{value:E,visible:_,onChange:T,onVisible:R,required:!0,warnShort:!1})]}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:()=>void M("key",async()=>{const Q=await ue.checkMachine(e.id);m(Q),i(Q.machine),I(v(Q.machine.login==="key"?"machines.usingKey":"machines.stillPassword"))}),children:v("machines.useKey")}),o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:k||!E,children:v("machines.updatePassword")})]})]})]}),O&&o.jsx("p",{className:"jv-hint",children:O})]})]}),o.jsx("div",{className:"jv-machine-part",children:o.jsx(_S,{grantedIds:e.botIds,bots:n,onGrant:async(Q,Y)=>{let H=e;for(const K of Q)H=await ue.grantMachine(e.id,K,Y);i(H)}})}),j?o.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":v($?"machines.forceTitle":"machines.deleteTitle",{name:e.name}),children:[o.jsx("strong",{children:v($?"machines.forceTitle":"machines.deleteTitle",{name:e.name})}),o.jsx("p",{children:$?v("machines.forceBody",{comment:`jarvy-${e.id}`}):v("machines.deleteBody")}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>{b(null),C("")},children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:k,onClick:()=>z($),children:v($?"machines.forceConfirm":"machines.deleteConfirm")})]})]}):o.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>b("delete"),children:v("machines.delete")})}),N&&o.jsx("p",{className:"jv-note-error",role:"alert",children:N})]})})}function xq({bot:e,onSaved:n,onManageSecrets:i,onAddMachine:r}){const[l,c]=w.useState(null),[d,f]=w.useState(null),[h,g]=w.useState(!1);if(w.useEffect(()=>{let m=!0;return Promise.all([ue.secrets(),ue.machines()]).then(([j,b])=>{m&&(c(j.secrets.filter(k=>k.kind==="value")),f(b.machines))}).catch(()=>{m&&g(!0)}),()=>{m=!1}},[e.id]),h)return o.jsx("p",{className:"jv-note-error",role:"alert",children:v("access.loadFailed")});if(!l||!d)return null;const y=m=>m.grants.find(j=>j.botId===e.id);return o.jsxs("section",{className:"jv-section jv-access","aria-label":v("bot.tab.access"),children:[o.jsx(sf,{rows:!0,grantedIds:l.filter(y).map(m=>m.id),items:l.map(m=>{var j;return{id:m.id,name:m.name,mono:!0,...m.description?{detail:m.description}:{},once:((j=y(m))==null?void 0:j.scope)==="once",icon:o.jsx(ff,{className:"jv-grant-icon","aria-hidden":"true"})}}),texts:{heading:v("access.secrets"),add:v("common.add"),search:v("access.searchSecrets"),none:v("access.noSecrets"),noMatch:v("access.noMatch"),all:v("access.allSecrets"),nothing:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:v("access.noSecretsYet")}),o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",onClick:i,children:[o.jsx(Ir,{}),v("access.newSecret")]})]})},onGrant:async(m,j)=>{const b=new Map;for(const k of m)b.set(k,await ue.grantSecret(k,e.id,j));c(k=>k&&k.map(S=>b.get(S.id)??S))}}),o.jsx(sf,{rows:!0,grantedIds:d.filter(m=>m.botIds.includes(e.id)).map(m=>m.id),items:d.map(m=>{var j;return{id:m.id,name:m.name,detail:cg(m),once:((j=e.environment.machines.find(b=>b.id===m.id))==null?void 0:j.once)===!0,icon:o.jsx(El,{className:"jv-grant-icon","aria-hidden":"true"})}}),texts:{heading:v("environment.external"),add:v("common.add"),search:v("access.searchMachines"),none:v("access.noMachines"),noMatch:v("access.noMatch"),all:v("access.allMachines"),nothing:o.jsxs(o.Fragment,{children:[o.jsx("span",{children:v("access.noMachinesYet")}),o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",onClick:r,children:[o.jsx(Ir,{}),v("machines.add")]})]})},onGrant:async(m,j)=>{for(const b of m)n(await ue.grantBotMachine(e.id,b,j));f(b=>b&&b.map(k=>m.includes(k.id)?{...k,botIds:j?[...new Set([...k.botIds,e.id])]:k.botIds.filter(S=>S!==e.id)}:k))}}),e.environment.sandboxes&&o.jsx(sf,{rows:!0,grantedIds:e.environment.sandboxes.filter(m=>m.granted).map(m=>m.id),items:e.environment.sandboxes.map(m=>({id:m.id,name:v("access.sandboxOf",{name:m.name}),once:m.once===!0,icon:o.jsx(C0,{className:"jv-grant-icon","aria-hidden":"true"})})),texts:{heading:v("access.sandboxes"),add:v("common.add"),search:v("access.searchSandboxes"),none:v("access.noSandboxes"),noMatch:v("access.noMatch"),all:v("access.allSandboxes"),nothing:o.jsx("span",{children:v("access.noOtherBots")})},onGrant:async(m,j)=>{for(const b of m)n(await ue.grantBotSandbox(e.id,b,j))}})]})}const bj=(e,n)=>Ao(new Date(2e3,0,1,e,n)),OS=e=>ca(new Date(2023,0,1+e),{weekday:"long"}),C1=e=>`${_f(e)} ${Ao(e)}`;function bq(e){switch(e.kind){case"once":return v("tasks.schedule.once",{time:C1(e.at)});case"every":return e.minutes%60===0?v("tasks.schedule.hours",{count:e.minutes/60}):v("tasks.schedule.minutes",{count:e.minutes});case"daily":return v("tasks.schedule.daily",{time:bj(e.hour,e.minute)});case"weekly":return v("tasks.schedule.weekly",{day:OS(e.weekday),time:bj(e.hour,e.minute)})}}const Sl=e=>String(e).padStart(2,"0"),jj=e=>{const n=new Date(e);return`${n.getFullYear()}-${Sl(n.getMonth()+1)}-${Sl(n.getDate())}T${Sl(n.getHours())}:${Sl(n.getMinutes())}`},jq=(e,n)=>`${Sl(e)}:${Sl(n)}`,wj={done:"agentLog.outcome.done",failed:"agentLog.outcome.failed",declined:"agentLog.outcome.declined",dismissed:"agentLog.outcome.dismissed",allowed:"agentLog.outcome.allowed","allowed once":"agentLog.outcome.allowedOnce"},wq=["chats.browse","chats.info","messages.read","messages.search","threads.list","chats.join","environments.enter","bots.activity","bots.create","bots.update","bots.start","bots.stop","bots.delete","chats.delete","chats.removeMembers","sections.delete"],kq=e=>wq.includes(e)?v(`agentLog.tool.${e}`):e;function Sq({bot:e,runs:n}){const[i,r]=w.useState(null),[l,c]=w.useState(null),[d,f]=w.useState(!1),[h,g]=w.useState("");w.useEffect(()=>{let m=!0;return g(""),ue.agentActions(e.id).then(j=>{m&&(r(j.items),c(j.nextBefore))}).catch(j=>{m&&g(Gt(j,"agentLog.loadFailed"))}),()=>{m=!1}},[e.id,n]);const y=()=>{d||l===null||(f(!0),g(""),ue.agentActions(e.id,l).then(m=>{r(j=>[...j??[],...m.items]),c(m.nextBefore)}).catch(m=>g(Gt(m,"agentLog.loadFailed"))).finally(()=>f(!1)))};return o.jsxs("section",{className:"jv-section jv-agent-log","aria-label":v("agentLog.title"),children:[o.jsx("h3",{className:"jv-section-title",children:v("agentLog.title")}),h&&o.jsx("p",{className:"jv-note-error",role:"alert",children:h}),i&&o.jsx("div",{className:"jv-list",children:i.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:v("agentLog.empty")})})}):i.map(m=>o.jsxs("div",{className:"jv-list-row jv-static-row jv-agent-log-row","data-outcome":m.outcome,children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsxs("strong",{children:[kq(m.tool),m.target&&o.jsxs("span",{className:"jv-agent-log-target",children:[" · ",m.target]})]}),o.jsx("span",{children:[C1(m.at),m.detail].filter(Boolean).join(" · ")})]}),o.jsx("span",{className:"jv-agent-log-outcome",children:wj[m.outcome]?v(wj[m.outcome]):m.outcome})]},m.id))}),l!==null&&o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",className:"jv-agent-log-more",disabled:d,onClick:y,children:v("agentLog.more")})]})}const Cq=["once","every","daily","weekly"],zS=5;function Nq(e){const n=Date.now()+36e5,i={at:jj(n-n%(300*1e3)),count:"30",unit:"minutes",time:"09:00",weekday:"1"};return e&&(e.kind==="once"&&(i.at=jj(e.at)),e.kind==="every"&&Object.assign(i,e.minutes%60===0?{count:String(e.minutes/60),unit:"hours"}:{count:String(e.minutes),unit:"minutes"}),(e.kind==="daily"||e.kind==="weekly")&&(i.time=jq(e.hour,e.minute)),e.kind==="weekly"&&(i.weekday=String(e.weekday))),i}function Eq(e,n){const[i,r]=n.time.split(":").map(Number),l=Number.isInteger(i)&&Number.isInteger(r)?{hour:i,minute:r}:null;if(e==="once"){const c=new Date(n.at).getTime();return Number.isFinite(c)?{kind:e,at:c}:null}if(e==="every"){const c=Number(n.count)*(n.unit==="hours"?60:1);return Number.isInteger(c)&&c>=zS?{kind:e,minutes:c}:null}return l?e==="daily"?{kind:e,...l}:{kind:e,weekday:Number(n.weekday),...l}:null}function Tq({task:e,busy:n,error:i,onSave:r,onDelete:l,onCancel:c}){const[d,f]=w.useState((e==null?void 0:e.name)??""),[h,g]=w.useState((e==null?void 0:e.instruction)??""),[y,m]=w.useState((e==null?void 0:e.schedule.kind)??"daily"),[j,b]=w.useState(()=>Nq(e==null?void 0:e.schedule)),[k,S]=w.useState(!1),N=Eq(y,j),C=E=>b(T=>({...T,...E}));function M(E){E.preventDefault(),N&&d.trim()&&h.trim()&&r({name:d.trim(),instruction:h.trim(),schedule:N})}return o.jsxs("form",{className:"jv-panel jv-task-editor",onSubmit:M,"aria-label":v(e?"tasks.editTitle":"tasks.newTitle"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("tasks.name")}),o.jsx(Nt,{required:!0,maxLength:80,value:d,placeholder:v("tasks.namePlaceholder"),onChange:E=>f(E.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("tasks.instruction")}),o.jsx(_l,{required:!0,maxLength:8e3,rows:4,value:h,placeholder:v("tasks.instructionPlaceholder"),onChange:E=>g(E.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("tasks.when")}),o.jsx("div",{className:"jv-seg jv-task-kinds",role:"radiogroup","aria-label":v("tasks.when"),children:Cq.map(E=>o.jsx("button",{type:"button",role:"radio","aria-checked":y===E,onClick:()=>m(E),children:v(`tasks.kind.${E}`)},E))}),o.jsxs("div",{className:"jv-task-when","data-kind":y,children:[y==="once"&&o.jsx(Nt,{type:"datetime-local","aria-label":v("tasks.at"),value:j.at,onChange:E=>C({at:E.target.value})}),y==="every"&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"jv-task-label",children:v("tasks.everyCount")}),o.jsx(Nt,{type:"number",min:j.unit==="hours"?1:zS,step:1,"aria-label":v("tasks.everyCount"),value:j.count,onChange:E=>C({count:E.target.value})}),o.jsxs(Hr,{value:j.unit,onValueChange:E=>C({unit:E}),children:[o.jsx(Ur,{"aria-label":v("tasks.everyCount"),children:o.jsx(Fr,{})}),o.jsx($r,{className:"jv-select-menu",children:["minutes","hours"].map(E=>o.jsx(za,{value:E,children:v(`tasks.unit.${E}`)},E))})]})]}),y==="weekly"&&o.jsxs(Hr,{value:j.weekday,onValueChange:E=>C({weekday:E}),children:[o.jsx(Ur,{"aria-label":v("tasks.weekday"),children:o.jsx(Fr,{})}),o.jsx($r,{className:"jv-select-menu",children:[1,2,3,4,5,6,0].map(E=>o.jsx(za,{value:String(E),children:OS(E)},E))})]}),(y==="daily"||y==="weekly")&&o.jsx(Nt,{type:"time","aria-label":v("tasks.time"),value:j.time,onChange:E=>C({time:E.target.value})})]}),y==="every"&&!N&&o.jsx("small",{className:"jv-hint",children:v("tasks.minimum")})]}),i&&o.jsx("p",{className:"jv-note-error",role:"alert",children:i}),k&&l&&o.jsxs("div",{className:"jv-env-confirm jv-task-confirm",role:"group","aria-label":v("tasks.deleteTitle",{name:d||(e==null?void 0:e.name)||""}),children:[o.jsx("strong",{children:v("tasks.deleteTitle",{name:d||(e==null?void 0:e.name)||""})}),o.jsx("p",{children:v("tasks.deleteBody")}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(!1),children:v("common.cancel")}),o.jsx(Ne,{type:"button",variant:"ghost",className:"jv-task-delete",size:"sm",disabled:n,onClick:l,children:v("tasks.delete")})]})]}),o.jsxs("div",{className:"jv-form-footer",children:[o.jsx("div",{className:"jv-task-editor-actions",children:l&&o.jsx(Ne,{type:"button",variant:"ghost",className:"jv-task-delete",disabled:n,onClick:()=>S(!0),children:v("tasks.delete")})}),o.jsxs("div",{className:"jv-task-editor-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:c,children:v("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:n||!N||!d.trim()||!h.trim(),children:v("common.save")})]})]})]})}function Mq({bot:e,runs:n}){const[i,r]=w.useState(null),[l,c]=w.useState(null),{busy:d,error:f,setError:h,run:g}=An(),y=An(),m=d||y.busy,j=y.error;w.useEffect(()=>{let _=!0;return ue.tasks(e.id).then(R=>{_&&r(R.tasks)}).catch(R=>{_&&h(Gt(R,"tasks.loadFailed"))}),()=>{_=!1}},[e.id,n]);const b=_=>r(R=>(R??[]).some(O=>O.id===_.id)?R.map(O=>O.id===_.id?_:O):[...R??[],_]);function k(_){h(""),y.setError(""),c(_)}async function S(_){await y.run("save",async()=>{b(l==="new"||!l?await ue.createTask(e.id,_):await ue.updateTask(e.id,l.id,_)),c(null)},"tasks.saveFailed")}const N=_=>g("change",_,"tasks.changeFailed"),C=_=>N(async()=>b(await ue.setTaskOn(e.id,_.id,_.state!=="active"))),M=_=>N(async()=>{await ue.deleteTask(e.id,_.id),r(R=>(R==null?void 0:R.filter(O=>O.id!==_.id))??null),c(null)}),E=_=>_.state==="active"?_.schedule.kind==="once"||!_.nextRunAt?"":v("tasks.next",{time:C1(_.nextRunAt)}):v(_.state==="done"?"tasks.done":"tasks.paused"),T=_=>[bq(_.schedule),E(_)].filter(Boolean).join(" · ");return o.jsxs("section",{className:"jv-section","aria-label":v("tasks.title"),children:[o.jsxs("div",{className:"jv-task-head",children:[o.jsx("h3",{className:"jv-section-title",children:v("tasks.title")}),!l&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:m||i===null,onClick:()=>k("new"),children:[o.jsx(Ir,{}),v("tasks.add")]})]}),l?o.jsx(Tq,{task:l==="new"?void 0:l,busy:m,error:j,onSave:_=>void S(_),onCancel:()=>c(null),...l==="new"?{}:{onDelete:()=>void M(l)}}):i&&o.jsx("div",{className:"jv-list",children:i.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:v("tasks.empty")})})}):i.map(_=>o.jsxs("div",{className:"jv-task-row","data-state":_.state,children:[o.jsx("button",{type:"button",className:"jv-list-row jv-task-open","aria-label":_.name,onClick:()=>k(_),children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:_.name}),o.jsx("span",{children:T(_)})]})}),_.state!=="done"&&o.jsx("button",{type:"button",role:"switch","aria-checked":_.state==="active","aria-label":v("tasks.toggle",{name:_.name}),disabled:m,className:"jv-env-access jv-task-switch",onClick:()=>void C(_),children:o.jsx("span",{className:"jv-env-switch","aria-hidden":"true"})})]},_.id))}),f&&o.jsx("p",{className:"jv-note-error",role:"alert",children:f})]})}function DS({id:e,open:n,onToggle:i,text:r,meta:l,extra:c,busy:d,error:f,remove:h,confirming:g,onAskRemove:y,onCancel:m,onConfirm:j,children:b}){const k=o.jsxs("button",{type:"button",className:"jv-list-row jv-secret-row","aria-expanded":n,"aria-controls":e,onClick:i,children:[o.jsx("span",{className:"jv-row-text",children:r}),l,c&&o.jsx("span",{className:"jv-secret-room","aria-hidden":"true"}),o.jsx(_o,{className:"jv-row-chevron","aria-hidden":"true"})]});return o.jsxs(o.Fragment,{children:[c?o.jsxs("div",{className:"jv-secret-head",children:[k,o.jsx("span",{className:"jv-secret-extra",children:c})]}):k,n&&o.jsxs("div",{id:e,className:"jv-list-row jv-static-row jv-secret-details",children:[b,g?o.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":g.title,children:[o.jsx("strong",{children:g.title}),o.jsx("p",{children:g.body}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:m,children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:d,onClick:j,children:g.confirm})]})]}):o.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:d,onClick:y,children:h})}),f&&o.jsx("p",{className:"jv-note-error",role:"alert",children:f})]})]})}const kj={local:"ports.hint.local",idle:"ports.hint.idle",stopped:"ports.hint.stopped"};function Aq(e){const n=`${location.protocol}//${location.hostname.includes(":")?`[${location.hostname}]`:location.hostname}:${e.hostPort}`;return[n,...e.urls.filter(i=>i!==n)]}function LS({bot:e,runs:n}){const[i,r]=w.useState(null),[l,c]=w.useState(null),[d,f]=w.useState(!1),[h,g]=w.useState(null),{busy:y,error:m,setError:j,run:b}=An();w.useEffect(()=>{let C=!0;return ue.ports(e.id).then(M=>{C&&r(M.ports)}).catch(M=>{C&&j(Gt(M,"ports.loadFailed"))}),()=>{C=!1}},[e.id,n]);function k(C){j(""),f(!1),c(M=>M===C?null:C)}const S=C=>b("unpublish",async()=>{await ue.unpublishPort(e.id,C.port),r(M=>(M==null?void 0:M.filter(E=>E.port!==C.port))??null),c(null),f(!1)},"ports.changeFailed"),N=l!==null&&!!(i!=null&&i.some(C=>C.port===l));return o.jsxs("section",{className:"jv-section","aria-label":v("ports.title"),children:[o.jsx("h3",{className:"jv-section-title",children:v("ports.title")}),i&&o.jsx("div",{className:"jv-list",children:i.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:v("ports.empty")})})}):i.map(C=>{const M=Aq(C),E=l===C.port;return o.jsxs(DS,{id:`port-${e.id}-${C.port}`,open:E,onToggle:()=>k(C.port),busy:y,error:E?m:"",text:o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:C.name}),o.jsxs("span",{className:"jv-port-line",children:[v("ports.port",{port:C.hostPort})," · ",o.jsx("span",{className:"jv-port-state","data-state":C.state,children:v(`ports.state.${C.state}`)})]})]}),meta:null,extra:o.jsx(Ne,{asChild:!0,variant:"ghost",size:"icon-sm",children:o.jsx("a",{href:M[0],target:"_blank",rel:"noopener noreferrer","aria-label":v("ports.open",{name:C.name}),children:o.jsx(df,{})})}),remove:v("ports.stop"),confirming:E&&d?{title:v("ports.stopTitle",{name:C.name}),body:v("ports.stopBody"),confirm:v("ports.stop")}:null,onAskRemove:()=>f(!0),onCancel:()=>f(!1),onConfirm:()=>void S(C),children:[C.description&&o.jsx("p",{className:"jv-port-about",children:C.description}),kj[C.state]&&o.jsx("p",{className:"jv-port-hint",role:"note",children:v(kj[C.state])}),o.jsx("div",{className:"jv-port-links",children:M.map((T,_)=>o.jsxs("div",{className:"jv-port-link",children:[o.jsx("span",{children:v(_?"ports.linkOther":"ports.link")}),o.jsx("code",{title:T,children:T}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":v(h===T?"ui.copied":"ports.copy"),onClick:()=>void ql(T).then(R=>g(R?T:null)),children:h===T?o.jsx(Ba,{}):o.jsx(eu,{})}),o.jsx(Ne,{asChild:!0,variant:"ghost",size:"icon-sm",children:o.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer","aria-label":v("ports.open",{name:C.name}),children:o.jsx(df,{})})})]},T))}),o.jsx("p",{className:"jv-port-from",children:v("ports.from",{port:C.port})})]},C.port)})}),m&&!N&&o.jsx("p",{className:"jv-note-error",role:"alert",children:m})]})}const BS=[["overview","bot.tab.overview"],["profile","bot.tab.profile"],["environment","bot.tab.environment"],["access","bot.tab.access"],["tasks","bot.tab.tasks"],["activity","bot.tab.activity"],["usage","usage.title"]],_q=[...BS,["log","bot.tab.log"]];function Rq({bot:e,status:n,connections:i,chats:r,onSaved:l,onManageModels:c,onManageSecrets:d,onAddMachine:f,onClose:h,onOpenChat:g,onOpenSubscription:y}){const[m,j]=w.useState("overview"),[b,k]=w.useState(()=>new Set(["overview"])),S=w.useRef(null);w.useEffect(()=>{var _;(_=S.current)==null||_.scrollIntoView({block:"nearest",inline:"nearest"})},[m]);const N=_=>{j(_),k(R=>R.has(_)?R:new Set(R).add(_))},C=e.agent?_q:BS,M=_=>{const R=C.findIndex(([I])=>I===m),O={ArrowRight:R+1,ArrowLeft:R-1,Home:0,End:C.length-1}[_.key];O!==void 0&&(_.preventDefault(),N(C[(O+C.length)%C.length][0]),requestAnimationFrame(()=>{var I;return(I=S.current)==null?void 0:I.focus()}))},E=`${(n==null?void 0:n.status)??"stop"}:${(n==null?void 0:n.runId)??""}`,T=(_,R,O=!1)=>b.has(_)&&o.jsx("div",{id:`jv-bot-panel-${_}`,role:"tabpanel","aria-labelledby":`jv-bot-tab-${_}`,hidden:m!==_,className:O?"jv-bot-fill":"jv-bot-scroll",children:R},_);return o.jsx(CS,{open:!0,onOpenChange:_=>{_||h()},children:o.jsxs(NS,{className:"jv-bot-info jv-ui","aria-describedby":void 0,children:[o.jsx(rq,{bot:e,status:n,onSaved:l}),o.jsx("div",{className:"jv-bot-tabs",role:"tablist","aria-label":v("entry.botInfo"),onKeyDown:M,children:C.map(([_,R])=>o.jsx("button",{id:`jv-bot-tab-${_}`,ref:m===_?S:void 0,type:"button",role:"tab","aria-selected":m===_,"aria-controls":`jv-bot-panel-${_}`,tabIndex:m===_?0:-1,onClick:()=>N(_),children:v(R)},_))}),T("overview",o.jsx(lq,{bot:e,status:n,connections:i,chats:r,onSaved:l,onManageModels:c,onOpenSubscription:y})),T("profile",o.jsx(cq,{bot:e,onSaved:l})),T("environment",o.jsxs(o.Fragment,{children:[o.jsx(AS,{bot:e,onSaved:l}),o.jsx(LS,{bot:e,runs:E})]})),T("access",o.jsx(xq,{bot:e,onSaved:l,onManageSecrets:d,onAddMachine:f})),T("tasks",o.jsx(Mq,{bot:e,runs:E})),T("activity",o.jsx(zI,{botId:e.id,onOpenChat:g}),!0),T("usage",o.jsx(qI,{botId:e.id}),!0),e.agent&&T("log",o.jsx(Sq,{bot:e,runs:E}))]})})}function IS({id:e,value:n,sections:i,onChange:r}){const[l,c]=w.useState(null);return o.jsxs(Hr,{value:n??"none",onValueChange:d=>r(d==="none"?null:d),children:[o.jsx(Ur,{id:e,ref:d=>c((d==null?void 0:d.closest("dialog"))??null),className:"jv-select jv-section-select",children:o.jsx(Fr,{})}),o.jsxs($r,{className:"jv-select-menu",position:"popper",sideOffset:4,container:l,children:[o.jsx(za,{value:"none",children:v("info.noSection")}),i.map(d=>o.jsx(za,{value:d.id,children:d.name},d.id))]})]})}const Oq=1024*1024,zq=e=>e==="text"||e==="markdown"||e==="html"||e==="svg",Dq=["txt","json","jsonl","yaml","yml","ts","tsx","js","jsx","mjs","cjs","css","log","csv","py","sh","sql","toml","xml","ini","env","diff","patch"],Si=e=>`/api/attachments/${e.id}`,Lq=e=>N1(e)==="gif"||e.mimeType==="image/gif"?Si(e):`${Si(e)}/thumb`,N1=e=>e.name.includes(".")?e.name.split(".").pop().toLowerCase():"";function cu(e){const n=N1(e),i=e.mimeType.toLowerCase();return n==="svg"||i==="image/svg+xml"?"svg":i.startsWith("image/")||["png","jpg","jpeg","gif","webp","avif","bmp"].includes(n)?"image":i.startsWith("video/")?"video":i.startsWith("audio/")?"audio":["webm","mp4","mov"].includes(n)?"video":["mp3","wav","ogg"].includes(n)?"audio":["html","htm"].includes(n)||i==="text/html"?"html":["md","markdown"].includes(n)?"markdown":i.startsWith("text/")||Dq.includes(n)?"text":"download"}const Fc=e=>e==="image"||e==="svg",qS=e=>e==="video"||e==="audio",PS={image:"files.kindImage",svg:"files.kindSvg",video:"files.kindVideo",audio:"files.kindAudio",html:"files.kindHtml",markdown:"files.kindMarkdown",text:"files.kindText",download:"files.kindFile"};function HS(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}async function FS(e,n){const i=await fetch(Si(e),{signal:n,credentials:"same-origin"});if(!i.ok)throw new Error(i.status===404?v("files.gone"):v("files.readFailed",{status:i.status}));return i.text()}async function US(e,n){return cu(e)==="svg"?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await FS(e,n))}`:Si(e)}const Sj=e=>`/api/attachments/${e.id}/run`;function Bq(e){const n=new DOMParser().parseFromString(e,"text/html");let i=n.querySelectorAll("script").length;const r=new Set;return n.querySelectorAll("*").forEach(l=>{for(const c of[...l.attributes])if(c.name.startsWith("on"))i++;else if(/^\s*javascript:/i.test(c.value)&&["href","src","action","formaction","xlink:href"].includes(c.name))i++;else if(["src","href"].includes(c.name)&&l.tagName!=="A")try{const d=new URL(c.value);(d.protocol==="http:"||d.protocol==="https:")&&r.add(d.host)}catch{}}),i?{count:i,hosts:[...r]}:null}function Iq(e){const n=new DOMParser().parseFromString(e,"text/html");return n.querySelectorAll("script,iframe,frame,object,embed,link,meta,base,audio,video,source,track").forEach(i=>i.remove()),n.querySelectorAll("*").forEach(i=>{for(const r of[...i.attributes])(r.name.startsWith("on")||["href","xlink:href","srcset","action","formaction","target","autofocus","contenteditable"].includes(r.name)||r.name==="src"&&!r.value.startsWith("data:image/"))&&i.removeAttribute(r.name);["BUTTON","INPUT","SELECT","TEXTAREA"].includes(i.tagName)&&i.setAttribute("disabled","")}),`<!doctype html><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; form-action 'none'; base-uri 'none'"><meta charset="utf-8">${n.documentElement.outerHTML}`}const Cj=new Map;function qq({file:e,onSize:n}){const i=cu(e)==="svg",[r,l]=w.useState(()=>i?void 0:Lq(e)),[c,d]=w.useState(!1);w.useEffect(()=>{if(!i)return;const h=new AbortController;return d(!1),US(e,h.signal).then(l).catch(()=>{h.signal.aborted||d(!0)}),()=>h.abort()},[e.id]);const f=()=>{!i&&r!==Si(e)?l(Si(e)):d(!0)};return c?o.jsx("span",{className:"ui-broken-image",children:o.jsx(qe,{name:"image"})}):r?o.jsx("img",{src:r,alt:e.name,loading:"lazy",onError:f,onLoad:h=>{const{naturalWidth:g,naturalHeight:y}=h.currentTarget;g&&y&&n({width:g,height:y})}}):o.jsx(qe,{name:"image"})}function Pq({file:e,onOpen:n}){const[i,r]=w.useState(()=>Cj.get(e.id)),l=cu(e),c=Fc(l),d=qS(l),f=N1(e).toUpperCase(),h=c&&i?{"--image-w":`${i.width}px`,"--image-ratio":`${i.width/i.height}`}:void 0;return o.jsxs("div",{className:`ui-message-file ${c?"ui-message-image":""}`,"data-sized":h?"":void 0,style:h,children:[o.jsxs("button",{type:"button",className:"ui-message-open",onClick:n,"aria-label":v("files.preview",{name:e.name}),children:[c?o.jsx("span",{className:"ui-image-frame",children:o.jsx(qq,{file:e,onSize:g=>{Cj.set(e.id,g),r(g)}})}):o.jsx("span",{className:"ui-file-icon","data-kind":d?l:void 0,children:o.jsx(qe,{name:d?`file-${l}`:"file"})}),o.jsxs("span",{className:"ui-file-copy",children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsxs("small",{children:[d?`${v(PS[l])} · `:"",f?`${f} · `:"",HS(e.size)]})]})]}),o.jsx("a",{className:"ui-iconbtn",href:Si(e),download:e.name,"aria-label":v("files.download",{name:e.name}),title:v("files.download",{name:e.name}),children:o.jsx(qe,{name:"cloud-download"})})]})}function $S({files:e,onOpen:n}){const i=e.some(r=>Fc(cu(r)));return o.jsx("div",{className:`ui-message-files ${i?"ui-has-images":""}`,children:e.map((r,l)=>o.jsx(Pq,{file:r,onOpen:()=>n(l)},r.id))})}function E1({icon:e,title:n,titleClass:i,purpose:r,label:l,busy:c,error:d,ready:f,decline:h,confirm:g,onDecline:y,onConfirm:m,once:j,children:b}){const k=w.Children.toArray(b).length>0||!!d,S=N=>{N.preventDefault(),f&&m()};return o.jsxs("form",{className:"jv-question jv-secret-request",autoComplete:"off","aria-label":l,"aria-busy":c||void 0,onSubmit:S,children:[o.jsxs("div",{className:"jv-question-head",children:[o.jsx("span",{className:"jv-question-icon",children:e}),o.jsxs("div",{className:"jv-question-heading",children:[o.jsx("p",{className:i?`jv-question-title ${i}`:"jv-question-title",children:n}),o.jsx("p",{className:"jv-question-detail",children:r})]})]}),k&&o.jsxs("div",{className:"jv-question-body",children:[b,d&&o.jsx("p",{className:"jv-question-error",role:"alert",children:d})]}),o.jsxs("div",{className:"jv-question-foot",children:[o.jsx("button",{type:"button",className:"ui-button",disabled:c,onClick:y,children:h}),j&&o.jsx("button",{type:"button",className:"ui-button",disabled:c||!f,onClick:j.onClick,children:j.label}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:c||!f,children:g})]})]})}function T1({icon:e,title:n,state:i,text:r,purpose:l}){return o.jsx("div",{className:"jv-question jv-question-settled","data-state":i,children:o.jsxs("div",{className:"jv-question-head",children:[o.jsx("span",{className:"jv-question-icon",children:e}),o.jsxs("div",{className:"jv-question-heading",children:[o.jsx("p",{className:"jv-question-title",children:n}),o.jsx("p",{className:"jv-question-detail",children:l})]}),o.jsxs("span",{className:"jv-question-outcome",children:[i==="answered"?o.jsx(Ba,{"aria-hidden":"true"}):o.jsx(Ow,{"aria-hidden":"true"}),r]})]})})}function VS({label:e,value:n,visible:i,disabled:r,autoFocus:l,placeholder:c,hint:d,short:f,onChange:h,onVisible:g}){return o.jsxs("label",{className:"ui-field jv-secret-request-value",children:[o.jsx("span",{children:e}),o.jsxs("span",{className:"jv-secret-request-field",children:[o.jsx("input",{type:i?"text":"password",autoComplete:"new-password",spellCheck:!1,autoFocus:l,placeholder:c,value:n,disabled:r,onChange:y=>h(y.target.value)}),o.jsx("button",{type:"button","aria-label":v(i?"secrets.hideValue":"secrets.showValue"),onClick:()=>g(!i),children:i?o.jsx(kg,{}):o.jsx(Sg,{})})]}),o.jsx("small",{"data-short":f||void 0,children:d})]})}function Hq({message:e,onSettled:n}){var C;const i=e.question,r=i.secret,[l,c]=w.useState(""),[d,f]=w.useState(!1),[h,g]=w.useState(!1),{busy:y,error:m,run:j}=An();if(i.state!=="pending"){const M=i.state!=="answered"?v(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):v(((C=i.answer)==null?void 0:C.selected[0])===1?"request.outcome.once":"request.outcome.allowed");return o.jsx(T1,{icon:o.jsx(ff,{"aria-hidden":"true"}),title:r.name,state:i.state,text:M,purpose:r.purpose})}const b=r.needsValue||h,k=l.length>0&&l.length<8,S=M=>{y||j("answer",async()=>n(await M()),"question.failed")},N=M=>S(()=>ue.fulfilSecret(e.chatId,e.id,{scope:M,...b?{value:l}:{}}));return o.jsxs(E1,{icon:o.jsx(ff,{"aria-hidden":"true"}),title:r.name,titleClass:"jv-secret-request-name",purpose:r.purpose,label:v("secretCard.title",{name:r.name}),busy:y,error:m,ready:!b||!!l,decline:v("secretCard.decline"),confirm:v("secretCard.always"),onDecline:()=>S(()=>ue.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>N("always"),once:{label:v("secretCard.once"),onClick:()=>N("once")},children:[!window.isSecureContext&&o.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[o.jsx(zf,{"aria-hidden":"true"}),v("secretCard.insecure")]}),r.exists&&!r.needsValue&&o.jsxs("p",{className:"jv-secret-request-note",children:[v("secretCard.exists"),o.jsx("button",{type:"button",className:"jv-secret-request-link",onClick:()=>{g(!h),c("")},children:v(h?"secretCard.keepValue":"secretCard.replace")})]}),r.exists&&r.needsValue&&o.jsx("p",{className:"jv-secret-request-note",children:v("secretCard.unreadable")}),b&&o.jsx(VS,{label:v("secretCard.value"),value:l,visible:d,disabled:y,autoFocus:!0,placeholder:v("secretCard.valuePlaceholder"),hint:v(k?"secrets.shortValue":"secretCard.valueHint"),short:k,onChange:c,onVisible:f})]})}function Fq({message:e,onSettled:n}){const i=e.question,r=i.machine,[l,c]=w.useState(""),[d,f]=w.useState(!1),{busy:h,error:g,setError:y,run:m}=An(),[j,b]=w.useState("password"),k=RS(i.state==="pending"&&!r.existing&&j==="key"),S=`${r.user}@${r.host}${r.port===22?"":`:${r.port}`}`;if(i.state!=="pending"){const E=i.state!=="answered"?v(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):v(r.existing?"request.outcome.allowed":"request.outcome.added");return o.jsx(T1,{icon:o.jsx(El,{"aria-hidden":"true"}),title:r.name,state:i.state,text:E,purpose:r.purpose})}const N=E=>{h||m("answer",async()=>{try{n(await E())}catch(T){throw T instanceof er&&T.code==="ssh_key_expired"&&k.renew(),T}},"question.failed")},C=!r.existing,M=!C||(j==="key"?!!k.key:!!l);return o.jsxs(E1,{icon:o.jsx(El,{"aria-hidden":"true"}),title:r.name,purpose:r.purpose,label:v("machineCard.title",{name:r.name}),busy:h,error:g,ready:M,decline:v("machineCard.decline"),confirm:v(C?j==="key"?h?"machines.verifying":"machines.verify":h?"machines.connecting":"machineCard.add":"machineCard.allow"),onDecline:()=>N(()=>ue.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>N(()=>ue.fulfilMachine(e.chatId,e.id,j==="key"&&k.key?{keyId:k.key.keyId}:{password:l})),children:[o.jsxs("p",{className:"jv-machine-where",children:[o.jsx("code",{children:S}),r.directory&&o.jsx("code",{children:r.directory})]}),r.existing?o.jsx("p",{className:"jv-secret-request-note",children:v("machineCard.existing")}):o.jsxs(o.Fragment,{children:[!window.isSecureContext&&o.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[o.jsx(zf,{"aria-hidden":"true"}),v("secretCard.insecure")]}),o.jsxs("div",{className:"jv-machine-card-field",children:[o.jsx("span",{children:v("machines.fingerprint")}),o.jsx("div",{className:"jv-machine-prints",children:r.hostKeys.fingerprints.map(E=>o.jsx("code",{children:E},E))}),o.jsx("small",{children:v("machines.fingerprintHint")})]}),o.jsx("div",{className:"jv-secret-request-seg",role:"radiogroup","aria-label":v("machines.login"),children:["password","key"].map(E=>o.jsx("button",{type:"button",role:"radio","aria-checked":j===E,disabled:h,onClick:()=>{b(E),y("")},children:v(E==="password"?"machines.byPassword":"machines.byKey")},E))}),j==="password"?o.jsx(VS,{label:v("machines.password"),value:l,visible:d,disabled:h,hint:v("machines.passwordHint"),onChange:c,onVisible:f}):o.jsxs("div",{className:"jv-machine-card-field",children:[o.jsx("span",{children:v("machines.publicKey")}),k.key?o.jsx(S1,{publicKey:k.key.publicKey}):k.error?o.jsx("p",{className:"jv-question-error",role:"alert",children:k.error}):o.jsx("small",{children:"…"}),o.jsx("small",{children:v("machines.keyHint",{user:r.user})})]})]})]})}function Uq({message:e,onSettled:n}){var y;const i=e.question,r=i.enter,l=r.kind==="sandbox"?v("envs.sandboxOf",{name:r.name}):r.name,{busy:c,error:d,run:f}=An();if(i.state!=="pending"){const m=i.state!=="answered"?v(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):v(((y=i.answer)==null?void 0:y.selected[0])===1?"request.outcome.once":"request.outcome.allowed");return o.jsx(T1,{icon:r.kind==="sandbox"?o.jsx(C0,{"aria-hidden":"true"}):o.jsx(El,{"aria-hidden":"true"}),title:l,state:i.state,text:m,purpose:r.purpose})}const h=m=>{c||f("answer",async()=>n(await m()),"question.failed")},g=m=>h(()=>ue.answerQuestion(e.chatId,e.id,{action:"answer",selected:[m]}));return o.jsx(E1,{icon:r.kind==="sandbox"?o.jsx(C0,{"aria-hidden":"true"}):o.jsx(El,{"aria-hidden":"true"}),title:l,purpose:r.purpose,label:v("enterCard.title",{name:l}),busy:c,error:d,ready:!0,decline:v("secretCard.decline"),confirm:v("secretCard.always"),onDecline:()=>h(()=>ue.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>g(0),once:{label:v("secretCard.once"),onClick:()=>g(1)},children:r.address&&o.jsx("p",{className:"jv-machine-where",children:o.jsx("code",{children:r.address})})})}const Nj=e=>String.fromCharCode(65+e),Ej=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable;function GS(e){const{message:n}=e,{secret:i,machine:r,enter:l}=n.question;return i?o.jsx(Hq,{message:{...n,question:{...n.question,secret:i}},onSettled:e.onSettled}):r?o.jsx(Fq,{message:{...n,question:{...n.question,machine:r}},onSettled:e.onSettled}):l?o.jsx(Uq,{message:{...n,question:{...n.question,enter:l}},onSettled:e.onSettled}):o.jsx($q,{...e})}function $q({message:e,keyboard:n,onSettled:i}){var C,M;const r=e.question,l=r.state==="pending",c=w.useId(),[d,f]=w.useState([]),[h,g]=w.useState(""),{busy:y,error:m,run:j}=An();async function b(E){y||!l||await j("settle",async()=>i(await ue.answerQuestion(e.chatId,e.id,E)),"question.failed")}const k=E=>{if(!r.multiple){b({action:"answer",selected:[E]});return}f(T=>T.includes(E)?T.filter(_=>_!==E):[...T,E])},S=()=>void b({action:"answer",selected:d,...h.trim()?{custom:h.trim()}:{}}),N=()=>{h.trim()&&(r.multiple?S():b({action:"answer",selected:[],custom:h.trim()}))};if(w.useEffect(()=>{if(!n||!l)return;const E=T=>{if(T.defaultPrevented||T.metaKey||T.ctrlKey||T.altKey||T.key.length!==1||Ej(T.target)||Ej(document.activeElement)||document.querySelector("dialog[open], [role=dialog]"))return;const _=T.key.toUpperCase().charCodeAt(0)-65;_<0||_>=r.options.length||(T.preventDefault(),k(_))};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)}),!l){const E=r.state==="answered"?[...(((C=r.answer)==null?void 0:C.selected)??[]).map(T=>{var _;return((_=r.options[T])==null?void 0:_.label)??""}),...(M=r.answer)!=null&&M.custom?[r.answer.custom]:[]].filter(Boolean).join(v("common.listSeparator")):null;return o.jsxs("p",{className:"jv-question-done","data-state":r.state,title:`${r.question}
796
+ ${E===null?v("question.dismissed"):v("question.chose",{answer:E})}`,children:[E===null?o.jsx(Ow,{"aria-hidden":"true"}):o.jsx(Ba,{"aria-hidden":"true"}),o.jsx("span",{className:"jv-question-answer",children:E===null?v("question.dismissed"):xg("question.chose",{answer:o.jsx("strong",{children:E})})}),o.jsx("span",{className:"jv-question-asked",children:r.question})]})}return o.jsxs("div",{className:"jv-question",role:"group","aria-labelledby":c,"aria-busy":y||void 0,children:[o.jsxs("div",{className:"jv-question-head",children:[o.jsx("span",{className:"jv-question-icon",children:o.jsx(Cw,{"aria-hidden":"true"})}),o.jsxs("div",{className:"jv-question-heading",children:[o.jsx("p",{id:c,className:"jv-question-title",children:r.question}),r.detail&&o.jsx("p",{className:"jv-question-detail",children:r.detail})]}),o.jsx("button",{type:"button",className:"jv-question-dismiss","aria-label":v("question.dismissLabel"),title:v("question.dismiss"),disabled:y,onClick:()=>void b({action:"dismiss"}),children:o.jsx(Rl,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"jv-question-body",children:[o.jsx("div",{className:"jv-question-options",role:r.multiple?"group":void 0,"aria-label":r.multiple?v("question.multiple"):void 0,children:r.options.map((E,T)=>{const _=d.includes(T);return o.jsxs("button",{type:"button",className:"jv-question-option","data-style":E.style,"data-on":_||void 0,"aria-pressed":r.multiple?_:void 0,"aria-keyshortcuts":n?Nj(T).toLowerCase():void 0,disabled:y,onClick:()=>k(T),children:[o.jsx("span",{className:"jv-question-key","aria-hidden":"true",children:_?o.jsx(Ba,{}):Nj(T)}),o.jsxs("span",{className:"jv-question-copy",children:[o.jsx("strong",{children:E.label}),E.description&&o.jsx("small",{children:E.description})]})]},E.label)})}),m&&o.jsx("p",{className:"jv-question-error",role:"alert",children:m})]}),(r.allowCustom||r.multiple)&&o.jsxs("div",{className:"jv-question-foot",children:[r.allowCustom&&o.jsx("input",{className:"jv-question-custom",value:h,maxLength:2e3,placeholder:v(r.multiple?"question.note":"question.own"),"aria-label":v("question.ownLabel"),disabled:y,onChange:E=>g(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.nativeEvent.isComposing&&(E.preventDefault(),N())}}),r.multiple?o.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!d.length&&!h.trim(),onClick:S,children:d.length?v("question.confirmCount",{count:d.length}):v("question.confirm")}):o.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!h.trim(),onClick:N,children:v("question.send")})]})]})}function Ti(e){return e?e.deleted?v("member.deleted",{name:e.name}):e.name:v("member.unknown")}const Vq={reasoning:"activity.reasoning",texting:"activity.texting",tool_calling:"activity.toolCalling",asking:"activity.asking"},YS=e=>v(Vq[e??""]??"activity.running");function KS(e,n){return e!=null&&e.connectionId?n!=null&&n.error?{label:v("activity.error"),tone:"error"}:(n==null?void 0:n.status)==="running"?{label:YS(n.activity),tone:"busy"}:{label:v((n==null?void 0:n.status)==="idle"?"activity.idle":"activity.stopped")}:{label:v("activity.noModel")}}const Gq=e=>e.environment.current==="ssh"?v("botCard.onMachine",{name:e.environment.currentName??""}):v("botCard.sandbox"),Ei=e=>e.filter(n=>!n.deleted);function Yq(e){const n=new Set(e.map(r=>r.toLowerCase()));let i=v("bot.newName");for(let r=2;n.has(i.toLowerCase());r++)i=v("bot.newNameN",{n:r});return i}const o0=/[\p{Script=Latin}\p{Nd}_]/u;function M1(e,n){const i=e.replace(/```[\s\S]*?```|`[^`\n]*`/g,d=>" ".repeat(d.length)),r=i.toLowerCase(),l=[...n].sort((d,f)=>f.name.length-d.name.length),c=[];for(let d=r.indexOf("@");d>=0;d=r.indexOf("@",d+1)){if(d>0&&o0.test(i[d-1]))continue;const f=l.find(h=>{const g=h.name.toLowerCase();if(!g||!r.startsWith(g,d+1))return!1;const y=i[d+1+g.length];return!(y&&o0.test(y)&&o0.test(g.at(-1)))});f&&(c.push({member:f,at:d,length:f.name.length+1}),d+=f.name.length)}return c}function Kq(e,n,i){let r="",l=0;for(const c of M1(e,n))r+=e.slice(l,c.at)+`[${e.slice(c.at,c.at+c.length)}](${c.member.id===i?"#mention-me":"#mention"})`,l=c.at+c.length;return r+e.slice(l)}function Xq(e){return e.type==="dm"?v("ref.dm",{title:e.title}):e.type==="thread"&&e.parentTitle?`# ${e.parentTitle} › ${e.title}`:`# ${e.title}`}function Qq({target:e,members:n,onJump:i}){const[r,l]=w.useState(!1),c=w.useRef(""),d=w.useRef(void 0),f=w.useRef(!1);w.useEffect(()=>()=>window.clearTimeout(d.current),[]);const h=Ti(n.find(b=>b.id===e.senderId)),g=Ds(e),y=(b,k)=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(b),k)},m=b=>k=>{k.pointerType==="mouse"&&y(b,b?350:150)},j=()=>{window.clearTimeout(d.current),f.current=!0,l(!1),i==null||i()};return o.jsxs(Vf,{open:r,onOpenChange:l,children:[o.jsxs(Gf,{className:"jv-ref-tag",title:"","aria-label":v("ref.label",{name:h,text:g}),onPointerDown:b=>{c.current=b.pointerType},onPointerEnter:m(!0),onPointerLeave:m(!1),onClick:b=>{const k=c.current==="touch"||c.current==="pen";c.current="",!k&&i&&(b.preventDefault(),j())},children:[o.jsx(qe,{name:"chat-bubble"}),o.jsx("span",{className:"jv-quote-name",children:v("quote.by",{name:h})}),o.jsx("span",{className:"jv-quote-text",children:g})]}),o.jsx(Yf,{children:o.jsxs(Kf,{className:"jv-ref-card jv-ui",side:"top",align:"start",sideOffset:6,collisionPadding:12,onOpenAutoFocus:b=>b.preventDefault(),onPointerEnter:m(!0),onPointerLeave:m(!1),onCloseAutoFocus:b=>{f.current&&b.preventDefault(),f.current=!1},children:[o.jsxs("div",{className:"jv-ref-place",children:[o.jsx("span",{children:Xq(e.chat)}),o.jsxs("span",{children:[_f(e.createdAt)," ",Ao(e.createdAt)]})]}),o.jsx("div",{className:"jv-ref-name",children:h}),o.jsx("p",{className:"jv-ref-text",children:g}),i&&o.jsx("button",{type:"button",className:"jv-ref-open",onClick:j,children:v("ref.open")})]})})]})}const XS=/\[\[q(\d+)\]\]/g,ug=(e,n=40)=>{const i=e.replace(/\s+/g," ").trim();return i.length>n?`${i.slice(0,n)}…`:i};function A1(e){return e.content.replace(XS,(n,i)=>{const r=e.quotes[Number(i)-1];return r?v("quote.inline",{text:r.text}):n})}function Ds(e){return A1(e).replace(/[*`~#>]/g,"").replace(/\s+/g," ").trim()||v("common.attachment")}function QS({message:e,members:n,me:i,onJump:r}){const l=Kq(e.content,n.filter(f=>e.mentions.includes(f.id)),i).replace(XS,(f,h)=>e.quotes[Number(h)-1]?`[q${h}](#quote-${h})`:f),c=f=>{const h=e.quotes[f-1];if(!h)return null;const g=Ti(n.find(y=>y.id===h.senderId));return o.jsxs("button",{type:"button",className:"jv-quote-tag",title:v("sidebar.said",{name:g,text:h.text}),"data-gone":h.messageId?void 0:"",onClick:()=>r==null?void 0:r(h.messageId,h.text),children:[o.jsx(qe,{name:"quote"}),o.jsx("span",{className:"jv-quote-name",children:v("quote.by",{name:g})}),o.jsx("span",{className:"jv-quote-text",children:ug(h.text,80)})]})},d=f=>{const h=e.refs.find(g=>g.id===f);return h?o.jsx(Qq,{target:h,members:n,onJump:r&&(()=>r(f))}):null};return o.jsx(Pl,{text:l,renderQuote:c,renderRef:d})}function ZS(e,n){var m;const i=n.replace(/\s+/g,"");if(!i||typeof CSS>"u"||!("highlights"in CSS))return!1;const r=e.querySelector(".ui-bubble")??e,l=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),c=[];for(let j=l.nextNode();j;j=l.nextNode())if(!((m=j.parentElement)!=null&&m.closest(".jv-quote-tag, button")))for(let b=0;b<j.data.length;b++)/\s/.test(j.data[b])||c.push({node:j,offset:b});const d=c.map(j=>j.node.data[j.offset]).join(""),f=d.indexOf(i);if(f<0)return!1;const h=c[f],g=c[f+i.length-1],y=new Range;return y.setStart(h.node,h.offset),y.setEnd(g.node,g.offset+1),CSS.highlights.set("jv-passage",new Highlight(y)),setTimeout(()=>CSS.highlights.delete("jv-passage"),2400),!0}function Nf(e,n){var i;(i=e.querySelector(".jv-long-toggle[aria-expanded='false']"))==null||i.click(),e.scrollIntoView({block:"center",behavior:"smooth"}),!(n&&ZS(e,n))&&(e.classList.add("jv-jump"),setTimeout(()=>e.classList.remove("jv-jump"),1200))}function Zq({quotes:e,onRemove:n}){return e.length?o.jsx("div",{className:"jv-compose-quotes",children:e.map((i,r)=>o.jsxs("span",{className:"jv-quote-tag",title:v("sidebar.said",{name:i.name,text:i.text}),children:[o.jsx(qe,{name:"quote"}),o.jsx("span",{className:"jv-quote-name",children:v("quote.by",{name:i.name})}),o.jsx("span",{className:"jv-quote-text",children:ug(i.text)}),o.jsx("button",{type:"button","aria-label":v("quote.remove",{text:ug(i.text,20)}),onClick:()=>n(r),children:"×"})]},r))}):null}function _1({container:e,drafts:n,chatId:i,source:r,members:l,onNotice:c}){const d=(y,m)=>{const j=r(y);j&&!Jq(n,i,j,l,m)&&c(v("quote.tooMany",{count:10}))},[f,h]=w.useState(null);if(w.useEffect(()=>{const y=e.current;if(!y||!matchMedia("(hover: hover) and (pointer: fine)").matches)return;const m=C=>{var M;return(M=C instanceof Element?C:C==null?void 0:C.parentElement)==null?void 0:M.closest(".ui-bubble")},j=()=>{var R,O;const C=getSelection(),M=(C==null?void 0:C.toString())??"";if(!C||C.isCollapsed||!M.trim()){h(null);return}const E=m(C.anchorNode),T=E==null?void 0:E.closest("[data-message]");if(!E||!T||!y.contains(E)||m(C.focusNode)!==E||(O=(R=C.anchorNode)==null?void 0:R.parentElement)!=null&&O.closest(".jv-quote-tag, button")){h(null);return}const _=C.getRangeAt(0).getBoundingClientRect();h({x:Math.min(Math.max(_.left+_.width/2,90),innerWidth-90),y:Math.max(_.top-8,48),messageId:T.getAttribute("data-message"),text:M.trim()})},b=()=>requestAnimationFrame(j),k=()=>h(null),S=C=>{C.key==="Escape"&&k()},N=()=>{var C;(C=getSelection())!=null&&C.isCollapsed&&k()};return y.addEventListener("mouseup",b),y.addEventListener("scroll",k,!0),document.addEventListener("keydown",S),document.addEventListener("selectionchange",N),()=>{y.removeEventListener("mouseup",b),y.removeEventListener("scroll",k,!0),document.removeEventListener("keydown",S),document.removeEventListener("selectionchange",N)}},[e]),!f)return null;const g=()=>{var y;h(null),(y=getSelection())==null||y.removeAllRanges()};return o.jsxs("div",{className:"ui-popover jv-selection-menu",role:"menu","aria-label":v("quote.selection"),style:{left:f.x,top:f.y},onMouseDown:y=>y.preventDefault(),children:[o.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{ql(f.text),g()},children:[o.jsx(qe,{name:"copy"}),o.jsx("span",{className:"ui-menu-copy",children:v("quote.copy")})]}),o.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{d(f.messageId,f.text),g()},children:[o.jsx(qe,{name:"quote"}),o.jsx("span",{className:"ui-menu-copy",children:v("quote.quote")})]})]})}function Jq(e,n,i,r,l){if(e.get(n).passages.length>=10)return!1;const c={messageId:i.id,name:Ti(r.find(d=>d.id===i.senderId)),text:l};return e.update(n,d=>({passages:[...d.passages,c]})),!0}const Wq="modulepreload",eP=function(e){return"/"+e},Tj={},tP=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let d=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=d(i.map(g=>{if(g=eP(g),g in Tj)return;Tj[g]=!0;const y=g.endsWith(".css"),m=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${m}`))return;const j=document.createElement("link");if(j.rel=y?"stylesheet":Wq,y||(j.as="script"),j.crossOrigin="",j.href=g,h&&j.setAttribute("nonce",h),document.head.appendChild(j),y)return new Promise((b,k)=>{j.addEventListener("load",b),j.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return l.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return n().catch(c)})};let Mj;function nP(){return Mj??(Mj=tP(()=>import("./data-uMIXh-O1.js"),[]).then(e=>e.default.groups)),Mj}const aP=["👍","👎","👌","✅","❌","👀","🙏","🤔"],JS=9,WS="jarvy-emoji-recent",iP={"Smileys & Emotion":F9,"People & Body":Z9,"Animals & Nature":z9,"Food & Drink":EN,"Travel & Places":hN,Activities:kN,Objects:tN,Symbols:W9,Flags:Y9};function rP(){try{const e=JSON.parse(localStorage.getItem(WS)??"[]");return Array.isArray(e)?e.filter(n=>typeof n=="string").slice(0,JS):[]}catch{return[]}}function oP(e,n){const[,i,r,l,c]=e,d=n.toLowerCase(),f=i.toLowerCase().split(/[\s:]+/),h=r.toLowerCase().split(" "),g=c.split(" "),y=f.includes(d)||l.split(/:\s*/).includes(n)?5:h.includes(d)||g.includes(n)?4:f.some(m=>m.startsWith(d))||l.startsWith(n)?3:h.some(m=>m.startsWith(d))||g.some(m=>m.startsWith(n))?2:d.length>3&&h.some(m=>m.includes(d))||l.includes(n)||c.includes(n)?1:0;return y&&y*1e3-Math.min(h.length+g.length,999)}function sP({onPick:e}){const[n,i]=w.useState(""),[r,l]=w.useState(rP),[c,d]=w.useState(0),[f,h]=w.useState([]);w.useEffect(()=>{let M=!0;return nP().then(E=>{M&&h(E)}),()=>{M=!1}},[]);const g=w.useRef(null),y=w.useRef(null),m=w.useRef([]),j=w.useMemo(()=>{if(!f.length)return[];const M=new Map(f.flatMap(T=>T.emoji.map(_=>[_[0],_]))),E=f.map(({name:T,emoji:_})=>({key:T,label:v(`actions.emoji.${T}`),Icon:iP[T],emoji:_}));return r.length?[{key:"recent",label:v("actions.recent"),Icon:L9,emoji:r.map(T=>M.get(T)??[T,"","","",""])},...E]:E},[f,r]),b=w.useMemo(()=>{const M=n.trim();return!M||!f.length?null:f.flatMap(E=>E.emoji).map(E=>[E,oP(E,M)]).filter(([,E])=>E>0).sort((E,T)=>T[1]-E[1]).map(([E])=>E)},[n,f]),k=M=>{const E=[M,...r.filter(T=>T!==M)].slice(0,JS);l(E);try{localStorage.setItem(WS,JSON.stringify(E))}catch{}e(M)};w.useEffect(()=>{const M=y.current;if(!M||b)return;const E=()=>{const T=M.getBoundingClientRect().top;let _=0;m.current.forEach((R,O)=>{R&&R.getBoundingClientRect().top-T<40&&(_=O)}),d(_)};return M.addEventListener("scroll",E,{passive:!0}),()=>M.removeEventListener("scroll",E)},[b]);const S=M=>{const E=m.current[M];!E||!y.current||(y.current.scrollTop+=E.getBoundingClientRect().top-y.current.getBoundingClientRect().top,d(M))},N=M=>o.jsx("button",{type:"button",className:"jv-emoji-cell",title:Wi()==="zh"?M[3]:M[1],onClick:()=>k(M[0]),children:M[0]},M[0]),C=M=>{var O;const E=[...((O=g.current)==null?void 0:O.querySelectorAll(".jv-emoji-grid button"))??[]],T=E.indexOf(document.activeElement),_={ArrowRight:1,ArrowLeft:-1,ArrowDown:9,ArrowUp:-9,Home:0,End:0}[M.key];if(T<0||_===void 0)return;const R=E[M.key==="Home"?T-T%9:M.key==="End"?T-T%9+8:Math.max(0,Math.min(E.length-1,T+_))];R&&(M.preventDefault(),R.focus())};return o.jsxs("div",{className:"jv-emoji-panel",ref:g,onKeyDown:C,children:[o.jsx("div",{className:"jv-emoji-quick",children:aP.map(M=>o.jsx("button",{type:"button",onClick:()=>k(M),children:M},M))}),o.jsxs("label",{className:"jv-emoji-search",children:[o.jsx(Rs,{"aria-hidden":"true"}),o.jsx("input",{value:n,onChange:M=>i(M.target.value),placeholder:v("actions.searchEmoji"),"aria-label":v("actions.searchEmoji"),autoFocus:matchMedia("(hover: hover)").matches,onKeyDown:M=>{M.key==="Escape"&&n&&(M.stopPropagation(),i("")),M.key==="Enter"&&!M.nativeEvent.isComposing&&(b!=null&&b[0])&&(M.preventDefault(),k(b[0][0]))}})]}),o.jsx("div",{className:"jv-emoji-groups",role:"tablist","data-hidden":!j.length||void 0,children:j.map(({key:M,label:E,Icon:T},_)=>o.jsx("button",{type:"button",role:"tab","aria-selected":!b&&_===c,title:E,onKeyDown:R=>{var I,P;if(R.key!=="ArrowLeft"&&R.key!=="ArrowRight")return;R.preventDefault();const O=(_+(R.key==="ArrowRight"?1:-1)+j.length)%j.length;S(O),(P=(I=g.current)==null?void 0:I.querySelectorAll(".jv-emoji-groups button")[O])==null||P.focus()},onClick:()=>{b?(i(""),requestAnimationFrame(()=>S(_))):S(_)},children:o.jsx(T,{"aria-hidden":"true"})},M))}),o.jsx("div",{className:"jv-emoji-scroll",ref:y,role:b?void 0:"tabpanel",children:b?b.length?o.jsx("div",{className:"jv-emoji-grid",children:b.map(N)}):o.jsx("p",{className:"jv-emoji-empty",children:v("actions.noEmoji")}):j.map(({key:M,label:E,emoji:T},_)=>o.jsxs("section",{className:"jv-emoji-section",ref:R=>{m.current[_]=R},children:[o.jsx("h2",{children:E}),o.jsx("div",{className:"jv-emoji-grid",children:T.map(N)})]},M))})]})}const jl=380,Ud=310;function e6({message:e,members:n,onJump:i}){if(!e.replyTo)return null;const r=n.find(l=>l.id===e.replyTo.senderId);return o.jsxs("button",{type:"button",className:"jv-reply-quote",onClick:()=>i(e.replyTo.id),children:[o.jsx("span",{className:"jv-reply-author",children:Ti(r)}),o.jsx("span",{className:"jv-reply-text",children:Ds(e.replyTo)})]})}const Aj=3;function t6({message:e,me:n,members:i,onReact:r,onError:l}){return e.reactions.length?o.jsx("div",{className:"jv-reactions",children:e.reactions.map(c=>{const d=c.memberIds.includes(n),f=v("common.listSeparator"),h=c.memberIds.map(y=>Ti(i.find(m=>m.id===y))),g=h.length-Aj;return o.jsxs("button",{type:"button",className:"jv-reaction","data-mine":d||void 0,title:h.join(f),onClick:()=>{try{r(e,c.emoji,!d)}catch(y){l(y)}},children:[o.jsx("span",{className:"jv-reaction-emoji",children:c.emoji}),o.jsx("span",{className:"jv-reaction-names",children:h.slice(0,Aj).join(f)}),g>0&&o.jsx("span",{className:"jv-reaction-more",children:v("reactions.more",{count:g})})]},c.emoji)})}):null}function n6({message:e,me:n,onReply:i,onReact:r,onError:l}){const[c,d]=w.useState(!1),[f,h]=w.useState(!1),[g,y]=w.useState(!1),m=w.useRef(null),[j,b]=w.useState(null);w.useEffect(()=>{if(!c)return;const N=C=>{var M;(M=m.current)!=null&&M.contains(C.target)||d(!1)};return document.addEventListener("pointerdown",N),()=>document.removeEventListener("pointerdown",N)},[c]);const k=N=>{var M;const C=!((M=e.reactions.find(E=>E.emoji===N))!=null&&M.memberIds.includes(n));try{r(e,N,C)}catch(E){l(E)}d(!1)},S=()=>{var M,E,T,_;const N=(M=m.current)==null?void 0:M.getBoundingClientRect(),C=(T=(E=m.current)==null?void 0:E.closest(".ui-transcript, .ui-pane-body"))==null?void 0:T.getBoundingClientRect();if(N){const R=((C==null?void 0:C.right)??window.innerWidth)-N.left,O=N.right-((C==null?void 0:C.left)??0),I=!!((_=m.current)!=null&&_.closest(".ui-user")),P=((C==null?void 0:C.bottom)??window.innerHeight)-N.bottom,z=N.top-((C==null?void 0:C.top)??0),q=I?R>=Ud||R>O:O<Ud&&R>O;h(P<jl),y(q),b(P<jl&&z<jl&&!matchMedia("(max-width: 640px)").matches?{top:N.top>jl+8?N.top-jl-4:Math.min(N.bottom+4,window.innerHeight-jl-8),left:Math.max(8,Math.min(q?N.left:N.right-Ud,window.innerWidth-Ud-8))}:null)}d(!c)};return o.jsxs("div",{className:"jv-message-actions",ref:m,children:[i&&o.jsx(vt,{icon:"arrow-u-up-right",label:v("actions.reply"),onClick:()=>i(e)}),o.jsx(vt,{icon:"smiley-plus",label:v("actions.react"),"aria-expanded":c,onClick:S}),c&&o.jsx("div",{className:"jv-emoji-menu",role:"dialog","aria-label":v("actions.pickEmoji"),"data-up":f||void 0,"data-right":g||void 0,style:j?{position:"fixed",top:j.top,left:j.left,right:"auto",bottom:"auto"}:void 0,onKeyDown:N=>{N.key==="Escape"&&d(!1)},children:o.jsx(sP,{onPick:k})})]})}const lP=12;function a6({children:e,whole:n=!1}){const i=w.useRef(null),[r,l]=w.useState(null),[c,d]=w.useState(n);w.useLayoutEffect(()=>{const h=i.current;if(!h)return;const g=()=>{const m=parseFloat(getComputedStyle(h).lineHeight)||24,j=Math.round(lP*m);l(h.scrollHeight>j+2*m?j:null)};g();const y=new ResizeObserver(g);return y.observe(h),()=>y.disconnect()},[]);const f=r!==null&&!c;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:i,className:"jv-long","data-cut":f||void 0,style:f?{maxHeight:r}:void 0,children:e}),r!==null&&o.jsx("button",{type:"button",className:"jv-long-toggle","aria-expanded":c,onClick:()=>d(!c),children:v(c?"fold.less":"fold.more")})]})}function i6(){const[e,n]=w.useState(new Set);return{has:i=>e.has(i),add:i=>n(r=>new Set(r).add(i))}}function r6({message:e}){return o.jsxs("div",{className:"jv-folded",children:[o.jsx("span",{className:"jv-folded-text",children:Ds(e)}),o.jsxs("span",{className:"jv-folded-tag",children:[o.jsx(qe,{name:"fold"}),v("fold.folded")]})]})}const o6="jarvy-notice-closed",cP=()=>{try{return JSON.parse(localStorage.getItem(o6)??"[]")}catch{return[]}};function sr({member:e,bots:n,size:i,working:r=!1,onBot:l}){const c=(e==null?void 0:e.kind)==="bot"?n.find(f=>f.id===e.id):void 0,d=c?o.jsx(_i,{color:c.color,mood:c.mood,size:i,badge:r?"working":void 0,crown:c.agent}):null;return c&&l?o.jsx("button",{type:"button",className:"jv-avatar-button","aria-label":v("botCard.open",{name:c.name}),"aria-haspopup":"dialog",onClick:f=>l(c,f.currentTarget.getBoundingClientRect()),children:d}):d||o.jsx("span",{className:"ui-user-avatar jv-user-avatar",style:{width:i,height:i,fontSize:Math.round(i*.38)},children:o.jsx("span",{children:((e==null?void 0:e.name)??"?").slice(0,2).toUpperCase()})})}function uP({chat:e,members:n,bots:i,infoOpen:r,membersOpen:l,threadsOpen:c,searchOpen:d,onNav:f,onInfo:h,onMembers:g,onThreads:y,onSearch:m}){const j=n.filter(b=>e.memberIds.includes(b.id));return o.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[o.jsxs("div",{className:"ui-header-left",children:[o.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:v("common.openNav"),onClick:f}),o.jsxs("button",{type:"button",className:"jv-channel-title","aria-label":v("channel.infoFor",{name:e.title}),"aria-pressed":r,onClick:h,children:[o.jsx("span",{className:"jv-hash",children:"#"}),e.title,o.jsx(qe,{name:"chevron-down"})]}),e.topic&&o.jsx("span",{className:"jv-channel-topic",children:e.topic})]}),o.jsxs("div",{className:"ui-header-actions",children:[o.jsxs("button",{type:"button",className:"jv-members-button","aria-label":v("channel.membersCount",{count:j.length}),"aria-pressed":l,title:v("channel.members"),onClick:g,children:[o.jsx("span",{className:"jv-stack",children:j.slice(0,3).map(b=>o.jsx("span",{className:"jv-stack-item",children:o.jsx(sr,{member:b,bots:i,size:22})},b.id))}),o.jsx("span",{className:"jv-members-count",children:j.length})]}),o.jsx(vt,{icon:"search",label:v("channel.search"),"aria-pressed":d,className:"jv-threads-button",onClick:m}),o.jsx(vt,{icon:"chat-bubble",label:v("channel.threads"),"aria-pressed":c,className:"jv-threads-button",onClick:y})]})]})}function dP({chat:e,onSave:n}){var b;const[i,r]=w.useState(cP),[l,c]=w.useState(null),[d,f]=w.useState(!1);w.useEffect(()=>c(null),[e.id]);const h=!i.includes(e.id),g=e.note,y=()=>r(k=>{const S=h?[...k,e.id]:k.filter(N=>N!==e.id);return localStorage.setItem(o6,JSON.stringify(S)),S}),m=async()=>{if(l!=null&&l.trim()){f(!0);try{await n(l.trim()),c(null)}finally{f(!1)}}};if(l!==null)return o.jsxs("div",{className:"jv-notice","data-editing":!0,children:[o.jsxs("div",{className:"jv-notice-head",children:[o.jsx(qe,{name:"megaphone"}),o.jsx("strong",{children:v("notice.edit")})]}),o.jsx("textarea",{className:"jv-notice-input",value:l,autoFocus:!0,"aria-label":v("notice.content"),onChange:k=>c(k.target.value)}),o.jsxs("div",{className:"jv-notice-actions",children:[o.jsx("button",{type:"button",className:"ui-button",onClick:()=>c(null),children:v("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:d||!l.trim(),onClick:()=>void m(),children:v("common.save")})]})]});if(!g)return o.jsxs("div",{className:"jv-notice","data-empty":!0,children:[o.jsx(qe,{name:"megaphone"}),o.jsx("span",{className:"jv-muted",children:v("notice.none")}),o.jsx(vt,{icon:"pencil",label:v("notice.edit"),onClick:()=>c("")})]});const j=((b=g.text.split(`
797
+ `).find(k=>k.trim()&&!k.startsWith("#")))==null?void 0:b.replace(/[*`|>-]/g,"").trim())??"";return o.jsxs("div",{className:"jv-notice","data-open":h||void 0,children:[o.jsxs("div",{className:"jv-notice-head",children:[o.jsxs("button",{type:"button",className:"jv-notice-toggle","aria-expanded":h,onClick:y,children:[o.jsx(qe,{name:"megaphone"}),o.jsx("strong",{children:v("notice.title")}),!h&&o.jsx("span",{className:"jv-notice-first",children:j}),o.jsx(qe,{name:h?"chevron-down":"chevron-right"})]}),o.jsxs("span",{className:"jv-muted jv-notice-meta",children:[g.updatedBy.name," · ",ca(g.updatedAt,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})," · ",v("notice.version",{version:g.version})]}),o.jsx(vt,{icon:"pencil",label:v("notice.edit"),onClick:()=>c(g.text)})]}),h&&o.jsx("div",{className:"jv-notice-body ui-bubble jv-flat",children:o.jsx(Pl,{text:g.text})})]})}function Ef({messages:e,members:n,bots:i,me:r,divider:l,before:c,activeQuestion:d,onSettled:f,onPreview:h,onReply:g,onOpenThread:y,onQuote:m,onReact:j,onFold:b,onJump:k,onBotCard:S,onError:N}){var E;const C=(E=e.find(T=>T.sequence>l&&T.senderId!==r))==null?void 0:E.id,M=i6();return o.jsx(o.Fragment,{children:e.map((T,_)=>{const R=e[_-1],O=n.find(q=>q.id===T.senderId),I=(R==null?void 0:R.createdAt)??c,P=!Wk(T,R,I)&&T.id!==C,z=T.folded;return o.jsxs("div",{children:[a1(T.createdAt,I)&&o.jsx(e5,{time:T.createdAt}),T.id===C&&o.jsx("div",{className:"jv-divider",role:"separator",children:o.jsx("span",{children:v("chat.newBelow")})}),o.jsxs("div",{className:"jv-row",tabIndex:-1,"data-message":T.id,"data-folded":P||void 0,"data-mention":T.mentions.includes(r)||void 0,"data-shut":z||void 0,children:[o.jsx("div",{className:"jv-row-gutter",children:P?o.jsx(Y0,{time:T.createdAt,className:"jv-row-time"}):o.jsx(sr,{member:O,bots:i,size:32,onBot:S})}),o.jsxs("div",{className:"jv-row-body",children:[!P&&o.jsxs("div",{className:"jv-row-head",children:[o.jsx("strong",{children:Ti(O)}),(O==null?void 0:O.kind)==="bot"&&o.jsx("span",{className:"jv-role",children:"Bot"}),o.jsx(Y0,{time:T.createdAt})]}),z?o.jsx(r6,{message:T}):o.jsxs(o.Fragment,{children:[T.echoOf&&o.jsx("button",{type:"button",className:"jv-echo",onClick:()=>y==null?void 0:y(T.echoOf.id),children:v("channel.echo",{title:T.echoOf.title})}),T.replyTo&&o.jsx(e6,{message:T,members:n,onJump:q=>k==null?void 0:k(q)}),T.question?o.jsx(GS,{message:{...T,question:T.question},keyboard:T.id===d,onSettled:f}):o.jsxs("div",{className:"ui-bubble jv-flat",children:[T.content&&o.jsx(a6,{whole:M.has(T.id),children:o.jsx(QS,{message:T,members:n,me:r,onJump:k})}),T.attachments.length>0&&o.jsx($S,{files:T.attachments,onOpen:q=>h(T.attachments,q)})]}),j&&o.jsx(t6,{message:T,me:r,members:n,onReact:j,onError:N??(()=>{})})]}),T.thread&&T.thread.replies>0&&o.jsxs("button",{type:"button",className:"jv-thread-link","data-done":T.thread.status==="done"||void 0,onClick:()=>y==null?void 0:y(T.thread.id),children:[v("channel.replies",{count:T.thread.replies}),T.thread.status==="done"&&` · ${v("channel.threadDone")}`,T.thread.lastReplyAt&&o.jsx("span",{className:"jv-muted",children:v("channel.lastReply",{time:i1(T.thread.lastReplyAt)})})]})]}),o.jsxs("div",{className:"jv-row-actions",children:[g&&!T.echoOf&&o.jsx(vt,{icon:"chat-bubble",label:v("channel.replyInThread"),onClick:()=>g(T)}),j&&o.jsx(n6,{message:T,me:r,onReply:m,onReact:j,onError:N??(()=>{})}),b&&o.jsx(vt,{icon:T.folded?"unfold":"fold",label:v(T.folded?"actions.unfold":"actions.fold"),onClick:()=>{T.folded&&M.add(T.id),b(T,!T.folded)}})]})]})]},T.id)})})}function s6({candidates:e,bots:n,busy:i,onCancel:r,onConfirm:l}){const[c,d]=w.useState(""),[f,h]=w.useState([]),g=e.filter(m=>m.name.toLowerCase().includes(c.trim().toLowerCase())),y=m=>h(j=>j.includes(m)?j.filter(b=>b!==m):[...j,m]);return o.jsxs("div",{className:"jv-picker",children:[o.jsx("div",{className:"ui-field",children:o.jsx("input",{type:"search",value:c,autoFocus:!0,placeholder:v("common.searchMembers"),"aria-label":v("common.searchMembers"),onChange:m=>d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&!m.nativeEvent.isComposing&&(m.preventDefault(),g.length===1&&y(g[0].id))}})}),o.jsxs("div",{className:"jv-picker-list",role:"listbox","aria-multiselectable":"true","aria-label":v("dialogs.candidates"),children:[g.map(m=>o.jsxs("button",{type:"button",role:"option","aria-selected":f.includes(m.id),className:"jv-member-option",onClick:()=>y(m.id),children:[o.jsx(sr,{member:m,bots:n,size:24}),o.jsx("span",{className:"jv-member-name",children:m.name}),o.jsx("span",{className:"jv-muted",children:m.kind==="bot"?"Bot":v("common.member")}),o.jsx("span",{className:"jv-check",children:f.includes(m.id)&&o.jsx(qe,{name:"check"})})]},m.id)),g.length===0&&o.jsx("p",{className:"jv-picker-empty",children:v(e.length?"common.noMatch":"dialogs.allInside")})]}),o.jsxs("div",{className:"ui-dialog-actions",children:[o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:r,children:v("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:i||f.length===0,onClick:()=>l(f),children:f.length?v("dialogs.addCount",{count:f.length}):v("common.add")})]})]})}function fP({chat:e,members:n,bots:i,onClose:r,onChanged:l}){const{busy:c,error:d,run:f}=An();async function h(g){await f("add",async()=>{let y=e;for(const m of g)y=await ue.addMember(e.id,m);l(y),r()},"dialogs.addFailed")}return o.jsxs(Al,{title:v("info.addMembers"),onClose:r,className:"jv-channel-dialog",children:[o.jsx(s6,{candidates:n.filter(g=>!e.memberIds.includes(g.id)),bots:i,busy:c,onCancel:r,onConfirm:g=>void h(g)}),d&&o.jsx("p",{className:"jv-form-error",role:"alert",children:d})]})}function hP({sections:e,members:n,bots:i,me:r,onClose:l,onSaved:c}){const d=w.useId(),[f,h]=w.useState(""),[g,y]=w.useState(""),[m,j]=w.useState(null),[b,k]=w.useState([r]),[S,N]=w.useState(!1),{busy:C,error:M,run:E}=An();async function T(R){R.preventDefault(),!(!f.trim()||C)&&await E("save",async()=>c(await ue.createChannel({name:f.trim(),topic:g.trim(),sectionId:m,memberIds:b.filter(O=>O!==r)})),"common.saveFailed")}const _=n.filter(R=>b.includes(R.id));return S?o.jsx(Al,{title:v("info.addMembers"),onClose:l,className:"jv-channel-dialog",children:o.jsx(s6,{candidates:n.filter(R=>!b.includes(R.id)),bots:i,busy:!1,onCancel:()=>N(!1),onConfirm:R=>{k(O=>[...O,...R]),N(!1)}})}):o.jsx(Al,{title:v("sidebar.newChannel"),onClose:l,className:"jv-channel-dialog",children:o.jsxs("form",{onSubmit:R=>void T(R),children:[o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-name`,children:v("info.name")}),o.jsx("input",{id:`${d}-name`,value:f,maxLength:80,autoFocus:!0,placeholder:v("info.newChannel"),onChange:R=>h(R.target.value)})]}),o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-topic`,children:v("info.topic")}),o.jsx("input",{id:`${d}-topic`,value:g,maxLength:200,placeholder:v("dialogs.optional"),onChange:R=>y(R.target.value)})]}),o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-section`,children:v("info.section")}),o.jsx(IS,{id:`${d}-section`,value:m,sections:e,onChange:j})]}),o.jsxs("div",{className:"jv-members",children:[o.jsxs("div",{className:"jv-members-head",children:[o.jsxs("span",{children:[v("channel.members")," · ",_.length]}),o.jsxs("button",{type:"button",className:"ui-button",onClick:()=>N(!0),children:[o.jsx(qe,{name:"person-add"}),v("info.addMembers")]})]}),_.map(R=>o.jsxs("div",{className:"jv-member-option",children:[o.jsx(sr,{member:R,bots:i,size:24}),o.jsx("span",{className:"jv-member-name",children:R.name}),o.jsx("span",{className:"jv-muted",children:R.id===r?v("common.you"):R.kind==="bot"?"Bot":v("common.member")}),R.id!==r&&o.jsx(vt,{icon:"close",label:v("members.remove",{name:R.name}),className:"jv-member-remove",onClick:()=>k(O=>O.filter(I=>I!==R.id))})]},R.id))]}),M&&o.jsx("p",{className:"jv-form-error",role:"alert",children:M}),o.jsxs("div",{className:"ui-dialog-actions",children:[o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:l,children:v("common.cancel")}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:C||!f.trim(),children:v("common.create")})]})]})})}function mP({section:e,onClose:n,onSaved:i,onDeleted:r}){const l=w.useId(),[c,d]=w.useState((e==null?void 0:e.name)??""),[f,h]=w.useState(!1),[g,y]=w.useState("");async function m(b){if(b.preventDefault(),!(!c.trim()||f)){h(!0),y("");try{i(e?await ue.updateSection(e.id,{name:c.trim()}):await ue.createSection({name:c.trim()}))}catch(k){y(Gt(k,"common.saveFailed")),h(!1)}}}async function j(){if(!(!e||!confirm(v("dialogs.deleteSection",{name:e.name})))){h(!0);try{await ue.deleteSection(e.id),r==null||r(e.id)}catch(b){y(Gt(b,"dialogs.deleteFailed")),h(!1)}}}return o.jsx(Al,{title:v(e?"dialogs.editSection":"sidebar.newSection"),onClose:n,children:o.jsxs("form",{onSubmit:b=>void m(b),children:[o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${l}-name`,children:v("dialogs.sectionName")}),o.jsx("input",{id:`${l}-name`,value:c,maxLength:80,autoFocus:!0,placeholder:v("dialogs.newSection"),onChange:b=>d(b.target.value)})]}),g&&o.jsx("p",{className:"jv-form-error",role:"alert",children:g}),o.jsxs("div",{className:"ui-dialog-actions",children:[e&&o.jsx("button",{type:"button",className:"ui-button jv-danger",disabled:f,onClick:()=>void j(),children:v("common.delete")}),o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:n,children:v("common.cancel")}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:f||!c.trim(),children:v(e?"common.save":"common.create")})]})]})})}function pP({bot:e,chats:n,onClose:i,onConfirm:r}){const[l,c]=w.useState(!1),[d,f]=w.useState(!1);return o.jsx(Al,{title:v("deleteBot.title",{name:e.name}),onClose:i,className:"jv-dialog",children:o.jsxs("div",{className:"jv-dialog-body",children:[o.jsx("p",{children:v("deleteBot.after")}),o.jsxs("ul",{className:"jv-dialog-list",children:[o.jsx("li",{children:v("deleteBot.chats",{count:n})}),o.jsx("li",{children:v("deleteBot.messages",{name:v("member.deleted",{name:e.name})})}),o.jsx("li",{children:v("deleteBot.history")})]}),o.jsxs("label",{className:"jv-checkline",children:[o.jsx("input",{type:"checkbox",checked:l,onChange:h=>c(h.target.checked)}),o.jsx("span",{children:v("deleteBot.files")})]}),o.jsx("p",{className:"jv-hint",children:v("deleteBot.filesHint")}),o.jsxs("div",{className:"jv-dialog-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:i,children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",disabled:d,onClick:()=>{f(!0),r(l).finally(()=>f(!1))},children:v(d?"deleteBot.deleting":"common.delete")})]})]})})}function l6({title:e,body:n,confirm:i,onClose:r,onConfirm:l}){const[c,d]=w.useState(!1);return o.jsx(Al,{title:e,onClose:r,className:"jv-dialog",children:o.jsxs("div",{className:"jv-dialog-body",children:[o.jsx("p",{children:n}),o.jsxs("div",{className:"jv-dialog-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:r,children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",disabled:c,onClick:()=>{d(!0),l().finally(()=>d(!1))},children:c?v("deleteBot.working"):i})]})]})})}function gP({target:e,x:n,y:i,onClose:r,onOpenBot:l,onSettings:c,onPin:d,onMute:f,onDeleteChat:h,onDeleteBot:g}){const y=w.useRef(null);w.useEffect(()=>{const b=S=>{var N;(N=y.current)!=null&&N.contains(S.target)||r()},k=S=>{S.key==="Escape"&&r()};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",k)}},[r]);const m=e.chat,j={left:Math.max(8,Math.min(n,window.innerWidth-200)),top:Math.max(8,Math.min(i,window.innerHeight-210))};return o.jsxs("div",{ref:y,className:"ui-popover jv-entry-menu",role:"menu","aria-label":v("entry.menu"),style:j,children:[m&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{d(m,!m.pinned),r()},children:[o.jsx(qe,{name:"pin"}),o.jsx("span",{className:"ui-menu-copy",children:v(m.pinned?"entry.unpin":"entry.pin")})]}),m&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{f(m,!m.muted),r()},children:[o.jsx(qe,{name:m.muted?"bell":"bell-slash"}),o.jsx("span",{className:"ui-menu-copy",children:v(m.muted?"entry.unmute":"entry.mute")})]}),e.kind==="dm"?o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{l(e.bot),r()},children:[o.jsx(qe,{name:"gear"}),o.jsx("span",{className:"ui-menu-copy",children:v("entry.botInfo")})]}):o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{c(e.chat),r()},children:[o.jsx(qe,{name:"info"}),o.jsx("span",{className:"ui-menu-copy",children:v("entry.channelInfo")})]}),!(e.kind==="dm"&&e.bot.agent)&&o.jsx("hr",{className:"ui-menu-divider"}),e.kind==="dm"?!e.bot.agent&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{g(e.bot),r()},children:[o.jsx(qe,{name:"close"}),o.jsx("span",{className:"ui-menu-copy",children:v("entry.deleteBot")})]}):o.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{h(e.chat),r()},children:[o.jsx(qe,{name:"close"}),o.jsx("span",{className:"ui-menu-copy",children:v("entry.deleteChannel")})]})]})}function vP({files:e,initialIndex:n=0,onClose:i}){const[r,l]=w.useState(n),[c,d]=w.useState("preview"),[f,h]=w.useState(!1),[g,y]=w.useState(""),[m,j]=w.useState(""),[b,k]=w.useState(""),[S,N]=w.useState(!0),[C,M]=w.useState(0),[E,T]=w.useState(!1),[_,R]=w.useState(!1),O=w.useRef(null),I=w.useRef(null),P=w.useRef(new Map),z=e[r],q=cu(z),$=qS(q),Q=zq(q)&&z.size>Oq,Y=!$&&!Q&&q!=="download";w.useEffect(()=>{const se=O.current,ne=document.activeElement;return se.showModal(),()=>{se.close(),ne!=null&&ne.isConnected&&ne.focus({preventScroll:!0})}},[]),w.useEffect(()=>{const se=new AbortController;return y(""),j(""),k(""),d("preview"),T(!1),R(!1),N(Y),Y&&(Fc(q)?US(z,se.signal).then(j):FS(z,se.signal).then(y)).then(()=>N(!1)).catch(ne=>{se.signal.aborted||(k(Gt(ne,"files.readError")),N(!1))}),()=>se.abort()},[z.id,C]),w.useEffect(()=>{I.current&&(I.current.scrollTop=P.current.get(`${r}:${c}`)??0)},[r,c,S]);const H=()=>{var se;return P.current.set(`${r}:${c}`,((se=I.current)==null?void 0:se.scrollTop)??0)},K=se=>{H(),l(Math.max(0,Math.min(e.length-1,se)))},V=w.useMemo(()=>q==="html"&&g?Bq(g):null,[q,g]),X=Y&&["markdown","html"].includes(q)&&!S&&!b,Z=Fc(q)||$&&!_?"ui-image-view":q==="html"&&c==="preview"?"ui-html-view":q==="markdown"&&c==="preview"?"ui-document":"",D=o.jsxs("a",{className:"ui-button",href:Si(z),download:z.name,children:[o.jsx(qe,{name:"cloud-download"}),v("files.downloadFile")]});return Do.createPortal(o.jsxs("dialog",{ref:O,className:"ui-viewer","aria-labelledby":"jvPreviewTitle","data-wide":f||void 0,onCancel:se=>{se.preventDefault(),i()},onKeyDown:se=>{!["ArrowLeft","ArrowRight"].includes(se.key)||["SELECT","INPUT","TEXTAREA"].includes(se.target.tagName)||(se.preventDefault(),K(r+(se.key==="ArrowLeft"?-1:1)))},children:[o.jsxs("header",{className:"ui-preview-header",children:[o.jsxs("div",{className:"ui-preview-heading",children:[o.jsx("h1",{id:"jvPreviewTitle",children:z.name}),o.jsxs("small",{children:[v(PS[q])," · ",HS(z.size)]})]}),o.jsxs("div",{className:"ui-preview-actions",children:[X&&o.jsx("button",{type:"button",className:"ui-button",onClick:()=>{H(),d(c==="source"?"preview":"source")},children:v(c==="source"?"files.showPreview":q==="html"?"files.showSource":"files.showText")}),E&&o.jsx(vt,{icon:"window",label:v("files.openTab"),onClick:()=>window.open(Sj(z),"_blank","noopener,noreferrer")}),o.jsx("a",{className:"ui-iconbtn",href:Si(z),download:z.name,"aria-label":v("files.download",{name:z.name}),title:v("files.download",{name:z.name}),children:o.jsx(qe,{name:"cloud-download"})}),o.jsx(vt,{icon:f?"arrows-contract":"arrows-expand",label:v(f?"files.narrow":"files.widen"),"data-action":"ui-wide",onClick:()=>h(!f)}),o.jsx(vt,{icon:"close",label:v("files.closePreview"),"data-action":"ui-close",onClick:i})]})]}),V&&c==="preview"&&!S&&!b&&o.jsxs("div",{className:"jv-run-tip",role:"status",children:[o.jsx("p",{children:E?v("files.running"):v("files.scripts",{count:V.count,hosts:V.hosts.length?v("files.scriptHosts",{hosts:V.hosts.slice(0,3).join(v("common.listSeparator"))+(V.hosts.length>3?v("files.andMore"):"")}):""})}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>T(!E),children:v(E?"files.stop":"files.run")})]}),o.jsx("div",{className:`ui-preview-body ${Z}`,ref:I,tabIndex:-1,children:$?_?o.jsxs("div",{className:"ui-fallback",children:[o.jsx(qe,{name:`file-${q}`}),o.jsx("strong",{children:v("files.cantPlay")}),o.jsx("p",{children:v("files.cantPlayHint")}),D]}):q==="video"?o.jsx("video",{className:"ui-preview-video",src:Si(z),controls:!0,preload:"metadata",playsInline:!0,onError:()=>R(!0)},z.id):o.jsx("audio",{className:"ui-preview-audio",src:Si(z),controls:!0,preload:"metadata",onError:()=>R(!0)},z.id):Y?S?o.jsx("p",{className:"ui-unloaded",children:v("files.reading")}):b?o.jsxs("div",{className:"ui-error",role:"alert",children:[o.jsx("p",{children:b}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>M(se=>se+1),children:v("common.retry")})]}):Fc(q)?o.jsx("img",{className:"ui-preview-image",src:m,alt:z.name}):c==="source"||q==="text"?o.jsx("pre",{className:"ui-source",tabIndex:0,children:g}):q==="html"?E?o.jsx("iframe",{title:v("files.runningTitle",{name:z.name}),sandbox:"allow-scripts",src:Sj(z),referrerPolicy:"no-referrer",className:"ui-html-frame"},"run"):o.jsx("iframe",{title:z.name,sandbox:"",srcDoc:Iq(g),referrerPolicy:"no-referrer",className:"ui-html-frame"},"static"):o.jsx("article",{className:"ui-prose",children:o.jsx(Pl,{text:g})}):o.jsxs("div",{className:"ui-fallback",children:[o.jsx(qe,{name:"file"}),o.jsx("strong",{children:v("files.downloadToView")}),o.jsx("p",{children:v(Q?"files.tooLarge":"files.unsupported")}),D]})}),e.length>1&&o.jsxs("footer",{className:"ui-preview-nav",children:[o.jsx(vt,{icon:"chevron-left",label:v("files.previous"),disabled:r===0,onClick:()=>K(r-1)}),o.jsx("select",{id:"ui-preview-select","aria-label":v("files.choose"),value:r,onChange:se=>K(Number(se.target.value)),children:e.map((se,ne)=>o.jsx("option",{value:ne,children:se.name},se.id))}),o.jsxs("span",{children:[r+1," / ",e.length]}),o.jsx(vt,{icon:"chevron-right",label:v("files.next"),disabled:r===e.length-1,onClick:()=>K(r+1)})]})]}),document.body)}function yP({dialog:e,entryMenu:n,confirm:i,preview:r,infoBot:l,bots:c,statuses:d,chats:f,sections:h,members:g,connections:y,meId:m,onDialog:j,onEntryMenu:b,onConfirm:k,onPreview:S,onInfoBot:N,onSettings:C,onAddMachine:M,onChannelInfo:E,onOpenChatId:T,chatSaved:_,openChat:R,onSectionSaved:O,onSectionDeleted:I,updateBot:P,openAnywhere:z,removeChannel:q,deleteBot:$,pinChat:Q,muteChat:Y}){return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.kind)==="channel"&&o.jsx(hP,{sections:h,members:Ei(g),bots:c,me:m,onClose:()=>j(null),onSaved:H=>{_(H),j(null),R(H)}}),(e==null?void 0:e.kind)==="members"&&o.jsx(fP,{chat:f.find(H=>H.id===e.chat.id)??e.chat,members:Ei(g),bots:c,onClose:()=>j(null),onChanged:_}),(e==null?void 0:e.kind)==="section"&&o.jsx(mP,{section:e.section,onClose:()=>j(null),onSaved:O,onDeleted:I}),n&&o.jsx(gP,{target:n.target,x:n.at.x,y:n.at.y,onClose:()=>b(null),onOpenBot:H=>N(H.id),onSettings:H=>{H.type==="channel"&&E(H)},onPin:(H,K)=>void Q(H,K),onMute:(H,K)=>void Y(H,K),onDeleteChat:H=>k({kind:"chat",chat:H}),onDeleteBot:H=>k({kind:"bot",bot:H})}),(i==null?void 0:i.kind)==="chat"&&o.jsx(l6,{title:v("app.deleteChannelTitle",{name:i.chat.title}),confirm:v("common.delete"),onClose:()=>k(null),body:v("app.deleteChannelBody"),onConfirm:async()=>{await q(i.chat),k(null)}}),(i==null?void 0:i.kind)==="bot"&&o.jsx(pP,{bot:i.bot,chats:f.filter(H=>H.type==="dm"&&H.botId===i.bot.id).length,onClose:()=>k(null),onConfirm:async H=>{await $(i.bot,H),k(null)}}),l&&o.jsx(Rq,{bot:l,status:d[l.id],connections:y,chats:f,onSaved:P,onOpenChat:H=>{N(null),T(H)},onOpenSubscription:z,onManageModels:()=>{N(null),C("models")},onManageSecrets:()=>{N(null),C("secrets")},onAddMachine:()=>{N(null),M()},onClose:()=>N(null)},l.id),r&&o.jsx(vP,{files:r.files,initialIndex:r.index,onClose:()=>S(null)})]})}function c6(e,n,i){const[r,l]=w.useState(null),[c,d]=w.useState(!1);return w.useEffect(()=>{const f=e.trim();if(!f){l(null),d(!1);return}let h=!0;d(!0);const g=setTimeout(()=>void ue.search(f,n).then(y=>{h&&l(y)}).catch(y=>{h&&i(y)}).finally(()=>{h&&d(!1)}),250);return()=>{h=!1,clearTimeout(g)}},[e,n]),{result:r,loading:c}}function u6(e,n,i){var r;return e.type==="thread"?`#${((r=n.find(l=>l.id===e.parentId))==null?void 0:r.title)??v("search.channel")} › ${e.title}`:e.type==="channel"?`#${e.title}`:Ti(i.find(l=>l.id===e.botId))}function d6({text:e,query:n,room:i=24}){const r=e.replace(/[*`~#>|]/g,"").replace(/\s+/g," ").trim(),l=r.toLocaleLowerCase().indexOf(n.trim().toLocaleLowerCase());if(l<0||!n.trim())return o.jsx(o.Fragment,{children:r.slice(0,120)});const c=Math.max(0,l-i),d=l+n.trim().length;return o.jsxs(o.Fragment,{children:[c>0&&"…",r.slice(c,l),o.jsx("mark",{className:"jv-hit",children:r.slice(l,d)}),r.slice(d,d+120)]})}const xP=e=>new Date(e).toDateString()===new Date().toDateString()?Ao(e):_f(e);function f6({message:e,chat:n,chats:i,members:r,query:l,showPlace:c=!0,onOpen:d}){return o.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>d(n,e.id),children:[o.jsxs("span",{className:"jv-hit-head",children:[o.jsx("strong",{children:Ti(r.find(f=>f.id===e.senderId))}),c&&o.jsx("span",{className:"jv-hit-place",children:u6(n,i,r)}),o.jsx("time",{dateTime:new Date(e.createdAt).toISOString(),children:xP(e.createdAt)})]}),o.jsx("span",{className:"jv-hit-text",children:o.jsx(d6,{text:A1(e),query:l})})]})}const _j=5;function lf({label:e,items:n,empty:i}){const[r,l]=w.useState(!1);return!n.length&&!i?null:o.jsxs("section",{className:"jv-result-group","aria-label":e,children:[o.jsxs("h3",{className:"jv-result-head",children:[e,o.jsx("span",{children:n.length})]}),n.length?r?n:n.slice(0,_j):o.jsx("p",{className:"jv-result-empty",children:i}),!r&&n.length>_j&&o.jsxs("button",{type:"button",className:"jv-result-more",onClick:()=>l(!0),children:[v("search.showAll",{count:n.length}),o.jsx(qe,{name:"chevron-down"})]})]})}function bP({query:e,shown:n,chats:i,members:r,onOpenChat:l,onOpenMessage:c,onError:d}){const{result:f,loading:h}=c6(e,void 0,d),g=((f==null?void 0:f.chats)??[]).filter(m=>!n.has(m.id)),y=m=>{var j,b;return o.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>l(m),children:[o.jsxs("span",{className:"jv-hit-head",children:[o.jsx("strong",{children:m.type==="thread"?m.title:`#${m.title}`}),m.type==="thread"&&o.jsx("span",{className:"jv-hit-place",children:u6(m,i,r).split(" › ")[0]})]}),(((j=m.note)==null?void 0:j.text)||m.topic)&&o.jsx("span",{className:"jv-hit-text",children:o.jsx(d6,{text:((b=m.note)==null?void 0:b.text)||m.topic,query:e})})]},m.id)};return o.jsxs("div",{className:"jv-results","aria-live":"polite",children:[o.jsx(lf,{label:v("search.threads"),items:g.filter(m=>m.type==="thread").map(y)}),o.jsx(lf,{label:v("search.channels"),items:g.filter(m=>m.type==="channel").map(y)}),f?o.jsx(lf,{label:v("search.messages"),empty:v("search.noMessages"),items:f.messages.map(({message:m,chat:j})=>o.jsx(f6,{message:m,chat:j,chats:i,members:r,query:e,onOpen:c},m.id))}):h&&o.jsx("p",{className:"jv-result-empty",children:v("search.searching")})]})}function jP({className:e,...n}){return o.jsx("div",{"data-slot":"input-group",role:"group",className:Dn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...n})}const wP=Eg("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function kP({className:e,align:n="inline-start",...i}){return o.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:Dn(wP({align:n}),e),onClick:r=>{var l,c;r.target.closest("button")||(c=(l=r.currentTarget.parentElement)==null?void 0:l.querySelector("input"))==null||c.focus()},...i})}function SP({className:e,...n}){return o.jsx(Nt,{"data-slot":"input-group-control",className:Dn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),...n})}function CP({className:e,children:n,...i}){return o.jsxs(VA,{"data-slot":"scroll-area",className:Dn("relative",e),...i,children:[o.jsx(GA,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:n}),o.jsx(NP,{}),o.jsx(YA,{})]})}function NP({className:e,orientation:n="vertical",...i}){return o.jsx(zA,{"data-slot":"scroll-area-scrollbar",orientation:n,className:Dn("flex touch-none p-px transition-colors select-none",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...i,children:o.jsx(PA,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const h6="jarvy-collapsed-sections",EP=()=>{try{return JSON.parse(localStorage.getItem(h6)??"[]")}catch{return[]}};function Rj({chat:e}){return e.alerts>0?o.jsx("span",{className:"jv-badge","aria-label":v("sidebar.alerts",{count:e.alerts}),children:e.alerts}):e.unread>0?o.jsx("span",{className:"jv-count","aria-label":v("sidebar.unread",{count:e.unread}),children:e.unread}):null}function m6(e){const n=e.hint;if(!n||n.createdAt<e.updatedAt-1e3)return null;const i=n.chatType==="thread"&&n.chatId!==e.id,r={actor:n.actor,emoji:n.detail,title:n.title.length>16?`${n.title.slice(0,16)}…`:n.title};return n.kind==="reaction"?v(i?"hint.reactionInThread":"hint.reaction",r):v(i?"hint.threadSummary":n.chatType==="thread"?"hint.summary":"hint.notice",r)}function TP(e){var n;return e.type==="channel"&&m6(e)&&((n=e.hint)==null?void 0:n.chatType)==="thread"&&e.hint.chatId!==e.id?e.hint.chatId:null}function Oj({chat:e,channel:n}){const i=m6(e),r=e.lastMessage&&Ds(e.lastMessage),l=i??(r?n&&e.lastSender?v("sidebar.said",{name:e.lastSender,text:r}):r:n?e.topic:"");return o.jsxs("span",{className:"jv-digest",children:[e.atMe&&o.jsx("span",{className:"jv-at-me",children:v("sidebar.atMe")}),o.jsx("span",{className:i?"jv-hint-line":void 0,children:l})]})}const zj=e=>{const n=e.getBoundingClientRect();return{x:n.right-168,y:n.bottom+4}};function MP({chats:e,sections:n,bots:i,members:r,onOpenMessage:l,onOpenFound:c,onError:d,working:f,asking:h,selected:g,filter:y,followed:m,followedOpen:j,onFilterChange:b,onSelect:k,onOpenBot:S,onOpenFollowed:N,onMenu:C,onEditSection:M}){const[E,T]=w.useState(EP),_=V=>T(X=>{const Z=X.includes(V)?X.filter(D=>D!==V):[...X,V];return localStorage.setItem(h6,JSON.stringify(Z)),Z}),R=y.toLocaleLowerCase(),O=e.filter(V=>{var X;return V.type!=="thread"&&`${V.title} ${V.topic} ${((X=i.find(Z=>Z.id===V.botId))==null?void 0:X.name)??""}`.toLocaleLowerCase().includes(R)}),I=(m==null?void 0:m.unread)??0,P=(m==null?void 0:m.mentions)??0,z=O.filter(V=>V.type==="channel").sort((V,X)=>Number(X.pinned)-Number(V.pinned)||V.title.localeCompare(X.title,"zh-CN")),q=i.map(V=>({bot:V,chat:e.find(X=>X.type==="dm"&&X.botId===V.id)})).filter(({bot:V})=>V.name.toLocaleLowerCase().includes(R)).sort((V,X)=>{var Z,D,se,ne;return Number(X.bot.agent)-Number(V.bot.agent)||+!!((Z=X.chat)!=null&&Z.pinned)-+!!((D=V.chat)!=null&&D.pinned)||(((se=X.chat)==null?void 0:se.updatedAt)??0)-(((ne=V.chat)==null?void 0:ne.updatedAt)??0)}),$=V=>o.jsxs("div",{className:"jv-side-wrap",onContextMenu:X=>{X.preventDefault(),C({kind:"channel",chat:V},{x:X.clientX,y:X.clientY})},children:[o.jsxs("button",{type:"button",className:"jv-side-row","data-active":g===V.id||void 0,"data-unread":V.unread>0||void 0,"aria-current":g===V.id?"page":void 0,onClick:()=>k(V),children:[V.pinned?o.jsx(E0,{className:"jv-side-pin","aria-label":v("sidebar.pinned")}):o.jsx("span",{className:"jv-hash","aria-hidden":"true",children:"#"}),o.jsxs("span",{className:"jv-side-text",children:[o.jsxs("span",{className:"jv-side-line",children:[o.jsx("span",{className:"jv-side-label",title:V.title,children:V.title}),V.muted&&o.jsx("span",{className:"jv-side-muted","aria-label":v("sidebar.muted"),children:o.jsx(qe,{name:"bell-slash"})})]}),o.jsxs("span",{className:"jv-side-line",children:[o.jsx(Oj,{chat:V,channel:!0}),o.jsx(Rj,{chat:V})]})]})]}),o.jsx("button",{type:"button",className:"jv-side-more","aria-label":v("sidebar.more",{name:V.title}),onClick:X=>C({kind:"channel",chat:V},zj(X.currentTarget)),children:o.jsx(N0,{"aria-hidden":"true"})})]},V.id),Q=({bot:V,chat:X})=>{const Z=h.has(V.id)?"asking":f.has(V.id)?"working":void 0,D=!!X&&g===X.id;return o.jsxs("div",{className:"shadcn-chat-row relative",onContextMenu:se=>{se.preventDefault(),C({kind:"dm",bot:V,chat:X},{x:se.clientX,y:se.clientY})},children:[o.jsxs(Ne,{type:"button",variant:"ghost","data-active":D,"aria-current":D?"page":void 0,className:"h-15 w-full justify-start gap-2.5 rounded-md px-2 text-left hover:bg-accent/70 data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",onClick:()=>X?k(X):S(V),children:[o.jsx(_i,{color:V.color,mood:V.mood,size:36,badge:Z,crown:V.agent}),Z&&o.jsx("span",{className:"sr-only",children:v(Z==="asking"?"sidebar.asking":"sidebar.working")}),o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${X!=null&&X.unread?"font-semibold":"font-medium"}`,title:V.name,children:V.name}),(X==null?void 0:X.muted)&&o.jsx("span",{className:"jv-side-muted","aria-label":v("sidebar.muted"),children:o.jsx(qe,{name:"bell-slash"})}),(X==null?void 0:X.pinned)&&o.jsx(E0,{className:"jv-dm-pin shrink-0","aria-label":v("sidebar.pinned")}),X&&o.jsx("time",{className:"shadcn-chat-time shrink-0 text-[11px] font-normal text-muted-foreground",dateTime:new Date(X.updatedAt).toISOString(),children:Ao(X.updatedAt)})]}),o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-normal text-muted-foreground",children:X?o.jsx(Oj,{chat:X,channel:!1}):""}),X&&o.jsx(Rj,{chat:X})]})]})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-xs","aria-label":v("sidebar.more",{name:V.name}),className:"shadcn-chat-more absolute top-4 right-2 opacity-0",onClick:se=>C({kind:"dm",bot:V,chat:X},zj(se.currentTarget)),children:o.jsx(N0,{"aria-hidden":"true"})})]},V.id)},Y=(V,X,Z,D,se)=>o.jsxs("div",{className:"jv-side-section-head",children:[o.jsxs("button",{type:"button",className:"jv-side-section-toggle","aria-expanded":!Z,onClick:()=>_(V),children:[o.jsx("span",{className:"jv-side-chevron",children:o.jsx(qe,{name:Z?"chevron-right":"chevron-down"})}),o.jsxs("span",{className:"jv-side-section-name",children:[X,Z&&D&&o.jsx("span",{className:"jv-dot","aria-label":v("sidebar.hasUnread")})]})]}),se&&o.jsx("button",{type:"button",className:"jv-side-section-edit","aria-label":v("sidebar.editSection",{name:X}),onClick:()=>M(se),children:o.jsx(qe,{name:"pencil"})})]}),H=V=>!R&&E.includes(V),K=(V,X,Z,D)=>o.jsxs("div",{className:"jv-side-section",children:[Y(V,X,H(V),Z.some(se=>se.unread>0),D),!H(V)&&Z.map($)]},V);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mx-3 mt-1 mb-2 shrink-0",role:"search",children:o.jsxs(jP,{className:"h-9 bg-background",children:[o.jsx(SP,{id:"jarvy-search",type:"search",value:y,onChange:V=>b(V.target.value),placeholder:v("sidebar.search"),"aria-label":v("sidebar.search"),onKeyDown:V=>{V.key==="Escape"&&y&&(V.preventDefault(),b(""))},className:"text-sm"}),o.jsx(kP,{align:"inline-start",children:o.jsx(Rs,{"aria-hidden":"true"})})]})}),o.jsx(CP,{className:"min-h-0 flex-1",type:"auto",children:R?o.jsxs("nav",{className:"jv-side-nav jv-side-search px-3 pb-6","aria-label":v("sidebar.results"),children:[o.jsx(lf,{label:v("sidebar.chats"),items:[...z.map($),...q.map(Q)]}),o.jsx(bP,{query:y,shown:new Set(z.map(V=>V.id)),chats:e,members:r,onOpenChat:c,onOpenMessage:l,onError:d})]}):o.jsxs("nav",{className:"jv-side-nav px-3 pb-6","aria-label":v("sidebar.nav"),children:[!!(m!=null&&m.total)&&o.jsxs("button",{type:"button",className:"jv-side-row jv-side-top","data-active":j||void 0,"data-unread":I>0||void 0,"aria-current":j?"page":void 0,onClick:N,children:[o.jsx(qe,{name:"chat-bubble"}),o.jsx("span",{className:"jv-side-label",children:v("sidebar.followed")}),P>0?o.jsx("span",{className:"jv-badge",children:P}):I>0&&o.jsx("span",{className:"jv-count",children:I})]}),n.map(V=>K(`s:${V.id}`,V.name,z.filter(X=>X.sectionId===V.id),V)),z.some(V=>!V.sectionId||!n.some(X=>X.id===V.sectionId))&&K("channels",v("sidebar.channels"),z.filter(V=>!V.sectionId||!n.some(X=>X.id===V.sectionId))),o.jsxs("div",{className:"jv-side-section",children:[Y("dms",v("sidebar.dms"),H("dms"),q.some(({chat:V})=>!!(V!=null&&V.unread))),!H("dms")&&o.jsx("div",{className:"space-y-1",children:q.map(Q)}),!H("dms")&&q.length===0&&o.jsx("p",{className:"jv-side-empty",children:v("sidebar.noDms")})]})]})})]})}function AP({chats:e,sections:n,bots:i,members:r,followed:l,followedOpen:c,working:d,asking:f,selected:h,filter:g,creating:y,createMenu:m,onFilterChange:j,onOpenFollowed:b,onOpenChat:k,onOpenBot:S,onOpenMenu:N,onEditSection:C,onCreate:M,onFind:E,onOpenFound:T,onError:_,onToggleCreate:R}){const O=w.useRef(null);return w.useEffect(()=>{if(!m)return;const I=P=>{var z;(z=O.current)!=null&&z.contains(P.target)||R(!1)};return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[m]),o.jsxs("aside",{className:"ui-sidebar","aria-label":v("sidebar.label"),children:[o.jsx("header",{className:"ui-sidebar-header",children:o.jsxs("div",{className:"jarvy-sidebar-create",ref:O,children:[o.jsx(vt,{icon:"add",label:v("sidebar.create"),"aria-expanded":m,"aria-haspopup":"menu",disabled:y,onClick:()=>R(!m)}),m&&o.jsxs("div",{className:"ui-popover jarvy-create-menu",role:"menu","aria-label":v("sidebar.createMenu"),children:[o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>M("channel"),children:[o.jsx(qe,{name:"list-bullets"}),o.jsx("span",{className:"ui-menu-copy",children:v("sidebar.newChannel")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>M("section"),children:[o.jsx(qe,{name:"folder"}),o.jsx("span",{className:"ui-menu-copy",children:v("sidebar.newSection")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>M("bot"),children:[o.jsx(qe,{name:"person-add"}),o.jsx("span",{className:"ui-menu-copy",children:v("sidebar.newBot")})]})]})]})}),o.jsx(MP,{chats:e,sections:n,bots:i,members:r,onOpenMessage:E,onOpenFound:T,onError:_,working:d,asking:f,selected:h,filter:g,onFilterChange:j,followed:l,followedOpen:c,onOpenFollowed:b,onSelect:k,onOpenBot:S,onMenu:N,onEditSection:C})]})}function _P({textarea:e,value:n,setValue:i,inside:r,outside:l,bots:c,onInvite:d,participants:f}){const[h,g]=w.useState(null),[y,m]=w.useState(0),[j,b]=w.useState(null),k=w.useRef(null),S=w.useRef(null),N=w.useRef(null);w.useLayoutEffect(()=>{N.current===null||!e.current||(e.current.focus(),e.current.setSelectionRange(N.current,N.current),N.current=null)},[n,e]);const C=(D,se)=>D.name.toLowerCase().includes(se.toLowerCase()),M=h===null?[]:r.filter(D=>C(D,h)),E=f?M.filter(D=>f.has(D.id)):M,T=f?M.filter(D=>!f.has(D.id)):[],_=E.length>0&&T.length>0,R=[...E,...T],O=h===null?[]:l.filter(D=>C(D,h)),I=j?l.filter(D=>C(D,j.search)):[],P=R.length+(O.length?1:0),z=()=>{g(null),b(null)};function q(D=n){const se=e.current,ne=se?/(?:^|[^\p{Script=Latin}\p{Nd}_])@([^\s@]*)$/u.exec(D.slice(0,se.selectionStart)):null;g(ne?ne[1]:null),m(0),b(null)}function $(D){const se=e.current;if(!se)return;r.some(F=>F.id===D.id)||d(D);const ne=n.slice(0,se.selectionStart).replace(/@([^\s@]*)$/u,`@${D.name} `),B=ne+n.slice(se.selectionStart);N.current=ne.length,i(B),z()}function Q(D){j||b({search:h??"",active:0}),D&&requestAnimationFrame(()=>{var se;return(se=S.current)==null?void 0:se.focus()})}function Y(){var D;b(null),(D=e.current)==null||D.focus()}function H(D){if(!P||D.nativeEvent.isComposing)return!1;const se=y===R.length;return D.key==="ArrowDown"||D.key==="ArrowUp"?(D.preventDefault(),m((y+(D.key==="ArrowDown"?1:-1)+P)%P),b(null),!0):(D.key==="Enter"||D.key==="Tab")&&!se?(D.preventDefault(),$(R[y]),!0):(D.key==="Enter"||D.key==="Tab"||D.key==="ArrowRight")&&se?(D.preventDefault(),Q(!0),!0):D.key==="Escape"?(D.preventDefault(),z(),!0):!1}function K(D){!j||D.nativeEvent.isComposing||((D.key==="ArrowDown"||D.key==="ArrowUp")&&I.length?(D.preventDefault(),b({...j,active:(j.active+(D.key==="ArrowDown"?1:-1)+I.length)%I.length})):D.key==="Enter"?(D.preventDefault(),I[j.active]&&$(I[j.active])):(D.key==="Escape"||D.key==="ArrowLeft"&&!j.search)&&(D.preventDefault(),Y()))}const V=D=>{var ne;const se=D.relatedTarget;(!se||!((ne=k.current)!=null&&ne.contains(se))&&se!==e.current)&&z()},X=(D,se)=>o.jsxs("button",{type:"button",role:"option","aria-selected":se,className:"ui-menu-item","data-active":se||void 0,onMouseDown:ne=>{ne.preventDefault(),$(D)},children:[o.jsx(sr,{member:D,bots:c,size:20}),o.jsx("span",{className:"ui-menu-copy",children:D.name}),o.jsx("span",{className:"jv-muted",children:D.kind==="bot"?"Bot":v("common.member")})]},D.id);return{menu:P>0?o.jsxs("div",{ref:k,className:"jv-mention-box","data-side":j?"":void 0,onBlur:V,children:[o.jsxs("div",{className:"ui-popover jv-mention-menu",role:"listbox","aria-label":v("mention.menu"),children:[_&&o.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:v("mention.inThread")}),E.map((D,se)=>X(D,se===y)),_&&o.jsx("div",{className:"jv-mention-sep",role:"separator"}),_&&o.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:v("mention.inChannel")}),T.map((D,se)=>X(D,E.length+se===y)),O.length>0&&o.jsxs("button",{type:"button",className:"ui-menu-item jv-mention-more","aria-haspopup":"listbox","aria-expanded":!!j,"data-active":y===R.length||void 0,onMouseEnter:()=>{m(R.length),Q(!1)},onMouseDown:D=>{D.preventDefault(),m(R.length),Q(!0)},children:[o.jsx("span",{className:"ui-menu-copy",children:v("mention.outside")}),o.jsx("span",{className:"jv-muted",children:O.length}),o.jsx(qe,{name:"chevron-right"})]})]}),j&&o.jsxs("div",{className:"ui-popover jv-mention-side",role:"listbox","aria-label":v("mention.outsideList"),children:[o.jsxs("div",{className:"jv-mention-side-head",children:[o.jsx("button",{type:"button",className:"jv-mention-back","aria-label":v("common.back"),onMouseDown:D=>{D.preventDefault(),Y()},children:o.jsx(qe,{name:"chevron-left"})}),o.jsx("input",{ref:S,type:"search",value:j.search,placeholder:v("common.searchMembers"),"aria-label":v("mention.searchOutside"),onChange:D=>b({search:D.target.value,active:0}),onKeyDown:K})]}),o.jsx("div",{className:"jv-mention-side-list",children:I.length?I.map((D,se)=>X(D,se===j.active)):o.jsx("p",{className:"jv-mention-empty",children:v("common.noMatch")})}),o.jsx("p",{className:"ui-menu-note ui-small",children:v("mention.invites")})]})]}):null,track:q,onKeyDown:H,close:z,leaves:V}}const Dj={text:null,files:[],quote:null,passages:[],key:null,signature:null,outgoing:null,sending:!1};function p6(e,n){var l;const i=((l=n.text)==null?void 0:l.trim())??"",r=e.text??"";return{text:r.trim()?i?`${i}
798
+
799
+ ${r}`:r:i||e.text,files:[...n.files.filter(c=>!e.files.some(d=>d.id===c.id)),...e.files],quote:e.quote??n.quote,passages:[...n.passages,...e.passages],outgoing:null}}class RP{constructor(n){He(this,"drafts",new Map);He(this,"listeners",new Set);He(this,"timer",null);He(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));this.storageKey=n;try{const i=JSON.parse(localStorage.getItem(n)??"{}");for(const[r,l]of Object.entries(i)){const c={...Dj,...l,sending:!1};this.drafts.set(r,c.outgoing?{...c,...p6(c,c.outgoing)}:c)}}catch{localStorage.removeItem(n)}}get(n){return this.drafts.get(n)??Dj}update(n,i){const r=this.get(n),l=typeof i=="function"?i(r):i;this.drafts.set(n,{...r,...l}),this.listeners.forEach(d=>d());const c=Object.keys(l).every(d=>d==="text"||d==="sending");this.timer&&clearTimeout(this.timer),c?this.timer=setTimeout(()=>this.save(),300):this.save()}save(){var i;this.timer&&(clearTimeout(this.timer),this.timer=null);const n={};for(const[r,{sending:l,...c}]of this.drafts)((i=c.text)!=null&&i.trim()||c.files.length||c.quote||c.passages.length||c.outgoing)&&(n[r]=c);Object.keys(n).length?localStorage.setItem(this.storageKey,JSON.stringify(n)):localStorage.removeItem(this.storageKey)}async clear(n){this.timer&&(clearTimeout(this.timer),this.timer=null);const i=[...this.drafts.values()].flatMap(r=>{var l;return[...r.files,...((l=r.outgoing)==null?void 0:l.files)??[]]});await Promise.all(i.map(r=>n(r.id).catch(l=>console.warn(`Pending attachment ${r.id} was not deleted on log-out`,l)))),this.drafts.clear(),localStorage.removeItem(this.storageKey),this.listeners.forEach(r=>r())}}const OP=e=>`jarvy-drafts:${e}`,Lj=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");function R1(e,n,i){e.update(n.chatId,{quote:{id:n.id,name:Ti(i.find(r=>r.id===n.senderId)),text:A1(n).replace(/\s+/g," ").slice(0,160)}})}function g6(e,n){return w.useSyncExternalStore(e.subscribe,()=>e.get(n))}function O1({chatId:e,id:n,drafts:i,placeholder:r,disabled:l=!1,mention:c,initialText:d,formRef:f,scrollRef:h,extra:g,onSend:y,onError:m,onNotice:j}){const b=g6(i,e),k=b.sending,[S,N]=w.useState([]),[C,M]=w.useState(!1),E=S.filter(Z=>Z.chatId===e),T=E.length>0,_=w.useRef(new Map),R=w.useRef(null),O=b.text??d??"",I=b.files,P=b.quote,z=Z=>i.update(e,{text:Z}),q=_P({textarea:R,value:O,setValue:z,inside:(c==null?void 0:c.inside)??[],outside:(c==null?void 0:c.outside)??[],bots:(c==null?void 0:c.bots)??[],onInvite:Z=>c==null?void 0:c.onInvite(Z),participants:c==null?void 0:c.participants});async function $(Z){var F;const D=e;if(!Z.length)return;if(T){j(v("composer.busy"));return}if(I.length+Z.length>5){j(v("composer.tooMany",{count:5}));return}if(Z.some(ee=>ee.size===0||ee.size>Vx)){j(v("composer.size",{limit:`${Vx/1024**3} GB`}));return}const se=Z.map(ee=>({key:Lj(),chatId:D,name:ee.name,done:0})),ne=se.map(ee=>ee.key),B=(ee,W)=>N(fe=>fe.map(le=>le.key===ee?{...le,done:W}:le));N(ee=>[...ee,...se]);for(const ee of ne)_.current.set(ee,new AbortController);try{for(const[ee,W]of Z.entries()){const fe=ne[ee];try{const le=await ue.uploadAttachment(D,W,be=>B(fe,be),(F=_.current.get(fe))==null?void 0:F.signal);i.update(D,be=>({files:[...be.files,le]}))}catch(le){if(!(le instanceof DOMException&&le.name==="AbortError"))throw le}finally{N(le=>le.filter(be=>be.key!==fe))}}}catch(ee){m(ee)}finally{N(ee=>ee.filter(W=>!ne.includes(W.key)));for(const ee of ne)_.current.delete(ee)}}async function Q(Z){const D=e;try{await ue.removeAttachment(Z),i.update(D,se=>({files:se.files.filter(ne=>ne.id!==Z)}))}catch(se){m(se)}}function Y(Z){const D=[...Z.clipboardData.files];if(!D.length)return;Z.preventDefault();const se=new Date().toISOString().replace(/\D/g,"").slice(0,14);$(D.map((ne,B)=>ne.type.startsWith("image/")&&/^image\.\w+$/.test(ne.name)?new File([ne],`${v("composer.pasted")}-${se}${D.length>1?`-${B+1}`:""}.${ne.name.split(".").pop()}`,{type:ne.type}):ne))}const H=Z=>Z.dataTransfer.types.includes("Files");function K(Z){!H(Z)||l||(Z.preventDefault(),Z.dataTransfer.dropEffect="copy",M(!0))}function V(Z){H(Z)&&(Z.preventDefault(),M(!1),l||$([...Z.dataTransfer.files]))}async function X(Z){Z==null||Z.preventDefault();const D=e,se=i.get(D),ne=(se.text??d??"").trim(),B=se.files,F=se.quote,ee=se.passages,fe=[ee.map((ve,re)=>`[[q${re+1}]]`).join(`
800
+ `),ne].filter(Boolean).join(`
801
+
802
+ `);if(!fe&&!B.length||se.sending||T||l)return;const le=JSON.stringify([fe,B.map(ve=>ve.id),(F==null?void 0:F.id)??null,ee]),be=se.signature===le&&se.key?se.key:Lj(),we={text:ne,files:B,quote:F,passages:ee};i.update(D,{text:"",files:[],quote:null,passages:[],key:be,signature:le,outgoing:we,sending:!0});try{await y(fe,B.map(ve=>ve.id),be,F==null?void 0:F.id,ee.map(({messageId:ve,text:re})=>({messageId:ve,text:re}))),i.update(D,{key:null,signature:null,outgoing:null})}catch(ve){i.update(D,re=>p6(re,we)),m(ve)}finally{i.update(D,{sending:!1})}}return w.useLayoutEffect(()=>{const Z=()=>{const D=R.current,se=h==null?void 0:h.current;if(!D)return;const ne=se==null?void 0:se.scrollTop;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,se&&ne!==void 0&&se.scrollTop!==ne&&se.scrollTo({top:ne,behavior:"instant"})};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[O,e,h]),o.jsxs("form",{ref:f,className:`ui-compose-wrap${C?" jarvy-dropping":""}`,onSubmit:Z=>void X(Z),onDragEnter:K,onDragOver:K,onDragLeave:Z=>{Z.currentTarget.contains(Z.relatedTarget)||M(!1)},onDrop:V,children:[I.length+E.length>0&&o.jsxs("div",{className:"jarvy-pending-files",children:[I.map(Z=>o.jsxs("span",{className:"jarvy-file-chip",children:[o.jsx(qe,{name:"paperclip"}),o.jsx("span",{title:Z.name,children:Z.name}),o.jsx("button",{type:"button","aria-label":v("composer.removeFile",{name:Z.name}),onClick:()=>void Q(Z.id),children:"×"})]},Z.id)),E.map(Z=>o.jsxs("span",{className:"jarvy-file-chip","data-uploading":!0,children:[o.jsx(qe,{name:"paperclip"}),o.jsx("span",{title:Z.name,children:Z.name}),o.jsxs("span",{className:"jarvy-file-percent",children:[Math.floor(Z.done*100),"%"]}),o.jsx("button",{type:"button","aria-label":v("composer.cancelUpload",{name:Z.name}),onClick:()=>{var D;return(D=_.current.get(Z.key))==null?void 0:D.abort()},children:"×"}),o.jsx("span",{className:"jarvy-file-progress",role:"progressbar","aria-label":v("composer.uploading",{name:Z.name}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Z.done*100),children:o.jsx("span",{style:{width:`${Z.done*100}%`}})})]},Z.key))]}),P&&o.jsxs("div",{className:"jv-compose-quote",children:[o.jsx("span",{className:"jv-compose-quote-label",children:v("composer.replying")}),o.jsx("span",{className:"jv-reply-author",children:P.name}),o.jsx("span",{className:"jv-reply-text",children:P.text||v("common.attachment")}),o.jsx("button",{type:"button","aria-label":v("composer.cancelReply"),onClick:()=>i.update(e,{quote:null}),children:"×"})]}),o.jsx(Zq,{quotes:b.passages,onRemove:Z=>i.update(e,D=>({passages:D.passages.filter((se,ne)=>ne!==Z)}))}),o.jsxs("div",{className:"ui-composer jv-composer",children:[c&&q.menu,C&&o.jsx("span",{className:"jarvy-drop-hint",role:"status",children:v("composer.drop")}),o.jsxs("label",{className:"jarvy-attach-trigger",title:v("composer.attach"),children:[o.jsx(qe,{name:"add"}),o.jsx("input",{type:"file",multiple:!0,"aria-label":v("composer.attach"),disabled:k||T||l||I.length>=5,onChange:Z=>{const D=[...Z.target.files??[]];Z.target.value="",$(D)}})]}),o.jsx("textarea",{ref:R,id:n,rows:1,maxLength:32e3,value:O,onPaste:Y,placeholder:r,disabled:l,"aria-label":v("composer.input"),onChange:Z=>{z(Z.target.value),c&&q.track(Z.target.value)},onKeyDown:Z=>{c&&q.onKeyDown(Z)||Z.key==="Enter"&&!Z.shiftKey&&!Z.nativeEvent.isComposing&&(Z.preventDefault(),X())},onClick:()=>{c&&q.track()},onBlur:c?q.leaves:void 0}),g,o.jsx("button",{type:"submit",className:"ui-round ui-send","aria-label":v("composer.send"),disabled:k||T||l||!O.trim()&&!I.length&&!b.passages.length,children:o.jsx(qe,{name:"arrow-up"})})]})]})}function v6({messages:e,members:n,me:i,activeQuestion:r,onSettled:l,onPreview:c,onQuote:d,onReact:f,onFold:h,onJump:g,onError:y,bot:m,onBotCard:j}){const b=i6(),k=m&&o.jsx(sr,{member:n.find(S=>S.id===m.id)??{id:m.id,kind:"bot",name:m.name},bots:[m],size:22,onBot:j});return o.jsx(o.Fragment,{children:e.map((S,N)=>{const C=e[N-1],M=e[N+1],E=S.role==="assistant"&&!!(M!=null&&M.question)&&M.senderId===S.senderId,T=S.folded;return o.jsxs(w.Fragment,{children:[a1(S.createdAt,C==null?void 0:C.createdAt)&&o.jsx(e5,{time:S.createdAt}),o.jsxs("div",{className:`ui-message-row ${S.role==="user"?"ui-user":""}`,"data-message":S.id,"data-asks":E||void 0,"data-shut":T||void 0,tabIndex:-1,children:[S.role==="assistant"&&o.jsx("span",{className:"jarvy-bubble-avatar",children:k??o.jsx(_i,{color:"gray",size:22})}),o.jsxs("div",{className:"jv-dm-stack",children:[Wk(S,C)&&o.jsx(Y0,{time:S.createdAt,className:"jv-dm-time"}),T?o.jsx("div",{className:"ui-bubble jv-folded-bubble",children:o.jsx(r6,{message:S})}):o.jsxs(o.Fragment,{children:[S.replyTo&&o.jsx(e6,{message:S,members:n,onJump:g}),S.question?o.jsx(GS,{message:{...S,question:S.question},keyboard:S.id===r,onSettled:l}):o.jsxs("div",{className:"ui-bubble",children:[S.content&&o.jsx(a6,{whole:b.has(S.id),children:o.jsx(QS,{message:S,members:n,me:i,onJump:g})}),S.attachments.length>0&&o.jsx($S,{files:S.attachments,onOpen:_=>c(S.attachments,_)})]}),o.jsx(t6,{message:S,me:i,members:n,onReact:f,onError:y})]})]}),o.jsxs("div",{className:"jv-row-actions",children:[o.jsx(n6,{message:S,me:i,onReply:d,onReact:f,onError:y}),o.jsx(vt,{icon:S.folded?"unfold":"fold",label:v(S.folded?"actions.unfold":"actions.fold"),onClick:()=>{S.folded&&b.add(S.id),h(S,!S.folded)}})]})]})]},S.id)})})}const _r=Math.PI*2,wa=(e,n=0,i=1)=>Math.min(i,Math.max(n,e)),wn=(e,n,i)=>e+(n-e)*i,dg=e=>(e=wa(e),e<.5?2*e*e:1-(-2*e+2)**2/2),zP=e=>1-(1-wa(e))**3,Lc=e=>{e=wa(e);const n=1.9;return 1+(n+1)*(e-1)**3+n*(e-1)**2},un=(e,n,i,r=dg)=>r((e-n)/(i-n)),sa=(e,n,i,r,l)=>e<r?un(e,n,i):1-un(e,r,l),vs=(e,n,i,r)=>e<n||e>n+i?0:4*r*((e-n)/i)*(1-(e-n)/i);class $d{constructor(n,i){He(this,"x",0);He(this,"v",0);this.k=n,this.c=i}kick(n){this.v+=n}step(n){return this.v+=(-this.k*this.x-this.c*this.v)*n,this.x+=this.v*n,this.x}get value(){return this.x}}const s0={hop:{name:"hop",dur:2,pose:e=>({squash:1+.22*sa(e,0,.14,.16,.22),lift:vs(e,.2,.46,.3),lid:.22*sa(e,0,.12,.16,.22),eyeScale:1+.08*sa(e,.2,.3,.55,.7),mouth:e>.2&&e<.9?2:0,mouthOpen:.6}),beats:[[.66,e=>e.squash(2.4)]]},spin:{name:"spin",dur:2.8,pose:e=>{const n=e<1.5?un(e,.1,.55,Lc):1-un(e,1.5,1.75),i=e>1.6&&e<2.6?Math.sin(_r*(e-1.6)*1.4)*.05*(1-un(e,1.9,2.6)):0;return{spin:_r*dg(un(e,.55,1.5)),lift:.03*n,squash:1-.13*n,tilt:i,kind:e>1.65&&e<2.35?3:0,eyeScale:1+.08*n,mouth:e>.55&&e<1.6?2:0,mouthOpen:.8,earL:wn(.22,.1,wa(n)),earR:wn(.22,.1,wa(n))}},beats:[[1.55,e=>{e.squash(1.5),e.ears(1.5,1.5)}]]},hopSpin:{name:"hopSpin",dur:2.9,pose:e=>({spin:_r*dg(un(e,.55,1.35)),lift:vs(e,.55,.8,.3),squash:1+.2*un(e,.1,.45),lid:.2*sa(e,.1,.3,.45,.6),eyeScale:1+.1*(e>.6&&e<1.4?1:0),mouth:e>.6&&e<1.5?2:0,mouthOpen:.75,blush:.3*wa(un(e,.45,.6)*(e<.95?1:0))}),beats:[[1.36,e=>{e.squash(1.6),e.tilt(1)}]]},joy:{name:"joy",dur:2.3,pose:e=>{const n=[.1,.52,.94],i=[.1,-.1,0];let r=0,l=0;n.forEach((d,f)=>{r+=vs(e,d,.3,.13),e>d-.1&&(l=wn(f?i[f-1]:0,i[f],un(e,d-.1,d+.12,Lc)))});const c=sa(e,0,.12,1.7,1.95);return{lift:r,tilt:l*(1-un(e,1.3,1.6)),happy:c,blush:c,mouth:c>.5?2:0,mouthOpen:.95,earL:wn(.22,.12,c),earR:wn(.22,.12,c)}},beats:[[.4,e=>e.squash(1.5)],[.82,e=>e.squash(1.5)],[1.24,e=>e.squash(1.8)]]},sway:{name:"sway",dur:3.8,pose:e=>{const n=sa(e,.15,.7,3.1,3.55),i=wa((e-.3)/3),r=Math.sin(_r*(1.6*i+.35*(i-Math.sin(_r*i)/_r)))*n;return{tilt:.115*r,look:[.014*r,-.004*n],mouth:n>.5?1:0,lid:.12*n,blush:.32*n,earL:wn(.22,.16,n),earR:wn(.22,.16,n)}}},flick:{name:"flick",dur:1.8,pose:e=>({look:[.035*sa(e,.05,.2,1.1,1.4),.012*sa(e,.05,.2,1.1,1.4)]}),beats:[[.2,e=>e.ears(0,-4.2)],[.52,e=>e.ears(0,-3.6)]]},tilt:{name:"tilt",dur:2.4,pose:e=>{const n=e<1.6?un(e,.05,.45,Lc):1-un(e,1.6,1.95);return{tilt:.17*n,earR:wn(.22,.03,wa(n)),earL:wn(.22,.42,wa(n)),eyeScale:1+.1*wa(n),look:[0,.03*wa(n)]}},beats:[[1.95,e=>e.tilt(-.9)]]},look:{name:"look",dur:3,pose:e=>{const n=e<.9?-.42*un(e,.1,.4,zP):e<1.9?wn(-.42,.42,un(e,.95,1.3)):.42*(1-un(e,2,2.35)),i=e<.85?-un(e,0,.1):e<1.85?wn(-1,1,un(e,.85,.95)):1-un(e,1.9,2);return{yaw:n,look:[.04*i,.01]}},beats:[[.08,e=>e.squash(.6)],[.92,e=>e.squash(.6)],[1.95,e=>e.squash(.5)]]},stretch:{name:"stretch",dur:3,pose:e=>{const n=e<1.55?un(e,0,1):0,i=sa(e,.15,.35,1.5,1.6);return{squash:1-.2*n,lift:.03*n,kind:i>.5?4:0,mouth:e>.3&&e<1.6?1:0,earL:wn(.22,.03,n),earR:wn(.22,.03,n),tilt:.03*Math.sin(_r*e*.9)*n,happy:sa(e,1.6,1.7,2.5,2.8)}},beats:[[1.56,e=>{e.squash(2.2),e.ears(2,2)}]]},doze:{name:"doze",dur:4.2,pose:e=>{const n=e<2.4?un(e,.1,2):0,i=n*Math.max(0,Math.sin(_r*e*.8)),r=sa(e,2.4,2.5,2.9,3.3),l=c=>.9*Math.max(0,1-Math.abs(e-c)/.07);return{open:Math.max(.08,1-.88*n-l(3.45)-l(3.7)),lid:.2*n,tilt:.08*n+.03*i,lift:-.012*n-.012*i+vs(e,2.42,.22,.07),squash:1+.05*n,earL:.22+.2*n,earR:.22+.2*n,eyeScale:1+.16*r}},beats:[[2.42,e=>{e.ears(-3.5,-3.5),e.tilt(-1.2)}],[2.64,e=>e.squash(1.2)]]},poke:{name:"poke",dur:2.4,pose:e=>{const n=sa(e,.14,.16,.42,.5),i=sa(e,.45,.6,1.5,1.9);return{kind:n>.5?1:0,blush:i*.9,happy:i*.7,mouth:i>.3?2:0,mouthOpen:.7}},beats:[[.15,e=>{e.squash(2.4),e.tilt(-2.4),e.ears(2.6,2.6)}]]},listen:{name:"listen",dur:2.2,pose:e=>{const n=sa(e,.08,.2,1.6,1.9);return{earL:wn(.22,.05,n),earR:wn(.22,.05,n),eyeScale:1+.12*n,lift:vs(e,.12,.2,.06),look:[-.02*n,-.045*n]}},beats:[[.1,e=>e.ears(-3,-3)],[.32,e=>e.squash(1)]]},dance:{name:"dance",dur:3.4,pose:e=>{const i=Math.floor(e/.36),r=e%.36/.36,l=sa(e,0,.2,2.7,3),c=i===0?0:i%2?.13:-.13,d=i%2?-.13:.13;return{tilt:wn(c,d,Lc(r*1.4))*l,lift:e<2.6?vs(r,.05,.9,.035):0,happy:l,blush:l*.8,mouth:l>.5?2:0,mouthOpen:.9}},beats:Array.from({length:7},(e,n)=>[n*.36+.02,i=>i.squash(.9)])},puff:{name:"puff",dur:2.6,pose:e=>{const n=e<1.4?un(e,.05,.6,Lc):1-un(e,1.4,1.52),i=wa(n);return{zoom:1+.13*n,squash:1-.04*n,blush:.9*i,eyeScale:1-.06*i,mouth:e>1.4&&e<1.8?3:0,mouthOpen:.55,lift:vs(e,1.45,.2,.05)}},beats:[[1.47,e=>{e.squash(1.8),e.ears(1.5,1.5)}]]},land:{name:"land",dur:.8,pose:e=>({kind:e>.16&&e<.34?1:0,squash:1-.05*sa(e,.16,.24,.4,.75)}),beats:[[.18,e=>{e.squash(1.6),e.tilt(1.6)}]]}},DP=[["flick",3],["tilt",3],["look",2],["sway",2],["stretch",2],["spin",1]],LP=[["flick",3],["sway",3]],Bj=8,Ij=12,BP=150,IP=45e3,qP=1/8;class PP{constructor(){He(this,"act",null);He(this,"name",null);He(this,"at",0);He(this,"beat",0);He(this,"last",0);He(this,"weight",0);He(this,"carried",!1);He(this,"squash",new $d(220,11));He(this,"roll",new $d(55,2.6));He(this,"earL",new $d(260,9));He(this,"earR",new $d(260,9));He(this,"lift",0);He(this,"vy",0);He(this,"tilt",0);He(this,"turn",0);He(this,"vTilt",0);He(this,"vTurn",0);He(this,"quiet",0);He(this,"next",0);He(this,"lastAct",null);He(this,"blink",-1e9);He(this,"blinkAt",0);He(this,"hold",0)}get playing(){return this.name}play(n,i,r=!1){this.carried||r&&this.act&&(i-this.at)/1e3<.8||(this.act=s0[n],this.name=n,this.at=i,this.beat=0,this.lastAct=n)}carry(n,i){n!==this.carried&&(this.carried=n,n?(this.act=null,this.name=null,this.at=i):(this.act=s0.land,this.name="land",this.at=i,this.beat=0))}idle(n,i,r,l=!1){if(this.quiet=r?0:this.quiet+i,!this.next){this.next=n+(Bj+Math.random()*Ij)*1e3;return}if(r||this.act||this.carried||n<this.next)return;if(!l&&this.quiet>BP*1e3){this.next=n+IP,this.quiet=0,this.play("doze",n);return}const c=(l||this.lastAct==="doze"?LP:DP).filter(([g])=>g!==this.lastAct),d=c.reduce((g,[,y])=>g+y,0);let f=Math.random()*d,h=c[0][0];for(const[g,y]of c)if(f-=y,f<=0){h=g;break}this.next=n+(Bj+Math.random()*Ij)*1e3,this.play(!l&&Math.random()<qP?"puff":h,n)}apply(n,i){const r=this.last?Math.min(.05,Math.max(0,(i-this.last)/1e3)):0;this.last=i;const l=(i-this.at)/1e3;this.act&&!this.carried&&l>this.act.dur&&(this.act=null,this.name=null);const c=this.act;this.weight=this.carried?1:c?(c===s0.land?1:wa(l/.1))*wa((c.dur-l)/.18):Math.max(0,this.weight-r/.18),this.hold=this.carried?Math.min(1,this.hold+r/.12):Math.max(0,this.hold-r/.2);const d=this.weight,f=this.carried?{squash:.8,tilt:.13*Math.sin(_r*1.1*l),eyeScale:1.1,mouth:1}:c?c.pose(l):{};if(c&&!this.carried)for(const[O,I]of c.beats??[])l<O||this.beat>O||(this.beat=O+1,I({squash:P=>this.squash.kick(P),tilt:P=>this.roll.kick(P),ears:(P,z)=>{this.earL.kick(P),this.earR.kick(z)}}));const h=(f.lift??0)*d+.22*this.hold,g=r?(h-this.lift)/r:0,y=g-this.vy;this.lift=h,this.vy=g,this.earL.kick(1.4*y),this.earR.kick(1.4*y);const m=4,j=r/m;for(let O=0;O<m;O++)this.squash.step(j),this.roll.step(j),this.earL.step(j),this.earR.step(j);const b=(f.tilt??0)*d+this.roll.value,k=(f.spin??0)*d,S=r?(b-this.tilt)/r:0,N=r?(k-this.turn)/r:0,C=S-this.vTilt,M=N-this.vTurn;this.tilt=b,this.vTilt=S,this.turn=k,this.vTurn=N,this.earL.kick(-.5*C-.4*M),this.earR.kick(.5*C+.4*M);const E=n.squash,T=(O,I)=>{I!==void 0&&(n[O]=wn(n[O],I,d))};if(T("eyeScale",f.eyeScale),T("lid",f.lid),T("open",f.open),T("blush",f.blush),T("mouthOpen",f.mouthOpen),T("earL",f.earL),T("earR",f.earR),T("spin",f.spin===void 0?void 0:n.spin+f.spin),T("yaw",f.yaw===void 0?void 0:n.yaw+f.yaw),f.look&&(n.look=[wn(n.look[0],f.look[0],d),wn(n.look[1],f.look[1],d)]),d>.5)for(const O of["kind","happy","mouth"]){const I=f[O];I!==void 0&&(n[O]=I)}const _=f.squash===void 0?1:f.squash;n.squash=wa(E*wn(1,_,d)+this.squash.value+.025*Math.abs(this.roll.value)*d,.82,1.24),n.tilt+=b,n.lift+=h,n.earL+=this.earL.value+.24*this.hold,n.earR+=this.earR.value+.24*this.hold,n.kind===0&&n.open>.5&&i>=this.blinkAt&&i-this.blink>400&&(this.blink=i,this.blinkAt=i+2200+Math.random()*3200);const R=(i-this.blink)/160;return R>=0&&R<=1&&(n.open*=1-.94*Math.sin(Math.PI*R)),{face:n,zoom:f.zoom?wn(1,f.zoom,d):1}}shake(){this.squash.kick(-2.2)}}const HP=64,FP=200,UP=33,$P=800;function qj(){try{return wS({gpu:!0})??null}catch{return null}}class y6{constructor(){He(this,"persona",new PP);He(this,"input",{motion:"sleep",mood:"normal",lookX:0,lookY:0});He(this,"color",0);He(this,"crown",!1);He(this,"near",!1);He(this,"onFrame",null);He(this,"rig",new ZI);He(this,"canvases",new Map);He(this,"reduced",matchMedia("(prefers-reduced-motion: reduce)"));He(this,"spare",null);He(this,"running",!1);He(this,"frame",0);He(this,"last",0);He(this,"drawn",0);He(this,"stirred",0);He(this,"visibility",()=>{cancelAnimationFrame(this.frame),document.hidden||(this.frame=requestAnimationFrame(this.tick))});He(this,"tick",n=>{var g;this.frame=requestAnimationFrame(this.tick);const i=[...this.canvases].filter(([y])=>y.offsetWidth>0);if(!this.running||!i.length){this.last=0;return}const r=this.input,l=r.motion!=="idle"&&r.motion!=="sleep",c=i.every(([y])=>y.offsetWidth<HP);if(c&&((this.near||this.persona.playing||l)&&(this.stirred=n),n-this.drawn<(n-this.stirred<$P?UP:FP)-4))return;this.drawn=n,(g=this.onFrame)==null||g.call(this,n),r.reduced=this.reduced.matches;const d=this.rig.frame(n,r);!r.reduced&&!c&&this.persona.idle(n,this.last?Math.min(50,n-this.last):16,l,r.motion==="sleep"),this.last=n;const{face:f,zoom:h}=this.persona.apply(d,n);for(const[y,m]of i){const j=y.getContext("2d"),b=Math.round(y.offsetWidth*Math.min(2,devicePixelRatio||1)),k=m.zoom*h;j&&(m.figure||(m.figure=this.spare??qj(),this.spare=null),m.figure&&(y.width!==b?y.width=y.height=b:j.clearRect(0,0,b,b),m.figure.paint(j,b,this.color,f,{zoom:k,shadow:m.shadow}),this.crown&&(j.globalAlpha=Math.min(1,Math.max(0,Math.cos(f.spin)*1.6-.2)),SS(j,b,jS(f,k)),j.globalAlpha=1)))}})}shake(){this.rig.shake()}add(n,i,r=!0){return this.canvases.set(n,{zoom:i,shadow:r,figure:null}),()=>{var l,c;(c=(l=this.canvases.get(n))==null?void 0:l.figure)==null||c.dispose(),this.canvases.delete(n)}}largest(){let n=null;for(const i of this.canvases.keys())i.offsetWidth>((n==null?void 0:n.offsetWidth)??0)&&(n=i);return n}start(){return this.running?!0:(this.spare=qj(),this.spare?(this.running=!0,document.addEventListener("visibilitychange",this.visibility),this.visibility(),!0):!1)}stop(){var n,i;document.removeEventListener("visibilitychange",this.visibility),cancelAnimationFrame(this.frame),this.running=!1,(n=this.spare)==null||n.dispose(),this.spare=null;for(const r of this.canvases.values())(i=r.figure)==null||i.dispose(),r.figure=null}}const l0=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function x6(e,n,i,r){const l=w.useRef(null);w.useEffect(()=>{const f=l.current;l.current={chat:i,id:r},!(!f||f.chat!==i||!r||r===f.id)&&(l0()||e.play("listen",performance.now()))},[r,i]);const c=w.useRef(!1);w.useEffect(()=>{if(!l0()){if(n.motion==="idle"||n.motion==="sleep"){c.current=!1;return}c.current||(c.current=!0,e.play("hop",performance.now(),!0))}},[n.motion]);const d=w.useRef(null);w.useEffect(()=>{const f=n.view.done;!f||d.current===n.view.startedAt||(d.current=n.view.startedAt,!(f.outcome!=="completed"||l0())&&e.play(["joy","hopSpin","dance"][Math.floor(Math.random()*3)],performance.now()))},[n.view.done,n.view.startedAt])}function VP(e,n,i,r,l,c=0){const g=n.offsetWidth,y=n.offsetHeight,m=n.offsetLeft,j=n.offsetTop,b=Math.max(300,Math.round(i*.4));e.style.maxHeight="";const k=e.hasAttribute("data-fit"),S=e.offsetHeight,N=X=>X==="left"||X==="right",C=X=>X==="left"?m-10-8:X==="right"?i-m-g-10-8:X==="below"?r-j-y-10-8:j-10-8,M=m+g/2>i/2,E=X=>k?N(X)?Math.min(b,Math.max(160,C(X))):Math.min(b,M?m+g-8:i-m-8):e.offsetWidth,T=X=>N(X)?E(X)<=C(X):Math.min(120,S)<=C(X),_=c>.05?"right":c<-.05?"left":null,O=(_==="left"||_===null&&C("left")>=C("right")?["left","right"]:["right","left"]).find(T)??(C("below")>=C("above")?"below":"above"),I=e.dataset.side,z=I!==void 0&&I!==O&&N(I)===N(O)&&T(I)&&C(I)+40>=C(O)?I:O,q=k&&(z==="left"||!N(z)&&M),$=z==="left"?m-10:z==="right"?m+g+10:M?m+g:m;e.style.width="",e.style.maxWidth=k?`${E(z)}px`:"",q?(e.style.left="",e.style.right=`${i-$}px`):(e.style.right="",k&&(e.style.left=`${$}px`));const Q=e.offsetWidth,Y=k?q?$-Q:$:z==="left"?m-10-Q:z==="right"?m+g+10:Math.min(Math.max(8,m+g-Q),Math.max(8,i-Q-8)),H=l&&Y<l.right&&Y+Q>l.left?l.bottom+6:0,K=Math.min(Math.max(8,H),Math.max(8,r-140));let V;z==="below"?(V=Math.max(8,Math.min(j+y+10,r-8-Math.min(S,120))),e.style.maxHeight=`${Math.max(40,r-V-8)}px`):z==="above"?(e.style.maxHeight=`${Math.max(40,j-10-K)}px`,V=Math.max(K,j-10-e.offsetHeight)):(e.style.maxHeight=`${Math.max(120,r-K-8)}px`,V=Math.min(Math.max(K,j+6),Math.max(K,r-e.offsetHeight-8))),k||(e.style.left=`${Y}px`),e.style.top=`${V}px`,e.dataset.side=z,e.style.setProperty("--npc-tail",N(z)?`${Math.min(e.offsetHeight-18,Math.max(18,j+Math.min(g,y)/2-V))}px`:`${Math.min(Q-18,Math.max(18,m+g/2-Y))}px`)}const Pj=.06,GP=matchMedia("(prefers-reduced-motion: reduce)");function Vd({text:e,limit:n,streaming:i=!1}){const[,r]=w.useState(0),l=w.useRef({text:"",count:0,rate:Pj,at:performance.now()}),c=performance.now(),d=l.current;d.count=Math.min(d.text.length,d.count+d.rate*(c-d.at)),d.at=c,e!==d.text&&(d.text=e,d.count=Math.min(d.count,e.length),d.rate=Math.max(Pj,(e.length-d.count)/n));const f=!GP.matches&&d.count<e.length;w.useEffect(()=>{if(!f)return;const g=requestAnimationFrame(()=>r(y=>y+1));return()=>cancelAnimationFrame(g)});const h=f?e.slice(0,Math.floor(d.count)).replace(/[\uD800-\uDBFF]$/,""):e;return o.jsxs(o.Fragment,{children:[h,(f||i)&&o.jsx("i",{className:"jv-npc-caret"})]})}function YP({className:e,children:n,onReading:i}){const r=w.useRef(null),l=w.useRef(null),c=w.useRef(i),[d,f]=w.useState(!1);return c.current=i,w.useEffect(()=>{const h=r.current,g=l.current;if(!h||!g)return;let y=!0,m=0;const j=()=>{h.scrollTop=h.scrollHeight,m=h.scrollTop},b=()=>{y&&j(),f(h.scrollTop>1)},k=()=>{const N=h.scrollHeight-h.scrollTop-h.clientHeight<4;N&&!y?(y=!0,m=h.scrollTop,c.current(!1)):!N&&y&&(h.scrollTop<m-1?(y=!1,c.current(!0)):j()),f(h.scrollTop>1)},S=new ResizeObserver(b);return S.observe(g),S.observe(h),b(),h.addEventListener("scroll",k,{passive:!0}),()=>{S.disconnect(),h.removeEventListener("scroll",k),c.current(!1)}},[]),o.jsx("span",{ref:r,className:`${e} jv-npc-tail`,"data-above":d||void 0,children:o.jsx("span",{ref:l,children:n})})}const b6={think:O9,mutter:jN,read:V9,write:dN,run:r3,script:B9,compact:T9,retry:Of,ask:Cw,say:rN,chat:Aw,tool:TN},fg=e=>v("npc.duration",{value:La(Math.max(0,e)/1e3,{maximumFractionDigits:1,minimumFractionDigits:1})}),KP={completed:"npc.done",interrupted:"npc.done.interrupted",failed:"npc.done.failed"};function j6({view:e,name:n,cat:i,area:r,avoid:l,layout:c,facing:d,toolbar:f,onHint:h}){var $,Q,Y;const g=w.useRef(null),y=w.useRef(null),[m,j]=w.useState(!1),[,b]=w.useState(0);w.useLayoutEffect(()=>{c.current=()=>{var Z;if(!g.current||!i.current||!r.current)return;const K=r.current.getBoundingClientRect(),V=l.current?l.current.getBoundingClientRect().top-K.top:K.height,X=(Z=y.current)==null?void 0:Z.getBoundingClientRect();m?g.current.removeAttribute("data-fit"):g.current.setAttribute("data-fit",""),VP(g.current,i.current,K.width,V,X?{left:X.left-K.left,right:X.right-K.left,bottom:X.bottom-K.top}:null,d())},c.current();const H=new ResizeObserver(()=>{var K;return(K=c.current)==null?void 0:K.call(c)});for(const K of[g.current,y.current])K&&H.observe(K);return()=>{H.disconnect(),c.current=null}},[m]);const k=e.steps.some(H=>H.state==="running");w.useEffect(()=>{if(!m||!k)return;const H=setInterval(()=>b(K=>K+1),200);return()=>clearInterval(H)},[m,k]),w.useEffect(()=>{if(!m)return;const H=K=>{K.key==="Escape"&&j(!1)};return addEventListener("keydown",H),()=>removeEventListener("keydown",H)},[m]);const S=($=e.steps[0])==null?void 0:$.id;w.useEffect(()=>{j(!1)},[S]);const[N,C]=w.useState(!1),[M,E]=w.useState(!1),[T,_]=w.useState(null);w.useEffect(()=>{if(!N)return;const H=K=>{var V;(V=g.current)!=null&&V.contains(K.target)||C(!1)};return document.addEventListener("pointermove",H),()=>document.removeEventListener("pointermove",H)},[N]);const R=N||M;w.useEffect(()=>{var H;_(R?((H=e.shown)==null?void 0:H.id)??null:null)},[R]);const O=T&&e.steps.find(H=>H.id===T)||e.shown,I=O?O.look:e.done?"action":null;let P=null;if((O==null?void 0:O.look)==="thought"||(O==null?void 0:O.look)==="mutter"){const H=(O.line??"").replace(/\n\s*\n\s*/g,`
803
+
804
+ `).trim(),K=o.jsx(Vd,{text:H,limit:300,streaming:O.look==="thought"&&O.state==="running"},O.id),[V,X]=v("npc.mutter",{text:""}).split("");P=o.jsx(YP,{className:O.look==="thought"?"jv-npc-thought":"jv-npc-murmur",onReading:E,children:O.look==="thought"?K:o.jsxs(o.Fragment,{children:[V,K,X]})},O.id)}else if((O==null?void 0:O.look)==="speech")P=o.jsx("span",{className:"jv-npc-speech",children:o.jsx(Vd,{text:O.line??"",limit:1500,streaming:O.state==="running"&&O.icon==="say"},O.id)});else if(O){const H=b6[O.icon];P=o.jsxs("span",{className:"jv-npc-action","data-state":O.state,children:[o.jsx(H,{}),o.jsx(Vd,{text:O.title,limit:300},O.id),O.state==="running"&&o.jsx("i",{className:"jv-npc-dots"})]})}else e.done&&(P=o.jsxs("span",{className:"jv-npc-action","data-state":e.done.outcome==="completed"?"ok":"failed",children:[e.done.outcome==="completed"?o.jsx(Ba,{}):o.jsx(Rl,{}),o.jsx(Vd,{text:v(KP[e.done.outcome],{duration:fg(e.done.ms)}),limit:300},`done:${e.done.ms}`)]}));const z=e.steps.length>0,q=(O==null?void 0:O.icon)==="ask"&&O.state==="running";return w.useEffect(()=>{P||C(!1)},[!P]),o.jsxs(o.Fragment,{children:[f==null?void 0:f(y,()=>j(!1)),o.jsx("div",{ref:g,className:"jv-npc","data-open":m||void 0,"data-look":m?void 0:I??void 0,"data-kind":O==null?void 0:O.icon,"data-fading":!m&&!O&&((Q=e.done)==null?void 0:Q.fading)||void 0,hidden:!m&&!P,onPointerEnter:H=>{H.pointerType==="mouse"&&C(!0)},onPointerLeave:()=>C(!1),children:m?o.jsxs("section",{className:"jv-npc-panel","aria-label":v("npc.panel"),children:[o.jsxs("header",{children:[o.jsx("strong",{children:v("npc.panel")}),e.startedAt>0&&o.jsx("span",{children:fg((e.endedAt??Date.now()+e.skew)-e.startedAt)}),o.jsx("button",{type:"button",onClick:()=>j(!1),"aria-label":v("npc.collapse"),title:v("npc.collapse"),children:o.jsx(sN,{})})]}),o.jsx("ol",{children:e.steps.map(H=>o.jsx(XP,{step:H,skew:e.skew},H.id))})]}):o.jsxs(o.Fragment,{children:[I==="speech"&&o.jsxs("span",{className:"jv-npc-name",children:[n,(O==null?void 0:O.to)&&o.jsx("em",{children:v("npc.to",{chat:O.to})})]}),z?o.jsx("div",{role:"button",tabIndex:0,className:"jv-npc-line",onClick:()=>j(!0),title:v("npc.expand"),onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),j(!0))},children:P}):o.jsx("div",{className:"jv-npc-line",children:P}),q&&e.answer&&((Y=O.options)==null?void 0:Y.some(H=>H.value))&&o.jsx("div",{className:"jv-npc-options",children:O.options.map(H=>o.jsx("button",{type:"button",onClick:()=>e.answer(H.value),children:H.label},H.label))}),q&&!e.answer&&O.hint&&(h?o.jsxs("button",{type:"button",className:"jv-npc-hint",onClick:h,children:[O.hint,o.jsx(Uc,{"aria-hidden":"true"})]}):o.jsx("p",{className:"jv-npc-hint",children:O.hint}))]})})]})}function XP({step:e,skew:n}){const[i,r]=w.useState(!1),l=b6[e.icon],c=e.detail;return o.jsxs("li",{"data-state":e.state,style:e.depth?{paddingLeft:`${e.depth*16}px`}:void 0,children:[o.jsxs("button",{type:"button","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>r(d=>!d),children:[o.jsx(l,{className:"jv-npc-kind"}),o.jsx("span",{className:"jv-npc-title",children:e.title}),o.jsxs("span",{className:"jv-npc-state",children:[e.state==="running"?o.jsx(jw,{}):e.state==="ok"?o.jsx(Ba,{}):o.jsx(Rl,{}),v(`npc.state.${e.state}`)]}),o.jsx("span",{className:"jv-npc-time",children:fg((e.endedAt??Date.now()+n)-e.startedAt)}),c&&o.jsx(_s,{className:"jv-npc-chevron"})]}),i&&c&&o.jsx("pre",{"data-kind":e.icon,children:c})]})}const cf="src/web/thread/ThreadPane.tsx",Tf="npm run build",QP=["export function ThreadPane({ thread, replies }: Props) {"," const scroll = useRef<HTMLDivElement>(null);"," useLayoutEffect(() => {"," scroll.current!.scrollTop = scroll.current!.scrollHeight;"," }, [thread.id]);"," …"].join(`
805
+ `),ZP=["> tsc -p tsconfig.web.json","src/web/thread/ThreadPane.tsx:58:41 - error TS2345: Argument of type","'HTMLDivElement | null' is not assignable to parameter of type 'HTMLDivElement'.","","Found 1 error."].join(`
806
+ `),w6={question:"npc.demo.question",options:[{value:"yes",label:"npc.demo.yes"},{value:"no",label:"npc.demo.no"}]},JP=[{kind:"think",text:"npc.demo.think1",ms:4200},{kind:"read",target:cf,ms:2600,output:QP},{kind:"think",text:"npc.demo.think2",ms:3800},{kind:"write",target:cf,ms:2600,output:["- useLayoutEffect(() => scrollToEnd(), [thread.id]);","+ useLayoutEffect(() => {","+ requestAnimationFrame(() => scrollToEnd(scroll.current));","+ }, [thread.id, replies.length]);"].join(`
807
+ `)},{kind:"mutter",text:"npc.demo.mutter1"},{kind:"run",target:Tf,ms:3200,failed:!0,output:ZP},{kind:"mutter",text:"npc.demo.mutter2"},{kind:"compact",ms:3400,output:"context: 412,380 → 38,210 tokens"},{kind:"write",target:cf,ms:2e3,output:"+ const el = scroll.current; if (el) scrollToEnd(el);"},{kind:"run",target:Tf,ms:3e3,output:["> vite build","✓ 2331 modules transformed.","✓ built in 4.9s"].join(`
808
+ `)},{kind:"say",text:"npc.demo.post",to:"npc.demo.channel"},{kind:"ask",...w6},{kind:"say",replies:{yes:"npc.demo.replyYes",no:"npc.demo.replyNo"}}],hg=[{key:"sleep",label:"npc.pose.sleep",motion:"sleep"},{key:"idle",label:"npc.pose.idle",motion:"idle"},{key:"think",label:"npc.pose.think",motion:"think",step:{kind:"think",text:"npc.demo.think1"}},{key:"mutter",label:"npc.pose.mutter",motion:"work",step:{kind:"mutter",text:"npc.demo.mutter2"}},{key:"say",label:"npc.pose.say",motion:"turn",step:{kind:"say",text:"npc.demo.replyNo"}},{key:"ask",label:"npc.pose.ask",motion:"ask",step:{kind:"ask",...w6}},{key:"read",label:"npc.pose.read",motion:"read",step:{kind:"read",target:cf}},{key:"work",label:"npc.pose.work",motion:"work",fast:!0,step:{kind:"run",target:Tf}},{key:"compact",label:"npc.pose.compact",motion:"yawn",step:{kind:"compact"}},{key:"busy",label:"npc.pose.busy",motion:"busy"},{key:"failed",label:"npc.pose.failed",motion:"idle",mood:"dizzy",shake:!0,step:{kind:"run",target:Tf,failed:!0}},{key:"done",label:"npc.pose.done",motion:"stretch",mood:"happy",done:!0},{key:"groom",label:"npc.pose.groom",motion:"groom"}];function WP({controls:e,onReplay:n,toolbar:i}){const[r,l]=w.useState(!1);return o.jsxs("div",{ref:i,className:"jv-npc-toolbar",role:"toolbar","aria-label":v("npc.toolbar"),children:[o.jsxs("div",{className:"jv-npc-toolbar-row",children:[o.jsx("span",{children:v("npc.toolbar")}),o.jsx("button",{type:"button",className:"jv-npc-icon",onClick:n,"aria-label":v("npc.replay"),title:v("npc.replay"),children:o.jsx(Yw,{})}),o.jsxs(Hr,{value:e.baseMood,onValueChange:c=>e.setBaseMood(c),children:[o.jsx(Ur,{className:"jv-npc-mood","aria-label":v("npc.mood"),title:v("npc.mood"),children:o.jsx(Fr,{})}),o.jsx($r,{className:"jv-select-menu",position:"popper",sideOffset:4,children:p9.map(c=>o.jsx(za,{value:c,children:v(`npc.mood.${c}`)},c))})]}),o.jsxs("button",{type:"button",className:"jv-npc-toggle","aria-expanded":r,onClick:()=>l(c=>!c),children:[o.jsx(vN,{}),v("npc.poses")]})]}),r&&o.jsx("div",{className:"jv-npc-poses",role:"group","aria-label":v("npc.poses"),children:hg.map(c=>{var d;return o.jsx("button",{type:"button","aria-pressed":((d=e.pose)==null?void 0:d.key)===c.key,onClick:()=>e.hold(c.key),children:v(c.label)},c.key)})})]})}const eH={think:"think",mutter:"mutter",read:"read",write:"write",run:"run",compact:"compact",ask:"ask",say:"say"},Hj=e=>e.text?[...v(e.text)].slice(0,e.typed).join(""):"";function tH(e){var r;if(e.kind==="think"||e.kind==="mutter")return v(`npc.step.${e.kind}`);if(e.kind==="ask"&&e.answer)return v("npc.step.ask.ok",{answer:v(e.answer.label)});const n=e.state==="failed"&&e.kind==="run"?"failed":e.state==="running"?"running":"ok",i=e.kind==="say"&&e.to?"post":e.kind;return v(`npc.step.${i}.${n}`,{target:((r=e.target)==null?void 0:r.split("/").pop())??"",chat:e.to?`#${v(e.to)}`:""})}function Fj(e){var r;const n=e.kind==="think"?"thought":e.kind==="mutter"?"mutter":e.kind==="say"||e.kind==="ask"?"speech":"action",i=e.kind==="ask"?v(e.question):Hj(e);return{id:String(e.id),look:n,icon:eH[e.kind],state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:0,title:tH(e),line:n==="action"?void 0:i,to:e.to?`#${v(e.to)}`:void 0,options:e.kind==="ask"&&e.state==="running"?(r=e.options)==null?void 0:r.map(l=>({label:v(l.label),value:l.value})):void 0,detail:e.kind==="ask"?v(e.question):e.text?Hj(e):e.output}}const c0={steps:[],phase:"before",startedAt:0,endedAt:null,flash:null,shake:0,recapUntil:0},nH=40,Uj=6e3,$j=500,aH={think:"think",mutter:"work",read:"read",write:"work",run:"work",compact:"yawn",ask:"ask",say:"turn"};class u0 extends Error{}const iH=e=>({...e,id:-1,state:e.failed?"failed":"running",startedAt:Date.now(),endedAt:null,typed:e.text?[...v(e.text)].length:0});function rH(e,n){const[i,r]=w.useState(c0),[l,c]=w.useState(n),[d,f]=w.useState(0),[h,g]=w.useState(null),[,y]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{if(!e||h)return;let T=!0;const _=new Set,R=z=>new Promise((q,$)=>{const Q=setTimeout(()=>{_.delete(Q),T?q():$(new u0)},z);_.add(Q)}),O=(z,q)=>r($=>({...$,steps:$.steps.map(Q=>Q.id===z?{...Q,...q}:Q)})),I=(z,q)=>r($=>({...$,flash:{mood:z,until:Date.now()+q}})),P=async(z,q,$)=>{const Q=[...v(q)].length,Y=$?Math.max(16,$/Q):nH;for(let H=1;H<=Q;H++)O(z,{typed:H}),await R(Y)};return(async()=>{r({...c0}),await R(700);const z=Date.now();let q="";r(Q=>({...Q,phase:"turn",startedAt:z}));for(const[Q,Y]of JP.entries()){const{ms:H,failed:K,replies:V,...X}=Y,Z=V?V[q]:Y.text;if(r(D=>({...D,steps:[...D.steps,{...X,text:Z,id:Q,state:"running",startedAt:Date.now(),endedAt:null,typed:0}]})),Y.kind==="ask"){if(q=await new Promise(D=>{m.current=D}),m.current=null,!T)throw new u0;O(Q,{state:"ok",endedAt:Date.now(),answer:Y.options.find(D=>D.value===q)});continue}Z?await P(Q,Z,Y.kind==="think"?H??null:null):await R(H??1e3),(Y.kind==="mutter"||Y.kind==="say")&&await R(1100),O(Q,{state:K?"failed":"ok",endedAt:Date.now()}),K&&(r(D=>({...D,shake:D.shake+1})),I("dizzy",2600),await R(900))}const $=Date.now();for(r(Q=>({...Q,phase:"stretch",endedAt:$,recapUntil:$+Uj})),$-z>2e4&&I("happy",3200),await R(2200);;)r(Q=>({...Q,phase:"idle"})),await R(9e3),r(Q=>({...Q,phase:"groom"})),await R(2800)})().catch(z=>{if(!(z instanceof u0))throw z}),()=>{var z;T=!1;for(const q of _)clearTimeout(q);(z=m.current)==null||z.call(m,"")}},[e,d,h]),w.useEffect(()=>{var O;const T=Date.now(),_=[((O=i.flash)==null?void 0:O.until)??0,i.recapUntil-$j,i.recapUntil].filter(I=>I>T);if(!_.length)return;const R=setTimeout(()=>y(I=>I+1),Math.min(..._)-T+20);return()=>clearTimeout(R)});const j=hg.find(T=>T.key===h)??null,b=Date.now(),k=j?null:i.phase==="turn"?[...i.steps].reverse().find(T=>T.state==="running")??null:null,S=j?j.motion:k?aH[k.kind]:i.phase==="stretch"?"stretch":i.phase==="groom"?"groom":i.phase==="turn"?"think":"idle",N=i.flash&&i.flash.until>b?i.flash.mood:null,C=i.endedAt!==null&&b<i.recapUntil,M=j?j.step?iH(j.step):null:k??(i.phase==="turn"?i.steps.at(-1)??null:null);return{...{view:{steps:i.steps.map(Fj),shown:M?Fj(M):null,startedAt:i.startedAt,endedAt:i.endedAt,skew:0,answer:T=>{var _;return(_=m.current)==null?void 0:_.call(m,T)},done:j!=null&&j.done?{ms:31400,outcome:"completed",fading:!1}:!j&&C?{ms:i.endedAt-i.startedAt,outcome:"completed",fading:b>=i.recapUntil-$j}:null},motion:S,fast:j?!!j.fast:(k==null?void 0:k.kind)==="write"||(k==null?void 0:k.kind)==="run",mood:(j==null?void 0:j.mood)??N??l,shake:i.shake,canRecap:!j&&i.endedAt!==null&&!C,showRecap:()=>r(T=>({...T,recapUntil:Date.now()+Uj}))},controls:{pose:j,baseMood:l,setBaseMood:c,replay:()=>{g(null),f(T=>T+1)},hold:T=>{g(T),r(_=>{var R;return{...c0,shake:_.shake+((R=hg.find(O=>O.key===T))!=null&&R.shake?1:0)}})}}}}const oH=4e3,Vj={turn:null,last:null,skew:0};function sH(e,n){const i=[...e.steps];let r=e.dropped;for(const l of n)if(l.op==="step"){const c=i.findIndex(d=>d.id===l.step.id);c>=0?i[c]=l.step:i.push(l.step)}else if(l.op==="text"){const c=i.findIndex(g=>g.id===l.id),d=i[c];if(!d)continue;const f=(d.text??"")+l.append,h=Math.max(0,f.length-oH);i[c]={...d,text:f.slice(h),omitted:(d.omitted??0)+h}}else{const c=i.findIndex(d=>d.id===l.id);c>=0&&(i.splice(c,1),r++)}return{...e,steps:i,dropped:r}}function lH(e){const[n,i]=w.useState(Vj);return w.useEffect(()=>{if(i(Vj),!e)return;const r=new EventSource(`/api/bots/${encodeURIComponent(e)}/live`),l=c=>JSON.parse(c.data);return r.addEventListener("snapshot",c=>{const d=l(c);i(f=>({...f,turn:d.turn,skew:d.now-Date.now()}))}),r.addEventListener("start",c=>{const{turn:d}=l(c);i(f=>({...f,turn:d}))}),r.addEventListener("patch",c=>{const{patches:d}=l(c);i(f=>f.turn?{...f,turn:sH(f.turn,d)}:f)}),r.addEventListener("end",c=>{const{outcome:d,endedAt:f}=l(c);i(h=>h.turn?{...h,turn:null,last:{...h.turn,outcome:d,endedAt:f}}:h)}),()=>r.close()},[e]),n}const d0=new Set(["messages.read","messages.search","chats.list","chats.info","threads.list","members.list","bots.list","sections.list","history.read","list","describe"]),Ki=e=>e.state==="running"?"running":e.state==="failed"?"failed":"ok",f0=e=>(e==null?void 0:e.split("/").filter(Boolean).pop())??"",cH=e=>{const n=(e??"").split(`
809
+ `)[0].trim();return n.length>40?`${n.slice(0,39)}…`:n},Gj=e=>e.type==="channel"?`#${e.title}`:e.title;function h0(e){return e?e.omitted?`${e.head}
810
+ ${v("npc.live.omitted",{count:La(e.omitted)})}
811
+ ${e.tail}`:e.head+e.tail:""}const Yj=e=>e.omitted?`${v("npc.live.omitted",{count:La(e.omitted)})}
812
+ `:"";function m0(e){switch(e.icon){case"think":return{motion:"think",fast:!1};case"mutter":return{motion:"work",fast:!1};case"read":case"chat":return{motion:"read",fast:!1};case"say":return{motion:"turn",fast:!1};case"ask":return{motion:"ask",fast:!1};case"compact":return{motion:"yawn",fast:!1};case"retry":return{motion:"busy",fast:!1};default:return{motion:"work",fast:!0}}}function uH(e,n,i){const r={id:e.id,state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:n},l=(h,g,y)=>({...r,look:"action",icon:h,title:g,detail:y});switch(e.kind){case"thinking":return{...r,look:"thought",icon:"think",title:v("npc.step.think"),line:e.text??"",detail:Yj(e)+(e.text??"")};case"text":return{...r,look:"mutter",icon:"mutter",title:v("npc.step.mutter"),line:e.text??"",detail:Yj(e)+(e.text??"")};case"compaction":return l("compact",v(`npc.live.compact.${Ki(e)}`),e.tokensBefore!=null&&e.tokensAfter!=null?v("npc.live.tokens",{before:La(e.tokensBefore),after:La(e.tokensAfter)}):h0(e.output));case"retry":return l("retry",e.state==="running"?v("npc.live.retry.running",{attempt:e.attempt??1,max:e.maxAttempts??1}):v(`npc.live.retry.${Ki(e)}`),h0(e.output))}const c=e.input??{},d=h0(e.output),f=[c.path??c.command??c.args,d].filter(Boolean).join(`
813
+
814
+ `);switch(e.tool){case"read":return l("read",v(`npc.live.read.${Ki(e)}`,{target:f0(c.path)}),f);case"edit":return l("write",v(`npc.live.edit.${Ki(e)}`,{target:f0(c.path)}),f);case"write":return l("write",v(`npc.live.write.${Ki(e)}`,{target:f0(c.path)}),f);case"bash":return l("run",v(`npc.live.run.${Ki(e)}`,{target:cH(c.command)}),f);case"codemode":return l("script",v(`npc.live.script.${Ki(e)}`),f);case"chat":return dH(e,r,i,d);default:return l("tool",v(`npc.live.tool.${Ki(e)}`,{tool:e.tool??""}),f)}}function dH(e,n,i,r){const l=e.input??{},c=l.action??"",d=l.chat,f=d&&(d.id===null?d.type!=="dm":d.id!==i)?Gj(d):void 0;if(c==="messages.send")return{...n,look:"speech",icon:"say",to:f,line:l.text??"",detail:[l.text,e.state==="failed"?r:""].filter(Boolean).join(`
815
+
816
+ `),title:e.state==="failed"?v("npc.live.sendFailed"):f?v(`npc.step.post.${e.state==="running"?"running":"ok"}`,{chat:f}):v(`npc.step.say.${e.state==="running"?"running":"ok"}`)};if(c==="messages.ask"){const y=fH(e);return{...n,look:"speech",icon:"ask",to:f,line:l.text??"",options:(l.options??[]).map(m=>({label:m})),hint:f?v("npc.live.answerIn",{chat:f}):v("npc.live.answerBelow"),detail:[l.text,...(l.options??[]).map(m=>`· ${m}`),r].filter(Boolean).join(`
817
+ `),title:e.state==="running"?v("npc.step.ask.running"):y?v("npc.step.ask.ok",{answer:y}):v(e.state==="failed"?"npc.live.askFailed":"npc.live.askClosed")}}if(c==="environments.switch")return{...n,look:"action",icon:"tool",title:v(`npc.live.switch.${Ki(e)}`),detail:r};const h=d?Gj(d):"",g=d0.has(c)?h?v(`npc.live.browse.${e.state==="running"?"running":"ok"}`,{chat:h}):v(`npc.live.browseAll.${e.state==="running"?"running":"ok"}`):v(`npc.live.tool.${Ki(e)}`,{tool:c||"chat"});return{...n,look:"action",icon:d0.has(c)?"chat":"tool",title:e.state==="failed"&&d0.has(c)?v("npc.live.tool.failed",{tool:c}):g,detail:r}}function fH(e){try{const n=JSON.parse(e.output?e.output.head+e.output.tail:"");return n.status!=="answered"?null:[...(n.selected??[]).map(i=>i.label??""),n.custom??""].filter(Boolean).join(v("common.listSeparator"))}catch{return null}}function Kj(e,n){const i=new Map(e.steps.map(l=>[l.id,l.parentId])),r=l=>{let c=0,d=l.parentId;for(;d&&c<4;)c++,d=i.get(d)??null;return c};return e.steps.map(l=>uH(l,r(l),n))}function Gd(e){var i;const n=((i=e.line)==null?void 0:i.length)??0;if(e.look==="speech"){const r=Math.min(7e3,Math.max(2500,1500+50*n))+Math.min(1500,n/.06);return{firm:r,light:r}}return e.look==="mutter"?{firm:1500,light:Math.min(3500,Math.max(1500,800+30*n))}:e.state==="failed"?{firm:2e3,light:2e3}:{firm:0,light:e.look==="action"?900:0}}const hH=4e3,Xj=1500;function Qj(e,n,i,r){var b;const l=k=>k-i;let c=null;for(const k of e)k.state==="running"&&(!c||k.startedAt>=c.startedAt)&&(c=k);const d=[];for(const k of e.filter(S=>S.state!=="running"&&S.endedAt!==null&&Gd(S).firm).sort((S,N)=>S.endedAt-N.endedAt)){const S=l(k.endedAt),N=d.at(-1);N&&k.look==="speech"&&(N.end=Math.min(N.end,Math.max(N.start+Xj,S)));const C=Math.max(S,(N==null?void 0:N.end)??0);C-S>hH||d.push({step:k,start:C,end:C+Gd(k).firm})}const f=(c==null?void 0:c.look)==="speech"?c:null;if(f){const k=l(f.startedAt);for(let S=d.length-1;S>=0;S--){const N=d[S];N.start>=k&&N.start>n?d.splice(S,1):N.end>k&&(N.end=Math.max(N.start+Xj,k))}}let h=null;for(const k of e){if(k.state==="running"||k.endedAt===null||!Gd(k).light)continue;const S=l(k.endedAt)+Gd(k).light;S>n&&(!h||k.endedAt>=h.step.endedAt)&&(h={step:k,end:S})}const g=d.find(k=>k.start<=n&&n<k.end),y=(g==null?void 0:g.step)??(f||c&&c.look!=="thought"||h==null?void 0:h.step),m=y??f??c??(r?e.at(-1)??null:null),j=[...d.flatMap(k=>[k.start,k.end]),(h==null?void 0:h.end)??0].filter(k=>k>n);return{shown:m,lingering:!!y,next:j.length?Math.min(...j):0,wordsEnd:((b=d.at(-1))==null?void 0:b.end)??0}}const Zj=6e3,Jj=500,mH=2e4,pH=10*6e4;function k6(e,n,i,r){var R;const{turn:l,last:c,skew:d}=lH(e),[f,h]=w.useState(null),[g,y]=w.useState(0),[m,j]=w.useState(0),[,b]=w.useState(0),k=w.useRef(new Set),S=w.useMemo(()=>l?Kj(l,n):c?Kj(c,n):[],[l,c,n]);w.useEffect(()=>{for(const O of(l==null?void 0:l.steps)??[])O.state==="failed"&&!k.current.has(O.id)&&(k.current.add(O.id),y(I=>I+1),h({mood:"dizzy",until:Date.now()+2600}))},[l]),w.useEffect(()=>{c&&(k.current.clear(),j(Math.max(Date.now(),Qj(S,Date.now(),d,!1).wordsEnd)+Zj),c.outcome==="completed"&&c.endedAt-c.startedAt>mH&&h({mood:"happy",until:Date.now()+3200}))},[c]);const N=Date.now(),C=Qj(S,N,d,l!==null),M=C.shown,E=S.filter(O=>O.state==="running").sort((O,I)=>I.startedAt-O.startedAt)[0],T=E&&E.look!=="thought"?m0(E):C.lingering&&M?m0(M):E?m0(E):l?{motion:"think",fast:!1}:r,_=!l&&!M&&c!==null&&N<m;return w.useEffect(()=>{const O=[(f==null?void 0:f.until)??0,m-Jj,m,C.next].filter(P=>P>Date.now()),I=setTimeout(()=>b(P=>P+1),O.length?Math.min(...O)-Date.now()+20:1e3);return()=>clearTimeout(I)}),{view:{steps:S,shown:M,skew:d,startedAt:((R=l??c)==null?void 0:R.startedAt)??0,endedAt:l?null:(c==null?void 0:c.endedAt)??null,done:_?{ms:c.endedAt-c.startedAt,outcome:c.outcome,fading:N>=m-Jj}:null},motion:T.motion,fast:T.fast,mood:f&&f.until>N?f.mood:i,shake:g,canRecap:!l&&c!==null&&!_&&N+d-c.endedAt<pH,showRecap:()=>j(Date.now()+Zj)}}const S6="jarvy-floating-bot",Bc=10,gH=4,Ic=.3,vH=.86,Yd=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,Kd=new URLSearchParams(location.search).get("npc")==="demo",yH={zz:o.jsxs(o.Fragment,{children:[o.jsx("i",{children:"z"}),o.jsx("i",{children:"Z"})]}),ask:"?",sweat:o.jsxs("svg",{viewBox:"0 0 20 28",children:[o.jsx("path",{d:"M10 1C10 1 2 13 2 18.5a8 8 0 0 0 16 0C18 13 10 1 10 1Z"}),o.jsx("ellipse",{cx:"7",cy:"18",rx:"1.8",ry:"3"})]}),sparkle:o.jsx("svg",{viewBox:"0 0 100 100",children:[[14,22,9],[86,18,7],[90,46,4.5]].map(([e,n,i])=>o.jsx("path",{d:`M${e} ${n-i}Q${e} ${n} ${e+i} ${n}Q${e} ${n} ${e} ${n+i}Q${e} ${n} ${e-i} ${n}Q${e} ${n} ${e} ${n-i}Z`},e))})};function C6({motion:e}){const n=KI[e];return n?o.jsx("span",{className:"jv-figure-mark","data-mark":n,"aria-hidden":"true",children:yH[n]}):null}function ah(e){return!e||e.status==="stop"?{motion:"sleep",fast:!1}:e.status!=="running"||e.activity==="asking"?{motion:"idle",fast:!1}:["compacting","retrying","aborting"].includes(e.phase)?{motion:"busy",fast:!1}:e.activity==="tool_calling"||e.phase==="tool"?{motion:"work",fast:!0}:e.activity==="texting"||e.phase==="texting"?{motion:"work",fast:!1}:{motion:"think",fast:!1}}function xH(){try{const e=JSON.parse(localStorage.getItem(S6)??"");if(e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1)return e}catch{}return{x:1,y:0}}function bH({bot:e,chatId:n,status:i,area:r,avoid:l,lastMine:c,onOpen:d}){const f=w.useRef(null),h=w.useRef(null),g=w.useRef(xH()),y=w.useRef(null),m=w.useRef(!1),j=w.useRef(null),[b]=w.useState(()=>new y6),k=b.input,S=b.persona,[N,C]=w.useState(!1),M=w.useRef(null),E=rH(Kd,e.mood),T=k6(Kd?null:e.id,n,e.mood,ah(i)),_=Kd?E:T;k.motion=_.motion,k.fast=_.fast,k.mood=_.mood;function R(){const z=r.current.getBoundingClientRect(),q=f.current.offsetWidth,$=l.current?l.current.getBoundingClientRect().top-z.top:z.height,Q=Math.max(Bc,Math.round(Ic*q)),Y=Math.max(Bc,z.width-q-Bc),H=Math.max(Q,$-q-Bc);return{minX:Bc,minY:Q,maxX:Y,maxY:H}}function O(){var Q;const z=(Q=r.current)==null?void 0:Q.getBoundingClientRect(),q=f.current;if(!z||!q)return 0;const $=z.width/2-q.offsetWidth/2;return $>0?Math.max(-1,Math.min(1,($-q.offsetLeft)/$)):0}function I(){var $;if(!f.current||!r.current)return;const z=R(),q=f.current;q.style.left=`${z.minX+g.current.x*(z.maxX-z.minX)}px`,q.style.top=`${z.minY+g.current.y*(z.maxY-z.minY)}px`,($=M.current)==null||$.call(M)}w.useLayoutEffect(()=>{I();const z=new ResizeObserver(I);for(const q of[r.current,l.current,f.current])q&&z.observe(q);return()=>z.disconnect()},[]);const P=i!=null&&i.error?`${i.runId??""}:${i.error}`:null;return w.useEffect(()=>{(P||_.shake)&&b.shake()},[P,_.shake]),w.useEffect(()=>{const z=Q=>{(Q.pointerType==="mouse"||Q.type==="pointerdown")&&(j.current={x:Q.clientX,y:Q.clientY})},q=Q=>{Q.relatedTarget||(j.current=null)},$=Q=>{const Y=Q.target;if(Y.id!=="jarvy-composer")return;const H=Y.getBoundingClientRect();j.current={x:H.left+H.width/2,y:H.top+H.height/2}};return window.addEventListener("pointermove",z),window.addEventListener("pointerdown",z),document.addEventListener("pointerout",q),document.addEventListener("input",$),document.addEventListener("focusin",$),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerdown",z),document.removeEventListener("pointerout",q),document.removeEventListener("input",$),document.removeEventListener("focusin",$)}},[]),x6(S,_,n,c),b.color=(Ni[e.color]??Ni.gray).hex,b.crown=e.agent,w.useEffect(()=>{if(!h.current)return;b.onFrame=()=>{var K;const q=f.current;if(!q)return;const $=q.getBoundingClientRect(),Q=j.current;k.lookX=Q?Math.max(-1,Math.min(1,(Q.x-$.left-$.width/2)/320)):0,k.lookY=Q?Math.max(-1,Math.min(1,(Q.y-$.top-$.height/2)/320)):0;const Y=!!((K=y.current)!=null&&K.moved)&&k.motion==="idle";(k.faceX===void 0||!(Y||k.motion==="sleep"))&&(k.faceX=O());const H=S.playing??"";q.dataset.act!==H&&(H?q.dataset.act=H:delete q.dataset.act)};const z=b.add(h.current,vH/(1+2*Ic));return C(b.start()),()=>{z(),b.stop(),b.onFrame=null}},[]),o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:f,type:"button",className:"jv-floating-bot","data-live":N||void 0,"data-motion":_.motion,title:e.name,"aria-label":v("avatar.openInfo",{name:e.name}),onPointerDown:z=>{if(z.button!==0)return;const q=z.currentTarget;q.setPointerCapture(z.pointerId),y.current={id:z.pointerId,x:z.clientX,y:z.clientY,left:q.offsetLeft,top:q.offsetTop,moved:!1}},onPointerMove:z=>{const q=y.current;if(!q||q.id!==z.pointerId)return;const $=z.clientX-q.x,Q=z.clientY-q.y;if(!q.moved&&Math.hypot($,Q)<gH)return;!q.moved&&!Yd()&&S.carry(!0,performance.now()),q.moved=!0;const Y=R(),H=Math.min(Y.maxX,Math.max(Y.minX,q.left+$)),K=Math.min(Y.maxY,Math.max(Y.minY,q.top+Q));g.current={x:Y.maxX>Y.minX?(H-Y.minX)/(Y.maxX-Y.minX):0,y:Y.maxY>Y.minY?(K-Y.minY)/(Y.maxY-Y.minY):0},I()},onPointerUp:z=>{const q=y.current;!q||q.id!==z.pointerId||(y.current=null,m.current=q.moved,q.moved&&(localStorage.setItem(S6,JSON.stringify(g.current)),Yd()||S.carry(!1,performance.now())))},onPointerCancel:()=>{y.current=null,Yd()||S.carry(!1,performance.now())},onClick:()=>{if(m.current){m.current=!1;return}Yd()||S.play("poke",performance.now()),_.canRecap?_.showRecap():d()},style:{"--jv-avatar-size":"100%"},children:[o.jsx("canvas",{ref:h,"aria-hidden":"true",style:{inset:`${-Ic*100}%`,width:`${(1+2*Ic)*100}%`,height:`${(1+2*Ic)*100}%`}}),!N&&o.jsx(_i,{color:e.color,mood:_.mood,size:88,crown:e.agent,asleep:_.motion==="sleep"}),o.jsx(C6,{motion:_.motion})]}),o.jsx(j6,{view:_.view,name:e.name,cat:f,area:r,avoid:l,layout:M,facing:O,toolbar:Kd?(z,q)=>o.jsx(WP,{controls:E.controls,toolbar:z,onReplay:()=>{q(),E.controls.replay()}}):void 0})]})}function jH({className:e,...n}){return o.jsx("div",{"data-slot":"card",className:Dn("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...n})}function wH({className:e,...n}){return o.jsx("div",{"data-slot":"card-header",className:Dn("grid gap-1 px-5",e),...n})}function kH({className:e,...n}){return o.jsx("div",{"data-slot":"card-title",className:Dn("font-semibold leading-none",e),...n})}function SH({className:e,...n}){return o.jsx("div",{"data-slot":"card-content",className:Dn("px-5",e),...n})}function CH({bot:e,connections:n,onSaved:i,onManage:r}){return o.jsxs(jH,{className:"jarvy-model-picker jv-ui",children:[o.jsx(wH,{children:o.jsx(kH,{children:v("botModel.pickFor",{name:e.name})})}),o.jsx(SH,{children:o.jsx(TS,{bot:e,connections:n,onSaved:i,onManage:r})})]})}function NH({chat:e,inChannel:n,bots:i,members:r,meId:l,drafts:c,composeReady:d,botName:f,activeBot:h,status:g,connections:y,activity:m,history:j,divider:b,activeQuestion:k,pane:S,onPane:N,onToggleInfo:C,find:M,onNav:E,onBot:T,hasBotDirects:_,onInvite:R,onQuote:O,onReply:I,onReact:P,onFold:z,onJump:q,onSettled:$,onSend:Q,onPreview:Y,onSaveNote:H,notice:K,createBot:V,creating:X,updateBot:Z,onManageModels:D,error:se,chatArea:ne,transcript:B,composeWrap:F,hidden:ee,onOpenThread:W,onBotCard:fe}){var Ke;const{messages:le,loading:be,hasOlder:we,loadingOlder:ve,top:re,away:Ce,unseen:Ve,toLatest:Pe}=j,Ze=le.filter(gt=>gt.senderId===l),Fe=(Ke=Ze[Ze.length-1])==null?void 0:Ke.id;return o.jsxs("main",{className:"ui-chat","aria-label":v("chat.area"),ref:ne,hidden:ee,children:[!n&&o.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only jv-floating-nav",label:v("common.openNav"),onClick:E}),!n&&_&&o.jsx(vt,{icon:"people",className:"jv-floating-dms",label:v("chat.botDms",{name:f}),"aria-pressed":(S==null?void 0:S.kind)==="botdms",onClick:()=>N((S==null?void 0:S.kind)==="botdms"?null:{kind:"botdms"})}),o.jsx("span",{className:"sr-only",role:"status","aria-label":v("chat.botStatus"),children:n?"":m}),e?o.jsxs(o.Fragment,{children:[n?o.jsx(uP,{chat:e,members:Ei(r),bots:i,onNav:E,infoOpen:(S==null?void 0:S.kind)==="info"&&S.page==="main",onInfo:()=>C("main"),membersOpen:(S==null?void 0:S.kind)==="info"&&S.page==="members",onMembers:()=>C("members"),threadsOpen:(S==null?void 0:S.kind)==="threads",onThreads:()=>N((S==null?void 0:S.kind)==="threads"?null:{kind:"threads"}),searchOpen:(S==null?void 0:S.kind)==="search",onSearch:()=>(S==null?void 0:S.kind)==="search"?N(null):M.search(e)}):h&&!ee&&o.jsx(bH,{bot:h,chatId:e.id,status:g,area:ne,avoid:F,lastMine:Fe,onOpen:()=>T(h.id)}),n&&o.jsx(dP,{chat:e,onSave:H}),o.jsxs("div",{className:"jv-transcript",children:[o.jsxs("div",{className:`ui-transcript jarvy-transcript${n?" jv-channel-transcript":""}`,ref:B,"aria-label":v("chat.transcript"),role:"log",children:[!n&&!(h!=null&&h.connectionId)&&h&&o.jsx("div",{className:"jarvy-model-onboarding",children:o.jsx(CH,{bot:h,connections:y,onSaved:Z,onManage:D})}),be?o.jsx("p",{className:"jarvy-empty-text",children:v("chat.loading")}):le.length===0?n?o.jsx("div",{className:"jarvy-empty-chat",children:o.jsx("p",{children:v("chat.empty")})}):h!=null&&h.connectionId?o.jsx("div",{className:"jarvy-empty-chat",children:o.jsx("h2",{children:v("chat.start",{name:f})})}):null:o.jsxs(o.Fragment,{children:[we&&o.jsx("div",{ref:re,className:"jv-history-more","aria-live":"polite",children:ve?v("chat.loadingOlder"):""}),n?o.jsx(Ef,{messages:le,members:r,bots:i,me:l,divider:b,activeQuestion:k,onSettled:$,onPreview:Y,onReply:I,onOpenThread:W,onQuote:O,onReact:P,onFold:z,onJump:q,onBotCard:fe,onError:se}):o.jsx(v6,{messages:le,members:r,me:l,activeQuestion:k,bot:h,onSettled:$,onPreview:Y,onQuote:O,onReact:P,onFold:z,onJump:q,onBotCard:fe,onError:se})]})]}),Ce&&le.length>0&&o.jsx("div",{className:"jv-to-latest",children:o.jsxs("button",{type:"button",onClick:Pe,"aria-label":v("chat.toLatest"),children:[Ve>0&&o.jsx("span",{children:v("chat.unseen",{count:Ve})}),o.jsx(qe,{name:"chevron-down"})]})})]}),o.jsx(O1,{chatId:e.id,id:"jarvy-composer",drafts:c,formRef:F,scrollRef:B,disabled:!d,placeholder:n?v("chat.toChannel",{name:e.title}):h!=null&&h.connectionId?v("chat.toBot",{name:f}):v("chat.pickModel"),mention:n?{bots:i,inside:Ei(r).filter(gt=>gt.id!==l&&e.memberIds.includes(gt.id)),outside:Ei(r).filter(gt=>!e.memberIds.includes(gt.id)),onInvite:gt=>R(e.id,gt)}:void 0,onSend:Q,onError:se,onNotice:K})]}):o.jsx("div",{className:"jarvy-empty-chat jarvy-first-chat",children:i.length?o.jsx("p",{children:v("chat.pick")}):o.jsxs("button",{className:"ui-button ui-primary",onClick:V,disabled:X,children:[o.jsx(qe,{name:"person-add"}),v("sidebar.newBot")]})}),e&&o.jsx(_1,{container:B,drafts:c,chatId:e.id,source:gt=>le.find(Ht=>Ht.id===gt),members:r,onNotice:K})]})}const EH=10,Wj=288,Ar=12,TH=620;function MH(e,n,i){const r=Math.max(Ar,n.height-i-Ar),l=h=>Math.min(Math.max(Ar,h),r);if(n.width>TH)return{left:Math.min(Math.max(Ar,e.right+EH),n.width-Wj-Ar),top:l(e.top-8),width:Wj};const c=e.bottom+6,d=e.top-6-i,f=c+i+Ar<=n.height?c:d>=Ar?d:l(c);return{left:Ar,top:f,width:n.width-Ar*2}}function AH({bot:e,status:n,connections:i,anchor:r,onClose:l,onMessage:c,onInfo:d}){var b;const f=w.useRef(null);w.useEffect(()=>{const k=C=>{var E;const M=C.target;(E=f.current)!=null&&E.contains(M)||M!=null&&M.closest(".jv-avatar-button")||l()},S=C=>{C.key==="Escape"&&l()},N=C=>{var M;(M=f.current)!=null&&M.contains(C.target)||l()};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",S),document.addEventListener("scroll",N,!0),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",S),document.removeEventListener("scroll",N,!0)}},[]),w.useEffect(()=>{var k;(k=f.current)==null||k.focus({preventScroll:!0})},[e.id]);const[h,g]=w.useState(0);w.useLayoutEffect(()=>{f.current&&g(f.current.offsetHeight)},[e.id,r]);const y=KS(e,n),m=(b=i.find(k=>k.id===e.connectionId))==null?void 0:b.models.find(k=>k.id===e.modelId),j=MH(r,{width:window.innerWidth,height:window.innerHeight},h);return Do.createPortal(o.jsxs("div",{ref:f,className:"jv-bot-card",role:"dialog","aria-label":e.name,tabIndex:-1,style:j,children:[o.jsxs("header",{className:"jv-bot-card-head",children:[o.jsx(_i,{color:e.color,mood:e.mood,size:44,crown:e.agent,asleep:(n==null?void 0:n.status)==="stop"}),o.jsxs("div",{children:[o.jsx("h2",{children:e.name}),o.jsx("span",{className:"jv-bot-card-role",children:e.agent?v("botCard.agent"):"Bot"})]})]}),e.description&&o.jsx("p",{className:"jv-bot-card-about",children:e.description}),o.jsxs("dl",{className:"jv-bot-card-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:v("botCard.state")}),o.jsx("dd",{"data-tone":y.tone,children:y.label})]}),o.jsxs("div",{children:[o.jsx("dt",{children:v("botCard.worksIn")}),o.jsx("dd",{children:Gq(e)})]}),m&&o.jsxs("div",{children:[o.jsx("dt",{children:v("usage.model")}),o.jsx("dd",{title:m.name,children:m.name})]})]}),o.jsxs("div",{className:"jv-bot-card-actions",children:[o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{c(),l()},children:v("botCard.message")}),o.jsx(Ne,{type:"button",variant:"outline",size:"sm",onClick:()=>{d(),l()},children:v("botCard.info")})]})]}),document.body)}class _H{constructor(){He(this,"listeners",new Set)}emit(n){for(const i of this.listeners)i(n)}on(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}}function z1(e,n){const i=w.useRef(n);i.current=n,w.useEffect(()=>e.on(r=>i.current(r)),[e])}const uu=(e,n)=>e.some(i=>i.id===n.id)?e.map(i=>i.id===n.id?n:i):e;function ih(e,n){if(e.some(r=>r.id===n.id))return uu(e,n);if(e[0]&&n.sequence<e[0].sequence)return e;const i=e.findIndex(r=>r.sequence>n.sequence);return i<0?[...e,n]:[...e.slice(0,i),n,...e.slice(i)]}const D1=(e,n)=>e.sequence>n+1;function N6(e,n,i){var l;const r=((l=n.at(-1))==null?void 0:l.sequence)??i;return[...e.filter(c=>c.sequence<=i),...n,...e.filter(c=>c.sequence>r)]}const RH=e=>ca(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function OH(e,n){const[i,r]=w.useState([]);return w.useEffect(()=>{if(r([]),!e)return;let l=!0;return ue.botDirects(e).then(c=>{l&&r(c.chats)}).catch(()=>{}),()=>{l=!1}},[e,n]),i}function zH({bot:e,chats:n,members:i,bots:r,me:l,live:c,onClose:d,onPreview:f,onError:h}){const[g,y]=w.useState(null),[m,j]=w.useState(null),[b,k]=w.useState(0);w.useEffect(()=>{if(!g){j(null);return}let C=!0;return ue.messages(g).then(M=>{C&&j(M.messages)}).catch(M=>{C&&h(M)}),()=>{C=!1}},[g,b]),w.useEffect(()=>j(null),[g]),z1(c,C=>{if(C.kind==="reconnected"){k(E=>E+1);return}if(C.kind==="chat"||C.message.chatId!==g)return;const M=C.message;j(E=>E&&(C.kind==="message"?ih(E,M):uu(E,M)))});const S=C=>i.find(M=>M.id!==e.id&&C.memberIds.includes(M.id)),N=n.find(C=>C.id===g);return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":v("chat.botDms",{name:e.name}),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[N&&o.jsx(vt,{icon:"chevron-left",label:v("directs.back"),onClick:()=>y(null)}),o.jsx("strong",{children:N?v("directs.between",{name:e.name,other:Ti(S(N))}):v("chat.botDms",{name:e.name})}),o.jsx("span",{className:"jv-spacer"}),o.jsx(vt,{icon:"close",label:v("common.close"),onClick:d})]}),N?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"ui-pane-body jv-pane-body",children:m===null?o.jsx("p",{className:"jv-picker-empty",children:v("threads.loading")}):m.length===0?o.jsx("p",{className:"jv-picker-empty",children:v("chat.empty")}):o.jsx(Ef,{messages:m,members:i,bots:r,me:l,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:f})}),o.jsx("p",{className:"jv-readonly",children:v("directs.readOnly")})]}):o.jsx("div",{className:"ui-pane-body jv-pane-body",children:n.length===0?o.jsx("p",{className:"jv-picker-empty",children:v("sidebar.noDms")}):n.map(C=>{const M=S(C);return o.jsxs("button",{type:"button",className:"jv-thread-item",onClick:()=>y(C.id),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx(sr,{member:M,bots:r,size:20}),o.jsx("strong",{children:Ti(M)}),o.jsx("span",{className:"jv-muted",children:RH(C.updatedAt)})]}),C.lastMessage&&o.jsx("span",{className:"jv-muted jv-thread-item-meta",children:Ds(C.lastMessage)})]},C.id)})})]})}function DH({x:e,y:n,admin:i,onAdmin:r,onRemove:l,onClose:c}){const d=w.useRef(null);w.useEffect(()=>{const h=y=>{var m;(m=d.current)!=null&&m.contains(y.target)||c()},g=y=>{y.key==="Escape"&&c()};return document.addEventListener("pointerdown",h),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("keydown",g)}},[c]);const f={right:Math.max(8,window.innerWidth-e),top:Math.max(8,Math.min(n,window.innerHeight-100))};return o.jsxs("div",{ref:d,className:"ui-popover jv-entry-menu",role:"menu","aria-label":v("members.menu"),style:f,children:[i!==null&&o.jsxs(o.Fragment,{children:[o.jsx("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{r(),c()},children:o.jsx("span",{className:"ui-menu-copy",children:v(i?"members.removeAdmin":"members.makeAdmin")})}),o.jsx("hr",{className:"ui-menu-divider"})]}),o.jsx("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{l(),c()},children:o.jsx("span",{className:"ui-menu-copy",children:v("members.removeFromChannel")})})]})}function LH({channel:e,members:n,bots:i,statuses:r,me:l,onAdd:c,onBot:d,onChanged:f,onError:h}){const[g,y]=w.useState(null),[m,j]=w.useState(null),b=async(M,E)=>{try{f(await ue.setAdmin(e.id,M.id,E))}catch(T){h(T)}},k=n.filter(M=>e.memberIds.includes(M.id)),S=k.filter(M=>M.kind!=="bot").sort((M,E)=>+(E.id===l)-+(M.id===l)),N=k.filter(M=>M.kind==="bot"),C=M=>{const E=M.kind==="bot"?i.find(O=>O.id===M.id):void 0,T=r[M.id],_=M.kind==="bot"?KS(E,T):void 0,R=o.jsxs(o.Fragment,{children:[o.jsx(sr,{member:M,bots:i,size:28,working:(T==null?void 0:T.status)==="running"&&T.activity!=="asking"}),o.jsxs("span",{className:"jv-member-name",children:[M.name,M.id===l&&o.jsx("span",{className:"jv-role",children:v("common.you")}),M.id===e.createdBy?o.jsx("span",{className:"jv-role",children:v("members.creator")}):e.adminIds.includes(M.id)&&o.jsx("span",{className:"jv-role",children:v("members.admin")})]}),_&&o.jsx("span",{className:"jv-member-state","data-tone":_.tone,children:_.label})]});return o.jsxs("div",{className:"jv-member-row",children:[E?o.jsx("button",{type:"button",className:"jv-member-main","aria-label":v("members.view",{name:M.name}),onClick:()=>d(M.id),children:R}):o.jsx("div",{className:"jv-member-main",children:R}),M.id!==l&&o.jsx(vt,{icon:"more",label:v("members.more",{name:M.name}),className:"jv-member-remove",onClick:O=>{const I=O.currentTarget.getBoundingClientRect();j({member:M,x:I.right,y:I.bottom+4})}})]},M.id)};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-member-bar",children:[o.jsx("span",{children:v("members.count",{count:k.length})}),o.jsxs("button",{type:"button",className:"ui-button ui-primary jv-member-pane-add",onClick:c,children:[o.jsx(qe,{name:"person-add"}),v("common.add")]})]}),o.jsx("div",{className:"ui-pane-body jv-pane-body",children:[["people",v("members.people"),S],["bots","Bot",N]].map(([M,E,T])=>T.length>0&&o.jsxs("section",{className:"jv-member-group","aria-label":E,children:[o.jsxs("h3",{children:[E," · ",T.length]}),T.map(C)]},M))}),m&&o.jsx(DH,{x:m.x,y:m.y,onClose:()=>j(null),onRemove:()=>y(m.member),admin:m.member.kind==="bot"&&m.member.id!==e.createdBy?e.adminIds.includes(m.member.id):null,onAdmin:()=>void b(m.member,!e.adminIds.includes(m.member.id))}),g&&o.jsx(l6,{title:v("members.removeTitle",{name:g.name,channel:e.title}),body:v("members.removeBody"),confirm:v("members.removeConfirm"),onClose:()=>y(null),onConfirm:async()=>{try{f(await ue.removeMember(e.id,g.id)),y(null)}catch(M){h(M)}}})]})}function e4({label:e,value:n,empty:i,maxLength:r,required:l=!1,onSave:c}){const d=w.useId(),[f,h]=w.useState(null),[g,y]=w.useState(!1);w.useEffect(()=>h(null),[n]);const m=async()=>{if(!(f===null||g||l&&!f.trim())){if(f.trim()===n){h(null);return}y(!0);try{await c(f.trim()),h(null)}catch{}finally{y(!1)}}};return o.jsxs("div",{className:"jv-info-field",children:[o.jsxs("div",{className:"jv-info-label",children:[o.jsx("label",{htmlFor:d,children:e}),f===null&&o.jsx(vt,{icon:"pencil",label:v("info.edit",{name:e}),className:"jv-info-edit",onClick:()=>h(n)})]}),f===null?o.jsx("p",{className:"jv-info-value","data-empty":!n||void 0,children:n||i}):o.jsxs("div",{className:"jv-inline-edit",children:[o.jsx("input",{id:d,value:f,maxLength:r,autoFocus:!0,placeholder:i,onChange:j=>h(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.nativeEvent.isComposing&&(j.preventDefault(),m()),j.key==="Escape"&&(j.stopPropagation(),h(null))}}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>h(null),children:v("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:g||l&&!f.trim(),onClick:()=>void m(),children:v("common.save")})]})]})}function BH({channel:e,page:n,sections:i,members:r,bots:l,statuses:c,me:d,onPage:f,onPin:h,onMute:g,onAdd:y,onBot:m,onDelete:j,onChanged:b,onClose:k,onError:S}){const N=w.useId(),C=async E=>{try{b(await ue.updateChannel(e.id,E))}catch(T){throw S(T),T}},M=r.filter(E=>e.memberIds.includes(E.id)).length;return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":v(n==="members"?"info.memberList":"entry.channelInfo"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[n==="members"&&o.jsx(vt,{icon:"chevron-left",label:v("info.back"),className:"jv-pane-back",onClick:()=>f("main")}),o.jsx("strong",{children:v(n==="members"?"channel.members":"entry.channelInfo")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),o.jsx("span",{className:"jv-spacer"}),o.jsx(vt,{icon:"close",label:v("common.close"),onClick:k})]}),n==="members"?o.jsx(LH,{channel:e,members:r,bots:l,statuses:c,me:d,onAdd:y,onBot:m,onChanged:b,onError:S}):o.jsxs("div",{className:"ui-pane-body jv-pane-body jv-info",children:[o.jsxs("div",{className:"jv-info-actions",children:[o.jsxs("button",{type:"button","aria-pressed":e.pinned,onClick:h,children:[o.jsx(qe,{name:"pin"}),v("entry.pin")]}),o.jsxs("button",{type:"button","aria-pressed":e.muted,onClick:g,children:[o.jsx(qe,{name:e.muted?"bell-slash":"bell"}),v("entry.mute")]}),o.jsxs("button",{type:"button",onClick:y,children:[o.jsx(qe,{name:"person-add"}),v("info.addMembers")]})]}),o.jsx(e4,{label:v("info.name"),value:e.title,empty:v("info.newChannel"),maxLength:80,required:!0,onSave:E=>C({name:E})}),o.jsx(e4,{label:v("info.topic"),value:e.topic,empty:v("info.noTopic"),maxLength:200,onSave:E=>C({topic:E})}),o.jsxs("div",{className:"jv-info-field",children:[o.jsx("div",{className:"jv-info-label",children:o.jsx("label",{htmlFor:N,children:v("info.section")})}),o.jsx(IS,{id:N,value:e.sectionId,sections:i,onChange:E=>void C({sectionId:E}).catch(()=>{})})]}),o.jsxs("nav",{className:"jv-info-menu","aria-label":v("info.menu"),children:[o.jsxs("button",{type:"button",className:"ui-menu-item",onClick:()=>f("members"),children:[o.jsx(qe,{name:"people"}),o.jsx("span",{className:"ui-menu-copy",children:v("channel.members")}),o.jsx("span",{className:"jv-muted",children:M}),o.jsx(qe,{name:"chevron-right"})]}),o.jsxs("button",{type:"button",className:"ui-menu-item jv-menu-danger",onClick:j,children:[o.jsx(qe,{name:"trash"}),o.jsx("span",{className:"ui-menu-copy",children:v("entry.deleteChannel")})]})]})]})]})}function IH({chat:e,chats:n,members:i,focusKey:r,onOpenMessage:l,onClose:c,onError:d}){const[f,h]=w.useState(""),g=w.useRef(null);w.useEffect(()=>{var b,k;(b=g.current)==null||b.focus(),(k=g.current)==null||k.select()},[r,e.id]);const{result:y,loading:m}=c6(f,e.id,d),j=e.type==="channel"?`#${e.title}`:v(e.type==="thread"?"search.inThread":"search.inDm");return o.jsxs("aside",{className:"ui-pane jv-pane jv-search-pane","aria-label":v("search.paneLabel"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[o.jsx("strong",{children:v("search.title")}),o.jsx("span",{className:"jv-muted jv-pane-sub",children:j}),o.jsx("span",{className:"jv-spacer"}),o.jsx(vt,{icon:"close",label:v("search.close"),onClick:c})]}),o.jsx("div",{className:"jv-pane-search",children:o.jsx("input",{ref:g,type:"search",value:f,placeholder:v(e.type==="channel"?"search.channelPlaceholder":"search.placeholder"),"aria-label":v("search.placeholder"),onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Escape"&&(b.preventDefault(),f?h(""):c())}})}),o.jsx("div",{className:"ui-pane-body jv-pane-body jv-results","aria-live":"polite",children:f.trim()?y?y.messages.length?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"jv-result-count",children:v(y.messages.length>=60?"search.countLatest":"search.count",{count:y.messages.length})}),y.messages.map(({message:b,chat:k})=>o.jsx(f6,{message:b,chat:k,chats:n,members:i,query:f,showPlace:k.id!==e.id,onOpen:l},b.id))]}):o.jsx("p",{className:"jv-result-empty",children:v("search.noMessages")}):m&&o.jsx("p",{className:"jv-result-empty",children:v("search.searching")}):o.jsx("p",{className:"jv-result-empty",children:v("search.prompt")})})]})}const qH=e=>ca(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function PH({chat:e,channelName:n,expanded:i=!1,onTitle:r,onStatus:l,onSummary:c,onConclude:d}){var E;const[f,h]=w.useState(null),[g,y]=w.useState(null),[m,j]=w.useState(!1),[b,k]=w.useState(i);w.useEffect(()=>{h(null),y(null),k(i)},[e.id,i]);const S=async(T,_)=>{j(!0);try{await T(),_()}catch{}finally{j(!1)}},N=e.status==="done",C=e.note,M=((E=C==null?void 0:C.text.split(`
818
+ `).find(T=>T.trim()&&!T.startsWith("#")))==null?void 0:E.replace(/[*`|>-]/g,"").trim())??"";return o.jsxs("div",{className:"jv-thread-meta","data-open":b||void 0,children:[o.jsxs("div",{className:"jv-thread-title-row",children:[f===null?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:"jv-thread-title",title:e.title,children:e.title}),o.jsx(vt,{icon:"pencil",label:v("thread.rename"),onClick:()=>h(e.title)})]}):o.jsxs("form",{className:"jv-inline-edit",onSubmit:T=>{T.preventDefault(),f.trim()&&S(()=>r(f.trim()),()=>h(null))},children:[o.jsx("input",{value:f,autoFocus:!0,maxLength:80,"aria-label":v("thread.title"),onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Escape"&&h(null)}}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:m||!f.trim(),children:v("common.save")})]}),o.jsx("button",{type:"button",className:"jv-thread-status","data-done":N||void 0,disabled:m,title:v("thread.toggleStatus"),onClick:()=>void S(()=>l(N?"open":"done"),()=>{}),children:N?o.jsxs(o.Fragment,{children:[o.jsx(qe,{name:"check"}),v("channel.threadDone")]}):v("threads.open")})]}),g!==null?o.jsxs("div",{className:"jv-summary","data-editing":!0,children:[o.jsx("textarea",{className:"jv-notice-input",value:g,autoFocus:!0,"aria-label":v("thread.summary"),onChange:T=>y(T.target.value)}),o.jsxs("div",{className:"jv-notice-actions",children:[o.jsx("button",{type:"button",className:"ui-button",onClick:()=>y(null),children:v("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:m||!g.trim(),onClick:()=>void S(()=>c(g.trim()),()=>y(null)),children:v("common.save")})]})]}):C?o.jsxs("div",{className:"jv-summary",children:[o.jsxs("div",{className:"jv-summary-head",children:[o.jsxs("button",{type:"button",className:"jv-summary-toggle","aria-expanded":b,onClick:()=>k(!b),children:[o.jsx("strong",{children:v("thread.summary")}),!b&&o.jsx("span",{className:"jv-summary-first",children:M}),o.jsx(qe,{name:b?"chevron-down":"chevron-right"})]}),b&&o.jsxs("span",{className:"jv-muted jv-summary-meta",children:[C.updatedBy.name," · ",qH(C.updatedAt)," · ",v("notice.version",{version:C.version})]}),o.jsx(vt,{icon:"pencil",label:v("thread.editSummary"),onClick:()=>y(C.text)})]}),b&&o.jsx("div",{className:"jv-summary-body ui-bubble jv-flat",children:o.jsx(Pl,{text:C.text})}),b&&!N&&o.jsxs("button",{type:"button",className:"ui-button jv-conclude",disabled:m,onClick:()=>void S(d,()=>{}),children:[o.jsx(qe,{name:"check"}),v("thread.conclude",{channel:n})]})]}):o.jsxs("button",{type:"button",className:"jv-summary-empty",onClick:()=>y(""),children:[o.jsx(qe,{name:"add"}),v("thread.addSummary")]})]})}const HH=20,t4=500;class E6{constructor(){He(this,"kept",new Map)}take(n){const i=this.kept.get(n);return this.kept.delete(n),i}keep(n,i){if(this.kept.delete(n),!(i.messages.length>t4)){this.kept.set(n,i);for(const r of this.kept.keys()){if(this.kept.size<=HH)break;this.kept.delete(r)}}}removed(n){var i;for(const[r,l]of this.kept)(r===n||((i=l.chat)==null?void 0:i.parentId)===n)&&this.kept.delete(r)}clear(){this.kept.clear()}heard(n){var c;if(n.kind==="reconnected")return;if(n.kind==="chat"){const d=this.kept.get(n.chat.id);d!=null&&d.chat&&(d.chat=n.chat);return}const i=n.message;for(const d of this.kept.values())((c=d.root)==null?void 0:c.id)===i.id&&(d.root=i);const r=this.kept.get(i.chatId);if(!r)return;if(n.kind==="updated"||r.messages.some(d=>d.id===i.id)){r.messages=uu(r.messages,i);return}const l=r.messages.at(-1);if(l&&D1(i,l.sequence)||r.messages.length>=t4){this.kept.delete(i.chatId);return}r.messages=ih(r.messages,i)}}function T6(e,n){if(e.scrollHeight-e.scrollTop-e.clientHeight<n)return{bottom:!0};const i=e.getBoundingClientRect();let r;for(const l of e.querySelectorAll("[data-message]")){const c=l.getBoundingClientRect();if(c.bottom<=i.top)continue;const d={bottom:!1,id:l.dataset.message,offset:c.top-i.top};if(c.top>=i.top&&c.top<i.bottom)return d;if(r??(r=d),c.top>=i.bottom)break}return r??{bottom:!0}}function Mf(e,n){if(n.bottom)return!1;const i=e.querySelector(`[data-message="${n.id}"]`);return i?(e.scrollTo({top:e.scrollTop+i.getBoundingClientRect().top-e.getBoundingClientRect().top-n.offset,behavior:"instant"}),!0):!1}class M6{constructor(){He(this,"stop")}get on(){return this.stop!==void 0}start(n,i){this.release();const r=new ResizeObserver(()=>Mf(n,i));for(const d of n.children)r.observe(d);const l=["wheel","touchstart","pointerdown","keydown"],c=()=>this.release();for(const d of l)n.addEventListener(d,c,{passive:!0});this.stop=()=>{r.disconnect();for(const d of l)n.removeEventListener(d,c)}}release(){var n;(n=this.stop)==null||n.call(this),this.stop=void 0}}const p0=50;function n4({threadId:e,mode:n,showSummary:i=!1,focus:r,onSearch:l,channel:c,drafts:d,members:f,bots:h,me:g,live:y,memory:m,onClose:j,onToggleMode:b,onNav:k,onChanged:S,onInvite:N,onPreview:C,onError:M,onNotice:E,onOpenMessage:T,onBotCard:_}){var Ln;const[R,O]=w.useState(null),[I,P]=w.useState(null),[z,q]=w.useState([]),[$,Q]=w.useState(null),[Y,H]=w.useState(!1),[K,V]=w.useState(!1),X=w.useRef(z),Z=w.useRef(Y),D=w.useRef(null),se=w.useRef(null),ne=w.useRef(!1);X.current=z,Z.current=Y;const B=w.useRef(null),F=w.useRef(null),ee=w.useRef(null),W=w.useRef(!1),fe=w.useRef(!0),[le,be]=w.useState(!1),we=w.useRef(0),ve=w.useRef(0),re=w.useRef(0),Ce=w.useRef({bottom:!0}),Ve=w.useRef(null),Pe=w.useRef(R),Ze=w.useRef(I),[Fe]=w.useState(()=>new M6),Ke=w.useRef(!1);Pe.current=R,Ze.current=I,w.useEffect(()=>{O(null),P(null),q([]),H(!1),Q(null),W.current=!1,fe.current=!0,be(!1),we.current=0,ve.current=0,re.current=0},[e]);const gt=async me=>{const Ee=await ue.message(me).catch(()=>null);if(!Ee||Ee.chatId!==e)return(Ee==null?void 0:Ee.chatId)??null;const _e=Math.max(0,Ee.sequence-1-p0/2);return{...await ue.messages(e,_e),hasOlder:_e>0}},Ht=async()=>{const me=X.current[0];if((me==null?void 0:me.chatId)===e)return{...await ue.messages(e,me.sequence-1),after:me.sequence-1};const Ee=r&&ee.current!==e?await gt(r.id):null;return Ee&&typeof Ee=="object"?Ee:await ue.latestMessages(e,p0)},Jt=me=>{const Ee=me.after;q(_e=>Ee===void 0?me.messages:N6(_e.filter(Be=>Be.chatId===e),me.messages,Ee)),me.hasOlder!==void 0&&H(me.hasOlder)},tn=me=>{const Ee=X.current,_e=Ee.at(-1),Be=Math.max((_e==null?void 0:_e.chatId)===e?_e.sequence:0,re.current);if(D1(me,Be)&&!Ee.some(ze=>ze.id===me.id)){Ht().then(Jt).catch(M);return}re.current=Math.max(re.current,me.sequence),q(ze=>ih(ze,me))};z1(y,me=>{if(me.kind==="reconnected"){if(!W.current)return;Ke.current=!0,Promise.all([ue.chat(e),Ht()]).then(async([_e,Be])=>{O(_e),Jt(Be),Ke.current=!1,_e.rootMessageId&&P(await ue.message(_e.rootMessageId))}).catch(M);return}if(me.kind==="chat"){const _e=me.chat;_e.id===e&&O(Be=>Be&&{..._e,readSequence:Math.max(Be.readSequence,_e.readSequence)});return}const Ee=me.message;Ee.id===(I==null?void 0:I.id)?P(Ee):Ee.chatId===e&&(me.kind==="message"?tn(Ee):q(_e=>uu(_e,Ee)))});const kn=async()=>{var _e;const me=X.current[0],Ee=B.current;if(!(!me||!Z.current||ne.current)){ne.current=!0,V(!0);try{const Be=await ue.olderMessages(e,me.sequence,p0);if(((_e=X.current[0])==null?void 0:_e.id)!==me.id)return;se.current=Ee?Ee.scrollHeight-Ee.scrollTop:null,q(ze=>{var dt;return((dt=ze[0])==null?void 0:dt.id)===me.id?[...Be.messages,...ze]:ze}),H(Be.hasOlder)}catch(Be){M(Be)}finally{ne.current=!1,V(!1)}}};w.useEffect(()=>{let me=!0;Ce.current={bottom:!0},Ve.current=null;const Ee=()=>{me=!1,Fe.release();const Be=Pe.current;W.current&&!Ke.current&&(Be==null?void 0:Be.id)===e&&m.keep(e,{messages:X.current.filter(ze=>ze.chatId===e),hasOlder:Z.current,place:Ce.current,seen:we.current,chat:Be,root:Ze.current})},_e=r?void 0:m.take(e);return _e!=null&&_e.chat?(Ve.current=_e.place,we.current=_e.seen,O(_e.chat),P(_e.root??null),q(_e.messages),H(_e.hasOlder),ee.current!==e&&(ee.current=e,Q(_e.chat.readSequence)),Ee):(Promise.all([ue.chat(e),Ht()]).then(async([Be,ze])=>{if(me&&(O(Be),Jt(ze),ee.current!==e&&(ee.current=e,Q(Be.readSequence)),Be.rootMessageId)){const dt=await ue.message(Be.rootMessageId);me&&P(dt)}}).catch(Be=>{me&&M(Be)}),Ee)},[e]),w.useLayoutEffect(()=>{const me=B.current;if(!me||!R)return;if(se.current!==null){me.scrollTo({top:me.scrollHeight-se.current,behavior:"instant"}),se.current=null;return}const Ee=()=>me.scrollTo({top:me.scrollHeight,behavior:"instant"}),_e=z.at(-1),Be=(_e==null?void 0:_e.senderId)===g&&_e.sequence>ve.current;if(ve.current=Math.max(ve.current,(_e==null?void 0:_e.sequence)??0),W.current)(fe.current||Be)&&(Fe.release(),me.scrollTo({top:me.scrollHeight,behavior:"smooth"}));else{if(!z.length&&!I)return;W.current=!0;const ze=r?me.querySelector(`[data-message="${r.id}"]`):null;if(ze){if(fe.current=!1,ze.scrollIntoView({block:"center"}),r!=null&&r.passage&&ZS(ze,r.passage))return;ze.classList.add("jv-jump"),setTimeout(()=>ze.classList.remove("jv-jump"),1600);return}const dt=Ve.current;if(Ve.current=null,dt&&Mf(me,dt)){fe.current=!1,Ce.current=dt,Fe.start(me,dt),be(!0);return}Ee(),requestAnimationFrame(Ee)}(fe.current||Be)&&(we.current=(_e==null?void 0:_e.sequence)??0)},[z,I,R]),w.useLayoutEffect(()=>{const me=B.current,Ee=Ce.current;me&&W.current&&Mf(me,Ee)&&Fe.start(me,Ee)},[n]),w.useEffect(()=>{W.current&&r&&Me(r.id,r.passage)},[r]),w.useEffect(()=>{const me=B.current,Ee=D.current;if(!me||!Ee||!Y||!W.current)return;const _e=new IntersectionObserver(Be=>{var ze;(ze=Be[0])!=null&&ze.isIntersecting&&W.current&&kn()},{root:me,rootMargin:"400px 0px 0px 0px"});return _e.observe(Ee),()=>_e.disconnect()},[Y,z,e,R]),w.useEffect(()=>{const me=B.current,Ee=F.current;if(!me||!Ee)return;let _e=0;const Be=()=>{cancelAnimationFrame(_e),_e=requestAnimationFrame(()=>{W.current&&me.clientHeight&&!Fe.on&&(Ce.current=T6(me,120))})},ze=new ResizeObserver(()=>{if(Be(),!!W.current){if(me.scrollHeight-me.clientHeight<8){dt();return}fe.current&&(me.scrollHeight-me.scrollTop-me.clientHeight<8||me.scrollTo({top:me.scrollHeight,behavior:"instant"}))}});ze.observe(Ee),ze.observe(me);const dt=()=>{var ta;Fe.on||(fe.current=me.scrollHeight-me.scrollTop-me.clientHeight<120,fe.current&&(we.current=Math.max(we.current,((ta=X.current.at(-1))==null?void 0:ta.sequence)??0)),be(!fe.current),Be())};return dt(),me.addEventListener("scroll",dt,{passive:!0}),()=>{ze.disconnect(),me.removeEventListener("scroll",dt),cancelAnimationFrame(_e)}},[B.current,e,R]),w.useEffect(()=>{const me=z.at(-1);if(!R||!me||me.chatId!==R.id)return;const Ee=()=>{if(document.visibilityState!=="visible"||R.readSequence>=me.sequence)return;const _e={...R,readSequence:me.sequence,unread:0,mentions:0,alerts:0,atMe:!1,hint:null};O(_e),ue.markRead(R.id,me.sequence).then(()=>S(_e)).catch(M)};return Ee(),document.addEventListener("visibilitychange",Ee),()=>document.removeEventListener("visibilitychange",Ee)},[z,R]);const vn=async me=>{try{const Ee=await me();O(Ee),S(Ee)}catch(Ee){throw M(Ee),Ee}},on=async(me,Ee,_e)=>{try{const Be=await ue.react(me.id,Ee,_e),ze=dt=>dt.id===Be.id?{...dt,reactions:Be.reactions}:dt;q(dt=>dt.map(ze)),P(dt=>dt&&ze(dt))}catch(Be){M(Be)}},ge=async(me,Ee)=>{try{const _e=await ue.fold(me.id,Ee),Be=ze=>ze.id===_e.id?{...ze,folded:_e.folded}:ze;q(ze=>ze.map(Be)),P(ze=>ze&&Be(ze))}catch(_e){M(_e)}},Me=(me,Ee)=>{Fe.release();const _e=()=>{var ze;return me?(ze=B.current)==null?void 0:ze.querySelector(`[data-message="${me}"]`):null},Be=_e();if(Be){Nf(Be,Ee);return}if(!me){E(v("app.sourceGone"));return}gt(me).then(ze=>{if(typeof ze=="string"&&T){T(ze,me,Ee);return}if(!ze||typeof ze=="string"){E(v("thread.sourceElsewhere"));return}Jt(ze),requestAnimationFrame(()=>{const dt=_e();dt&&Nf(dt,Ee)})})},Xe={onQuote:me=>R1(d,me,f),onReact:on,onFold:ge,onJump:Me,onError:M,..._?{onBotCard:_}:{}},Je=async(me,Ee,_e,Be,ze=[],dt=!1)=>{const ta=await ue.send(e,me,Ee,_e,dt,Be,ze),Rn=c?[...new Set(M1(me,Ei(f)).filter(yn=>!c.memberIds.includes(yn.member.id)).map(yn=>yn.member.name))]:[];Rn.length&&E(v("app.notInChannel",{names:Rn.join(v("common.listSeparator")),count:Rn.length})),tn(ta)},rt=(c==null?void 0:c.title)??v("search.channel"),Wt=f.find(me=>me.id===(I==null?void 0:I.senderId)),_n=le?z.filter(me=>me.sequence>we.current&&me.senderId!==g).length:0,dn=new Set([...I?[I.senderId,...I.mentions]:[],...z.flatMap(me=>[me.senderId,...me.mentions])]);return dn.delete(g),o.jsxs("section",{role:n==="pane"?"complementary":n==="full"?"main":void 0,className:n==="pane"?"ui-pane jv-pane":n==="embed"?"ui-chat jv-thread-full jv-thread-embed":"ui-chat jv-thread-full","aria-label":v("thread.label"),onKeyDown:me=>{R&&l&&(me.ctrlKey||me.metaKey)&&me.key.toLowerCase()==="f"&&(me.preventDefault(),l(R))},children:[o.jsxs("header",{className:n==="pane"?"ui-pane-header jv-pane-header":"ui-chat-header jv-pane-header",children:[n==="full"&&o.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:v("common.openNav"),onClick:k}),n==="embed"&&o.jsx(vt,{icon:"chevron-left",className:"ui-mobile-only",label:v("thread.backToList"),onClick:j}),n==="full"?o.jsxs("button",{type:"button",className:"jv-crumb",onClick:j,children:[o.jsx(qe,{name:"chevron-left"}),o.jsx("span",{className:"jv-hash",children:"#"}),rt]}):n==="embed"?o.jsxs("button",{type:"button",className:"jv-crumb",title:v("thread.inChannel"),onClick:b,children:[o.jsx("span",{className:"jv-hash",children:"#"}),rt]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:v("thread.label")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",rt]})]}),o.jsx("span",{className:"jv-spacer"}),R&&l&&o.jsx(vt,{icon:"search",label:v("thread.search"),onClick:()=>l(R)}),R&&o.jsxs("button",{type:"button",className:"ui-button jv-follow","data-on":R.following||void 0,title:v(R.following?"thread.followingHint":"thread.notFollowingHint"),onClick:()=>void vn(()=>ue.follow(e,!R.following)).catch(()=>{}),children:[o.jsx(qe,{name:"bell"}),v(R.following?"threads.following":"thread.follow")]}),n!=="embed"&&o.jsx(vt,{icon:n==="pane"?"arrows-expand":"arrows-contract",className:"jv-desktop-only",label:v(n==="pane"?"thread.expand":"thread.collapse"),onClick:b}),n==="pane"&&o.jsx(vt,{icon:"close",label:v("thread.close"),onClick:j})]}),R&&o.jsx("div",{className:n==="pane"?"jv-thread-pin":"jv-thread-pin jv-thread-pin-wide",children:o.jsx(PH,{chat:R,channelName:rt,expanded:i,onTitle:me=>vn(()=>ue.updateThread(e,{title:me})),onStatus:me=>vn(()=>ue.updateThread(e,{status:me})),onSummary:me=>vn(()=>ue.setNote(e,me)),onConclude:async()=>{var me;try{await Je(`${v("thread.conclusion")}
819
+
820
+ ${((me=R.note)==null?void 0:me.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),Ee=>Ee.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await vn(()=>ue.updateThread(e,{status:"done"})),E(v("thread.concluded",{channel:rt}))}catch(Ee){throw M(Ee),Ee}}})}),o.jsxs("div",{className:"jv-transcript",children:[o.jsx("div",{ref:B,className:n==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:o.jsxs("div",{ref:F,children:[I&&o.jsx(Ef,{messages:[{...I,thread:null}],members:f,bots:h,me:g,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:C,onReact:on,onFold:ge,onJump:Me,onError:M}),o.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:o.jsx("span",{children:z.length?v("channel.replies",{count:((Ln=I==null?void 0:I.thread)==null?void 0:Ln.replies)??z.length}):v("thread.noReplies")})}),Y&&o.jsx("div",{ref:D,className:"jv-history-more","aria-live":"polite",children:K?v("chat.loadingOlder"):""}),o.jsx(Ef,{messages:z,members:f,bots:h,me:g,divider:$??Number.MAX_SAFE_INTEGER,before:I==null?void 0:I.createdAt,onSettled:me=>q(Ee=>Ee.map(_e=>_e.id===me.id?me:_e)),onPreview:C,...Xe})]})}),le&&z.length>0&&o.jsx("div",{className:"jv-to-latest",children:o.jsxs("button",{type:"button","aria-label":v("thread.toLatest"),onClick:()=>{var me;Fe.release(),(me=B.current)==null||me.scrollTo({top:B.current.scrollHeight,behavior:"smooth"})},children:[_n>0&&o.jsx("span",{children:v("chat.unseen",{count:_n})}),o.jsx(qe,{name:"chevron-down"})]})})]}),o.jsx(O1,{chatId:e,id:"jarvy-thread-composer",drafts:d,placeholder:v("thread.reply"),scrollRef:B,disabled:!R,initialText:z.length===0&&I&&I.senderId!==g&&Wt&&!Wt.deleted?`@${Wt.name} `:void 0,mention:{bots:h,inside:Ei(f).filter(me=>me.id!==g&&!!(c!=null&&c.memberIds.includes(me.id))),outside:Ei(f).filter(me=>!(c!=null&&c.memberIds.includes(me.id))),onInvite:N,participants:dn},onSend:Je,onError:M,onNotice:E}),o.jsx(_1,{container:B,drafts:d,chatId:e,members:f,onNotice:E,source:me=>me===(I==null?void 0:I.id)?I:z.find(Ee=>Ee.id===me)})]})}function a4(e,n){const i=e.lastReplyAt??e.createdAt;return n==="created"?[0,-e.createdAt,e.id]:n==="status"?[e.status==="done"?1:0,-i,e.id]:[0,-i,e.id]}function FH(e,n){return e[0]-n[0]||e[1]-n[1]||(e[2]<n[2]?-1:e[2]>n[2]?1:0)}const Af=e=>(n,i)=>FH(a4(n,e),a4(i,e)),g0={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},UH=(e,n)=>[...e].sort(Af(n));function A6(e){const n=`jarvy-thread-sort-${e}`,[i,r]=w.useState(()=>{const l=localStorage.getItem(n);return l==="created"||l==="status"?l:"updated"});return[i,l=>{r(l),localStorage.setItem(n,l)}]}function _6({value:e,onChange:n}){return o.jsxs(Hr,{value:e,onValueChange:i=>n(i),children:[o.jsxs(Ur,{className:"jv-thread-sort","aria-label":v("threadSort.current",{order:v(g0[e])}),title:v("threadSort.title"),children:[o.jsx(M9,{}),o.jsx(Fr,{})]}),o.jsx($r,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(g0).map(i=>o.jsx(za,{value:i,children:v(g0[i])},i))})]})}const i4={epoch:0,unlisted:0,counts:{}},$H=(e,n,i)=>({epoch:e.epoch,unlisted:e.unlisted+(i?1:0),counts:{...e.counts,[n]:(e.counts[n]??0)+1}}),VH=e=>({...e,epoch:e.epoch+1}),GH=(e,n)=>`${e.epoch}:${n?e.counts[n]??0:0}`,YH=e=>`${e.epoch}:${e.unlisted}`,KH=e=>ca(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function XH({channel:e,members:n,bots:i,changes:r,onOpen:l,onClose:c,onError:d}){const[f,h]=w.useState(null),[g,y]=w.useState("open"),[m,j]=A6("channel");w.useEffect(()=>{let S=!0;return ue.channelThreads(e.id).then(N=>{S&&h(N.threads)}).catch(N=>{S&&d(N)}),()=>{S=!1}},[e.id,GH(r,e.id)]);const b=UH((f??[]).filter(S=>g==="all"||S.status===g),m),k=S=>(f??[]).filter(N=>N.status===S).length;return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":v("threads.list"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[o.jsx("strong",{children:v("channel.threads")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),o.jsx("span",{className:"jv-spacer"}),o.jsx(_6,{value:m,onChange:j}),o.jsx(vt,{icon:"close",label:v("threads.closeList"),onClick:c})]}),o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":v("threads.byStatus"),children:[["open",v("threads.openCount",{count:k("open")})],["done",v("threads.doneCount",{count:k("done")})],["all",v("threads.all")]].map(([S,N])=>o.jsx("button",{type:"button",role:"tab","aria-selected":g===S,onClick:()=>y(S),children:N},S))}),o.jsx("div",{className:"ui-pane-body jv-pane-body",children:f===null?o.jsx("p",{className:"jv-picker-empty",children:v("threads.loading")}):b.length===0?o.jsx("p",{className:"jv-picker-empty",children:v("threads.none")}):b.map(S=>{const N=n.find(C=>{var M;return C.id===((M=S.root)==null?void 0:M.senderId)});return o.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>l(S.id),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx("strong",{children:S.title}),S.alerts>0?o.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&o.jsx("span",{className:"jv-count",children:S.unread}),o.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:v(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&o.jsxs("span",{className:"jv-thread-item-root",children:[o.jsx(sr,{member:N,bots:i,size:16}),o.jsx("span",{children:Ds(S.root)})]}),o.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[v("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${KH(S.lastReplyAt)}`:"",S.following?` · ${v("threads.following")}`:""]})]},S.id)})})]})}class QH{constructor(){He(this,"listeners",new Set)}emit(n){for(const i of this.listeners)i(n)}on(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}}const v0=(e,n)=>n==="all"||(n==="unread"?e.unread>0:e.status===n),Xd=(e,n)=>[...new Map(e.map(i=>[i.id,i])).values()].sort(Af(n));function ZH(e,n,i){const[r,l]=w.useState({items:[],next:null,ready:!1}),[c,d]=w.useState(!1),[f,h]=w.useState(!1),g=w.useRef({filter:n,sort:i,generation:0}),y=w.useRef(r),m=w.useRef(new Map);y.current=r;const j=E=>{y.current=E,l(E)};async function b(E){const T=g.current.generation;d(!0),h(!1);try{const _=await ue.followedThreads({filter:n,sort:i,cursor:E});if(T!==g.current.generation)return;const R=y.current,O=_.next?_.threads.at(-1):void 0,I=[...m.current.values()].filter(P=>v0(P,n)&&(!O||Af(i)(P,O)<=0));j({items:Xd([...E?R.items:[],..._.threads,...I],i),next:_.next,ready:!0})}catch{T===g.current.generation&&h(!0)}finally{T===g.current.generation&&d(!1)}}w.useEffect(()=>{g.current={filter:n,sort:i,generation:g.current.generation+1},j({items:[],next:null,ready:!1}),b()},[n,i]);const k=w.useRef(new Map);function S(E){if(k.current.has(E)){k.current.set(E,!0);return}k.current.set(E,!1);const T=g.current.generation;ue.followedThread(E).then(_=>N(_,T),_=>{_ instanceof er&&_.status===404&&T===g.current.generation&&j({...y.current,items:y.current.items.filter(R=>R.id!==E)})}).finally(()=>{const _=k.current.get(E);k.current.delete(E),_&&S(E)})}function N(E,T){if(T!==g.current.generation)return;C(E);const _=y.current,R=_.items.some(P=>P.id===E.id),O=_.items.at(-1),I=E.following&&v0(E,g.current.filter)&&(_.next===null||!O||Af(g.current.sort)(E,O)<0);(R||_.ready&&I)&&j({..._,items:Xd([..._.items,E],g.current.sort)})}w.useEffect(()=>e.on(E=>{if(E.kind==="changed")S(E.id);else if(E.kind==="reconnected")M();else{const T=E.chat,_=y.current,R=_.items.find(I=>I.id===T.id);if(!R){T.following&&S(T.id);return}const O={...R,title:T.title,status:T.status??R.status,unread:T.unread,mentions:T.mentions,alerts:T.alerts,following:T.following};C(O),j({..._,items:Xd([..._.items,O],g.current.sort)})}}),[e]);function C(E){E.following?m.current.delete(E.id):y.current.items.some(T=>T.id===E.id)&&m.current.set(E.id,E)}async function M(){const E=g.current.generation,T=await ue.followedThreads({filter:g.current.filter,sort:g.current.sort}).catch(()=>null);if(!T||E!==g.current.generation)return;const _=y.current,R=_.items.length>T.threads.length;j({items:Xd([..._.items,...T.threads],g.current.sort),next:R?_.next:T.next,ready:!0})}return{items:r.items.filter(E=>v0(E,n)),find:E=>r.items.find(T=>T.id===E),ready:r.ready,more:r.next!==null,loading:c,failed:f,loadMore:()=>{r.next&&!c&&b(r.next)},retry:()=>void b(r.next??void 0)}}const JH=e=>ca(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),WH={all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"};function eF({events:e,summary:n,chats:i,members:r,bots:l,onNav:c,renderThread:d}){const[f,h]=w.useState(null),[g,y]=w.useState("all"),[m,j]=A6("followed"),b=ZH(e,g,m),k=f?b.find(f.id)??f:void 0,S=w.useRef(null),N=w.useRef(null);w.useEffect(()=>{if(!S.current||!N.current||!b.more||b.loading||b.failed)return;const M=new IntersectionObserver(E=>{var T;(T=E[0])!=null&&T.isIntersecting&&b.loadMore()},{root:S.current,rootMargin:"0px 0px 400px 0px"});return M.observe(N.current),()=>M.disconnect()},[b.more,b.loading,b.failed,b.items]);const C=[["all",v("threads.all")],["unread",n!=null&&n.unreadThreads?v("threads.unreadCount",{count:n.unreadThreads}):v("threads.unread")],["open",v("threads.openCount",{count:(n==null?void 0:n.open)??0})],["done",v("threads.doneCount",{count:(n==null?void 0:n.done)??0})]];return o.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":v("sidebar.followed"),"data-open":k?"":void 0,children:[o.jsxs("section",{className:"jv-followed-list","aria-label":v("threads.list"),children:[o.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[o.jsxs("div",{className:"ui-header-left",children:[o.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:v("common.openNav"),onClick:c}),o.jsx("strong",{className:"jv-channel-title",children:v("sidebar.followed")})]}),o.jsx(_6,{value:m,onChange:j})]}),o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":v("threads.filter"),children:C.map(([M,E])=>o.jsx("button",{type:"button",role:"tab","aria-selected":g===M,onClick:()=>y(M),children:E},M))}),o.jsxs("div",{className:"jv-followed-items",ref:S,children:[b.ready&&b.items.length===0&&!b.more?o.jsx("p",{className:"jv-picker-empty",children:v(WH[g])}):b.items.map(M=>{const E=r.find(_=>{var R;return _.id===((R=M.root)==null?void 0:R.senderId)}),T=i.find(_=>_.id===M.parentId);return o.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":M.unread>0||void 0,"aria-current":M.id===(f==null?void 0:f.id)||void 0,onClick:()=>h(M),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx("strong",{children:M.title}),M.alerts>0?o.jsx("span",{className:"jv-badge",children:M.alerts}):M.unread>0&&o.jsx("span",{className:"jv-count",children:M.unread}),o.jsx("span",{className:"jv-thread-status","data-done":M.status==="done"||void 0,children:v(M.status==="done"?"channel.threadDone":"threads.open")})]}),M.root&&o.jsxs("span",{className:"jv-thread-item-root",children:[o.jsx(sr,{member:E,bots:l,size:16}),o.jsx("span",{children:Ds(M.root)})]}),o.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(T==null?void 0:T.title)??""," · ",v("channel.replies",{count:M.replies}),M.lastReplyAt?` · ${JH(M.lastReplyAt)}`:"",M.following?"":` · ${v("threads.notFollowing")}`]})]},M.id)}),o.jsx("div",{ref:N,className:"jv-followed-end",children:b.failed?o.jsxs(o.Fragment,{children:[o.jsx("p",{role:"alert",children:v("threads.loadFailed")}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:b.retry,children:v("common.retry")})]}):(b.loading||!b.ready)&&o.jsx("p",{role:"status",children:v("threads.loading")})})]})]}),k?d(k,()=>h(null)):o.jsx("div",{className:"jv-followed-empty",children:o.jsx("p",{children:v("threads.pick")})})]})}function tF({pane:e,followedView:n,threadEvents:i,followed:r,chats:l,sections:c,members:d,bots:f,statuses:h,meId:g,drafts:y,changes:m,live:j,memory:b,paneChannel:k,activeBot:S,botDirects:N,find:C,onPane:M,onNav:E,onBackToChannel:T,onAddMembers:_,onOpenBot:R,onPin:O,onMute:I,onDeleteChannel:P,onChannelSaved:z,onThreadChanged:q,onInvite:$,onPreview:Q,onNotice:Y,onError:H,onBotCard:K,paneWidth:V,onResize:X}){var B,F;const Z=(e==null?void 0:e.kind)==="thread"?e:null,D=(Z==null?void 0:Z.mode)==="full",se=()=>M(null),ne=(ee,W,fe)=>void ue.chat(ee).then(le=>C.openMessage(le,W,fe),H);return o.jsxs(o.Fragment,{children:[n&&!D&&o.jsx(eF,{events:i,summary:r,chats:l,members:d,bots:f,onNav:E,renderThread:(ee,W)=>o.jsx(n4,{threadId:ee.id,mode:"embed",channel:l.find(fe=>fe.id===ee.parentId),drafts:y,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:q,onClose:W,onToggleMode:()=>T({id:ee.id,parentId:ee.parentId},!0),onInvite:fe=>$(ee.parentId,fe),onPreview:Q,onError:H,onNotice:Y,onOpenMessage:ne,onBotCard:K},ee.id)}),Z&&o.jsx(n4,{threadId:Z.id,mode:Z.mode,showSummary:Z.summary,focus:Z.focus,onSearch:C.search,channel:l.find(ee=>ee.id===Z.parentId),drafts:y,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:q,onClose:()=>D?T(Z,!1):se(),onToggleMode:()=>D?T(Z,!0):M({...Z,mode:"full"}),onInvite:ee=>$(Z.parentId,ee),onPreview:Q,onError:H,onNotice:Y,onOpenMessage:ne,onBotCard:K},`${Z.id}:${((B=Z.focus)==null?void 0:B.id)??""}:${((F=Z.focus)==null?void 0:F.passage)??""}`),(e==null?void 0:e.kind)==="search"&&o.jsx(IH,{chat:e.chat,chats:l,members:d,focusKey:C.focusKey,onOpenMessage:C.openMessage,onClose:se,onError:H}),(e==null?void 0:e.kind)==="threads"&&k&&o.jsx(XH,{channel:k,members:d,bots:f,changes:m,onOpen:ee=>M({kind:"thread",id:ee,parentId:k.id,mode:"pane"}),onClose:se,onError:H}),(e==null?void 0:e.kind)==="info"&&k&&o.jsx(BH,{channel:k,page:e.page,sections:c,members:Ei(d),bots:f,statuses:h,me:g,onPage:ee=>M({kind:"info",page:ee}),onPin:()=>O(k),onMute:()=>I(k),onAdd:()=>_(k),onBot:R,onDelete:()=>P(k),onChanged:z,onClose:se,onError:H}),(e==null?void 0:e.kind)==="botdms"&&S&&!k&&o.jsx(zH,{bot:S,chats:N,members:d,bots:f,me:g,live:j,onClose:se,onPreview:Q,onError:H}),e&&!D&&o.jsx("div",{className:"jv-resize",style:{right:V-4},onPointerDown:X,role:"separator","aria-orientation":"vertical","aria-label":v("app.resizePane")})]})}const r4="@goodfish/jarvy",R6="0.15.0",nF={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},aF="Apache-2.0",mg=nF.url.replace(/^git\+/,"").replace(/\.git$/,""),o4=`${mg}/blob/v${R6}`,iF=[{label:"about.source",detail:mg.replace(/^https:\/\//,""),href:mg},{label:"about.package",detail:r4,href:`https://www.npmjs.com/package/${r4}`},{label:"about.license",detail:aF,href:`${o4}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${o4}/THIRD_PARTY_NOTICE.md`}];function rF(){return o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:v("settings.about")})}),o.jsxs("div",{className:"jv-list",children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:"Jarvy"}),o.jsx("span",{children:v("about.tagline")})]}),o.jsx("span",{className:"jv-row-meta",children:v("about.version",{version:R6})})]}),iF.map(e=>o.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:v(e.label)}),o.jsx("span",{children:e.detail})]}),o.jsx(df,{"aria-hidden":"true"})]},e.label))]})]})}function oF(){const[e,n]=w.useState(document.documentElement.classList.contains("dark")),i=l=>{Sf(l?"dark":"light"),n(l)},r=(l,c,d,f,h)=>o.jsxs("button",{type:"button",role:"radio","aria-checked":d,lang:h,className:"jv-list-row jv-choice-row",onClick:f,children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:c})}),d&&o.jsx(Ba,{"aria-hidden":"true"})]},l);return o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:v("settings.general")})}),o.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[o.jsx("h3",{id:"general-language",className:"jv-section-title",children:v("general.language")}),o.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:w4.map(l=>r(l,k0(l,"name"),Wi()===l,()=>C4(l),l))})]}),o.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[o.jsx("h3",{id:"general-theme",className:"jv-section-title",children:v("general.theme")}),o.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[r("light",v("general.light"),!e,()=>i(!1)),r("dark",v("general.dark"),e,()=>i(!0))]})]})]})}const sF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.797 6.282a.451.451 0 01-.336-.315 1.019 1.019 0 010-.505c.156-.86.3-1.725.501-2.577.14-.7.42-1.367.823-1.96.305-.431.75-.746 1.262-.89.877-.217 1.24.629.937 1.348-.259.593-.877.914-1.334 1.348-.835.795-1.096 2.14-1.336 3.212a.427.427 0 01-.186.277.437.437 0 01-.331.062z" fill="url(#lobe-icons-ant-group-0-_R_0_)" transform="translate(3)"></path><path d="M6.334 4.672c.33-.121.682.146.946.297.278.145.587.219.901.214.231.01.466 0 .688.018 4.098.176 7.484 3.22 8.05 7.237.565 4.016-1.852 7.859-5.745 9.134-3.894 1.276-8.153-.38-10.126-3.935A8.339 8.339 0 013.133 7.081c.348-.278.716-.53 1.102-.755a8.404 8.404 0 001.318-.79c.28-.243.45-.742.781-.864zm4.406 2.15c-2.841.003-4.898 2.533-4.628 5.642.27 3.109 2.781 5.641 5.613 5.665 2.832.024 4.932-2.512 4.658-5.644-.273-3.133-2.802-5.666-5.643-5.663zm.357.57a4.707 4.707 0 013.304 1.446 5.703 5.703 0 011.643 3.49 4.841 4.841 0 01-1.141 3.705v.015a3.923 3.923 0 01-2.808 1.303 4.664 4.664 0 01-3.367-1.387 5.678 5.678 0 01-1.71-3.518 4.832 4.832 0 011.14-3.753 3.923 3.923 0 012.813-1.3h.126z" fill="url(#lobe-icons-ant-group-1-_R_0_)" transform="translate(3)"></path><path d="M2.346 2.054a1.26 1.26 0 01.384-.594.842.842 0 011.165.11c.694.82.169 2.078.142 3.02.013.805.208 1.597.57 2.318.084.134.147.279.186.43a.539.539 0 01-.3.577c-.345.17-.568-.19-.709-.446-.324-.6-.617-1.216-.877-1.846a8.698 8.698 0 01-.618-1.987 7.523 7.523 0 01-.051-.37 3.717 3.717 0 01-.024-.34 2.506 2.506 0 01.132-.872z" fill="url(#lobe-icons-ant-group-2-_R_0_)" transform="translate(3)"></path><defs><linearGradient id="lobe-icons-ant-group-0-_R_0_" x1="31.373%" x2="61.365%" y1="95.551%" y2="-.348%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-1-_R_0_" x1="4.366%" x2="94.359%" y1="65.982%" y2="32.918%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-2-_R_0_" x1="56.255%" x2="45.986%" y1="99.257%" y2="1.384%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient></defs></svg>
821
+ `,lF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
822
+ `,cF='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><mask height="23" id="lobe-icons-antigravity-0-_R_0_" maskUnits="userSpaceOnUse" width="24" x="0" y="1"><path d="M21.751 22.607c1.34 1.005 3.35.335 1.508-1.508C17.73 15.74 18.904 1 12.037 1 5.17 1 6.342 15.74.815 21.1c-2.01 2.009.167 2.511 1.507 1.506 5.192-3.517 4.857-9.714 9.715-9.714 4.857 0 4.522 6.197 9.714 9.715z" fill="#fff"></path></mask><g mask="url(#lobe-icons-antigravity-0-_R_0_)"><g filter="url(#lobe-icons-antigravity-1-_R_0_)"><path d="M-1.018-3.992c-.408 3.591 2.686 6.89 6.91 7.37 4.225.48 7.98-2.043 8.387-5.633.408-3.59-2.686-6.89-6.91-7.37-4.225-.479-7.98 2.043-8.387 5.633z" fill="#FFE432"></path></g><g filter="url(#lobe-icons-antigravity-2-_R_0_)"><path d="M15.269 7.747c1.058 4.557 5.691 7.374 10.348 6.293 4.657-1.082 7.575-5.653 6.516-10.21-1.058-4.556-5.691-7.374-10.348-6.292-4.657 1.082-7.575 5.653-6.516 10.21z" fill="#FC413D"></path></g><g filter="url(#lobe-icons-antigravity-3-_R_0_)"><path d="M-12.443 10.804c1.338 4.703 7.36 7.11 13.453 5.378 6.092-1.733 9.947-6.95 8.61-11.652C8.282-.173 2.26-2.58-3.833-.848-9.925.884-13.78 6.1-12.443 10.804z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-4-_R_0_)"><path d="M-12.443 10.804c1.338 4.703 7.36 7.11 13.453 5.378 6.092-1.733 9.947-6.95 8.61-11.652C8.282-.173 2.26-2.58-3.833-.848-9.925.884-13.78 6.1-12.443 10.804z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-5-_R_0_)"><path d="M-7.608 14.703c3.352 3.424 9.126 3.208 12.896-.483 3.77-3.69 4.108-9.459.756-12.883C2.69-2.087-3.083-1.871-6.853 1.82c-3.77 3.69-4.108 9.458-.755 12.883z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-6-_R_0_)"><path d="M9.932 27.617c1.04 4.482 5.384 7.303 9.7 6.3 4.316-1.002 6.971-5.448 5.93-9.93-1.04-4.483-5.384-7.304-9.7-6.301-4.316 1.002-6.971 5.448-5.93 9.93z" fill="#3186FF"></path></g><g filter="url(#lobe-icons-antigravity-7-_R_0_)"><path d="M2.572-8.185C.392-3.329 2.778 2.472 7.9 4.771c5.122 2.3 11.042.227 13.222-4.63 2.18-4.855-.205-10.656-5.327-12.955-5.122-2.3-11.042-.227-13.222 4.63z" fill="#FBBC04"></path></g><g filter="url(#lobe-icons-antigravity-8-_R_0_)"><path d="M-3.267 38.686c-5.277-2.072 3.742-19.117 5.984-24.83 2.243-5.712 8.34-8.664 13.616-6.592 5.278 2.071 11.533 13.482 9.29 19.195-2.242 5.713-23.613 14.298-28.89 12.227z" fill="#3186FF"></path></g><g filter="url(#lobe-icons-antigravity-9-_R_0_)"><path d="M28.71 17.471c-1.413 1.649-5.1.808-8.236-1.878-3.135-2.687-4.531-6.201-3.118-7.85 1.412-1.649 5.1-.808 8.235 1.878s4.532 6.2 3.119 7.85z" fill="#749BFF"></path></g><g filter="url(#lobe-icons-antigravity-10-_R_0_)"><path d="M18.163 9.077c5.81 3.93 12.502 4.19 14.946.577 2.443-3.612-.287-9.727-6.098-13.658-5.81-3.931-12.502-4.19-14.946-.577-2.443 3.612.287 9.727 6.098 13.658z" fill="#FC413D"></path></g><g filter="url(#lobe-icons-antigravity-11-_R_0_)"><path d="M-.915 2.684c-1.44 3.473-.97 6.967 1.05 7.804 2.02.837 4.824-1.3 6.264-4.772 1.44-3.473.97-6.967-1.05-7.804-2.02-.837-4.824 1.3-6.264 4.772z" fill="#FFEE48"></path></g></g><defs><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="17.587" id="lobe-icons-antigravity-1-_R_0_" width="19.838" x="-3.288" y="-11.917"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="1.117"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="38.565" id="lobe-icons-antigravity-2-_R_0_" width="38.9" x="4.251" y="-13.493"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="5.4"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.517" id="lobe-icons-antigravity-3-_R_0_" width="40.955" x="-21.889" y="-10.592"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.517" id="lobe-icons-antigravity-4-_R_0_" width="40.955" x="-21.889" y="-10.592"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.595" id="lobe-icons-antigravity-5-_R_0_" width="36.632" x="-19.099" y="-10.278"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="34.087" id="lobe-icons-antigravity-6-_R_0_" width="33.533" x=".981" y="8.758"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.363"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="35.276" id="lobe-icons-antigravity-7-_R_0_" width="35.978" x="-6.143" y="-21.659"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.954"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="46.523" id="lobe-icons-antigravity-8-_R_0_" width="45.114" x="-11.96" y="-.46"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.531"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="24.054" id="lobe-icons-antigravity-9-_R_0_" width="25.094" x="10.485" y=".58"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.159"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="30.007" id="lobe-icons-antigravity-10-_R_0_" width="33.508" x="5.833" y="-12.467"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="2.669"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="26.151" id="lobe-icons-antigravity-11-_R_0_" width="22.194" x="-8.355" y="-8.876"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.303"></feGaussianBlur></filter></defs></svg>',uF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
823
+ `,dF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>
824
+ `,fF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="lobe-icons-bedrock-_R_0_" x1="80%" x2="20%" y1="20%" y2="80%"><stop offset="0%" stop-color="#6350FB"></stop><stop offset="50%" stop-color="#3D8FFF"></stop><stop offset="100%" stop-color="#9AD8F8"></stop></linearGradient></defs><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z" fill="url(#lobe-icons-bedrock-_R_0_)" fill-rule="nonzero"></path></svg>
825
+ `,hF=`<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>
826
+ `,mF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>
827
+ `,pF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
828
+ `,gF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z"></path></svg>
829
+ `,vF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
830
+ `,yF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z" fill="#4285F4"></path><path d="M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z" fill="#34A853"></path><path d="M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z" fill="#FBBC05"></path><path d="M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z" fill="#EB4335"></path></svg>
831
+ `,xF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
832
+ `,bF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B"></path><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E"></path><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D"></path><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45"></path><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B"></path><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E"></path></svg>
833
+ `,jF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"></path><path d="M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"></path></svg>
834
+ `,wF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.897 4h-.024l-.031 2.615h.022c1.715 0 3.046 1.357 5.94 6.246l.175.297.012.02 1.62-2.438-.012-.019a48.763 48.763 0 00-1.098-1.716 28.01 28.01 0 00-1.175-1.629C10.413 4.932 8.812 4 6.896 4z" fill="url(#lobe-icons-meta-0-_R_0_)"></path><path d="M6.873 4C4.95 4.01 3.247 5.258 2.02 7.17a4.352 4.352 0 00-.01.017l2.254 1.231.011-.017c.718-1.083 1.61-1.774 2.568-1.785h.021L6.896 4h-.023z" fill="url(#lobe-icons-meta-1-_R_0_)"></path><path d="M2.019 7.17l-.011.017C1.2 8.447.598 9.995.274 11.664l-.005.022 2.534.6.004-.022c.27-1.467.786-2.828 1.456-3.845l.011-.017L2.02 7.17z" fill="url(#lobe-icons-meta-2-_R_0_)"></path><path d="M2.807 12.264l-2.533-.6-.005.022c-.177.918-.267 1.851-.269 2.786v.023l2.598.233v-.023a12.591 12.591 0 01.21-2.44z" fill="url(#lobe-icons-meta-3-_R_0_)"></path><path d="M2.677 15.537a5.462 5.462 0 01-.079-.813v-.022L0 14.468v.024a8.89 8.89 0 00.146 1.652l2.535-.585a4.106 4.106 0 01-.004-.022z" fill="url(#lobe-icons-meta-4-_R_0_)"></path><path d="M3.27 16.89c-.284-.31-.484-.756-.589-1.328l-.004-.021-2.535.585.004.021c.192 1.01.568 1.85 1.106 2.487l.014.017 2.018-1.745a2.106 2.106 0 01-.015-.016z" fill="url(#lobe-icons-meta-5-_R_0_)"></path><path d="M10.78 9.654c-1.528 2.35-2.454 3.825-2.454 3.825-2.035 3.2-2.739 3.917-3.871 3.917a1.545 1.545 0 01-1.186-.508l-2.017 1.744.014.017C2.01 19.518 3.058 20 4.356 20c1.963 0 3.374-.928 5.884-5.33l1.766-3.13a41.283 41.283 0 00-1.227-1.886z" fill="#0082FB"></path><path d="M13.502 5.946l-.016.016c-.4.43-.786.908-1.16 1.416.378.483.768 1.024 1.175 1.63.48-.743.928-1.345 1.367-1.807l.016-.016-1.382-1.24z" fill="url(#lobe-icons-meta-6-_R_0_)"></path><path d="M20.918 5.713C19.853 4.633 18.583 4 17.225 4c-1.432 0-2.637.787-3.723 1.944l-.016.016 1.382 1.24.016-.017c.715-.747 1.408-1.12 2.176-1.12.826 0 1.6.39 2.27 1.075l.015.016 1.589-1.425-.016-.016z" fill="#0082FB"></path><path d="M23.998 14.125c-.06-3.467-1.27-6.566-3.064-8.396l-.016-.016-1.588 1.424.015.016c1.35 1.392 2.277 3.98 2.361 6.971v.023h2.292v-.022z" fill="url(#lobe-icons-meta-7-_R_0_)"></path><path d="M23.998 14.15v-.023h-2.292v.022c.004.14.006.282.006.424 0 .815-.121 1.474-.368 1.95l-.011.022 1.708 1.782.013-.02c.62-.96.946-2.293.946-3.91 0-.083 0-.165-.002-.247z" fill="url(#lobe-icons-meta-8-_R_0_)"></path><path d="M21.344 16.52l-.011.02c-.214.402-.519.67-.917.787l.778 2.462a3.493 3.493 0 00.438-.182 3.558 3.558 0 001.366-1.218l.044-.065.012-.02-1.71-1.784z" fill="url(#lobe-icons-meta-9-_R_0_)"></path><path d="M19.92 17.393c-.262 0-.492-.039-.718-.14l-.798 2.522c.449.153.927.222 1.46.222.492 0 .943-.073 1.352-.215l-.78-2.462c-.167.05-.341.075-.517.073z" fill="url(#lobe-icons-meta-10-_R_0_)"></path><path d="M18.323 16.534l-.014-.017-1.836 1.914.016.017c.637.682 1.246 1.105 1.937 1.337l.797-2.52c-.291-.125-.573-.353-.9-.731z" fill="url(#lobe-icons-meta-11-_R_0_)"></path><path d="M18.309 16.515c-.55-.642-1.232-1.712-2.303-3.44l-1.396-2.336-.011-.02-1.62 2.438.012.02.989 1.668c.959 1.61 1.74 2.774 2.493 3.585l.016.016 1.834-1.914a2.353 2.353 0 01-.014-.017z" fill="url(#lobe-icons-meta-12-_R_0_)"></path><defs><linearGradient id="lobe-icons-meta-0-_R_0_" x1="75.897%" x2="26.312%" y1="89.199%" y2="12.194%"><stop offset=".06%" stop-color="#0867DF"></stop><stop offset="45.39%" stop-color="#0668E1"></stop><stop offset="85.91%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-1-_R_0_" x1="21.67%" x2="97.068%" y1="75.874%" y2="23.985%"><stop offset="13.23%" stop-color="#0064DF"></stop><stop offset="99.88%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-2-_R_0_" x1="38.263%" x2="60.895%" y1="89.127%" y2="16.131%"><stop offset="1.47%" stop-color="#0072EC"></stop><stop offset="68.81%" stop-color="#0064DF"></stop></linearGradient><linearGradient id="lobe-icons-meta-3-_R_0_" x1="47.032%" x2="52.15%" y1="90.19%" y2="15.745%"><stop offset="7.31%" stop-color="#007CF6"></stop><stop offset="99.43%" stop-color="#0072EC"></stop></linearGradient><linearGradient id="lobe-icons-meta-4-_R_0_" x1="52.155%" x2="47.591%" y1="58.301%" y2="37.004%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#007CF6"></stop></linearGradient><linearGradient id="lobe-icons-meta-5-_R_0_" x1="37.689%" x2="61.961%" y1="12.502%" y2="63.624%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-6-_R_0_" x1="34.808%" x2="62.313%" y1="68.859%" y2="23.174%"><stop offset="27.99%" stop-color="#007FF8"></stop><stop offset="91.41%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-7-_R_0_" x1="43.762%" x2="57.602%" y1="6.235%" y2="98.514%"><stop offset="0%" stop-color="#0082FB"></stop><stop offset="99.95%" stop-color="#0081FA"></stop></linearGradient><linearGradient id="lobe-icons-meta-8-_R_0_" x1="60.055%" x2="39.88%" y1="4.661%" y2="69.077%"><stop offset="6.19%" stop-color="#0081FA"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-9-_R_0_" x1="30.282%" x2="61.081%" y1="59.32%" y2="33.244%"><stop offset="0%" stop-color="#027AF3"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-10-_R_0_" x1="20.433%" x2="82.112%" y1="50.001%" y2="50.001%"><stop offset="0%" stop-color="#0377EF"></stop><stop offset="99.94%" stop-color="#0279F1"></stop></linearGradient><linearGradient id="lobe-icons-meta-11-_R_0_" x1="40.303%" x2="72.394%" y1="35.298%" y2="57.811%"><stop offset=".19%" stop-color="#0471E9"></stop><stop offset="100%" stop-color="#0377EF"></stop></linearGradient><linearGradient id="lobe-icons-meta-12-_R_0_" x1="32.254%" x2="68.003%" y1="19.719%" y2="84.908%"><stop offset="27.65%" stop-color="#0867DF"></stop><stop offset="100%" stop-color="#0471E9"></stop></linearGradient></defs></svg>
835
+ `,kF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
836
+ `,SF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
837
+ `,CF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
838
+ `,NF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>
839
+ `,EF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
840
+ `,TF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>
841
+ `,MF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z" fill="#C8FF00"></path></svg>
842
+ `,AF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
843
+ `,_F=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path></svg>
844
+ `,RF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 0l12 20.785H0L12 0z"></path></svg>
845
+ `,OF=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z" fill="#4285F4"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z" fill="#669DF6" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z" fill="#AECBFA" fill-rule="evenodd"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#AECBFA"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#669DF6"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z" fill="#AECBFA"></path></svg>
846
+ `,zF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
847
+ `,DF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>
848
+ `,LF=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path></svg>
849
+ `,BF=Object.assign({"./antgroup.svg":sF,"./anthropic.svg":lF,"./antigravity.svg":cF,"./azure.svg":uF,"./baseten.svg":dF,"./bedrock.svg":fF,"./cerebras.svg":hF,"./cloudflare.svg":mF,"./deepseek.svg":pF,"./fireworks.svg":gF,"./githubcopilot.svg":vF,"./google.svg":yF,"./groq.svg":xF,"./huggingface.svg":bF,"./kimi.svg":jF,"./meta.svg":wF,"./minimax.svg":kF,"./mistral.svg":SF,"./moonshot.svg":CF,"./nvidia.svg":NF,"./openai.svg":EF,"./opencode.svg":TF,"./openrouter.svg":MF,"./qwen.svg":AF,"./together.svg":_F,"./vercel.svg":RF,"./vertexai.svg":OF,"./xai.svg":zF,"./xiaomimimo.svg":DF,"./zai.svg":LF}),s4={"amazon-bedrock":"bedrock","ant-ling":"antgroup",anthropic:"anthropic",antigravity:"antigravity",azure:"azure",baseten:"baseten",cerebras:"cerebras","cloudflare-ai-gateway":"cloudflare","cloudflare-workers-ai":"cloudflare",deepseek:"deepseek",fireworks:"fireworks","github-copilot":"githubcopilot",google:"google","google-vertex":"vertexai",groq:"groq",huggingface:"huggingface","kimi-coding":"kimi",meta:"meta",minimax:"minimax","minimax-cn":"minimax",mistral:"mistral",moonshotai:"moonshot","moonshotai-cn":"moonshot",nvidia:"nvidia",openai:"openai","openai-codex":"openai",opencode:"opencode","opencode-go":"opencode",openrouter:"openrouter","qwen-token-plan":"qwen","qwen-token-plan-cn":"qwen","qwen-token-plan-individual":"qwen",together:"together","vercel-ai-gateway":"vercel",xai:"xai",xiaomi:"xiaomimimo","xiaomi-token-plan-ams":"xiaomimimo","xiaomi-token-plan-cn":"xiaomimimo","xiaomi-token-plan-sgp":"xiaomimimo",zai:"zai","zai-coding-cn":"zai"},IF=e=>e&&s4[e]?BF[`./${s4[e]}.svg`]:void 0;function L1({name:e,provider:n}){var r;const i=IF(n);return i?o.jsx("span",{className:"jv-provider-mark","data-logo":"","aria-hidden":"true",dangerouslySetInnerHTML:{__html:i}}):o.jsx("span",{className:"jv-provider-mark","aria-hidden":"true",children:((r=[...e.trim()][0])==null?void 0:r.toUpperCase())??"?"})}function O6(e){const n=e.authType==="oauth";return e.configured?{ok:!0,label:v(n?"status.signedIn":"status.configured")}:{ok:!1,label:v(n?"status.signedOut":"status.notConfigured")}}const z6=[{id:"custom",label:"group.custom"},{id:"subscription",label:"group.subscription"},{id:"api_key",label:"group.apiKey"}],D6=e=>e.custom?"custom":e.authType==="oauth"?"subscription":"api_key",qF={id:"custom",name:"OpenAI / Anthropic compatible",authType:"api_key",api:"openai-completions",modelCount:0};function PF({onBack:e,onSelect:n}){const[i,r]=w.useState([]),[l,c]=w.useState(""),[d,f]=w.useState(""),[h,g]=w.useState(!0),[y,m]=w.useState(0);w.useEffect(()=>{let k=!0;return g(!0),f(""),ue.modelProviders().then(S=>{k&&r(S.providers)}).catch(S=>{k&&f(Gt(S,"picker.loadFailed"))}).finally(()=>{k&&g(!1)}),()=>{k=!1}},[y]);const j=[qF,...i].filter(k=>`${k.name} ${k.id}`.toLowerCase().includes(l.toLowerCase())),b=k=>D6({authType:k.authType,custom:k.id==="custom"});return o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"jv-back",onClick:e,"aria-label":v("picker.back"),children:o.jsx(bg,{})}),o.jsx("h2",{children:v("models.add")})]}),o.jsxs("label",{className:"jv-search",children:[o.jsx(Rs,{}),o.jsx("input",{autoFocus:!0,"aria-label":v("picker.search"),placeholder:v("picker.searchPlaceholder"),value:l,onChange:k=>c(k.target.value)})]}),z6.filter(k=>j.some(S=>b(S)===k.id)).map(({id:k,label:S})=>o.jsxs("section",{className:"jv-section","aria-label":v(S),children:[o.jsx("h3",{className:"jv-section-title",children:v(S)}),o.jsx("div",{className:"jv-list",children:j.filter(N=>b(N)===k).map(N=>o.jsxs("button",{className:"jv-list-row",type:"button",onClick:()=>n(N),children:[o.jsx(L1,{name:N.id==="custom"?"+":N.name,provider:N.id}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:N.name}),N.id!=="custom"&&N.authType!=="oauth"&&o.jsx("span",{children:v("picker.keyHint",{count:N.modelCount})})]}),o.jsx(_s,{className:"jv-row-chevron"})]},`${N.id}:${N.authType}`))})]},k)),h&&o.jsx("p",{role:"status",className:"jv-hint",children:v("picker.loading")}),d&&o.jsxs("div",{className:"jv-empty",role:"alert",children:[o.jsx("strong",{children:d}),o.jsx(Ne,{variant:"outline",onClick:()=>m(k=>k+1),children:v("picker.retry")})]}),!h&&!d&&!j.length&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:v("picker.noMatch")})})]})}const HF=Eg("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",destructive:"border-transparent bg-destructive text-white"}},defaultVariants:{variant:"default"}});function FF({className:e,variant:n,...i}){return o.jsx("span",{"data-slot":"badge",className:Dn(HF({variant:n}),e),...i})}function L6({className:e,...n}){return o.jsx(dA,{"data-slot":"label",className:Dn("flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function UF({connection:e,providerName:n,authType:i,ensureConnection:r,onChanged:l}){var $,Q;const[c,d]=w.useState({phase:"idle"}),[f,h]=w.useState(""),{busy:g,error:y,setError:m,run:j}=An(),[b,k]=w.useState(0),S=w.useRef(void 0),N=e==null?void 0:e.id,C=w.useRef(l);C.current=l;const M=w.useRef(c.phase);M.current=c.phase,w.useEffect(()=>{if(!N)return;const Y=N;let H=!0,K;async function V(){var X;try{let Z=await ue.authStatus(Y);if(!H)return;if(S.current&&((X=Z.prompt)==null?void 0:X.type)==="select"){const se=S.current;if(S.current=void 0,Z=await ue.authInput(Y,Z.prompt.id,se),!H)return}const D=M.current==="running"&&Z.phase!=="running";M.current=Z.phase,d(Z),D&&await C.current(),Z.phase==="running"&&H&&(K=setTimeout(()=>void V(),750))}catch(Z){H&&m(Gt(Z,"auth.statusFailed"))}}return V(),()=>{H=!1,clearTimeout(K)}},[N,c.phase,b]),w.useEffect(()=>h(""),[($=c.prompt)==null?void 0:$.id]);async function E(Y){await j("act",async()=>{const H=await Y();d(H),H.phase!=="running"&&await l()},"common.failed")}function T(Y){S.current=Y,E(async()=>{const H=N??await r();return ue.authStart(H)})}const _=n==="openai-codex"&&i==="oauth",R=n==="openai"&&i==="oauth",O=c.phase==="running",I=c.prompt,P=c.event,z=(P==null?void 0:P.type)==="auth_url"?P.url:(P==null?void 0:P.type)==="device_code"?P.verificationUri:null,q=Y=>{I&&N&&E(()=>ue.authInput(N,I.id,Y))};return o.jsxs("section",{className:"jv-auth","aria-label":v("auth.title"),children:[o.jsxs("div",{className:"jv-auth-header",children:[o.jsx("h3",{children:v("auth.title")}),o.jsx(FF,{variant:"outline","data-state":O?"running":e!=null&&e.configured?"connected":"disconnected",children:v(O?"auth.running":e!=null&&e.configured?i==="oauth"?"status.signedIn":"status.configured":i==="oauth"?"status.signedOut":"status.notConfigured")})]}),O?o.jsxs("div",{className:"jv-auth-flow",children:[z&&o.jsx(Ne,{asChild:!0,variant:"outline",children:o.jsx("a",{style:{color:"inherit",textDecoration:"none"},href:z,target:"_blank",rel:"noopener noreferrer",children:v("auth.openPage")})}),(P==null?void 0:P.type)==="device_code"&&o.jsx("p",{children:v("auth.code",{code:P.userCode})}),(I==null?void 0:I.type)==="select"&&o.jsx("div",{className:"flex flex-wrap gap-2",children:(Q=I.options)==null?void 0:Q.map(Y=>o.jsx(Ne,{type:"button",variant:"outline",disabled:g,onClick:()=>q(Y.id),children:_&&Y.id==="browser"?v("auth.browser"):_&&Y.id==="device_code"?v("auth.deviceCode"):Y.label},Y.id))}),I&&I.type!=="select"&&o.jsxs("div",{className:"jv-auth-input",children:[o.jsx(L6,{htmlFor:`oauth-input-${N??n}`,children:I.type==="manual_code"?v(R?"auth.redirectFull":"auth.redirectOrCode"):I.message}),I.type==="manual_code"&&o.jsx("p",{className:"jv-auth-note",children:v("auth.manualNote")}),o.jsx(Nt,{id:`oauth-input-${N??n}`,type:I.type==="text"?"text":"password",autoComplete:"off",value:f,disabled:g,onChange:Y=>h(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&!Y.nativeEvent.isComposing&&(Y.preventDefault(),q(f))}}),o.jsx(Ne,{type:"button",variant:"outline",disabled:g||!f.trim(),onClick:()=>q(f),children:v("common.continue")})]}),!I&&o.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:v("auth.waiting")}),(P==null?void 0:P.type)==="info"&&o.jsx("p",{className:"text-sm",children:P.message}),o.jsx(Ne,{type:"button",variant:"ghost",disabled:g,onClick:()=>void E(()=>ue.authCancel(N)),children:v("auth.cancel")})]}):o.jsxs(o.Fragment,{children:[n==="antigravity"&&o.jsxs("p",{className:"jv-auth-risk",role:"note",children:[o.jsx(zf,{"aria-hidden":"true"}),v("auth.antigravityRisk")]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[_?o.jsxs(o.Fragment,{children:[o.jsx(Ne,{type:"button",variant:"outline",disabled:g,onClick:()=>T("browser"),children:v("auth.browser")}),o.jsx(Ne,{type:"button",variant:"outline",disabled:g,onClick:()=>T("device_code"),children:v("auth.deviceCode")})]}):o.jsx(Ne,{type:"button",variant:"outline",disabled:g,onClick:()=>T(),children:v(i==="api_key"?"auth.configureCredential":e!=null&&e.configured?"auth.signInAgain":"auth.signIn")}),(e==null?void 0:e.configured)&&o.jsx(Ne,{type:"button",variant:"outline",disabled:g,onClick:()=>void E(async()=>(await ue.authLogout(N),{phase:"idle"})),children:v(i==="api_key"?"auth.removeCredential":"auth.signOut")})]})]}),(y||c.phase==="error")&&o.jsx("p",{role:"alert",className:"jarvy-model-feedback",children:y||v("error.loginFailed")}),y&&o.jsx(Ne,{type:"button",variant:"link",disabled:g,onClick:()=>{m(""),k(Y=>Y+1)},children:v("auth.refresh")})]})}const B6=e=>e.authType==="oauth"&&e.configured&&g9.includes(e.providerName),I6=.2;function $F(e){const[n,i]=w.useState({}),r=e.filter(B6).map(l=>l.id).join(",");return w.useEffect(()=>{let l=!0;for(const c of r?r.split(","):[])ue.connectionQuota(c).then(d=>{l&&i(f=>({...f,[c]:d}))},()=>{});return()=>{l=!1}},[r]),n}function VF({quota:e}){if(!e||e.state!=="ok"||!e.windows.length)return null;const n=e.windows.filter(r=>!r.name),i=n.length?n.slice(0,2):[...e.windows].sort((r,l)=>r.remaining-l.remaining).slice(0,2);return o.jsx(o.Fragment,{children:i.map(r=>o.jsxs(w.Fragment,{children:[" · ",o.jsx("span",{className:"jv-quota-brief","data-low":r.remaining<I6||void 0,children:r.kind==="credits"&&r.amount?v("quota.creditsLeft",{amount:uf(r.amount.left,r.amount.unit)}):v("quota.summary",{label:GF(pg(r)),percent:P6(r.remaining)})})]},q6(r)))})}const GF=e=>Wi()==="zh"&&/[\x21-\x7e]$/.test(e)?`${e} `:e;function YF({connection:e}){const[n,i]=w.useState(),[r,l]=w.useState(!1),[c,d]=w.useState(""),[,f]=w.useState(0),h=e.id;w.useEffect(()=>{let m=!0;i(void 0),d(""),ue.connectionQuota(h).then(b=>{m&&i(b)},b=>{m&&d(Gt(b,"common.failed"))});const j=setInterval(()=>f(b=>b+1),3e4);return()=>{m=!1,clearInterval(j)}},[h]);async function g(){l(!0),d("");try{i(await ue.connectionQuota(h,!0))}catch(m){d(Gt(m,"common.failed"))}finally{l(!1)}}if((n==null?void 0:n.state)==="none"&&!n.link)return null;const y=n!=null&&n.checkedAt?v(n.source==="response"?"quota.fromReply":"quota.checked",{time:QF(n.checkedAt)}):"";return o.jsxs("section",{className:"jv-section","aria-label":v("quota.title"),children:[o.jsxs("div",{className:"jv-section-head",children:[o.jsxs("h3",{className:"jv-section-title",children:[v("quota.title"),(n==null?void 0:n.plan)&&o.jsx("span",{children:XF(n.plan)})]}),n&&n.state!=="none"&&o.jsxs("div",{className:"jv-section-actions",children:[y&&o.jsx("span",{className:"jv-quota-when",children:y}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:r,onClick:()=>void g(),children:[o.jsx(Of,{className:r?"animate-spin":void 0}),v("quota.refresh")]})]})]}),o.jsxs("div",{className:"jv-panel jv-quota",children:[!n&&!c&&o.jsx("p",{role:"status",className:"jv-hint",children:v("quota.checking")}),(n==null?void 0:n.state)==="none"&&o.jsxs("div",{className:"jv-quota-none",children:[o.jsx("p",{className:"jv-hint",children:v("quota.noReport")}),o.jsx(Ne,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",children:[v("quota.openPage"),o.jsx(df,{})]})})]}),(n==null?void 0:n.state)==="unchecked"&&o.jsx("p",{className:"jv-hint",children:v("quota.unchecked")}),(n==null?void 0:n.state)==="ok"&&!n.windows.length&&o.jsx("p",{className:"jv-hint",children:v("quota.unlimited")}),n==null?void 0:n.windows.map(m=>o.jsx(KF,{window:m},q6(m))),(c||(n==null?void 0:n.error))&&o.jsx("p",{role:"alert",className:"jv-quota-error",children:c||((n==null?void 0:n.state)==="failed"?v("quota.failed",{error:n.error}):v("quota.stale",{error:n.error}))})]})]})}function KF({window:e}){const n=e.remaining<I6;return o.jsxs("div",{className:"jv-quota-row","data-low":n||void 0,children:[o.jsxs("div",{className:"jv-quota-line",children:[o.jsx("strong",{children:pg(e)}),o.jsx("span",{children:e.kind==="credits"&&e.amount?v("quota.creditsLeft",{amount:uf(e.amount.left,e.amount.unit)}):v("quota.left",{percent:P6(e.remaining)})})]}),o.jsx("div",{className:"jv-quota-bar",role:"meter","aria-label":pg(e),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.remaining*100),children:o.jsx("span",{style:{width:`${Math.max(e.remaining>0?2:0,e.remaining*100)}%`}})}),(e.resetsAt||e.amount)&&o.jsxs("div",{className:"jv-quota-meta",children:[o.jsx("span",{children:e.resetsAt?ZF(e.resetsAt):""}),e.amount&&o.jsx("span",{children:v("quota.amountLeft",{left:uf(e.amount.left,e.amount.unit),total:uf(e.amount.total,e.amount.unit)})})]})]})}const q6=e=>`${e.kind}-${e.hours??""}-${e.name??""}`;function pg(e){const n=e.kind==="hours"?v("quota.hours",{count:e.hours??0}):e.kind==="pool"?"":v(`quota.${e.kind}`),i=e.name==="premium"||e.name==="chat"||e.name==="completions"?v(`quota.${e.name}`):e.name;return i?n&&e.kind!=="month"?v("quota.named",{name:i,window:n}):i:n}const P6=e=>La(e,{style:"percent",maximumFractionDigits:0}),uf=(e,n)=>n==="usd"?La(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",maximumFractionDigits:2}):La(e,{maximumFractionDigits:0}),XF=e=>e.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase());function QF(e){const n=Math.floor((Date.now()-e)/6e4);return n<1?v("quota.justNow"):n<60?v("quota.minutesAgo",{count:n}):v("quota.hoursAgo",{count:Math.floor(n/60)})}function ZF(e){const n=Math.ceil((e-Date.now())/6e4);if(n<=0)return v("quota.resetsSoon");if(n<60)return v("quota.resetsInMinutes",{count:n});if(n<1440)return v("quota.resetsInHours",{count:Math.round(n/60)});const i=Wi()==="zh";return v("quota.resetsOn",{date:ca(e,{month:i?"long":"short",day:"numeric",hour:i?"2-digit":"numeric",minute:"2-digit"})})}async function JF(e,n,i){try{return await ue.autoconfigModel({modelId:e.id,api:e.api||n,...i?{choice:i}:{}})}catch(r){return{status:"error",message:Gt(r,"auto.failed")}}}function WF(e,n){if(n.status!=="matched")return{...e,auto:n};const{fields:i,...r}=n,l=e.model.name&&e.model.name!==e.model.id;return{...e,model:{...e.model,...i,name:l?e.model.name:n.source.name||e.model.id},auto:r}}const H6=e=>`${e.provider} / ${e.modelId}`;function l4({items:e,onPick:n}){return o.jsx("div",{className:"jv-auto-sources",children:e.map(i=>o.jsxs("button",{type:"button",onClick:()=>n(i),children:[o.jsx("span",{className:"jv-mono",children:H6(i)}),i.official&&o.jsx("em",{children:v("auto.official")}),o.jsx("small",{children:i.api})]},`${i.provider}/${i.modelId}`))})}function eU({state:e,modelId:n,onRun:i}){const r=c=>i({provider:c.provider,modelId:c.modelId}),l=(e==null?void 0:e.status)==="pending";return o.jsxs("div",{className:"jv-autoconfig","aria-live":"polite",children:[o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",disabled:!n.trim()||l,onClick:()=>i(),children:[o.jsx(n3,{}),v(l?"auto.pending":"auto.run")]}),e&&!l&&o.jsxs("div",{className:"jv-auto-result",children:[e.status==="matched"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:xg("auto.matched",{source:o.jsx("strong",{className:"jv-mono",children:H6(e.source)}),note:e.reseller?v("auto.reseller"):"",suffix:v("auto.applied")})}),e.apiMismatch&&o.jsx("p",{className:"jv-auto-warn",children:v("auto.apiMismatch",{api:e.source.api})}),e.alternatives.length>0&&o.jsxs("details",{children:[o.jsx("summary",{children:v("auto.changeSource")}),o.jsx(l4,{items:e.alternatives,onPick:r})]})]}),e.status==="choose"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:e.reason==="multiple"?v("auto.multiple"):v("auto.similar",{modelId:n})}),o.jsx(l4,{items:e.options,onPick:r})]}),e.status==="none"&&o.jsx("p",{children:v("auto.notFound")}),e.status==="error"&&o.jsx("p",{role:"alert",children:e.message})]})]})}const y0=["openai","openrouter","deepseek","zai","qwen","together","baseten","chat-template","qwen-chat-template","string-thinking","ant-ling"],F6=[["off","thinking.level.off"],["minimal","thinking.level.minimal"],["low","thinking.level.low"],["medium","thinking.level.medium"],["high","thinking.level.high"],["xhigh","thinking.level.xhigh"],["max","thinking.level.max"]],U6=e=>e==="xhigh"||e==="max";function $6(e,n){const i=e[n];return i===null||i===void 0&&U6(n)?"unsupported":i===void 0?"default":"custom"}function tU(e){return e.reasoning?F6.filter(([n])=>$6(e.thinkingLevelMap,n)!=="unsupported").map(([,n])=>v(n)):[v("thinking.level.off")]}function nU({model:e,api:n,onChange:i}){const r=e.thinkingLevelMap,l=(f,h,g)=>{const y={...r};h==="default"?delete y[f]:h==="unsupported"?y[f]=null:y[f]=g??(typeof r[f]=="string"?r[f]:f),i({thinkingLevelMap:y})},c=n==="openai-completions",d=e.thinkingFormat&&!y0.includes(e.thinkingFormat)?[...y0,e.thinkingFormat]:y0;return o.jsxs("section",{className:"jv-thinking",children:[o.jsx("h4",{children:v("thinking.title")}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("thinking.format")}),o.jsxs(Hr,{value:e.thinkingFormat||"default",disabled:!c&&!e.thinkingFormat,onValueChange:f=>i({thinkingFormat:f==="default"?"":f}),children:[o.jsx(Ur,{"aria-label":v("thinking.format"),children:o.jsx(Fr,{})}),o.jsxs($r,{className:"jv-select-menu",children:[o.jsx(za,{value:"default",children:v("thinking.protocolDefault")}),d.map(f=>o.jsx(za,{value:f,children:f},f))]})]}),!c&&o.jsx("small",{className:"jv-field-hint",children:v("thinking.onlyCompletions")})]}),o.jsx("div",{className:"jv-thinking-levels",role:"group","aria-label":v("thinking.levels"),children:F6.map(([f,h])=>{const g=$6(r,f);return o.jsxs("div",{className:"jv-thinking-level",children:[o.jsxs("span",{children:[v(h),o.jsx("code",{children:f})]}),o.jsxs(Hr,{value:g,onValueChange:y=>l(f,y),children:[o.jsx(Ur,{"aria-label":v("thinking.levelName",{level:v(h)}),children:o.jsx(Fr,{})}),o.jsxs($r,{className:"jv-select-menu",children:[!U6(f)&&o.jsx(za,{value:"default",children:v("thinking.supportedDefault")}),o.jsx(za,{value:"unsupported",children:v("thinking.unsupported")}),o.jsx(za,{value:"custom",children:v("thinking.supportedCustom")})]})]}),g==="custom"?o.jsx(Nt,{className:"jv-mono",required:!0,"aria-label":v("thinking.levelValue",{level:v(h)}),maxLength:80,value:r[f]??"",onChange:y=>l(f,"custom",y.target.value)}):o.jsx("span",{})]},f)})}),o.jsx("p",{className:"jv-field-hint",children:v("thinking.supported",{levels:tU(e).join(" · ")})})]})}const x0=[{id:"openai-completions",label:"OpenAI · Chat Completions"},{id:"openai-responses",label:"OpenAI · Responses"},{id:"anthropic-messages",label:"Anthropic · Messages"},{id:"google-generative-ai",label:"Google · Gemini"}],aU=()=>({id:"",name:"",reasoning:!1,input:["text"],contextWindow:null,maxTokens:null,thinkingFormat:"",thinkingLevelMap:{},compat:{},cost:null});function gg({value:e,onChange:n,allowDefault:i=!1}){const r=x0.some(l=>l.id===e)||!e?x0:[...x0,{id:e,label:e}];return o.jsxs(Hr,{value:e||"default",onValueChange:l=>n(l==="default"?"":l),children:[o.jsx(Ur,{"aria-label":v("editor.protocol"),children:o.jsx(Fr,{})}),o.jsxs($r,{className:"jv-select-menu",children:[i&&o.jsx(za,{value:"default",children:v("card.defaultProtocol")}),r.map(l=>o.jsx(za,{value:l.id,children:l.label},l.id))]})]})}const iU=e=>e>=1e6?`${+(e/1e6).toFixed(2)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e),c4={pending:"auto.pending",choose:"auto.tagChoose",none:"auto.tagNone",error:"auto.failed"};function rU({value:e,onChange:n}){const i=h=>Object.keys(h).length?JSON.stringify(h,null,2):"",[r,l]=w.useState(()=>i(e)),[c,d]=w.useState(""),f=w.useRef(null);return w.useEffect(()=>{var h;try{if(JSON.stringify(JSON.parse(r||"{}"))===JSON.stringify(e))return}catch{}l(i(e)),d(""),(h=f.current)==null||h.setCustomValidity("")},[e]),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("card.compat")}),o.jsx(_l,{ref:f,className:"jv-mono jv-compat",rows:Math.min(10,Math.max(2,r.split(`
850
+ `).length)),placeholder:"{}",value:r,onChange:h=>{l(h.target.value);try{const g=JSON.parse(h.target.value||"{}");if(!g||typeof g!="object"||Array.isArray(g))throw new Error;n(g),d(""),h.currentTarget.setCustomValidity("")}catch{d(v("card.jsonObject")),h.currentTarget.setCustomValidity(v("card.jsonObject"))}}}),c&&o.jsx("small",{role:"alert",children:c})]})}function oU({draft:e,protocol:n,onChange:i,onRemove:r,onAutoconfig:l}){const{model:c}=e,[d,f]=w.useState(!c.id),[h,g]=w.useState(!1),[y,m]=w.useState(()=>(c.headerNames??[]).map(S=>({name:S,value:"",saved:!0}))),j=S=>i({...e,model:{...c,...S}}),b=(S,N)=>o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:S}),N]}),k=(S,N,C)=>{const M=y.map((T,_)=>_===S?{...T,[N]:C}:T);m(M);const E={...c.headerUpdates};!y[S].saved&&y[S].name&&y[S].name!==M[S].name&&(E[y[S].name]=null);for(const T of M)T.name&&(T.value||!T.saved)&&(E[T.name]=T.value);j({headerUpdates:E})};return o.jsxs("article",{className:`jv-model-card ${e.selected?"is-selected":""}`,children:[o.jsxs("div",{className:"jv-model-summary",children:[o.jsx("input",{type:"checkbox",checked:e.selected,"aria-label":v("card.use",{name:c.id||v("card.newModel")}),onChange:S=>i({...e,selected:S.target.checked})}),o.jsxs("button",{type:"button","aria-expanded":d,className:"jv-model-expand",onClick:()=>f(!d),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:c.name||c.id||v("card.newModel")}),o.jsx("span",{className:"jv-mono",children:c.id||v("card.enterId")})]}),o.jsxs("span",{className:"jv-chips",children:[c.contextWindow&&o.jsx("span",{className:"jv-chip",children:iU(c.contextWindow)}),c.input.includes("image")&&o.jsx("span",{className:"jv-chip",children:v("card.image")}),c.reasoning&&o.jsx("span",{className:"jv-chip",children:v("card.reasoning")}),e.auto&&c4[e.auto.status]&&o.jsx("span",{className:"jv-chip jv-chip-warn",children:v(c4[e.auto.status])})]}),o.jsx(_o,{className:"jv-expand-icon"})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-model-remove","aria-label":v("card.remove",{name:c.id||v("card.newModel")}),onClick:r,children:o.jsx(hf,{})})]}),d&&o.jsxs("div",{className:"jv-model-fields",children:[o.jsxs("div",{className:"jv-field-grid",children:[b(v("card.modelId"),o.jsx(Nt,{className:"jv-mono",required:!0,value:c.id,onChange:S=>j({id:S.target.value}),placeholder:"model-id"})),b(v("card.modelName"),o.jsx(Nt,{value:c.name,onChange:S=>j({name:S.target.value}),placeholder:v("card.optional")}))]}),o.jsx(eU,{state:e.auto,modelId:c.id,onRun:l}),o.jsxs("section",{children:[o.jsx("h4",{children:v("card.capabilities")}),o.jsxs("div",{className:"flex flex-wrap gap-5",children:[o.jsxs("label",{className:"jarvy-model-check",children:[o.jsx("input",{type:"checkbox",checked:c.reasoning,onChange:S=>j({reasoning:S.target.checked})}),v("card.reasoningThinking")]}),o.jsxs("label",{className:"jarvy-model-check",children:[o.jsx("input",{type:"checkbox",checked:c.input.includes("image"),onChange:S=>j({input:S.target.checked?["text","image"]:["text"]})}),v("card.imageInput")]})]})]}),c.reasoning&&o.jsx(nU,{model:c,api:c.api||n,onChange:j}),o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h4",{children:v("card.specs")}),o.jsx(Ne,{type:"button",variant:"link",size:"sm",onClick:()=>g(!h),children:v(h?"card.hidePrices":"card.editPrices")})]}),o.jsxs("div",{className:"jv-field-grid",children:[b(v("card.context"),o.jsx(Nt,{type:"number",min:1,value:c.contextWindow??"",placeholder:v("card.notProvided"),onChange:S=>j({contextWindow:S.target.value?Number(S.target.value):null})})),b(v("card.maxOutput"),o.jsx(Nt,{type:"number",min:1,value:c.maxTokens??"",placeholder:v("card.notProvided"),onChange:S=>j({maxTokens:S.target.value?Number(S.target.value):null})}))]}),o.jsx("h4",{className:"jv-cost-title",children:v("card.costTitle")}),o.jsx("div",{className:"jv-costs",children:[["input","card.costInput"],["output","card.costOutput"],["cacheRead","card.costCacheRead"],["cacheWrite","card.costCacheWrite"]].map(([S,N])=>{var C,M;return o.jsxs("div",{children:[o.jsx(L6,{children:v(N)}),h?o.jsx(Nt,{type:"number",step:"any",min:0,value:((C=c.cost)==null?void 0:C[S])??"",onChange:E=>j({cost:{input:0,output:0,cacheRead:0,cacheWrite:0,...c.cost,[S]:Number(E.target.value)}})}):o.jsx("span",{children:((M=c.cost)==null?void 0:M[S])??v("card.notProvided")})]},S)})})]}),o.jsxs("details",{className:"jv-advanced",children:[o.jsxs("summary",{children:[v("card.advanced"),o.jsx(_o,{className:"size-4"})]}),o.jsxs("div",{className:"jv-advanced-fields",children:[o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("card.apiOverride")}),o.jsx(gg,{allowDefault:!0,value:c.api??"",onChange:S=>j({api:S,baseUrl:void 0})})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("card.headers")}),y.map((S,N)=>o.jsxs("div",{className:"jv-header-row",children:[o.jsx(Nt,{className:"jv-mono","aria-label":"Header Name",placeholder:"Header-Name",readOnly:S.saved,value:S.name,onChange:C=>k(N,"name",C.target.value)}),o.jsx(Nt,{"aria-label":"Header Value",type:"password",autoComplete:"off",placeholder:S.saved?v("card.headerSaved"):"value",value:S.value,onChange:C=>k(N,"value",C.target.value)}),o.jsx(Ne,{type:"button",size:"icon-sm",variant:"ghost","aria-label":v("card.removeHeader"),onClick:()=>{m(y.filter((C,M)=>M!==N)),S.name&&j({headerUpdates:{...c.headerUpdates,[S.name]:null}})},children:o.jsx(hf,{})})]},N)),o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",className:"self-start",onClick:()=>m([...y,{name:"",value:"",saved:!1}]),children:[o.jsx(Ir,{}),v("card.addHeader")]})]}),o.jsx(rU,{value:c.compat,onChange:S=>j({compat:S})})]})]})]})]})}let sU=0;const Qd=(e,n,i=!1)=>({key:`draft-${++sU}`,model:e,selected:n,...i?{originalId:e.id}:{}});function lU({connection:e,preset:n,defaultName:i,saved:r=!1,onBack:l,onSaved:c,onConnected:d,onChanged:f}){const h=e?e.kind==="custom":(n==null?void 0:n.id)==="custom",g=(e==null?void 0:e.authType)??n.authType,[y,m]=w.useState(e?h?e.providerName:e.displayName:h?"":i),[j,b]=w.useState((e==null?void 0:e.baseUrl)??""),[k,S]=w.useState((e==null?void 0:e.api)??n.api),[N,C]=w.useState(""),[M,E]=w.useState(()=>((e==null?void 0:e.models)??[]).map(re=>Qd(re,!0,!0))),[T,_]=w.useState([]),[R,O]=w.useState(""),{busy:I,error:P,setError:z,run:q}=An(),[$,Q]=w.useState(!1),[Y,H]=w.useState(r?v("editor.saved"):""),[K,V]=w.useState(null),X=w.useRef(e==null?void 0:e.id);function Z(re){E(Ce=>{const Ve=new Set(Ce.map(Pe=>Pe.model.id));return[...Ce,...re.filter(Pe=>!Ve.has(Pe.id)).map(Pe=>Qd(Pe,!1))]})}w.useEffect(()=>{if(h)return;let re=!0;return Q(!0),(e?ue.modelCatalog(e.id):ue.providerModels(n.id)).then(Ve=>{if(!re)return;const Pe=new Set(Ve.models.map(Ze=>Ze.id));e!=null&&e.configured&&E(Ze=>Ze.filter(Fe=>Fe.selected||Fe.originalId!==void 0||Pe.has(Fe.model.id))),Z(Ve.models)}).catch(Ve=>{re&&z(Gt(Ve,"editor.fetchFailed"))}).finally(()=>{re&&Q(!1)}),()=>{re=!1}},[e==null?void 0:e.id,e==null?void 0:e.configured,n==null?void 0:n.id,h]);async function D(){Q(!0),z(""),H("");try{const re=await ue.discoverModels({connectionId:X.current,baseUrl:j,api:k,...N.trim()?{apiKey:N}:{}});Z(re.models),H(re.models.length?v("editor.fetched",{count:re.models.length}):v("editor.noneReturned"))}catch(re){z(Gt(re,"editor.fetchFailed"))}finally{Q(!1)}}async function se(re,Ce){const Ve=M.filter(Ze=>re.includes(Ze.key)&&Ze.model.id.trim());if(!Ve.length)return;z(""),H(""),E(Ze=>Ze.map(Fe=>Ve.some(Ke=>Ke.key===Fe.key)?{...Fe,auto:{status:"pending"}}:Fe));const Pe={matched:0,choose:0,none:0,error:0};for(const Ze of Ve){const Fe=await JF(Ze.model,k,Ce);Pe[Fe.status]++,E(Ke=>Ke.map(gt=>gt.key===Ze.key?WF(gt,Fe):gt))}Ve.length>1&&H(v("editor.autoSummary",{parts:[v("editor.autoMatched",{count:Pe.matched}),Pe.choose&&v("editor.autoChoose",{count:Pe.choose}),Pe.none&&v("editor.autoNone",{count:Pe.none}),Pe.error&&v("editor.autoFailed",{count:Pe.error})].filter(Boolean).join(v("common.listSeparator"))}))}async function ne(){if(!X.current){const re=await ue.createModelConnection({providerName:n.id,displayName:y,kind:"builtin",authType:g,baseUrl:j,api:k});X.current=re.id}return await d(X.current),X.current}async function B(re){re.preventDefault(),H(""),await q("save",async()=>{let Ce;X.current?(Ce=await ue.updateModelConnection(X.current,{displayName:y,...h?{providerName:y}:{},baseUrl:j,api:k}),h&&N.trim()&&await ue.saveModelCredential(Ce.id,N)):(Ce=await ue.createModelConnection({providerName:h?y:n.id,displayName:y,kind:h?"custom":"builtin",authType:g,baseUrl:j,api:k,...h&&N.trim()?{apiKey:N}:{}}),X.current=Ce.id);for(const Ve of M)Ve.selected&&await ue.saveConnectionModel(Ce.id,Ve.model,Ve.originalId);for(const Ve of new Set([...T,...M.filter(Pe=>Pe.originalId&&!Pe.selected).map(Pe=>Pe.originalId)]))await ue.deleteConnectionModel(Ce.id,Ve);C(""),await c(Ce.id),H(v("editor.saved"))},"editor.saveFailed")}async function F(){H(""),await q("reset",async()=>V(await ue.modelResetPlan(e.id)),"editor.resetFailed")}async function ee(){H(""),await q("reset",async()=>{const Ce=await ue.resetModelConnection(e.id);V(null),_([]),b(Ce.baseUrl),S(Ce.api),E(Ce.models.map(Ve=>Qd(Ve,!0,!0))),Z((await ue.modelCatalog(Ce.id)).models),await f()},"editor.resetFailed")&&H(v("editor.resetDone"))}async function W(){!e||!confirm(v("editor.confirmDelete",{name:e.displayName}))||await q("delete",async()=>{await ue.deleteModelConnection(e.id),await f(),l()},"editor.deleteFailed")}const fe=M.filter(re=>`${re.model.id} ${re.model.name}`.toLowerCase().includes(R.toLowerCase())),le=M.filter(re=>re.selected).length,be=h?(e==null?void 0:e.displayName)??v("group.custom"):(e==null?void 0:e.displayName)??n.name,we=e?O6(e):null,ve=M.some(re=>{var Ce;return((Ce=re.auto)==null?void 0:Ce.status)==="pending"});return o.jsxs("form",{className:"jv-editor",onChange:()=>H(""),onSubmit:re=>void B(re),children:[o.jsxs("header",{className:"jv-editor-header",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-back",disabled:I,onClick:l,"aria-label":v("editor.back"),children:o.jsx(bg,{})}),o.jsx(L1,{name:be,provider:e?e.kind==="builtin"?e.providerName:void 0:n==null?void 0:n.id}),o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:be}),o.jsx("span",{children:h?"OpenAI / Anthropic compatible":v(g==="oauth"?"group.subscription":"group.apiKey")})]}),we&&o.jsx("span",{className:"jv-status","data-ok":we.ok||void 0,children:we.label}),e&&o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-danger-icon",disabled:I,onClick:()=>void W(),"aria-label":v("editor.delete"),children:o.jsx(hf,{})})]}),o.jsxs("div",{className:"jv-editor-scroll",children:[o.jsxs("section",{className:"jv-section","aria-label":v("editor.connection"),children:[o.jsx("h3",{className:"jv-section-title",children:v("editor.connection")}),o.jsx("div",{className:"jv-panel",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-field-grid",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("editor.providerName")}),o.jsx(Nt,{className:"jv-mono",required:!0,maxLength:80,"aria-label":v("editor.providerName"),placeholder:"my-provider",value:y,onChange:re=>m(re.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("editor.protocol")}),o.jsx(gg,{value:k,onChange:S})]})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("editor.url")}),o.jsx(Nt,{required:!0,type:"url","aria-label":v("editor.url"),value:j,placeholder:"https://api.example.com/v1",onChange:re=>b(re.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("editor.key")}),o.jsx(Nt,{type:"password",autoComplete:"new-password","aria-label":v("editor.key"),placeholder:v(e!=null&&e.configured?"editor.keySaved":"editor.keyPlaceholder"),value:N,onChange:re=>C(re.target.value)})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("editor.name")}),o.jsx(Nt,{required:!0,maxLength:100,"aria-label":v("editor.name"),value:y,onChange:re=>m(re.target.value)})]}),o.jsx(UF,{connection:e,providerName:(e==null?void 0:e.providerName)??n.id,authType:g,ensureConnection:ne,onChanged:f}),o.jsxs("details",{className:"jv-advanced",children:[o.jsxs("summary",{children:[o.jsx(_o,{}),v("editor.settings")]}),o.jsxs("div",{className:"jv-advanced-fields",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("editor.url")}),o.jsx(Nt,{className:"jv-mono",value:j,placeholder:v("editor.defaultUrl"),onChange:re=>b(re.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:"API Protocol"}),o.jsx(gg,{value:k,onChange:S})]})]})]})]})})]}),e&&B6(e)&&o.jsx(YF,{connection:e}),o.jsxs("section",{className:"jv-section","aria-label":v("editor.models"),children:[o.jsxs("div",{className:"jv-section-head",children:[o.jsxs("h3",{className:"jv-section-title",children:[v("settings.models")," ",o.jsx("span",{children:v("editor.selected",{selected:le,total:M.length})})]}),o.jsxs("div",{className:"jv-section-actions",children:[h&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:I||$||!j.trim()||!(N.trim()||e!=null&&e.configured),onClick:()=>void D(),children:[o.jsx(wg,{}),v($?"editor.fetching":"editor.fetch")]}),le>0&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:I||ve,onClick:()=>void se(M.filter(re=>re.selected).map(re=>re.key)),children:[o.jsx(n3,{}),v("editor.autoSelected")]}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>E([...M,Qd(aU(),!0)]),children:[o.jsx(Ir,{}),v("editor.addManually")]}),e&&!h&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:I||$||!!K,onClick:()=>void F(),children:[o.jsx(Yw,{}),v("editor.reset")]})]})]}),K&&o.jsx(cU,{plan:K,busy:I,onCancel:()=>V(null),onConfirm:()=>void ee()}),M.length>6&&o.jsxs("div",{className:"jv-models-filter",children:[o.jsxs("label",{className:"jv-search",children:[o.jsx(Rs,{}),o.jsx("input",{"aria-label":v("editor.filter"),placeholder:v("editor.filterPlaceholder"),value:R,onChange:re=>O(re.target.value)})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(re=>re.map(Ce=>fe.includes(Ce)?{...Ce,selected:!0}:Ce)),children:v("editor.selectVisible")})]}),$&&!h&&o.jsx("p",{role:"status",className:"jv-hint",children:v("editor.loadingCatalog")}),o.jsx("div",{className:"jv-model-cards",children:fe.map(re=>o.jsx(oU,{draft:re,protocol:k,onAutoconfig:Ce=>void se([re.key],Ce),onChange:Ce=>E(Ve=>Ve.map(Pe=>Pe.key===re.key?Ce:Pe)),onRemove:()=>{re.originalId&&_(Ce=>[...Ce,re.originalId]),E(Ce=>Ce.filter(Ve=>Ve.key!==re.key))}},re.key))}),!$&&!M.length&&o.jsxs("div",{className:"jv-empty",children:[o.jsx("strong",{children:v("editor.empty")}),o.jsx("span",{children:v(h?"editor.emptyCustom":"editor.emptyBuiltin")})]})]})]}),o.jsxs("footer",{className:"jv-editor-footer",children:[o.jsx("div",{"aria-live":"polite",children:P?o.jsx("p",{role:"alert",children:P}):Y?o.jsx("p",{role:"status",children:Y}):null}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:I||$||ve,children:v(I?"editor.saving":"editor.save")})]})]})}function cU({plan:e,busy:n,onCancel:i,onConfirm:r}){const l=[...new Set(e.removed.flatMap(d=>d.bots))],c=v("common.listSeparator");return o.jsxs("div",{className:"jv-reset-confirm",role:"group","aria-label":v("editor.resetTitle"),children:[o.jsx("strong",{children:v("editor.resetTitle")}),e.reset.length>0&&o.jsx("p",{children:v("editor.resetModels",{count:e.reset.length})}),e.removed.length>0&&o.jsx("p",{children:v("editor.resetRemoves",{count:e.removed.length,names:e.removed.map(d=>d.name||d.id).join(c)})}),l.length>0&&o.jsx("p",{className:"jv-reset-bots",children:v("editor.resetBots",{count:l.length,bots:l.join(c)})}),o.jsx("p",{children:v("editor.resetKeeps")}),o.jsxs("div",{className:"jv-reset-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:i,children:v("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:n,onClick:r,children:v("editor.resetConfirm")})]})]})}function uU({connections:e,onChanged:n}){const[i,r]=w.useState("list"),[l,c]=w.useState(),[d,f]=w.useState(),[h,g]=w.useState(0),y=$F(i==="list"?e:[]),m=()=>{r("list"),f(void 0),c(void 0),g(0)},j=k=>D6({authType:k.authType,custom:k.kind==="custom"});let b=(l==null?void 0:l.name)??"";if(l){let k=2;for(;e.some(S=>S.displayName===b);)b=`${l.name} ${k++}`}return i==="choose"?o.jsx(PF,{onBack:m,onSelect:k=>{c(k),f(void 0),r("editor")}}):i==="editor"?o.jsx(lU,{connection:e.find(k=>k.id===d),preset:l,defaultName:b,saved:h>0,onBack:m,onChanged:n,onConnected:async k=>{await n(),f(k),c(void 0)},onSaved:async k=>{await n(),f(k),c(void 0),g(S=>S+1)}},h):o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx("h2",{children:v("settings.models")}),o.jsxs(Ne,{className:"jv-primary",onClick:()=>r("choose"),children:[o.jsx(Ir,{}),v("models.add")]})]}),!e.length&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:v("models.empty")})}),z6.filter(k=>e.some(S=>j(S)===k.id)).map(({id:k,label:S})=>o.jsxs("section",{className:"jv-section","aria-label":v(S),children:[o.jsx("h3",{className:"jv-section-title",children:v(S)}),o.jsx("div",{className:"jv-list",children:e.filter(N=>j(N)===k).map(N=>{const C=O6(N);return o.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>{f(N.id),c(void 0),r("editor")},children:[o.jsx(L1,{name:N.displayName,provider:N.kind==="builtin"?N.providerName:void 0}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:N.displayName}),o.jsxs("span",{children:[N.models.length?v("models.count",{count:N.models.length}):v("models.none"),o.jsx(VF,{quota:y[N.id]})]})]}),o.jsx("span",{className:"jv-status","data-ok":C.ok||void 0,children:C.label}),o.jsx(_s,{className:"jv-row-chevron"})]},N.id)})})]},k))]})}function dU({info:e,onSaved:n}){const[i,r]=w.useState(String(e.ports.from)),[l,c]=w.useState(String(e.ports.to)),[d,f]=w.useState(null),[h,g]=w.useState(!1),y=i!==String(e.ports.from)||l!==String(e.ports.to),m=async j=>{j.preventDefault(),g(!0),f(null);try{const b=await ue.setPortRange({from:Number(i),to:Number(l)});n(b),r(String(b.ports.from)),c(String(b.ports.to)),f({error:!1,text:v("ports.rangeSaved")})}catch(b){f({error:!0,text:Gt(b)})}finally{g(!1)}};return o.jsxs("section",{className:"jv-section","aria-labelledby":"network-ports",children:[o.jsx("h3",{id:"network-ports",className:"jv-section-title",children:v("ports.range")}),o.jsxs("form",{className:"jv-panel jv-conn-ports",onSubmit:j=>void m(j),children:[o.jsxs("div",{className:"jv-conn-range",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("ports.rangeFrom")}),o.jsx(Nt,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:i,onChange:j=>{r(j.target.value),f(null)}})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("ports.rangeTo")}),o.jsx(Nt,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:l,onChange:j=>{c(j.target.value),f(null)}})]})]}),o.jsx("small",{className:"jv-hint",children:v("ports.rangeHint")}),o.jsxs("div",{className:"jv-form-footer",children:[d?o.jsx("p",{className:d.error?"jv-note-error":"jv-hint",role:d.error?"alert":"status",children:d.text}):o.jsx("span",{}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:h||!y,children:v("common.save")})]})]})]})}function fU(){var j;const[e,n]=w.useState(null),[i,r]=w.useState(null),[l,c]=w.useState(!1),[d,f]=w.useState(!1),[h,g]=w.useState(!1);w.useEffect(()=>{ue.connection().then(n).catch(()=>g(!0))},[]);const y=b=>o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:v("settings.network")})}),o.jsxs("section",{className:"jv-section","aria-labelledby":"network-lan",children:[o.jsx("h3",{id:"network-lan",className:"jv-section-title",children:v("connection.lan")}),b]}),h&&o.jsx("p",{className:"jv-note-error",role:"alert",children:v("common.failed")}),e&&o.jsx(dU,{info:e,onSaved:n})]});if(!e)return y(null);if(!e.https)return y(o.jsx("div",{className:"jv-list",children:o.jsx("div",{className:"jv-list-row jv-static-row jv-conn-local",children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:v("connection.localOnly")}),o.jsx("span",{children:xg("connection.localOnlyHint",{flag:o.jsx("code",{children:"--host 0.0.0.0"})})})]})})}));const m=async()=>{f(!0),g(!1);try{n(await ue.setConnection(!e.allowHttp))}catch{g(!0)}finally{f(!1)}};return y(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"jv-list",role:"group","aria-label":v("connection.addresses"),children:e.addresses.map(b=>o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("code",{children:b})}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":v(i===b?"ui.copied":"connection.copy"),onClick:()=>void ql(b).then(k=>r(k?b:null)),children:i===b?o.jsx(Ba,{}):o.jsx(eu,{})})]},b))}),o.jsxs("div",{className:"jv-list jv-conn-cert",children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-root",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:v("connection.root")})}),o.jsx(Ne,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs("a",{href:"/api/connection/root.crt",children:[o.jsx(wg,{}),v("connection.download")]})})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-print",children:[o.jsx("span",{children:v("connection.fingerprint")}),o.jsx("code",{children:(j=e.fingerprint)==null?void 0:j.replaceAll(":",":​")}),e.fingerprintSha1&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:v("connection.fingerprintSha1")}),o.jsx("code",{children:e.fingerprintSha1.replaceAll(":",":​")})]})]}),o.jsxs("button",{type:"button",className:"jv-list-row jv-conn-disclosure","aria-expanded":l,onClick:()=>c(!l),children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:v("connection.howTo")})}),o.jsx(_o,{"aria-hidden":"true"})]}),l&&o.jsx("div",{className:"jv-list-row jv-static-row jv-conn-steps",children:o.jsxs("ul",{children:[o.jsx("li",{children:v("connection.howMac")}),o.jsx("li",{children:v("connection.howWindows")}),o.jsx("li",{children:v("connection.howIos")}),o.jsx("li",{children:v("connection.howAndroid")}),o.jsx("li",{children:v("connection.howRestart")})]})})]}),o.jsx("div",{className:"jv-list",children:o.jsxs("button",{type:"button",role:"switch","aria-checked":e.allowHttp,disabled:d,className:"jv-list-row jv-choice-row jv-conn-http",onClick:()=>void m(),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:v("connection.allowHttp")}),o.jsx("span",{children:v("connection.allowHttpHint")})]}),o.jsx("span",{className:"jv-conn-switch","aria-hidden":"true"})]})})]}))}const u4=e=>ca(e,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function hU({secret:e,bots:n,open:i,onToggle:r,onChanged:l,onDeleted:c}){const[d,f]=w.useState(null),[h,g]=w.useState(e.description),[y,m]=w.useState(""),[j,b]=w.useState(!1),[k,S]=w.useState(!1),{busy:N,error:C,run:M}=An();w.useEffect(()=>{i&&ue.secretUses(e.id).then(O=>f(O.uses)).catch(()=>f([]))},[i,e.id,e.uses]);const E=O=>{O.preventDefault(),M("save",async()=>{l(await ue.updateSecret(e.id,{description:h.trim(),...y?{value:y}:{}})),m(""),b(!1)})},T=new Set(e.grants.map(O=>O.botId)),_=O=>{var I;return((I=n.find(P=>P.id===O))==null?void 0:I.name)??v("secrets.deletedBot")},R=h.trim()!==e.description||!!y;return o.jsxs(DS,{id:`secret-${e.id}`,open:i,onToggle:r,busy:N,error:C,text:o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"jv-mono",children:e.name}),o.jsx("span",{children:e.description||v("secrets.noDescription")})]}),meta:e.readable?o.jsx("span",{className:"jv-row-meta",children:T.size?v("secrets.grantCount",{count:T.size}):v("secrets.notGranted")}):o.jsx("span",{className:"jv-status","data-busy":"",children:v("secrets.unreadable")}),remove:v("secrets.delete"),confirming:k?{title:v("secrets.deleteTitle",{name:e.name}),body:v("secrets.deleteBody"),confirm:v("secrets.deleteConfirm")}:null,onAskRemove:()=>S(!0),onCancel:()=>S(!1),onConfirm:()=>void M("delete",async()=>{await ue.deleteSecret(e.id),c()}),children:[o.jsxs("p",{className:"jv-secret-meta",children:[v("secrets.fingerprint")," ",o.jsx("code",{children:e.fingerprint})," · ",v("secrets.updated",{time:u4(e.updatedAt)})," · ",e.uses?v("secrets.usedCount",{count:e.uses}):v("secrets.neverUsed")]}),!e.readable&&o.jsx("p",{className:"jv-note-error",children:v("secrets.unreadableHint")}),o.jsx(vq,{secret:e,bots:n,onChanged:l}),o.jsxs("form",{className:"jv-secret-edit",onSubmit:E,"aria-label":v("secrets.edit"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("secrets.description")}),o.jsx(Nt,{maxLength:200,placeholder:v("secrets.descriptionPlaceholder"),value:h,onChange:O=>g(O.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("secrets.newValue")}),o.jsx(nh,{value:y,visible:j,onChange:m,onVisible:b,placeholder:v("secrets.newValuePlaceholder")})]}),o.jsx("div",{className:"jv-secret-actions",children:o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:N||!R,children:v("common.save")})})]}),o.jsx("h4",{className:"jv-secret-heading",children:v("secrets.uses")}),d&&d.length?o.jsx("ul",{className:"jv-secret-uses",children:d.map(O=>o.jsxs("li",{children:[o.jsxs("span",{children:[_(O.botId)," · ",u4(O.at)," · ",v(O.how==="ssh_sign"?"secrets.useSsh":"secrets.useCommand")]}),O.detail&&o.jsx("code",{children:O.detail})]},O.id))}):o.jsx("p",{className:"jv-hint",children:v("secrets.noUses")})]})}const d4=(e,n)=>e.name.localeCompare(n.name);function mU(){const[e,n]=w.useState(null),[i,r]=w.useState(""),[l,c]=w.useState([]),[d,f]=w.useState(!1),[h,g]=w.useState(null),[y,m]=w.useState(null);w.useEffect(()=>{ue.secrets().then(b=>{n([...b.secrets].sort(d4)),r(b.keyLocation)}).catch(b=>m(Gt(b))),ue.bots().then(b=>c(b.bots)).catch(()=>c([]))},[]);const j=b=>n(k=>k&&k.map(S=>S.id===b.id?b:S));return o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx("h2",{children:v("settings.secrets")}),!d&&o.jsxs(Ne,{className:"jv-primary",onClick:()=>f(!0),children:[o.jsx(Ir,{}),v("secrets.add")]})]}),d&&o.jsx(pU,{onCancel:()=>f(!1),onSaved:b=>{f(!1),n(k=>[...k??[],b].sort(d4)),g(b.id)}}),e&&!e.length&&!d&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:v("secrets.empty")})}),e&&e.length>0&&o.jsx("section",{className:"jv-section","aria-label":v("settings.secrets"),children:o.jsx("div",{className:"jv-list",children:e.map(b=>o.jsx(hU,{secret:b,bots:l,open:h===b.id,onToggle:()=>g(h===b.id?null:b.id),onChanged:j,onDeleted:()=>{g(null),n(k=>k&&k.filter(S=>S.id!==b.id))}},b.id))})}),i&&o.jsxs("section",{className:"jv-section","aria-labelledby":"secrets-key",children:[o.jsx("h3",{id:"secrets-key",className:"jv-section-title",children:v("secrets.masterKey")}),o.jsx("div",{className:"jv-list",children:o.jsx("div",{className:"jv-list-row jv-static-row jv-secret-key",children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:v("secrets.keyFile")}),o.jsx("code",{children:i}),o.jsx("span",{children:v("secrets.keyHint")})]})})})]}),y&&o.jsx("p",{className:"jv-note-error",role:"alert",children:y})]})}function pU({onCancel:e,onSaved:n}){const[i,r]=w.useState(""),[l,c]=w.useState(""),[d,f]=w.useState(""),[h,g]=w.useState(!1),{busy:y,error:m,run:j}=An(),b=async k=>{k.preventDefault(),await j("add",async()=>n(await ue.createSecret({name:i.trim(),description:l.trim(),value:d})))};return o.jsxs("form",{className:"jv-panel jv-secret-form",onSubmit:k=>void b(k),"aria-label":v("secrets.add"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("secrets.name")}),o.jsx(Nt,{className:"jv-mono",required:!0,autoFocus:!0,maxLength:64,placeholder:"GITHUB_TOKEN",value:i,onChange:k=>r(k.target.value.toUpperCase())})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("secrets.description")}),o.jsx(Nt,{maxLength:200,placeholder:v("secrets.descriptionPlaceholder"),value:l,onChange:k=>c(k.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("secrets.value")}),o.jsx(nh,{value:d,visible:h,onChange:f,onVisible:g,required:!0})]}),m&&o.jsx("p",{className:"jv-note-error",role:"alert",children:m}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:e,children:v("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:y||!i.trim()||!d,children:v("common.save")})]})]})}const f4=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"]];function gU({bots:e}){const{range:n,setRange:i,data:r,error:l,reload:c}=gS(pS.overview,"all");return o.jsxs("div",{className:"jv-page jv-usage-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:v("settings.usage")})}),o.jsxs("div",{className:"jv-usage",children:[o.jsx(vS,{range:n,setRange:i,busy:!r&&!l,reload:c}),o.jsx(yS,{loading:!r,error:l,empty:!(r!=null&&r.models.length),reload:c}),r&&r.models.length>0&&!l&&o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"jv-section","aria-labelledby":"usage-models",children:[o.jsx("h3",{id:"usage-models",className:"jv-section-title",children:v("usage.byModel")}),o.jsx(xS,{models:r.models,note:!1})]}),o.jsxs("section",{className:"jv-section","aria-labelledby":"usage-bots",children:[o.jsx("h3",{id:"usage-bots",className:"jv-section-title",children:v("usage.byBot")}),o.jsx(vU,{rows:r.bots,bots:e})]}),r.models.some(d=>d.cost===null)&&r.models.some(d=>d.cost!==null)&&o.jsx("p",{className:"jv-usage-note",children:v("usage.noteCosts")})]})]})]})}function vU({rows:e,bots:n}){return o.jsxs("table",{className:"jv-usage-table jv-usage-bots",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:"Bot"}),f4.map(([i,r])=>o.jsx("th",{scope:"col",children:v(r)},i)),o.jsx("th",{scope:"col",children:v("usage.cost")})]})}),o.jsx("tbody",{children:e.map(i=>{const r=n.find(l=>l.id===i.botId);return o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsxs("span",{className:"jv-usage-bot",children:[r&&o.jsx(_i,{color:r.color,mood:r.mood,size:22}),o.jsx("strong",{children:(r==null?void 0:r.name)??i.botId})]})}),f4.map(([l,c])=>o.jsx("td",{"data-label":v(c),title:La(i[l]),children:rg(i[l])},l)),og(i.cost)]},i.botId)})})]})}const yU=[{id:"general",label:"settings.general",icon:bN},{id:"models",label:"settings.models",icon:q9},{id:"usage",label:"settings.usage",icon:D9},{id:"secrets",label:"settings.secrets",icon:ff},{id:"network",label:"settings.network",icon:Q9},{id:"about",label:"settings.about",icon:Cg}];function xU({connections:e,bots:n,onChanged:i,onClose:r,initialTab:l="general"}){const[c,d]=w.useState(l),f=w.useRef(null);return w.useEffect(()=>{var h;(h=f.current)==null||h.scrollIntoView({block:"nearest",inline:"nearest"})},[c]),o.jsx(CS,{open:!0,onOpenChange:h=>{h||r()},children:o.jsxs(NS,{className:"jv-settings-shell","aria-describedby":void 0,children:[o.jsxs("nav",{className:"jv-settings-nav","aria-label":v("settings.sections"),children:[o.jsx(ES,{className:"jv-settings-title",children:v("settings.title")}),o.jsx("div",{className:"jv-settings-tabs",children:yU.map(h=>o.jsxs("button",{type:"button",ref:c===h.id?f:void 0,className:"jv-nav-item","aria-current":c===h.id?"page":void 0,onClick:()=>d(h.id),children:[o.jsx(h.icon,{}),v(h.label)]},h.id))})]}),o.jsx("main",{className:"jv-settings-content",children:c==="general"?o.jsx(oF,{}):c==="models"?o.jsx(uU,{connections:e,onChanged:i}):c==="usage"?o.jsx(gU,{bots:n}):c==="secrets"?o.jsx(mU,{}):c==="network"?o.jsx(fU,{}):o.jsx(rF,{})})]})})}const h4="Jarvy";let m4=null,Qi=null,ys=null;function bU(){return document.querySelector('link[rel="icon"][type="image/png"]')}function jU(e){if(!(Qi!=null&&Qi.complete)||!Qi.naturalWidth)return null;const n=64,i=document.createElement("canvas");i.width=i.height=n;const r=i.getContext("2d");if(!r)return null;r.drawImage(Qi,0,0,n,n);const l=e>9?"9+":String(e),c=l.length>1?21:18;return r.fillStyle="#e5484d",r.beginPath(),r.arc(n-c,c,c,0,Math.PI*2),r.fill(),r.fillStyle="#fff",r.font=`bold ${l.length>1?26:30}px system-ui, sans-serif`,r.textAlign="center",r.textBaseline="middle",r.fillText(l,n-c,c+2),i.toDataURL("image/png")}function p4(e){document.title=e>0?`(${e>99?"99+":e}) ${h4}`:h4;const n=bU();if(!n)return;if(m4??(m4=n.href),ys??(ys=document.querySelector('link[rel="icon"][type="image/svg+xml"]')),e<=0){n.href=m4,ys&&!ys.isConnected&&document.head.prepend(ys);return}const i=jU(e);i&&(n.href=i,ys==null||ys.remove())}function wU(e){w.useEffect(()=>{Qi||(Qi=new Image,Qi.src="/favicon.svg"),Qi.complete?p4(e):Qi.onload=()=>p4(e)},[e])}const Zd=50;function V6({chatId:e,ready:n,scroller:i,me:r,memory:l,onError:c}){const[d,f]=w.useState([]),[h,g]=w.useState(!1),[y,m]=w.useState(!1),[j,b]=w.useState(!1),k=w.useRef(d),S=w.useRef(e),N=w.useRef(0),C=w.useRef(!1),M=w.useRef(!1),E=w.useRef(0);k.current=d,S.current=e,M.current=y;const T=w.useRef(null),_=w.useRef(!1),R=w.useRef(void 0),O=w.useRef(!0),I=w.useRef(!1),P=w.useRef(null),[z,q]=w.useState(!1),$=w.useRef(0),Q=w.useRef({bottom:!0}),Y=w.useRef(null),[H]=w.useState(()=>new M6),K=w.useRef(null),V=w.useRef(!1);w.useEffect(()=>{if(f([]),m(!1),I.current=!1,O.current=!0,E.current=0,Q.current={bottom:!0},Y.current=null,!n||!e)return;let W=!0;const fe=++N.current;q(!1),$.current=0;const le=()=>{var we;W=!1,H.release(),I.current&&!V.current&&((we=k.current[0])==null?void 0:we.chatId)===e&&l.keep(e,{messages:k.current,hasOlder:M.current,place:Q.current,seen:$.current})},be=l.take(e);return be?(_.current=!0,Y.current=be.place,$.current=be.seen,f(be.messages),m(be.hasOlder),g(!1),le):(g(!0),ue.latestMessages(e,Zd).then(we=>{!W||fe!==N.current||(_.current=!0,f(we.messages),m(we.hasOlder),g(!1))}).catch(we=>{W&&(g(!1),c(we))}),le)},[e,n]);function X(W,fe){var we;if(W.chatId!==S.current)return;if(!fe){f(ve=>uu(ve,W));return}const le=k.current,be=Math.max(((we=le.at(-1))==null?void 0:we.chatId)===W.chatId?le.at(-1).sequence:0,E.current);if(D1(W,be)&&!le.some(ve=>ve.id===W.id)){Z(W.chatId).catch(c);return}E.current=Math.max(E.current,W.sequence),f(ve=>ih(ve,W))}async function Z(W){V.current=!0;try{await D(W)}finally{V.current=!1}}async function D(W){const fe=k.current[0],le=++N.current;if(!fe||fe.chatId!==W){const ve=await ue.latestMessages(W,Zd);S.current===W&&le===N.current&&(_.current=!0,f(ve.messages),m(ve.hasOlder),g(!1));return}const be=fe.sequence-1,we=await ue.messages(W,be);S.current!==W||le!==N.current||(f(ve=>N6(ve.filter(re=>re.chatId===W),we.messages,be)),g(!1))}async function se(){const W=k.current[0],fe=i.current;if(!(!W||!M.current||C.current)){C.current=!0,b(!0);try{const le=await ue.olderMessages(W.chatId,W.sequence,Zd);if(S.current!==W.chatId)return;T.current=fe?fe.scrollHeight-fe.scrollTop:null,f(be=>{var we;return((we=be[0])==null?void 0:we.id)===W.id?[...le.messages,...be]:be}),m(le.hasOlder)}catch(le){c(le)}finally{C.current=!1,b(!1)}}}w.useEffect(()=>{const W=i.current;if(!W)return;let fe=0;const le=()=>{cancelAnimationFrame(fe),fe=requestAnimationFrame(()=>{I.current&&W.clientHeight&&!H.on&&(Q.current=T6(W,160))})},be=new ResizeObserver(()=>{if(le(),!!I.current){if(W.scrollHeight-W.clientHeight<8){re();return}O.current&&(W.scrollHeight-W.scrollTop-W.clientHeight<8||W.scrollTo({top:W.scrollHeight,behavior:"instant"}))}}),we=()=>{be.disconnect(),be.observe(W);for(const Ce of W.children)be.observe(Ce)};we();const ve=new MutationObserver(we);ve.observe(W,{childList:!0});const re=()=>{var Ce;if(!I.current){O.current=!0,q(!1);return}H.on||(O.current=W.scrollHeight-W.scrollTop-W.clientHeight<160,q(!O.current),O.current&&($.current=((Ce=k.current.at(-1))==null?void 0:Ce.sequence)??0),le())};return re(),W.addEventListener("scroll",re,{passive:!0}),()=>{be.disconnect(),ve.disconnect(),W.removeEventListener("scroll",re),cancelAnimationFrame(fe)}},[i.current,e]),w.useLayoutEffect(()=>{const W=i.current,fe=d.at(-1);if(W){if(K.current){const{id:le,passage:be}=K.current,we=W.querySelector(`[data-message="${le}"]`);K.current=null,Y.current=null,_.current=!1,R.current=fe==null?void 0:fe.id,we&&(I.current=!0,O.current=!1,q(!0),Nf(we,be));return}if(T.current!==null)W.scrollTo({top:W.scrollHeight-T.current,behavior:"instant"}),T.current=null;else if(Y.current&&d.length&&Mf(W,Y.current))Q.current=Y.current,H.start(W,Y.current),Y.current=null,_.current=!1,I.current=!0,O.current=!1,q(!0);else if(_.current&&d.length){Y.current=null;const le=()=>W.scrollTo({top:W.scrollHeight,behavior:"instant"});le(),requestAnimationFrame(le),_.current=!1,I.current=!0,O.current=!0}else fe&&fe.id!==R.current&&(O.current||fe.senderId===r)&&(H.release(),W.scrollTo({top:W.scrollHeight,behavior:"smooth"}));R.current=fe==null?void 0:fe.id,O.current&&($.current=(fe==null?void 0:fe.sequence)??0)}},[d]),w.useEffect(()=>{const W=i.current,fe=P.current;if(!W||!fe||!y||!I.current)return;const le=new IntersectionObserver(be=>{var we;(we=be[0])!=null&&we.isIntersecting&&I.current&&se()},{root:W,rootMargin:"400px 0px 0px 0px"});return le.observe(fe),()=>le.disconnect()},[y,d,e,h]);async function ne(W,fe){var Pe;if(H.release(),k.current.some(Ze=>Ze.id===W)){B(W,fe);return}const be=S.current,we=await ue.message(W);if(we.chatId!==be)return we.chatId;const ve=++N.current,[re,Ce]=await Promise.all([ue.olderMessages(we.chatId,we.sequence,Zd),ue.messages(we.chatId,we.sequence-1)]);if(S.current!==we.chatId||ve!==N.current)return;const Ve=((Pe=Ce.messages.at(-1))==null?void 0:Pe.sequence)??we.sequence;K.current={id:W,passage:fe},E.current=0,f(Ze=>[...re.messages,...Ce.messages,...Ze.filter(Fe=>Fe.chatId===we.chatId&&Fe.sequence>Ve)]),m(re.hasOlder)}function B(W,fe){var be;H.release();const le=(be=i.current)==null?void 0:be.querySelector(`[data-message="${W}"]`);le&&Nf(le,fe)}const F=z?d.filter(W=>W.sequence>$.current&&W.senderId!==r).length:0;return{messages:d,setMessages:f,loading:h,hasOlder:y,loadingOlder:j,refresh:Z,heard:X,top:P,away:z,unseen:F,toLatest:()=>{H.release();const W=i.current;W==null||W.scrollTo({top:W.scrollHeight,behavior:"smooth"})},toMessage:ne,cancel:()=>{N.current++}}}function kU({ready:e,selected:n,messages:i,chats:r,chatList:l,setChats:c,onError:d}){const f=r.find(h=>h.id===n);w.useEffect(()=>{const h=n,g=i.at(-1);if(!e||!h||!g||g.chatId!==h)return;const y=()=>{const m=l.current.find(j=>j.id===h);document.visibilityState!=="visible"||((m==null?void 0:m.readSequence)??0)>=g.sequence&&!(m!=null&&m.hint)&&!(m!=null&&m.alerts)||G6(c,h,g.sequence,d)};return y(),document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[i,n,e,f==null?void 0:f.readSequence,f==null?void 0:f.alerts,f==null?void 0:f.hint])}function G6(e,n,i,r){e(l=>l.map(c=>c.id===n?{...c,readSequence:Math.max(c.readSequence,i),unread:0,mentions:0,alerts:0,atMe:!1,hint:null}:c)),ue.markRead(n,i).catch(r)}const g4="jarvy-seen-failure";function SU(e,n){const i=e!=null&&e.error?`${e.botId}:${e.runId??""}:${e.error}`:null,[r,l]=w.useState(()=>localStorage.getItem(g4));return{call:i&&i!==r?"error":(e==null?void 0:e.activity)==="asking"?"ask":n!=null&&n.alerts&&(e==null?void 0:e.status)!=="running"?"reply":null,seen:()=>{i&&(localStorage.setItem(g4,i),l(i))}}}const v4={mark:"M12 5v14M12 29h0",ask:"M6.5 10a5.5 5.5 0 1 1 8.2 4.8c-1.7 1-2.7 2.1-2.7 3.9v.6M12 29h0"};function Y6({call:e}){if(!e)return null;const n=e==="ask"?v4.ask:v4.mark;return o.jsx("span",{className:"jv-call","data-call":e,"aria-hidden":"true",children:o.jsxs("svg",{viewBox:"0 0 24 36",children:[o.jsx("path",{className:"jv-call-edge",d:n}),o.jsx("path",{d:n})]})})}const y4=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function CU({view:e,onView:n,agent:i,figure:r,call:l,asleep:c,alerts:d,username:f,accountMenu:h,onToggleAccount:g,onSettings:y,onToggleTheme:m,onLogOut:j}){const b=w.useRef(null),k=w.useRef(null),S=w.useRef(null);w.useEffect(()=>b.current&&r.live?r.stage.add(b.current,.74,!1):void 0,[r.live,!!i]),w.useEffect(()=>{if(!h)return;const C=M=>{var T,_;const E=M.target;!((T=k.current)!=null&&T.contains(E))&&!((_=S.current)!=null&&_.contains(E))&&g(!1)};return document.addEventListener("pointerdown",C),()=>document.removeEventListener("pointerdown",C)},[h]);const N=r.stage.persona;return o.jsxs(o.Fragment,{children:[o.jsxs("nav",{className:"jv-rail","aria-label":v("rail.label"),children:[o.jsxs("div",{className:"jv-rail-top",children:[i&&o.jsxs("button",{type:"button",className:"jv-rail-item jv-rail-agent","data-still":!r.live||void 0,"aria-current":e==="home"?"page":void 0,title:i.name,onPointerEnter:C=>{C.pointerType==="mouse"&&(r.stage.near=!0,!y4()&&!N.playing&&N.play("look",performance.now()))},onPointerLeave:()=>{r.stage.near=!1},onClick:()=>{y4()||N.play("hop",performance.now()),n("home")},children:[r.live?o.jsx("canvas",{ref:b,"aria-hidden":"true"}):o.jsx(_i,{color:i.color,mood:l==="error"?"dizzy":i.mood,size:30,crown:i.agent,asleep:c}),o.jsx(Y6,{call:l}),l&&o.jsx("span",{className:"sr-only",children:v(`home.call.${l}`)}),o.jsx("span",{className:"jv-rail-label",children:i.name})]}),o.jsxs("button",{type:"button",className:"jv-rail-item","aria-current":e==="chats"?"page":void 0,title:v("rail.chats"),onClick:()=>n("chats"),children:[o.jsx(Ng,{"aria-hidden":"true"}),d>0&&o.jsx("span",{className:"jv-rail-dot",role:"status","aria-label":v("sidebar.alerts",{count:d})}),o.jsx("span",{className:"jv-rail-label",children:v("rail.chats")})]}),o.jsxs("button",{type:"button",className:"jv-rail-item","aria-current":e==="envs"?"page":void 0,title:v("rail.environments"),onClick:()=>n("envs"),children:[o.jsx(r3,{"aria-hidden":"true"}),o.jsx("span",{className:"jv-rail-label",children:v("rail.environments")})]})]}),o.jsx("button",{ref:S,type:"button",className:"jv-rail-item jv-rail-account","aria-label":v("account.menuFor",{name:f}),title:f,"aria-expanded":h,onClick:()=>g(!h),children:o.jsx("span",{className:"ui-user-avatar",children:o.jsx("span",{children:f.slice(0,2).toUpperCase()})})})]}),h&&o.jsxs("div",{ref:k,className:"ui-popover jarvy-account-menu",role:"menu","aria-label":v("account.menu"),children:[o.jsx("div",{className:"ui-menu-note ui-small",children:f}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:y,children:[o.jsx(qe,{name:"gear"}),o.jsx("span",{className:"ui-menu-copy",children:v("settings.title")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:m,children:[o.jsx(qe,{name:"moon"}),o.jsx("span",{className:"ui-menu-copy",children:v("account.toggleTheme")})]}),o.jsx("hr",{className:"ui-menu-divider"}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:j,children:[o.jsx(qe,{name:"arrow-bracket-to-left"}),o.jsx("span",{className:"ui-menu-copy",children:v("account.signOut")})]})]})]})}const x4=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,NU=".jv-dock, .jv-npc, .jv-home-cat, .ui-popover, dialog, [role=dialog]",EU=".jv-emoji-menu, .ui-popover, dialog[open], [role=dialog]";function TU({bot:e,chat:n,meId:i,members:r,drafts:l,live:c,dockRef:d,opener:f,onOpenDm:h,ensureDm:g,onRead:y,onSent:m,onPreview:j,onNotice:b,onError:k}){var se,ne;const[S,N]=w.useState(null),C=w.useRef(0),M=w.useRef(null),[E]=w.useState(()=>new E6),T=(n==null?void 0:n.id)??null,_=S==="open",R=V6({chatId:T,ready:S!==null,scroller:M,me:i,memory:E,onError:k}),{messages:O,setMessages:I}=R;z1(c,B=>{if(B.kind==="reconnected"){S&&T&&R.refresh(T).catch(k);return}B.kind!=="chat"&&S&&R.heard(B.message,B.kind==="message")}),w.useLayoutEffect(()=>{const B=M.current;if(!B)return;const F=B.querySelectorAll(":scope > [data-message]"),ee=F[Math.max(0,F.length-2)];B.style.setProperty("--fit",ee?`${Math.ceil(B.scrollHeight-ee.offsetTop+8)}px`:"0px")},[O,_]);const P=O.at(-1);w.useEffect(()=>{if(!_||!n||!P||n.readSequence>=P.sequence&&!n.alerts)return;const B=()=>{document.visibilityState==="visible"&&y(n,P.sequence)};return B(),document.addEventListener("visibilitychange",B),()=>document.removeEventListener("visibilitychange",B)},[_,P==null?void 0:P.sequence,n==null?void 0:n.readSequence,n==null?void 0:n.alerts]);function z(){clearTimeout(C.current),E.clear(),N("open"),n||g().catch(k),setTimeout(()=>{var B,F;return(F=(B=d.current)==null?void 0:B.querySelector("textarea"))==null?void 0:F.focus({preventScroll:!0})},x4()?0:200)}f.current=z;function q(){var B,F;(F=(B=document.activeElement)==null?void 0:B.blur)==null||F.call(B),N("closing"),C.current=window.setTimeout(()=>N(null),x4()?0:320)}w.useEffect(()=>()=>clearTimeout(C.current),[]);const $=g6(l,T??""),Q=!((se=$.text)!=null&&se.trim())&&!$.files.length&&!$.quote&&!$.passages.length;w.useEffect(()=>{if(!_||!Q)return;const B=F=>{var ee,W;(W=(ee=F.target).closest)!=null&&W.call(ee,NU)||q()};return document.addEventListener("pointerdown",B),()=>document.removeEventListener("pointerdown",B)},[_,Q]);async function Y(B,F,ee,W,fe){const le=n??await g(),be=await ue.send(le.id,B,F,ee,!1,W,fe);R.heard(be,!0),m(be)}const H=B=>I(F=>F.map(ee=>ee.id===B.id?{...ee,...B}:ee));async function K(B,F,ee){try{const W=await ue.react(B.id,F,ee);H({...B,reactions:W.reactions})}catch(W){k(W)}}async function V(B,F){try{const ee=await ue.fold(B.id,F);H({...B,folded:ee.folded})}catch(ee){k(ee)}}const X=(B,F)=>B?void R.toMessage(B,F).catch(()=>b(v("app.sourceGone"))):b(v("app.sourceGone")),Z=_?(ne=[...O].reverse().find(B=>{var F;return((F=B.question)==null?void 0:F.state)==="pending"}))==null?void 0:ne.id:void 0,D=!!e.connectionId;return o.jsxs("div",{ref:d,className:"jv-dock","data-state":S??void 0,onKeyDown:B=>{B.key==="Escape"&&_&&!B.defaultPrevented&&!document.querySelector(EU)&&(B.preventDefault(),q())},children:[o.jsx("div",{className:"jv-dock-wrap",children:o.jsxs("div",{ref:M,className:"ui-transcript jv-dock-log",role:"log","aria-label":v("home.recent"),"aria-hidden":!_,children:[R.hasOlder&&o.jsx("div",{ref:R.top,className:"jv-history-more","aria-live":"polite",children:R.loadingOlder?v("chat.loadingOlder"):""}),o.jsx(v6,{messages:O,members:r,me:i,activeQuestion:Z,bot:e,onSettled:H,onPreview:j,onQuote:B=>R1(l,B,r),onReact:(B,F,ee)=>void K(B,F,ee),onFold:(B,F)=>void V(B,F),onJump:X,onError:k})]})}),o.jsxs("div",{className:"jv-dock-bar",children:[o.jsx("button",{type:"button",className:"jv-dock-icon",title:v("home.talk",{name:e.name}),"aria-label":v("home.talk",{name:e.name}),"aria-expanded":_,tabIndex:_?-1:0,onClick:z,children:o.jsx(Ng,{"aria-hidden":"true"})}),o.jsx("div",{className:"jv-dock-input","aria-hidden":!_,inert:!_,children:n&&o.jsx(O1,{chatId:n.id,id:"jv-dock-composer",drafts:l,scrollRef:M,disabled:!D,placeholder:D?v("chat.toBot",{name:e.name}):v("chat.pickModel"),onSend:Y,onError:k,onNotice:b,extra:o.jsx("button",{type:"button",className:"jv-dock-go",title:v("home.openDm"),"aria-label":v("home.openDm"),onClick:h,children:o.jsx(Uc,{"aria-hidden":"true"})})})})]}),n&&_&&o.jsx(_1,{container:M,drafts:l,chatId:n.id,source:B=>O.find(F=>F.id===B),members:r,onNotice:b})]})}const MU=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,AU=()=>1;function _U({bot:e,chat:n,status:i,figure:r,call:l,onSeen:c,meId:d,members:f,drafts:h,live:g,onOpenDm:y,onBotInfo:m,ensureDm:j,onRead:b,onPreview:k,onNotice:S,onError:N}){var X;const C=w.useRef(null),M=w.useRef(null),E=w.useRef(null),T=w.useRef(null),_=w.useRef(null),R=w.useRef(null),[O,I]=w.useState(),P=r.stage,z=k6(e.id,(n==null?void 0:n.id)??null,e.mood,ah(i));Object.assign(P.input,{motion:z.motion,fast:z.fast,mood:l==="error"?"dizzy":z.mood}),x6(P.persona,z,(n==null?void 0:n.id)??null,O);const q=i!=null&&i.error?`${i.runId??""}:${i.error}`:null;w.useEffect(()=>{(q||z.shake)&&P.shake()},[q,z.shake]);const[$,Q]=w.useState(null),Y=!!q&&$===q;w.useEffect(()=>{if(!Y)return;const Z=se=>{var ne,B;(B=(ne=se.target).closest)!=null&&B.call(ne,".jv-npc, .jv-home-cat")||Q(null)},D=se=>{se.key==="Escape"&&Q(null)};return document.addEventListener("pointerdown",Z),document.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",Z),document.removeEventListener("keydown",D)}},[Y]);const H=Y&&i&&q?{...z.view,shown:RU(q,mS(i)),done:null}:((X=z.view.shown)==null?void 0:X.icon)==="ask"&&!z.view.shown.to?{...z.view,shown:{...z.view.shown,hint:v("home.answerInDm")}}:z.view;function K(){var Z;MU()||P.persona.play("poke",performance.now()),l==="reply"?(Z=R.current)==null||Z.call(R):l==="ask"?y():l==="error"?(c(),Q(q)):z.canRecap?z.showRecap():m()}w.useEffect(()=>E.current&&r.live?P.add(E.current,.9):void 0,[r.live]),w.useLayoutEffect(()=>{const Z=new ResizeObserver(()=>{var D;return(D=_.current)==null?void 0:D.call(_)});for(const D of[C.current,T.current])D&&Z.observe(D);return()=>Z.disconnect()},[]);const V=i!=null&&i.error?"error":(i==null?void 0:i.status)==="running"?"running":!i||i.status==="stop"?"stopped":"idle";return o.jsxs("section",{ref:C,className:"jv-home","aria-label":e.name,children:[o.jsxs("div",{ref:M,className:"jv-home-figure",children:[o.jsxs("button",{type:"button",className:"jv-home-cat","data-still":!r.live||void 0,title:e.name,onClick:K,"aria-label":l?`${v(`home.call.${l}`)}, ${e.name}`:v("avatar.openInfo",{name:e.name}),children:[r.live?o.jsx("canvas",{ref:E,"aria-hidden":"true"}):o.jsx(_i,{color:e.color,mood:l==="error"?"dizzy":z.mood,size:168,crown:e.agent,asleep:z.motion==="sleep"}),l?o.jsx(Y6,{call:l}):o.jsx(C6,{motion:z.motion})]}),o.jsx("h1",{className:"jv-home-name",children:e.name}),o.jsx("p",{className:"sr-only",role:"status",children:V==="idle"?"":v(V==="error"?"activity.error":V==="running"?"activity.running":"activity.stopped")})]}),o.jsx(j6,{view:H,name:e.name,cat:M,area:C,avoid:T,layout:_,facing:AU,onHint:y}),o.jsx(TU,{bot:e,chat:n,meId:d,members:f,drafts:h,live:g,dockRef:T,opener:R,onOpenDm:y,ensureDm:j,onRead:b,onSent:Z=>I(Z.id),onPreview:k,onNotice:S,onError:N})]})}const RU=(e,n)=>({id:`failure:${e}`,look:"speech",icon:"say",state:"failed",startedAt:0,endedAt:0,depth:0,title:n,line:v("home.failed",{reason:n})});function OU(e,n,i){const[r]=w.useState(()=>new y6),[l,c]=w.useState(!1);if(e){const d=ah(n);r.color=(Ni[e.color]??Ni.gray).hex,r.crown=e.agent,Object.assign(r.input,{motion:d.motion,fast:d.fast,mood:i?"dizzy":e.mood})}return w.useEffect(()=>{if(!e)return;const d={x:-1,y:-1},f=h=>{d.x=h.clientX,d.y=h.clientY};return window.addEventListener("pointermove",f),r.onFrame=()=>{const h=r.largest();if(!h||d.x<0)return;const g=h.getBoundingClientRect(),y=g.width>100?320:220;r.input.lookX=Math.max(-1,Math.min(1,(d.x-g.left-g.width/2)/y)),r.input.lookY=Math.max(-1,Math.min(1,(d.y-g.top-g.height/2)/y))},c(r.start()),()=>{window.removeEventListener("pointermove",f),r.onFrame=null,r.stop()}},[!!e]),{stage:r,live:l}}function zU({onCancel:e,onSaved:n}){const[i,r]=w.useState(""),[l,c]=w.useState("22"),[d,f]=w.useState(""),[h,g]=w.useState(""),[y,m]=w.useState(""),[j,b]=w.useState(""),[k,S]=w.useState(null),[N,C]=w.useState(""),[M,E]=w.useState(!1),[T,_]=w.useState("password"),{busy:R,error:O,setError:I,run:P}=An(),z=RS(!!k&&T==="key"),q={host:i.trim(),port:Number(l)||22,user:d.trim()},$=H=>P("add",async()=>{try{await H()}catch(K){throw K instanceof er&&K.code==="ssh_key_expired"&&z.renew(),K}}),Q=H=>{H.preventDefault(),$(k?async()=>n(await ue.addMachine({...q,name:h.trim(),directory:y.trim(),description:j.trim(),hostKeys:k,...T==="key"?{keyId:z.key.keyId}:{password:N}})):async()=>S(await ue.scanMachine(q)))},Y=q.user&&q.host?`${q.user}@${q.host}`:"";return o.jsxs("form",{className:"jv-panel jv-machine-form",autoComplete:"off",onSubmit:Q,"aria-label":v("machines.add"),"aria-busy":R||void 0,children:[k?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"jv-machine-where",children:[h.trim()&&o.jsx("strong",{children:h.trim()}),o.jsxs("code",{children:[q.user,"@",q.host,q.port===22?"":`:${q.port}`]})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("machines.fingerprint")}),o.jsx("div",{className:"jv-machine-prints",children:k.fingerprints.map(H=>o.jsx("code",{children:H},H))}),o.jsx("span",{className:"jv-field-hint",children:v("machines.fingerprintHint")})]}),o.jsx("div",{className:"jv-seg jv-machine-login",role:"radiogroup","aria-label":v("machines.login"),children:["password","key"].map(H=>o.jsx("button",{type:"button",role:"radio","aria-checked":T===H,disabled:R,onClick:()=>{_(H),I("")},children:v(H==="password"?"machines.byPassword":"machines.byKey")},H))}),T==="password"?o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.password")}),o.jsx(nh,{value:N,visible:M,onChange:C,onVisible:E,required:!0,warnShort:!1}),o.jsx("span",{className:"jv-field-hint",children:v("machines.passwordHint")})]}):o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:v("machines.publicKey")}),z.key?o.jsx(S1,{publicKey:z.key.publicKey}):z.error?o.jsx("p",{className:"jv-note-error",role:"alert",children:z.error}):o.jsx("p",{className:"jv-hint",children:"…"}),o.jsx("span",{className:"jv-field-hint",children:v("machines.keyHint",{user:q.user})})]})]}):o.jsxs("div",{className:"jv-machine-fields",children:[o.jsxs("div",{className:"jv-machine-address",children:[o.jsxs("label",{className:"jv-field jv-machine-host",children:[o.jsx("span",{children:v("machines.host")}),o.jsx(Nt,{required:!0,autoFocus:!0,maxLength:253,spellCheck:!1,placeholder:v("machines.hostPlaceholder"),value:i,onChange:H=>r(H.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-port",children:[o.jsx("span",{children:v("machines.port")}),o.jsx(Nt,{required:!0,inputMode:"numeric",maxLength:5,value:l,onChange:H=>c(H.target.value.replace(/\D/g,""))})]})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.user")}),o.jsx(Nt,{required:!0,maxLength:64,spellCheck:!1,autoCapitalize:"off",value:d,onChange:H=>f(H.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:v("machines.name")}),o.jsx(Nt,{maxLength:40,placeholder:Y,value:h,onChange:H=>g(H.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-wide",children:[o.jsx("span",{children:v("machines.directory")}),o.jsx(Nt,{className:"jv-mono",maxLength:1e3,spellCheck:!1,placeholder:v("machines.directoryPlaceholder"),value:y,onChange:H=>m(H.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-wide",children:[o.jsx("span",{children:v("machines.description")}),o.jsx(_l,{maxLength:2e3,rows:3,placeholder:v("machines.descriptionPlaceholder"),value:j,onChange:H=>b(H.target.value)})]})]}),O&&o.jsx("p",{className:"jv-note-error",role:"alert",children:O}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",disabled:R,onClick:()=>{k?(S(null),C(""),I("")):e()},children:v(k?"machines.back":"common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:R||!q.host||!q.user||!!k&&(T==="key"?!z.key:!N),children:v(k?T==="key"?R?"machines.verifying":"machines.verify":R?"machines.connecting":"machines.connect":R?"machines.scanning":"machines.next")})]})]})}let b0=null;const j0=3;function DU({bots:e,statuses:n,adding:i,onAdding:r,onSaved:l}){const[c,d]=w.useState(null),[f,h]=w.useState(null),[g,y]=w.useState(b0),[m,j]=w.useState(i);w.useEffect(()=>{ue.machines().then(P=>d(P.machines)).catch(P=>h(Gt(P)))},[]),w.useEffect(()=>{i&&j(!0)},[i]);const b=e.filter(P=>P.environment.computer),k=P=>e.filter(z=>z.environment.current==="ssh"&&z.environment.currentName===P.name),S=P=>P.environment.current==="computer"?[P]:[],N=(g==null?void 0:g.kind)==="machine"?c==null?void 0:c.find(P=>P.id===g.id):void 0,C=(g==null?void 0:g.kind)==="sandbox"?b.find(P=>P.id===g.id):void 0,M=!N&&!C,E=i?void 0:N??(M?c==null?void 0:c[0]:void 0),T=i||E?void 0:C??(M&&(c||f)?b[0]:void 0),_=P=>{b0=P,y(P),r(!1),j(!0)},R=E?k(E):T?S(T):[],O=T&&n[T.id],I=P=>o.jsx(LU,{bots:P,statuses:n});return o.jsxs("section",{className:"jv-envs","data-open":m||void 0,"aria-label":v("rail.environments"),children:[o.jsxs("aside",{className:"jv-envs-list",children:[o.jsxs("header",{className:"jv-envs-list-head",children:[o.jsx("h2",{children:v("rail.environments")}),o.jsx(vt,{icon:"add",label:v("machines.add"),"aria-pressed":i,onClick:()=>{r(!0),j(!0)}})]}),o.jsxs("div",{className:"jv-envs-scroll",children:[c==null?void 0:c.map(P=>o.jsxs("button",{type:"button",className:"jv-envs-row","aria-current":(E==null?void 0:E.id)===P.id||void 0,onClick:()=>_({kind:"machine",id:P.id}),children:[o.jsx(Jd,{type:"ssh"}),o.jsxs("span",{className:"jv-envs-text",children:[o.jsx("strong",{children:P.name}),o.jsx("span",{className:"jv-mono",children:cg(P)})]}),I(k(P)),o.jsx("span",{className:"jv-envs-state"})]},P.id)),b.map(P=>{const z=P.environment.computer;return o.jsxs("button",{type:"button",className:"jv-envs-row","aria-current":(T==null?void 0:T.id)===P.id||void 0,onClick:()=>_({kind:"sandbox",id:P.id}),children:[o.jsx(Jd,{type:z.type}),o.jsxs("span",{className:"jv-envs-text",children:[o.jsx("strong",{children:v("envs.sandboxOf",{name:P.name})}),o.jsx("span",{children:v(z.type==="vm"?"environment.type.vm":"environment.type.container")})]}),I(S(P)),o.jsx("span",{className:"jv-envs-state","data-state":z.state,role:"img","aria-label":v(lg[z.state]),title:v(lg[z.state])})]},P.id)}),f&&o.jsx("p",{className:"jv-note-error",role:"alert",children:f})]})]}),o.jsxs("main",{className:"jv-envs-detail jv-ui",children:[o.jsxs("header",{className:"jv-envs-head",children:[o.jsx("button",{type:"button",className:"jv-envs-back","aria-label":v("envs.back"),onClick:()=>{j(!1),r(!1)},children:o.jsx(jg,{"aria-hidden":"true"})}),i?o.jsx("h2",{children:v("machines.add")}):E?o.jsxs(o.Fragment,{children:[o.jsx(Jd,{type:"ssh"}),o.jsx("h2",{children:E.name}),o.jsx("span",{className:"jv-envs-sub jv-mono",children:cg(E)})]}):T?o.jsxs(o.Fragment,{children:[o.jsx(Jd,{type:T.environment.computer.type}),o.jsx("h2",{children:v("envs.sandboxOf",{name:T.name})})]}):null]}),o.jsxs("div",{className:"jv-envs-body",children:[!i&&R.length>0&&o.jsxs("p",{className:"jv-envs-here",children:[I(R),v("envs.workingHere",{names:R.map(P=>P.name).join(v("common.listSeparator")),count:R.length})]}),i?o.jsx(zU,{onCancel:()=>{r(!1),j(!1)},onSaved:P=>{d(z=>[...z??[],P]),_({kind:"machine",id:P.id})}}):E?o.jsx(yq,{machine:E,bots:e,onChanged:P=>d(z=>z&&z.map(q=>q.id===P.id?P:q)),onDeleted:()=>{b0=null,y(null),j(!1),d(P=>P&&P.filter(z=>z.id!==E.id))}},E.id):T?o.jsxs(o.Fragment,{children:[o.jsx(AS,{bot:T,onSaved:l,heading:!1},T.id),o.jsx(LS,{bot:T,runs:`${(O==null?void 0:O.status)??"stop"}:${(O==null?void 0:O.runId)??""}`},`ports-${T.id}`)]}):null]})]})]})}function Jd({type:e}){const n=e==="ssh"?El:e==="vm"?lN:I9;return o.jsx("span",{className:"jv-envs-icon","data-kind":e,children:o.jsx(n,{"aria-hidden":"true"})})}function LU({bots:e,statuses:n}){return o.jsxs("span",{className:"jv-envs-faces",title:e.map(i=>i.name).join(v("common.listSeparator"))||void 0,children:[e.slice(0,j0).map(i=>{var r;return o.jsx(_i,{color:i.color,mood:i.mood,size:22,crown:i.agent,asleep:((r=n[i.id])==null?void 0:r.status)==="stop"},i.id)}),e.length>j0&&o.jsxs("span",{className:"jv-envs-more",children:["+",e.length-j0]})]})}function BU({onLogin:e}){const[n,i]=w.useState(""),[r,l]=w.useState(""),[c,d]=w.useState(!1),[f,h]=w.useState(!1),[g,y]=w.useState(null),[m,j]=w.useState(document.documentElement.classList.contains("dark"));async function b(k){if(k.preventDefault(),!f){h(!0),y(null);try{const S=await ue.login(n.trim(),r);l(""),e(S.username)}catch(S){y(S instanceof er&&S.status===401?"login.wrong":S instanceof er&&S.status===429?"login.tooMany":"login.offline")}finally{h(!1)}}}return o.jsxs("div",{className:"jv-login",children:[o.jsxs("div",{className:"jv-login-corner",children:[o.jsx("div",{className:"jv-login-locales",role:"group","aria-label":v("general.language"),children:w4.map(k=>o.jsx("button",{type:"button",lang:k,"aria-pressed":Wi()===k,title:k0(k,"name"),onClick:()=>C4(k),children:k0(k,"short")},k))}),o.jsx("button",{className:"jv-login-theme",type:"button",onClick:()=>{Sf(m?"light":"dark"),j(!m)},"aria-label":v(m?"login.themeLight":"login.themeDark"),children:o.jsx(qe,{name:m?"sun":"moon"})})]}),o.jsx("main",{className:"jv-login-stage",children:o.jsxs("div",{className:"jv-login-wrap",children:[o.jsxs("header",{className:"jv-login-brand",children:[o.jsx("img",{className:"jv-login-logo",src:"/icon.svg",alt:"",width:64,height:64}),o.jsx("h1",{children:"Jarvy"}),o.jsx("p",{children:v("login.subtitle")})]}),o.jsxs("form",{className:"jv-login-form",onSubmit:k=>void b(k),"aria-label":v("login.form"),"aria-busy":f,children:[o.jsxs("div",{className:"jv-login-field",children:[o.jsx("label",{htmlFor:"login-username",children:v("login.username")}),o.jsx("input",{id:"login-username",autoComplete:"username",autoFocus:!0,required:!0,disabled:f,value:n,onChange:k=>i(k.target.value)})]}),o.jsxs("div",{className:"jv-login-field",children:[o.jsx("label",{htmlFor:"login-password",children:v("login.password")}),o.jsxs("div",{className:"jv-login-password",children:[o.jsx("input",{id:"login-password",type:c?"text":"password",autoComplete:"current-password",required:!0,disabled:f,value:r,onChange:k=>l(k.target.value)}),o.jsx("button",{type:"button",className:"jv-login-visibility","aria-label":v(c?"login.hidePassword":"login.showPassword"),onClick:()=>d(!c),children:o.jsx(qe,{name:c?"eye-slash":"eye"})})]})]}),g&&o.jsx("p",{className:"jv-login-error",role:"alert",children:v(g)}),o.jsx("button",{className:"jv-login-submit",type:"submit",disabled:f,children:v(f?"login.submitting":"login.submit")})]})]})})]})}function IU({selected:e,chats:n,transcript:i,openChat:r,setPane:l,paneRef:c,blocked:d}){const[f,h]=w.useState(null),[g,y]=w.useState(0);w.useEffect(()=>{var b;!f||e!==f.chatId||i.loading||((b=i.messages[0])==null?void 0:b.chatId)!==f.chatId||(i.toMessage(f.id,f.passage),h(null))},[f,e,i.loading,i.messages]);function m(b,k,S){if(b.type==="thread"){const T=n.find(_=>_.id===b.parentId);T&&r(T),l({kind:"thread",id:b.id,parentId:b.parentId,mode:"pane",focus:{id:k,passage:S}});return}const N=c.current,C=window.matchMedia("(max-width: 760px)").matches,M=(N==null?void 0:N.kind)==="thread"&&(C||N.mode==="full")||(N==null?void 0:N.kind)==="search"&&C;M&&l(null);const E=b.id===e;r(b),E&&!M?i.toMessage(k,S):h({chatId:b.id,id:k,passage:S})}function j(b){l({kind:"search",chat:b}),y(k=>k+1)}return w.useEffect(()=>{const b=k=>{var N,C;if(d||k.defaultPrevented||!(k.ctrlKey||k.metaKey)||k.key.toLowerCase()!=="f")return;const S=n.find(M=>M.id===e);S&&(((N=c.current)==null?void 0:N.kind)==="search"&&((C=document.activeElement)!=null&&C.closest(".jv-search-pane"))||(k.preventDefault(),j(S)))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[d,n,e]),{openMessage:m,search:j,focusKey:g}}const qU=45e3,PU=25e3;function HU(e,n,i){let r,l=Date.now(),c="";const d=()=>{r==null||r.close(),l=Date.now();const y=new EventSource(c?`${e}?after=${encodeURIComponent(c)}`:e);y.addEventListener("heartbeat",()=>{l=Date.now()});for(const[m,j]of Object.entries(n))y.addEventListener(m,b=>{l=Date.now();const k=b;k.lastEventId&&(c=k.lastEventId),j(k)});y.onerror=i,r=y},f=y=>{Date.now()-l>y&&d()},h=setInterval(()=>f(qU),1e4),g=()=>{document.visibilityState==="visible"&&f(PU)};return window.addEventListener("online",d),document.addEventListener("visibilitychange",g),window.addEventListener("pageshow",g),d(),()=>{clearInterval(h),window.removeEventListener("online",d),document.removeEventListener("visibilitychange",g),window.removeEventListener("pageshow",g),r==null||r.close()}}function FU(e,n){let i=null,r=Promise.resolve();return()=>i??(i=new Promise((l,c)=>setTimeout(()=>{r=r.then(()=>{i=null;const d=e();return d.then(l,c),d.catch(()=>{})})},n)))}const UU=null;function b4(){var ln,pr,eo,ti,gr,Fo;const[e,n]=w.useState("loading"),[i,r]=w.useState(""),[l,c]=w.useState([]),[d,f]=w.useState({}),h=w.useRef(new Map),[g,y]=w.useState([]),[m,j]=w.useState([]),[b,k]=w.useState([]),[S,N]=w.useState(null),[C,M]=w.useState({}),[E,T]=w.useState(null),[_,R]=w.useState(null),[O,I]=w.useState(null),[P,z]=w.useState(null),q=(U,pe)=>z(Ae=>(Ae==null?void 0:Ae.id)===U.id?null:{id:U.id,anchor:pe}),$=()=>z(null),[Q,Y]=w.useState([]),[H,K]=w.useState(null),[V,X]=w.useState(!1),[Z,D]=w.useState(!1),[se,ne]=w.useState(!1),[B,F]=w.useState(""),[ee,W]=w.useState(!1),[fe,le]=w.useState(null),[be,we]=w.useState(()=>{const U=localStorage.getItem("jarvy-view");return U==="home"||U==="envs"?U:"chats"}),[ve,re]=w.useState(!1);w.useEffect(()=>{localStorage.setItem("jarvy-view",be)},[be]);const[Ce,Ve]=w.useState(!1),[Pe,Ze]=w.useState(420),[Fe,Ke]=w.useState(i4),[gt,Ht]=w.useState(null),[Jt]=w.useState(()=>new QH),[tn]=w.useState(()=>new _H),[kn]=w.useState(()=>new E6);w.useEffect(()=>tn.on(U=>kn.heard(U)),[tn,kn]);const[vn,on]=w.useState(""),ge=w.useRef(null),Me=w.useRef(null),Xe=w.useRef(null),[Je,rt]=w.useState(null),[Wt,_n]=w.useState(null),[dn,Ln]=w.useState(null),me=w.useRef(E);me.current=E;const Ee=w.useRef(0),_e=w.useRef(g);_e.current=g;const Be=w.useRef(fe);Be.current=fe;const ze=w.useMemo(()=>new RP(OP(i)),[i]);w.useEffect(()=>{const U=()=>ze.save();return window.addEventListener("pagehide",U),()=>window.removeEventListener("pagehide",U)},[ze]);const dt=((ln=b.find(U=>U.kind==="user"&&U.name===i))==null?void 0:ln.id)??"",ta=w.useRef(dt);ta.current=dt;const Rn=V6({chatId:E,ready:e==="ready",scroller:ge,me:dt,memory:kn,onError:ft}),{messages:yn,setMessages:lr}=Rn,Ri=IU({selected:E,chats:g,transcript:Rn,openChat:ha,setPane:le,paneRef:Be,blocked:!!O||!!H}),Xr=((pr=g.find(U=>U.id===E))==null?void 0:pr.botId)??_??((eo=l[0])==null?void 0:eo.id);async function cr(U){const pe=(h.current.get(U)??0)+1;h.current.set(U,pe);const Ae=await ue.botStatus(U);h.current.get(U)===pe&&f(lt=>({...lt,[U]:Ae}))}w.useEffect(()=>{e==="ready"&&Xr&&cr(Xr).catch(ft)},[e,Xr]);const Yt=l.find(U=>U.agent),xn=Yt?d[Yt.id]:void 0,Kt=g.find(U=>U.type==="dm"&&U.botId===(Yt==null?void 0:Yt.id)),sn=be==="home"&&!!Yt,qa=be==="envs",Ca=sn||qa,mi=w.useRef(Ca);mi.current=Ca;const Na=SU(xn,Kt),Pa=OU(Yt,xn,Na.call==="error");w.useEffect(()=>{e==="ready"&&Yt&&cr(Yt.id).catch(ft)},[e,Yt==null?void 0:Yt.id]);const da=((ti=g.find(U=>U.id===E&&U.type==="channel"))==null?void 0:ti.memberIds.filter(U=>l.some(pe=>pe.id===U)).join(","))??"";w.useEffect(()=>{if(e==="ready"&&da)for(const U of da.split(","))cr(U).catch(ft)},[e,da]);async function Wa(U){var mt,Ft;const[pe,Ae,lt,ht,hn]=await Promise.all([ue.bots(),ue.chats(),ue.modelConnections(),ue.sections(),ue.members()]);r(U),c(pe.bots),y(Ae.chats),Y(lt.connections),j(ht.sections),k(hn.members),Ht(Ae.followed);const Ue=Ae.chats.find(Xt=>Xt.type!=="thread");T((Ue==null?void 0:Ue.id)??null),Ue&&M({[Ue.id]:Ue.readSequence}),R(((mt=Ae.chats[0])==null?void 0:mt.botId)??((Ft=pe.bots[0])==null?void 0:Ft.id)??null),n("ready")}w.useEffect(()=>{Sf(localStorage.getItem("jarvy-theme")==="dark"?"dark":"light"),ue.me().then(U=>Wa(U.username)).catch(()=>n("login"))},[]),w.useEffect(()=>{if(e!=="ready")return;let U=!0;const pe=Ue=>{U&&ft(Ue)},Ae=async()=>{const Ue=me.current;U&&Ue&&await Rn.refresh(Ue)},lt=()=>void ue.sections().then(Ue=>{U&&j(Ue.sections)}).catch(Ue=>{U&&ft(Ue)}),ht=({chat:Ue,parent:mt,followed:Ft,message:Xt},mn)=>{const Bn=ia=>ia.type!=="thread"&&ia.memberIds.includes(ta.current);for(const ia of mt?[Ue,mt]:[Ue])Bn(ia)&&$n(ia);Ft&&Ht(Ft),Ue.type==="thread"&&Jt.emit({kind:"changed",id:Ue.id}),Ke(ia=>$H(ia,Ue.id,Ue.type==="dm"&&!Bn(Ue))),Xt&&mn?(Rn.heard(Xt,mn==="message"),tn.emit({kind:mn,message:Xt})):tn.emit({kind:"chat",chat:Ue})},hn=HU("/api/events",{ready:Ue=>{JSON.parse(Ue.data).resumed||(kn.clear(),tn.emit({kind:"reconnected"}),Ke(VH),na().catch(pe),Ae().catch(pe),lt(),Jt.emit({kind:"reconnected"}),ue.bots().then(mt=>{if(U){c(mt.bots);for(const Ft of mt.bots)cr(Ft.id).catch(Xt=>{U&&ft(Xt)})}}).catch(mt=>{U&&ft(mt)}))},sections:lt,bots:()=>{ue.bots().then(Ue=>{U&&c(Ue.bots)}).catch(pe),na().catch(pe)},message:Ue=>ht(JSON.parse(Ue.data),"message"),"message.updated":Ue=>ht(JSON.parse(Ue.data),"updated"),chat:Ue=>ht(JSON.parse(Ue.data)),"chat.removed":Ue=>{var Xt;const{chatId:mt,followed:Ft}=JSON.parse(Ue.data);y(mn=>mn.filter(Bn=>Bn.id!==mt)),Ht(Ft),kn.removed(mt),me.current===mt&&T(null),((Xt=Be.current)==null?void 0:Xt.kind)==="thread"&&Be.current.parentId===mt&&le(null),Jt.emit({kind:"reconnected"})},bot:Ue=>{var mn;const{botId:mt,status:Ft,bot:Xt}=JSON.parse(Ue.data);h.current.set(mt,(h.current.get(mt)??0)+1),f(Bn=>({...Bn,[mt]:Ft})),Ft.error&&!mi.current&&((mn=_e.current.find(Bn=>Bn.id===me.current))==null?void 0:mn.botId)===Ft.botId&&on(mS(Ft)),Xt&&c(Bn=>Bn.map(ia=>ia.id===Xt.id?Xt:ia))}},()=>{ue.me().catch(Ue=>{U&&Ue instanceof er&&Ue.status===401&&n("login")})});return()=>{U=!1,hn(),Rn.cancel(),Ee.current++}},[e]),kU({ready:e==="ready"&&!Ca,selected:E,messages:yn,chats:g,chatList:_e,setChats:y,onError:ft}),wU(e==="ready"?g.reduce((U,pe)=>U+pe.alerts,0):0),w.useEffect(()=>{if(!vn)return;const U=setTimeout(()=>on(""),4800);return()=>clearTimeout(U)},[vn]),w.useEffect(()=>{const U=pe=>{pe.defaultPrevented||O||H||(pe.key==="Escape"&&(X(!1),D(!1),ne(!1)),(pe.ctrlKey||pe.metaKey)&&pe.key.toLowerCase()==="k"&&(pe.preventDefault(),we("chats"),ne(window.matchMedia("(max-width: 620px)").matches),requestAnimationFrame(()=>{var Ae;return(Ae=document.querySelector("#jarvy-search"))==null?void 0:Ae.focus()})))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[O,H]),w.useEffect(()=>{const U=window.matchMedia("(max-width: 620px)"),pe=()=>{U.matches||ne(!1)};return U.addEventListener("change",pe),()=>U.removeEventListener("change",pe)},[]);function ft(U){if(U instanceof er&&U.status===401){n("login");return}on(Gt(U,"common.failed"))}const[na]=w.useState(()=>FU(async()=>{const U=++Ee.current,pe=await ue.chats();return U===Ee.current&&(y(pe.chats),Ht(pe.followed)),pe.chats},100));async function Oi(){const[U,pe]=await Promise.all([ue.modelConnections(),ue.bots()]);Y(U.connections),c(pe.bots)}const ur=()=>void ue.members().then(U=>k(U.members)).catch(ft);function fa(U){c(pe=>pe.map(Ae=>Ae.id===U.id?U:Ae)),ur()}function ha(U){var Ae;const pe=TP(U);pe?le({kind:"thread",id:pe,parentId:U.id,mode:"pane",summary:((Ae=U.hint)==null?void 0:Ae.kind)==="note"}):U.id!==me.current&&le(null),Ve(!1),we("chats"),M(lt=>({...lt,[U.id]:U.readSequence})),T(U.id),U.botId&&R(U.botId),ne(!1),X(!1),D(!1)}const pi=U=>le((fe==null?void 0:fe.kind)==="info"&&fe.page===U?null:{kind:"info",page:U});function $n(U){y(pe=>pe.some(Ae=>Ae.id===U.id)?pe.map(Ae=>Ae.id===U.id?U:Ae):[U,...pe])}async function ma(U){if(!ee){W(!0);try{const pe=await ue.createChat(U);$n(pe),ha(pe),requestAnimationFrame(()=>{var Ae;return(Ae=document.querySelector("#jarvy-composer"))==null?void 0:Ae.focus()})}catch(pe){ft(pe)}finally{W(!1)}}}async function dr(){if(!ee){W(!0);try{const U=await ue.createBot(Yq(Ei(b).map(Ae=>Ae.name))),pe=await ue.createChat(U.id);c(Ae=>[...Ae,U]),$n(pe),ur(),ha(pe)}catch(U){ft(U)}finally{W(!1)}}}async function fr(U){try{await ue.deleteChat(U.id),await na(),me.current===U.id&&T(null),on(v("app.channelDeleted"))}catch(pe){ft(pe)}}async function gi(U,pe){try{$n(await ue.pin(U.id,pe))}catch(Ae){ft(Ae)}}async function pa(U,pe){try{$n(await ue.mute(U.id,pe))}catch(Ae){ft(Ae)}}async function Ea(U,pe){try{await ue.deleteBot(U.id,pe);const Ae=new Set(g.filter(lt=>lt.type==="dm"&&lt.botId===U.id).map(lt=>lt.id));y(lt=>lt.filter(ht=>!Ae.has(ht.id)).map(ht=>ht.memberIds.includes(U.id)?{...ht,memberIds:ht.memberIds.filter(hn=>hn!==U.id)}:ht)),c(lt=>lt.filter(ht=>ht.id!==U.id)),ur(),me.current&&Ae.has(me.current)&&T(null),O===U.id&&I(null),on(v("app.botDeleted",{name:U.name}))}catch(Ae){ft(Ae)}}async function hr(U,pe,Ae,lt,ht){const hn=E,Ue=await ue.send(hn,U,pe,Ae,!1,lt,ht),mt=_e.current.find(Xt=>Xt.id===hn),Ft=(mt==null?void 0:mt.type)==="channel"?[...new Set(M1(U,Ei(b)).filter(Xt=>!mt.memberIds.includes(Xt.member.id)).map(Xt=>Xt.member.name))]:[];Ft.length&&on(v("app.notInChannel",{names:Ft.join(v("common.listSeparator")),count:Ft.length})),Rn.heard(Ue,!0)}function nn(U,pe){ue.addMember(U,pe.id).then(Ae=>{$n(Ae),on(v("app.memberAdded",{name:pe.name,channel:Ae.title}))}).catch(ft)}async function en(U){try{const pe=await ue.openThread(U.id);le({kind:"thread",id:pe.id,parentId:U.chatId,mode:"pane"})}catch(pe){ft(pe)}}function On(U,pe){const Ae=g.find(lt=>lt.id===U.parentId);Ae&&ha(Ae),le(pe?{kind:"thread",id:U.id,parentId:U.parentId,mode:"pane"}:null)}function aa(U){I(null);const pe=g.find(Ae=>Ae.id===(U.type==="thread"?U.parentId:U.id));pe&&ha(pe),U.type==="thread"&&le({kind:"thread",id:U.id,parentId:U.parentId,mode:"pane"})}async function Ho(U,pe,Ae){try{const lt=await ue.react(U.id,pe,Ae);lr(ht=>ht.map(hn=>hn.id===lt.id?{...hn,reactions:lt.reactions}:hn))}catch(lt){ft(lt)}}async function Qr(U,pe){try{const Ae=await ue.fold(U.id,pe);lr(lt=>lt.map(ht=>ht.id===Ae.id?{...ht,folded:Ae.folded}:ht))}catch(Ae){ft(Ae)}}function Zr(U){R1(ze,U,b)}const zi=(U,pe)=>U?void Rn.toMessage(U,pe).then(async Ae=>{Ae&&Ri.openMessage(await ue.chat(Ae),U,pe)}).catch(()=>on(v("app.sourceGone"))):on(v("app.sourceGone"));function mr(U){Jt.emit({kind:"chat",chat:U})}function Jr(U){U.preventDefault();const pe=lt=>Ze(Math.min(Math.max(340,window.innerWidth-lt.clientX),Math.round(window.innerWidth*.6))),Ae=()=>{window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",Ae),document.body.style.cursor=""};window.addEventListener("pointermove",pe),window.addEventListener("pointerup",Ae),document.body.style.cursor="col-resize"}async function Wr(){try{await ze.clear(U=>ue.removeAttachment(U)),await ue.logout(),n("login"),X(!1),K(null),h.current.clear(),f({}),le(null),Ht(null),Ke(i4),kn.clear(),r(""),T(null),y([]),c([]),Y([]),lr([])}catch(U){ft(U)}}const Ha=e==="ready"&&g.some(U=>U.id===E);w.useEffect(()=>{const U=ge.current;if(!U)return;let pe=0,Ae=U.clientHeight;const lt=()=>{pe=U.scrollHeight-U.scrollTop-U.clientHeight},ht=new ResizeObserver(()=>{U.clientHeight!==Ae&&(Ae=U.clientHeight,U.scrollTo({top:U.scrollHeight-U.clientHeight-pe,behavior:"instant"}))}),hn=new MutationObserver(lt);return lt(),U.addEventListener("scroll",lt,{passive:!0}),ht.observe(U),hn.observe(U,{childList:!0,subtree:!0,characterData:!0}),()=>{ht.disconnect(),hn.disconnect(),U.removeEventListener("scroll",lt)}},[Ha]);const ei=g.find(U=>U.id===E),de=(ei==null?void 0:ei.type)==="channel",ke=OH(e==="ready"?((gr=g.find(U=>U.id===E&&U.type==="dm"))==null?void 0:gr.botId)??void 0:void 0,YH(Fe));if(e==="loading")return o.jsx("div",{className:"jarvy-loading",children:v("app.connecting")});if(e==="login")return o.jsx(BU,{onLogin:U=>void Wa(U).catch(ft)});const je=g.find(U=>U.id===E),De=l.find(U=>U.id===((je==null?void 0:je.botId)??_))??l[0],at=!!(De!=null&&De.connectionId),et=de||at,st=(De==null?void 0:De.name)??"Jarvy",yt=De?d[De.id]:void 0,_t=yt!=null&&yt.error?v("activity.error"):(yt==null?void 0:yt.status)==="running"?YS(yt.activity):"",Ye=(Fo=[...yn].reverse().find(U=>{var pe;return((pe=U.question)==null?void 0:pe.state)==="pending"}))==null?void 0:Fo.id,nt=(fe==null?void 0:fe.kind)==="thread"?fe:null,xt=(nt==null?void 0:nt.mode)==="full",Ge=de?ei:void 0,bn=l.find(U=>U.id===O),zt=l.find(U=>U.id===(P==null?void 0:P.id)),ga=new Set(Object.values(d).filter(U=>U.status==="running"&&U.activity!=="asking").map(U=>U.botId)),fn=new Set(Object.values(d).filter(U=>U.activity==="asking").map(U=>U.botId));return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"ui-app","data-nav":se?"":void 0,"data-pane":fe&&!xt&&!Ca?"":void 0,"data-view":sn?"home":qa?"envs":void 0,style:{"--ui-pane":`${Pe}px`},children:[o.jsx(CU,{view:sn?"home":qa?"envs":"chats",agent:Yt,figure:Pa,call:Na.call,asleep:ah(xn).motion==="sleep",alerts:g.reduce((U,pe)=>U+(pe.id===(Kt==null?void 0:Kt.id)?0:pe.alerts),0),username:i,onView:U=>{we(U),ne(U==="chats"&&window.matchMedia("(max-width: 620px)").matches),X(!1)},accountMenu:V,onToggleAccount:U=>{X(U),D(!1)},onSettings:()=>{X(!1),K("general")},onToggleTheme:()=>{Sf(document.documentElement.classList.contains("dark")?"light":"dark"),X(!1)},onLogOut:()=>void Wr()}),o.jsx(AP,{chats:g,sections:m,bots:l,members:b,followed:gt,followedOpen:Ce&&!xt,working:ga,asking:fn,selected:Ce?null:E,filter:B,creating:ee,createMenu:Z,onFilterChange:F,onOpenFollowed:()=>{Ve(!0),le(null),ne(!1)},onOpenChat:ha,onOpenBot:U=>void ma(U.id),onOpenMenu:(U,pe)=>_n({target:U,at:pe}),onEditSection:U=>N({kind:"section",section:U}),onCreate:U=>{if(U==="bot")return void dr();N({kind:U}),D(!1)},onFind:Ri.openMessage,onOpenFound:aa,onError:ft,onToggleCreate:U=>{D(U),X(!1)}}),o.jsx(NH,{chat:je,inChannel:de,bots:l,members:b,meId:dt,drafts:ze,composeReady:et,botName:st,activeBot:De,status:yt,connections:Q,activity:_t,history:Rn,divider:C[(je==null?void 0:je.id)??""]??(je==null?void 0:je.readSequence)??0,activeQuestion:Ye,pane:fe,onPane:le,onToggleInfo:pi,find:Ri,onNav:()=>ne(!0),onBot:U=>I(U),hasBotDirects:ke.length>0,onBotCard:q,onInvite:nn,onQuote:Zr,onReply:U=>void en(U),onReact:(U,pe,Ae)=>void Ho(U,pe,Ae),onFold:(U,pe)=>void Qr(U,pe),onJump:zi,onSettled:U=>lr(pe=>pe.map(Ae=>Ae.id===U.id?U:Ae)),onPreview:(U,pe)=>rt({files:U,index:pe}),onSend:hr,notice:on,onSaveNote:async U=>{try{$n(await ue.setNote(je.id,U))}catch(pe){throw ft(pe),pe}},createBot:()=>void dr(),creating:ee,updateBot:fa,onManageModels:()=>K("models"),error:ft,chatArea:Me,transcript:ge,composeWrap:Xe,hidden:xt||Ce||Ca,onOpenThread:U=>le({kind:"thread",id:U,parentId:je.id,mode:"pane"})}),o.jsx(tF,{onBotCard:q,pane:fe,followedView:Ce,threadEvents:Jt,followed:gt,chats:g,sections:m,members:b,bots:l,statuses:d,meId:dt,drafts:ze,changes:Fe,live:tn,memory:kn,paneChannel:Ge,activeBot:De,botDirects:ke,find:Ri,onPane:le,onNav:()=>ne(!0),onBackToChannel:On,onAddMembers:U=>N({kind:"members",chat:U}),onOpenBot:I,onPin:U=>void gi(U,!U.pinned),onMute:U=>void pa(U,!U.muted),onDeleteChannel:U=>Ln({kind:"chat",chat:U}),onChannelSaved:$n,onThreadChanged:mr,onInvite:nn,onPreview:(U,pe)=>rt({files:U,index:pe}),onNotice:on,onError:ft,paneWidth:Pe,onResize:Jr}),sn&&o.jsx(_U,{bot:Yt,chat:Kt,status:xn,figure:Pa,call:Na.call,onSeen:Na.seen,meId:dt,members:b,drafts:ze,live:tn,onOpenDm:()=>void ma(Yt.id),onBotInfo:()=>I(Yt.id),ensureDm:async()=>{const U=await ue.createChat(Yt.id);return $n(U),U},onRead:(U,pe)=>G6(y,U.id,pe,ft),onPreview:(U,pe)=>rt({files:U,index:pe}),onNotice:on,onError:ft}),qa&&o.jsx(DU,{bots:l,statuses:d,adding:ve,onAdding:re,onSaved:fa})]}),zt&&P&&o.jsx(AH,{bot:zt,status:d[zt.id],connections:Q,anchor:P.anchor,onClose:$,onMessage:()=>void ma(zt.id),onInfo:()=>I(zt.id)}),H&&o.jsx(xU,{connections:Q,bots:l,initialTab:H,onChanged:Oi,onClose:()=>K(null)}),o.jsx(yP,{dialog:S,entryMenu:Wt,confirm:dn,preview:Je,infoBot:bn,bots:l,statuses:d,chats:g,sections:m,members:b,connections:Q,meId:dt,onDialog:N,onEntryMenu:_n,onConfirm:Ln,onPreview:rt,onInfoBot:I,onSettings:K,onAddMachine:()=>{we("envs"),re(!0),ne(!1)},onChannelInfo:U=>{ha(U),le({kind:"info",page:"main"})},onOpenChatId:U=>{T(U),ne(!1)},chatSaved:$n,openChat:ha,onSectionSaved:U=>{j(pe=>pe.some(Ae=>Ae.id===U.id)?pe.map(Ae=>Ae.id===U.id?U:Ae):[...pe,U]),N(null)},onSectionDeleted:U=>{N(null),j(pe=>pe.filter(Ae=>Ae.id!==U)),na().catch(ft)},updateBot:fa,openAnywhere:aa,removeChannel:fr,deleteBot:Ea,pinChat:gi,muteChat:pa}),vn&&o.jsx("div",{className:"ui-toast",role:"status",children:vn}),UU]})}function $U(){const e=`https://${location.host}${location.pathname}${location.search}`;return o.jsxs("div",{className:"jv-insecure",role:"status",children:[o.jsx(yN,{"aria-hidden":"true"}),o.jsx("span",{children:v("connection.insecure")}),o.jsx("a",{href:e,children:v("connection.useHttps")})]})}function VU(){return N4(),window.isSecureContext?o.jsx(b4,{}):o.jsxs("div",{className:"jv-insecure-shell",children:[o.jsx($U,{}),o.jsx(b4,{})]})}D7.createRoot(document.getElementById("root")).render(o.jsx(w.StrictMode,{children:o.jsx(VU,{})}));