@goodfish/jarvy 0.15.0 → 0.17.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,877 @@
1
+ var X7=Object.defineProperty;var Ux=e=>{throw TypeError(e)};var Q7=(e,n,i)=>n in e?X7(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var $e=(e,n,i)=>Q7(e,typeof n!="symbol"?n+"":n,i),$x=(e,n,i)=>n.has(e)||Ux("Cannot "+i);var ia=(e,n,i)=>($x(e,n,"read from private field"),i?i.call(e):n.get(e)),Vx=(e,n,i)=>n.has(e)?Ux("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),_p=(e,n,i,o)=>($x(e,n,"write to private field"),o?o.call(e,i):n.set(e,i),i);function Z7(e,n){for(var i=0;i<n.length;i++){const o=n[i];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(o,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>o[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"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).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 o(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function Nv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rp={exports:{}},Lc={};/**
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 Gx;function W7(){if(Gx)return Lc;Gx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(o,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var h in l)h!=="key"&&(c[h]=l[h])}else c=l;return l=c.ref,{$$typeof:e,type:o,key:u,ref:l!==void 0?l:null,props:c}}return Lc.Fragment=n,Lc.jsx=i,Lc.jsxs=i,Lc}var Yx;function J7(){return Yx||(Yx=1,Rp.exports=W7()),Rp.exports}var r=J7(),Op={exports:{}},lt={};/**
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 Kx;function eN(){if(Kx)return lt;Kx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),w=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 A(F,ie,$){this.props=F,this.context=ie,this.refs=C,this.updater=$||S}A.prototype.isReactComponent={},A.prototype.setState=function(F,ie){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,ie,"setState")},A.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function E(){}E.prototype=A.prototype;function T(F,ie,$){this.props=F,this.context=ie,this.refs=C,this.updater=$||S}var R=T.prototype=new E;R.constructor=T,N(R,A.prototype),R.isPureReactComponent=!0;var _=Array.isArray;function L(){}var I={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function O(F,ie,$){var X=$.ref;return{$$typeof:e,type:F,key:ie,ref:X!==void 0?X:null,props:$}}function P(F,ie){return O(F.type,ie,F.props)}function U(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function Y(F){var ie={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function($){return ie[$]})}var K=/\/+/g;function q(F,ie){return typeof F=="object"&&F!==null&&F.key!=null?Y(""+F.key):ie.toString(36)}function Q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(L,L):(F.status="pending",F.then(function(ie){F.status==="pending"&&(F.status="fulfilled",F.value=ie)},function(ie){F.status==="pending"&&(F.status="rejected",F.reason=ie)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function V(F,ie,$,X,ee){var me=typeof F;(me==="undefined"||me==="boolean")&&(F=null);var te=!1;if(F===null)te=!0;else switch(me){case"bigint":case"string":case"number":te=!0;break;case"object":switch(F.$$typeof){case e:case n:te=!0;break;case y:return te=F._init,V(te(F._payload),ie,$,X,ee)}}if(te)return ee=ee(F),te=X===""?"."+q(F,0):X,_(ee)?($="",te!=null&&($=te.replace(K,"$&/")+"/"),V(ee,ie,$,"",function(je){return je})):ee!=null&&(U(ee)&&(ee=P(ee,$+(ee.key==null||F&&F.key===ee.key?"":(""+ee.key).replace(K,"$&/")+"/")+te)),ie.push(ee)),1;te=0;var ce=X===""?".":X+":";if(_(F))for(var J=0;J<F.length;J++)X=F[J],me=ce+q(X,J),te+=V(X,ie,$,me,ee);else if(J=k(F),typeof J=="function")for(F=J.call(F),J=0;!(X=F.next()).done;)X=X.value,me=ce+q(X,J++),te+=V(X,ie,$,me,ee);else if(me==="object"){if(typeof F.then=="function")return V(Q(F),ie,$,X,ee);throw ie=String(F),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.")}return te}function Z(F,ie,$){if(F==null)return F;var X=[],ee=0;return V(F,X,"","",function(me){return ie.call($,me,ee++)}),X}function ue(F){if(F._status===-1){var ie=F._result,$=ie();$.then(function(X){(F._status===0||F._status===-1)&&(F._status=1,F._result=X,$.status===void 0&&($.status="fulfilled",$.value=X))},function(X){(F._status===0||F._status===-1)&&(F._status=2,F._result=X,$.status===void 0&&($.status="rejected",$.reason=X))}),F._status===-1&&(F._status=0,F._result=$)}if(F._status===1)return F._result.default;throw F._result}var z=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ie=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(ie))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)};function he(F){var ie=I.T,$={};$.types=ie!==null?ie.types:null,I.T=$;try{var X=F(),ee=I.S;ee!==null&&ee($,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(L,z)}catch(me){z(me)}finally{ie!==null&&$.types!==null&&(ie.types=$.types),I.T=ie}}function oe(F){var ie=I.T;if(ie!==null){var $=ie.types;$===null?ie.types=[F]:$.indexOf(F)===-1&&$.push(F)}else he(oe.bind(null,F))}var D={map:Z,forEach:function(F,ie,$){Z(F,function(){ie.apply(this,arguments)},$)},count:function(F){var ie=0;return Z(F,function(){ie++}),ie},toArray:function(F){return Z(F,function(ie){return ie})||[]},only:function(F){if(!U(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return lt.Activity=p,lt.Children=D,lt.Component=A,lt.Fragment=i,lt.Profiler=l,lt.PureComponent=T,lt.StrictMode=o,lt.Suspense=f,lt.ViewTransition=w,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,lt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return I.H.useMemoCache(F)}},lt.addTransitionType=oe,lt.cache=function(F){return function(){return F.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(F,ie,$){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var X=N({},F.props),ee=F.key;if(ie!=null)for(me in ie.key!==void 0&&(ee=""+ie.key),ie)!H.call(ie,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&ie.ref===void 0||(X[me]=ie[me]);var me=arguments.length-2;if(me===1)X.children=$;else if(1<me){for(var te=Array(me),ce=0;ce<me;ce++)te[ce]=arguments[ce+2];X.children=te}return O(F.type,ee,X)},lt.createContext=function(F){return F={$$typeof:u,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:c,_context:F},F},lt.createElement=function(F,ie,$){var X,ee={},me=null;if(ie!=null)for(X in ie.key!==void 0&&(me=""+ie.key),ie)H.call(ie,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(ee[X]=ie[X]);var te=arguments.length-2;if(te===1)ee.children=$;else if(1<te){for(var ce=Array(te),J=0;J<te;J++)ce[J]=arguments[J+2];ee.children=ce}if(F&&F.defaultProps)for(X in te=F.defaultProps,te)ee[X]===void 0&&(ee[X]=te[X]);return O(F,me,ee)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(F){return{$$typeof:h,render:F}},lt.isValidElement=U,lt.lazy=function(F){return{$$typeof:y,_payload:{_status:-1,_result:F},_init:ue}},lt.memo=function(F,ie){return{$$typeof:v,type:F,compare:ie===void 0?null:ie}},lt.startTransition=he,lt.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},lt.use=function(F){return I.H.use(F)},lt.useActionState=function(F,ie,$){return I.H.useActionState(F,ie,$)},lt.useCallback=function(F,ie){return I.H.useCallback(F,ie)},lt.useContext=function(F){return I.H.useContext(F)},lt.useDebugValue=function(){},lt.useDeferredValue=function(F,ie){return I.H.useDeferredValue(F,ie)},lt.useEffect=function(F,ie){return I.H.useEffect(F,ie)},lt.useEffectEvent=function(F){return I.H.useEffectEvent(F)},lt.useId=function(){return I.H.useId()},lt.useImperativeHandle=function(F,ie,$){return I.H.useImperativeHandle(F,ie,$)},lt.useInsertionEffect=function(F,ie){return I.H.useInsertionEffect(F,ie)},lt.useLayoutEffect=function(F,ie){return I.H.useLayoutEffect(F,ie)},lt.useMemo=function(F,ie){return I.H.useMemo(F,ie)},lt.useOptimistic=function(F,ie){return I.H.useOptimistic(F,ie)},lt.useReducer=function(F,ie,$){return I.H.useReducer(F,ie,$)},lt.useRef=function(F){return I.H.useRef(F)},lt.useState=function(F){return I.H.useState(F)},lt.useSyncExternalStore=function(F,ie,$){return I.H.useSyncExternalStore(F,ie,$)},lt.useTransition=function(){return I.H.useTransition()},lt.version="19.3.0",lt}var Xx;function Ev(){return Xx||(Xx=1,Op.exports=eN()),Op.exports}var j=Ev();const tN=Nv(j),cu=Z7({__proto__:null,default:tN},[j]);var Dp={exports:{}},Bc={},zp={exports:{}},Lp={};/**
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 nN(){return Qx||(Qx=1,(function(e){function n(Q,V){var Z=Q.length;Q.push(V);e:for(;0<Z;){var ue=Z-1>>>1,z=Q[ue];if(0<l(z,V))Q[ue]=V,Q[Z]=z,Z=ue;else break e}}function i(Q){return Q.length===0?null:Q[0]}function o(Q){if(Q.length===0)return null;var V=Q[0],Z=Q.pop();if(Z!==V){Q[0]=Z;e:for(var ue=0,z=Q.length,he=z>>>1;ue<he;){var oe=2*(ue+1)-1,D=Q[oe],F=oe+1,ie=Q[F];if(0>l(D,Z))F<z&&0>l(ie,D)?(Q[ue]=ie,Q[F]=Z,ue=F):(Q[ue]=D,Q[oe]=Z,ue=oe);else if(F<z&&0>l(ie,Z))Q[ue]=ie,Q[F]=Z,ue=F;else break e}}return V}function l(Q,V){var Z=Q.sortIndex-V.sortIndex;return Z!==0?Z:Q.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 u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var f=[],v=[],y=1,p=null,w=3,b=!1,k=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(Q){for(var V=i(v);V!==null;){if(V.callback===null)o(v);else if(V.startTime<=Q)o(v),V.sortIndex=V.expirationTime,n(f,V);else break;V=i(v)}}function R(Q){if(S=!1,T(Q),!k)if(i(f)!==null)k=!0,_||(_=!0,U());else{var V=i(v);V!==null&&q(R,V.startTime-Q)}}var _=!1,L=-1,I=5,H=-1;function O(){return N?!0:!(e.unstable_now()-H<I)}function P(){if(N=!1,_){var Q=e.unstable_now();H=Q;var V=!0;try{e:{k=!1,S&&(S=!1,A(L),L=-1),b=!0;var Z=w;try{t:{for(T(Q),p=i(f);p!==null&&!(p.expirationTime>Q&&O());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,w=p.priorityLevel;var z=ue(p.expirationTime<=Q);if(Q=e.unstable_now(),typeof z=="function"){p.callback=z,T(Q),V=!0;break t}p===i(f)&&o(f),T(Q)}else o(f);p=i(f)}if(p!==null)V=!0;else{var he=i(v);he!==null&&q(R,he.startTime-Q),V=!1}}break e}finally{p=null,w=Z,b=!1}V=void 0}}finally{V?U():_=!1}}}var U;if(typeof E=="function")U=function(){E(P)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,K=Y.port2;Y.port1.onmessage=P,U=function(){K.postMessage(null)}}else U=function(){C(P,0)};function q(Q,V){L=C(function(){Q(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(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(Q){switch(w){case 1:case 2:case 3:var V=3;break;default:V=w}var Z=w;w=V;try{return Q()}finally{w=Z}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(Q,V){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var Z=w;w=Q;try{return V()}finally{w=Z}},e.unstable_scheduleCallback=function(Q,V,Z){var ue=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ue+Z:ue):Z=ue,Q){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Z+z,Q={id:y++,callback:V,priorityLevel:Q,startTime:Z,expirationTime:z,sortIndex:-1},Z>ue?(Q.sortIndex=Z,n(v,Q),i(f)===null&&Q===i(v)&&(S?(A(L),L=-1):S=!0,q(R,Z-ue))):(Q.sortIndex=z,n(f,Q),k||b||(k=!0,_||(_=!0,U()))),Q},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(Q){var V=w;return function(){var Z=w;w=V;try{return Q.apply(this,arguments)}finally{w=Z}}}})(Lp)),Lp}var Zx;function aN(){return Zx||(Zx=1,zp.exports=nN()),zp.exports}var Bp={exports:{}},Wn={};/**
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 Wx;function iN(){if(Wx)return Wn;Wx=1;var e=Ev();function n(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)p+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={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"),u=Symbol.for("react.optimistic_key");function h(y,p,w){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:b==null?null:b===u?u:""+b,children:y,containerInfo:p,implementation:w}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Wn.browser=function(y){return{$$typeof:c,_reason:y}},Wn.createPortal=function(y,p){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return h(y,p,null,w)},Wn.flushSync=function(y){var p=f.T,w=o.p;try{if(f.T=null,o.p=2,y)return y()}finally{f.T=p,o.p=w,o.d.f()}},Wn.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(y,p))},Wn.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},Wn.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var w=p.as,b=v(w,p.crossOrigin),k=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;w==="style"?o.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:k,fetchPriority:S}):w==="script"&&o.d.X(y,{crossOrigin:b,integrity:k,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Wn.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var w=v(p.as,p.crossOrigin);o.d.M(y,{crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&o.d.M(y)},Wn.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var w=p.as,b=v(w,p.crossOrigin);o.d.L(y,w,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Wn.preloadModule=function(y,p){if(typeof y=="string")if(p){var w=v(p.as,p.crossOrigin);o.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else o.d.m(y)},Wn.requestFormReset=function(y){o.d.r(y)},Wn.unstable_batchedUpdates=function(y,p){return y(p)},Wn.useFormState=function(y,p,w){return f.H.useFormState(y,p,w)},Wn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Wn.version="19.3.0",Wn}var Jx;function Pw(){if(Jx)return Bp.exports;Jx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Bp.exports=iN(),Bp.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 eb;function rN(){if(eb)return Bc;eb=1;var e=aN(),n=Ev(),i=Pw();function o(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 u(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 h(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 f(t){if(c(t)!==t)throw Error(o(188))}function v(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(o(188));return a!==t?null:t}for(var s=t,d=a;;){var g=s.return;if(g===null)break;var x=g.alternate;if(x===null){if(d=g.return,d!==null){s=d;continue}break}if(g.child===x.child){for(x=g.child;x;){if(x===s)return f(g),t;if(x===d)return f(g),a;x=x.sibling}throw Error(o(188))}if(s.return!==d.return)s=g,d=x;else{for(var M=!1,B=g.child;B;){if(B===s){M=!0,s=g,d=x;break}if(B===d){M=!0,d=g,s=x;break}B=B.sibling}if(!M){for(B=x.child;B;){if(B===s){M=!0,s=x,d=g;break}if(B===d){M=!0,d=x,s=g;break}B=B.sibling}if(!M)throw Error(o(189))}}if(s.alternate!==d)throw Error(o(190))}if(s.tag!==3)throw Error(o(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 p(t,a,s,d,g,x){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&s(t,d,g,x)||(t.tag!==22||t.memoizedState===null)&&(a||t.tag!==5&&t.tag!==27)&&p(t.child,a,s,d,g,x))return!0;t=t.sibling}return!1}function w(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=w(t);return s===null||S(a,t,s.child,{foundSelf:!1}),a}function S(t,a,s,d){for(;s!==null;){if(s===a)d.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(d.foundSelf)return t[1]=s,!0;t[0]=s}else if((s.tag!==22||s.memoizedState===null)&&S(t,a,s.child,d))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(o(559))}}var C=null,A=null;function E(t,a,s){return t===s?!0:t===a?(C=t,!0):!1}function T(t,a,s){return t===s?(A=t,!1):t===a?(A!==null&&(C=t),!0):!1}function R(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 _(t,a,s){for(var d=0,g=t;g;g=s(g))d++;g=0;for(var x=a;x;x=s(x))g++;for(;0<d-g;)t=s(t),d--;for(;0<g-d;)a=s(a),g--;for(;d--;){if(t===a||a!==null&&t===a.alternate)return t;t=s(t),a=s(a)}return null}var L=Object.assign,I=Symbol.for("react.element"),H=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),q=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),oe=Symbol.for("react.legacy_hidden"),D=Symbol.for("react.memo_cache_sentinel"),F=Symbol.for("react.view_transition"),ie=Symbol.for("react.recoverable"),$=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var ee=Symbol.for("react.client.reference");function me(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case P:return"Fragment";case Y:return"Profiler";case U:return"StrictMode";case V:return"Suspense";case Z:return"SuspenseList";case he:return"Activity";case F:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case O:return"Portal";case q:return t.displayName||"Context";case K:return(t._context.displayName||"Context")+".Consumer";case Q:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ue:return a=t.displayName||null,a!==null?a:me(t.type)||"Memo";case z:a=t._payload,t=t._init;try{return me(t(a))}catch{}}return null}var te=Array.isArray,ce=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je={pending:!1,data:null,method:null,action:null},Re=[],De=-1;function Pe(t){return{current:t}}function Le(t){0>De||(t.current=Re[De],Re[De]=null,De--)}function He(t,a){De++,Re[De]=t.current,t.current=a}var at=Pe(null),Lt=Pe(null),Gt=Pe(null),ft=Pe(null);function Cn(t,a){switch(He(Gt,a),He(Lt,t),He(at,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Wy(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Wy(a),t=Jy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Le(at),He(at,t)}function wn(){Le(at),Le(Lt),Le(Gt)}function fn(t){var a=t.memoizedState;a!==null&&(wl._currentValue=a.memoizedState,He(ft,t)),a=at.current;var s=Jy(a,t.type);a!==s&&(He(Lt,t),He(at,s))}function ye(t){Lt.current===t&&(Le(at),Le(Lt)),ft.current===t&&(Le(ft),wl._currentValue=je)}var _e,We;function tt(t){if(_e===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);_e=a&&a[1]||"",We=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_e+t+We}var ct=!1;function on(t,a){if(!t||ct)return"";ct=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(a){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ze){var re=ze}Reflect.construct(t,[],Se)}else{try{Se.call()}catch(ze){re=ze}Se=!1;try{var fe=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Se=!0,new t}finally{Se&&(fe!==void 0?Object.defineProperty(t.prototype,"props",fe):delete t.prototype.props)}}}else{try{throw Error()}catch(ze){re=ze}(Se=t())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ze){if(ze&&re&&typeof ze.stack=="string")return[ze.stack,re.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),M=x[0],B=x[1];if(M&&B){var W=M.split(`
44
+ `),le=B.split(`
45
+ `);for(g=d=0;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;for(;g<le.length&&!le[g].includes("DetermineComponentFrameRoot");)g++;if(d===W.length||g===le.length)for(d=W.length-1,g=le.length-1;1<=d&&0<=g&&W[d]!==le[g];)g--;for(;1<=d&&0<=g;d--,g--)if(W[d]!==le[g]){if(d!==1||g!==1)do if(d--,g--,0>g||W[d]!==le[g]){var ve=`
46
+ `+W[d].replace(" at new "," at ");return t.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",t.displayName)),ve}while(1<=d&&0<=g);break}}}finally{ct=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?tt(s):""}function On(t,a){switch(t.tag){case 26:case 27:case 5:return tt(t.type);case 16:return tt("Lazy");case 13:return t.child!==a&&a!==null?tt("Suspense Fallback"):tt("Suspense");case 19:return tt("SuspenseList");case 0:case 15:return on(t.type,!1);case 11:return on(t.type.render,!1);case 1:return on(t.type,!0);case 31:return tt("Activity");case 30:return tt("ViewTransition");default:return""}}function yn(t){try{var a="",s=null;do a+=On(t,s),s=t,t=t.return;while(t);return a}catch(d){return`
47
+ Error generating stack: `+d.message+`
48
+ `+d.stack}}var Bn=Object.prototype.hasOwnProperty,ge=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,qe=e.unstable_requestPaint,Be=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,$n=e.unstable_ImmediatePriority,Ba=e.unstable_UserBlockingPriority,Yt=e.unstable_NormalPriority,Vo=e.unstable_LowPriority,Pi=e.unstable_IdlePriority,gr=e.log,Jr=e.unstable_setDisableYieldValue,Ia=null,Et=null;function sn(t){if(typeof gr=="function"&&Jr(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Ia,t)}catch{}}var cn=Math.clz32?Math.clz32:ka,Pa=Math.log,qa=Math.LN2;function ka(t){return t>>>=0,t===0?32:31-(Pa(t)/qa|0)|0}var ai=256,ua=262144,Sa=4194304;function Fa(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 Ca(t,a,s){var d=t.pendingLanes;if(d===0)return 0;var g=0,x=t.suspendedLanes,M=t.pingedLanes;t=t.warmLanes;var B=d&134217727;return B!==0?(d=B&~x,d!==0?g=Fa(d):(M&=B,M!==0?g=Fa(M):s||(s=B&~t,s!==0&&(g=Fa(s))))):(B=d&~x,B!==0?g=Fa(B):M!==0?g=Fa(M):s||(s=d&~t,s!==0&&(g=Fa(s)))),g===0?0:a!==0&&a!==g&&(a&x)===0&&(x=g&-g,s=a&-a,x>=s||x===32&&(s&4194048)!==0)?a:g}function Na(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function gt(t,a){(a&8)!==0&&(a|=a&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=a;0<s;){var d=31-cn(s),g=1<<d;a|=t[d],s&=~g}return a}function qi(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 Ha(){var t=Sa;return Sa<<=1,(Sa&62914560)===0&&(Sa=4194304),t}function Fi(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function Ua(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function da(t,a,s,d,g,x){var M=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 B=t.entanglements,W=t.expirationTimes,le=t.hiddenUpdates;for(s=M&~s;0<s;){var ve=31-cn(s),Se=1<<ve;B[ve]=0,W[ve]=-1;var re=le[ve];if(re!==null)for(le[ve]=null,ve=0;ve<re.length;ve++){var fe=re[ve];fe!==null&&(fe.lane&=-536870913)}s&=~Se}d!==0&&$a(t,d,0),x!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=x&~(M&~a))}function $a(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var d=31-cn(a);t.entangledLanes|=a,t.entanglements[d]=t.entanglements[d]|1073741824|s&261930}function Vn(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var d=31-cn(s),g=1<<d;g&a|t[d]&a&&(t[d]|=a),s&=~g}}function gi(t,a){var s=a&-a;return s=(s&42)!==0?1:yi(s),(s&(t.suspendedLanes|a))!==0?0:s}function yi(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 Ea(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ha(){var t=J.p;return t!==0?t:(t=window.event,t===void 0?32:Lx(t.type))}function Hi(t,a){var s=J.p;try{return J.p=t,a()}finally{J.p=s}}var mn=Math.random().toString(36).slice(2),ln="__reactFiber$"+mn,Nn="__reactProps$"+mn,fa="__reactContainer$"+mn,Go="__reactEvents$"+mn,xi="__reactListeners$"+mn,yr="__reactHandles$"+mn,Ui="__reactResources$"+mn,xr="__reactMarker$"+mn,eo="__reactLoad$"+mn;function to(t){delete t[ln],delete t[Nn],delete t[xi],delete t[yr]}function Va(t){var a;if(a=t[ln])return a;for(var s=t.parentNode;s;){if(a=s[fa]||s[ln]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=vx(t);t!==null;){if(s=t[ln])return s;t=vx(t)}return a}t=s,s=t.parentNode}return null}function br(t){if(t=t[ln]||t[fa]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function pe(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(o(33))}function Ne(t){var a=t[Ui];return a||(a=t[Ui]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ce(t){t[xr]=!0}function Ve(t){t[eo]=void 0}var st=new Set,Ge={};function nt(t,a){Dt(t,a),Dt(t+"Capture",a)}function Dt(t,a){for(Ge[t]=a,t=0;t<a.length;t++)st.add(a[t])}var Rt=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]*$"),Ze={},Je={};function Nt(t){return Bn.call(Je,t)?!0:Bn.call(Ze,t)?!1:Rt.test(t)?Je[t]=!0:(Ze[t]=!0,!1)}var Qe=!1;function pn(){var t=Qe;return Qe=!1,t}function Kt(t,a,s){if(Nt(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var d=a.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,s)}}function ma(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 xn(t,a,s,d){if(d===null)t.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,d)}}function Jt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function no(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Yo(t,a,s){var d=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,x=d.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return g.call(this)},set:function(M){s=""+M,x.call(this,M)}}),Object.defineProperty(t,a,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(M){s=""+M},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function ii(t){if(!t._valueTracker){var a=no(t)?"checked":"value";t._valueTracker=Yo(t,a,""+t[a])}}function jr(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),d="";return t&&(d=no(t)?t.checked?"true":"false":t.value),t=d,t!==s?(a.setValue(t),!0):!1}var Ko=/[\n"\\]/g;function Ft(t){return t.replace(Ko,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Dn(t,a,s,d,g,x,M,B){t.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.type=M:t.removeAttribute("type"),a!=null?M==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Jt(a)):t.value!==""+Jt(a)&&(t.value=""+Jt(a)):M!=="submit"&&M!=="reset"||t.removeAttribute("value"),a!=null?M==="number"&&t.value==a?G(t,Jt(t.value)):G(t,Jt(a)):s!=null?G(t,Jt(s)):d!=null&&t.removeAttribute("value"),g==null&&x!=null&&(t.defaultChecked=!!x),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?t.name=""+Jt(B):t.removeAttribute("name")}function bi(t,a,s,d,g,x,M,B){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)){ii(t);return}s=s!=null?""+Jt(s):"",a=a!=null?""+Jt(a):s,B||a===t.value||(t.value=a),t.defaultValue=a}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,t.checked=B?t.checked:!!d,t.defaultChecked=!!d,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(t.name=M),ii(t)}function G(t,a){t.defaultValue!==""+a&&(t.defaultValue=""+a)}function be(t,a,s,d){if(t=t.options,a){a={};for(var g=0;g<s.length;g++)a["$"+s[g]]=!0;for(s=0;s<t.length;s++)g=a.hasOwnProperty("$"+t[s].value),t[s].selected!==g&&(t[s].selected=g),g&&d&&(t[s].defaultSelected=!0)}else{for(s=""+Jt(s),a=null,g=0;g<t.length;g++){if(t[g].value===s){t[g].selected=!0,d&&(t[g].defaultSelected=!0);return}a!==null||t[g].disabled||(a=t[g])}a!==null&&(a.selected=!0)}}function Te(t,a,s){if(a!=null&&(a=""+Jt(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+Jt(s):""}function ot(t,a,s,d){if(a==null){if(d!=null){if(s!=null)throw Error(o(92));if(te(d)){if(1<d.length)throw Error(o(93));d=d[0]}s=d}s==null&&(s=""),a=s}s=Jt(a),t.defaultValue=s,d=t.textContent,d===s&&d!==""&&d!==null&&(t.value=d),ii(t)}function pt(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var un=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 it(t,a,s){var d=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":d?t.setProperty(a,s):typeof s!="number"||s===0||un.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function yt(t,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(t=t.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||a!=null&&a.hasOwnProperty(d)||(d.indexOf("--")===0?t.setProperty(d,""):d==="float"?t.cssFloat="":t[d]="",Qe=!0);for(var g in a)d=a[g],a.hasOwnProperty(g)&&s[g]!==d&&(it(t,g,d),Qe=!0)}else for(var x in a)a.hasOwnProperty(x)&&it(t,x,a[x])}function en(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 Xt=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"]]),pa=/^[\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 Ht(t){return pa.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function tn(){}var Xo=null;function Qo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Tt=null,In=null;function ri(t){var a=br(t);if(a&&(t=a.stateNode)){var s=t[Nn]||null;e:switch(t=a.stateNode,a.type){case"input":if(Dn(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="'+Ft(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var d=s[a];if(d!==t&&d.form===t.form){var g=d[Nn]||null;if(!g)throw Error(o(90));Dn(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<s.length;a++)d=s[a],d.form===t.form&&jr(d)}break e;case"textarea":Te(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&be(t,!!s.multiple,a,!1)}}}var Ga=!1;function Zo(t,a,s){if(Ga)return t(a,s);Ga=!0;try{var d=t(a);return d}finally{if(Ga=!1,(Tt!==null||In!==null)&&(wd(),Tt&&(a=Tt,t=In,In=Tt=null,ri(a),t)))for(a=0;a<t.length;a++)ri(t[a])}}function wr(t,a){var s=t.stateNode;if(s===null)return null;var d=s[Nn]||null;if(d===null)return null;s=d[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":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var Gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wo=!1;if(Gn)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Wo=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Wo=!1}var ao=null,pf=null,ku=null;function Kg(){if(ku)return ku;var t,a=pf,s=a.length,d,g="value"in ao?ao.value:ao.textContent,x=g.length;for(t=0;t<s&&a[t]===g[t];t++);var M=s-t;for(d=1;d<=M&&a[s-d]===g[x-d];d++);return ku=g.slice(t,1<d?1-d:void 0)}function Su(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 Cu(){return!0}function Xg(){return!1}function va(t){function a(s,d,g,x,M){this._reactName=s,this._targetInst=g,this.type=d,this.nativeEvent=x,this.target=M,this.currentTarget=null;for(var B in t)t.hasOwnProperty(B)&&(s=t[B],this[B]=s?s(x):x[B]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Cu:Xg,this.isPropagationStopped=Xg,this}return L(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=Cu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Cu)},persist:function(){},isPersistent:Cu}),a}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nu=va(io),Ql=L({},io,{view:0,detail:0}),bC=va(Ql),vf,gf,Zl,Eu=L({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xf,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!==Zl&&(Zl&&t.type==="mousemove"?(vf=t.screenX-Zl.screenX,gf=t.screenY-Zl.screenY):gf=vf=0,Zl=t),vf)},movementY:function(t){return"movementY"in t?t.movementY:gf}}),Qg=va(Eu),jC=L({},Eu,{dataTransfer:0}),wC=va(jC),kC=L({},Ql,{relatedTarget:0}),yf=va(kC),SC=L({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),CC=va(SC),NC=L({},io,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),EC=va(NC),TC=L({},io,{data:0}),Zg=va(TC),AC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MC={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"},_C={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RC(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=_C[t])?!!a[t]:!1}function xf(){return RC}var OC=L({},Ql,{key:function(t){if(t.key){var a=AC[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Su(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?MC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xf,charCode:function(t){return t.type==="keypress"?Su(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Su(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),DC=va(OC),zC=L({},Eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wg=va(zC),LC=L({},io,{submitter:0}),BC=va(LC),IC=L({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xf}),PC=va(IC),qC=L({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),FC=va(qC),HC=L({},Eu,{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}),UC=va(HC),$C=L({},io,{newState:0,oldState:0,source:0}),VC=va($C),GC=[9,13,27,32],bf=Gn&&"CompositionEvent"in window,Wl=null;Gn&&"documentMode"in document&&(Wl=document.documentMode);var YC=Gn&&"TextEvent"in window&&!Wl,Jg=Gn&&(!bf||Wl&&8<Wl&&11>=Wl),e1=" ",t1=!1;function n1(t,a){switch(t){case"keyup":return GC.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $s=!1;function KC(t,a){switch(t){case"compositionend":return a1(a);case"keypress":return a.which!==32?null:(t1=!0,e1);case"textInput":return t=a.data,t===e1&&t1?null:t;default:return null}}function XC(t,a){if($s)return t==="compositionend"||!bf&&n1(t,a)?(t=Kg(),ku=pf=ao=null,$s=!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 Jg&&a.locale!=="ko"?null:a.data;default:return null}}var QC={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 i1(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!QC[t.type]:a==="textarea"}function r1(t,a,s,d){Tt?In?In.push(d):In=[d]:Tt=d,a=Td(a,"onChange"),0<a.length&&(s=new Nu("onChange","change",null,s,d),t.push({event:s,listeners:a}))}var Jl=null,ec=null;function ZC(t){Gy(t,0)}function Tu(t){var a=pe(t);if(jr(a))return t}function o1(t,a){if(t==="change")return a}var s1=!1;if(Gn){var jf;if(Gn){var wf="oninput"in document;if(!wf){var l1=document.createElement("div");l1.setAttribute("oninput","return;"),wf=typeof l1.oninput=="function"}jf=wf}else jf=!1;s1=jf&&(!document.documentMode||9<document.documentMode)}function c1(){Jl&&(Jl.detachEvent("onpropertychange",u1),ec=Jl=null)}function u1(t){if(t.propertyName==="value"&&Tu(ec)){var a=[];r1(a,ec,t,Qo(t)),Zo(ZC,a)}}function WC(t,a,s){t==="focusin"?(c1(),Jl=a,ec=s,Jl.attachEvent("onpropertychange",u1)):t==="focusout"&&c1()}function JC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tu(ec)}function e8(t,a){if(t==="click")return Tu(a)}function t8(t,a){if(t==="input"||t==="change")return Tu(a)}function n8(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var Ya=typeof Object.is=="function"?Object.is:n8;function tc(t,a){if(Ya(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),d=Object.keys(a);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var g=s[d];if(!Bn.call(a,g)||!Ya(t[g],a[g]))return!1}return!0}function kf(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 d1(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function h1(t,a){var s=d1(t);t=0;for(var d;s;){if(s.nodeType===3){if(d=t+s.textContent.length,t<=a&&d>=a)return{node:s,offset:a-t};t=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=d1(s)}}function f1(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?f1(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function m1(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=kf(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=kf(t.document)}return a}function Sf(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 a8=Gn&&"documentMode"in document&&11>=document.documentMode,Vs=null,Cf=null,nc=null,Nf=!1;function p1(t,a,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Nf||Vs==null||Vs!==kf(d)||(d=Vs,"selectionStart"in d&&Sf(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),nc&&tc(nc,d)||(nc=d,d=Td(Cf,"onSelect"),0<d.length&&(a=new Nu("onSelect","select",null,a,s),t.push({event:a,listeners:d}),a.target=Vs)))}function Jo(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var Gs={animationend:Jo("Animation","AnimationEnd"),animationiteration:Jo("Animation","AnimationIteration"),animationstart:Jo("Animation","AnimationStart"),transitionrun:Jo("Transition","TransitionRun"),transitionstart:Jo("Transition","TransitionStart"),transitioncancel:Jo("Transition","TransitionCancel"),transitionend:Jo("Transition","TransitionEnd")},Ef={},v1={};Gn&&(v1=document.createElement("div").style,"AnimationEvent"in window||(delete Gs.animationend.animation,delete Gs.animationiteration.animation,delete Gs.animationstart.animation),"TransitionEvent"in window||delete Gs.transitionend.transition);function es(t){if(Ef[t])return Ef[t];if(!Gs[t])return t;var a=Gs[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in v1)return Ef[t]=a[s];return t}var g1=es("animationend"),y1=es("animationiteration"),x1=es("animationstart"),i8=es("transitionrun"),r8=es("transitionstart"),o8=es("transitioncancel"),b1=es("transitionend"),j1=new Map,Tf="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(" ");Tf.push("scrollEnd");function ji(t,a){j1.set(t,a),nt(a,[t])}var s8=0;function kr(t,a){if(t.name!=null&&t.name!=="auto")return t.name;if(a.autoName!==null)return a.autoName;t=Ci.identifierPrefix;var s=s8++;return t="_"+t+"t_"+s.toString(32)+"_",a.autoName=t}function w1(t){if(t==null||typeof t=="string")return t;var a=null,s=hl;if(s!==null)for(var d=0;d<s.length;d++){var g=t[s[d]];if(g!=null){if(g==="none")return"none";a=a==null?g:a+(" "+g)}}return a??t.default}function Sr(t,a){return t=w1(t),a=w1(a),a==null?t==="auto"?null:t:a==="auto"?null:a}var Au=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)},oi=[],Ys=0,Af=0;function Mu(){for(var t=Ys,a=Af=Ys=0;a<t;){var s=oi[a];oi[a++]=null;var d=oi[a];oi[a++]=null;var g=oi[a];oi[a++]=null;var x=oi[a];if(oi[a++]=null,d!==null&&g!==null){var M=d.pending;M===null?g.next=g:(g.next=M.next,M.next=g),d.pending=g}x!==0&&k1(s,g,x)}}function _u(t,a,s,d){oi[Ys++]=t,oi[Ys++]=a,oi[Ys++]=s,oi[Ys++]=d,Af|=d,t.lanes|=d,t=t.alternate,t!==null&&(t.lanes|=d)}function Mf(t,a,s,d){return _u(t,a,s,d),Ru(t)}function ts(t,a){return _u(t,null,null,a),Ru(t)}function k1(t,a,s){t.lanes|=s;var d=t.alternate;d!==null&&(d.lanes|=s);for(var g=!1,x=t.return;x!==null;)x.childLanes|=s,d=x.alternate,d!==null&&(d.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(g=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,g&&a!==null&&(g=31-cn(s),t=x.hiddenUpdates,d=t[g],d===null?t[g]=[a]:d.push(a),a.lane=s|536870912),x):null}function Ru(t){if(50<Sc)throw Sc=0,jd=null,Error(o(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var Ks={};function l8(t,a,s,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ta(t,a,s,d){return new l8(t,a,s,d)}function _f(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Cr(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 S1(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 Ou(t,a,s,d,g,x){var M=0;if(d=t,typeof d=="function")_f(d)&&(M=1);else if(typeof d=="string")M=L7(t,s,at.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(d){case he:return t=Ta(31,s,a,g),t.elementType=he,t.lanes=x,t;case P:return ns(s.children,g,x,a);case U:M=8,g|=24;break;case Y:return t=Ta(12,s,a,g|2),t.elementType=Y,t.lanes=x,t;case V:return t=Ta(13,s,a,g),t.elementType=V,t.lanes=x,t;case Z:return t=Ta(19,s,a,g),t.elementType=Z,t.lanes=x,t;case oe:case F:return t=g|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 d=="object"&&d!==null)switch(d.$$typeof){case q:M=10;break e;case K:M=9;break e;case Q:M=11;break e;case ue:M=14;break e;case z:M=16,d=null;break e}M=29,s=Error(o(130,t===null?"null":typeof t,"")),d=null}return a=Ta(M,s,a,g),a.elementType=t,a.type=d,a.lanes=x,a}function ns(t,a,s,d){return t=Ta(7,t,d,a),t.lanes=s,t}function Rf(t,a,s){return t=Ta(6,t,null,a),t.lanes=s,t}function C1(t){var a=Ta(18,null,null,0);return a.stateNode=t,a}function Of(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 N1=new WeakMap;function si(t,a){if(typeof t=="object"&&t!==null){var s=N1.get(t);return s!==void 0?s:(a={value:t,source:a,stack:yn(a)},N1.set(t,a),a)}return{value:t,source:a,stack:yn(a)}}var Xs=[],Qs=0,Du=null,ac=0,li=[],ci=0,ro=null,$i=1,Vi="";function Nr(t,a){Xs[Qs++]=ac,Xs[Qs++]=Du,Du=t,ac=a}function E1(t,a,s){li[ci++]=$i,li[ci++]=Vi,li[ci++]=ro,ro=t;var d=$i;t=Vi;var g=32-cn(d)-1;d&=~(1<<g),s+=1;var x=32-cn(a)+g;if(30<x){var M=g-g%5;x=(d&(1<<M)-1).toString(32),d>>=M,g-=M,$i=1<<32-cn(a)+g|s<<g|d,Vi=x+t}else $i=1<<x|s<<g|d,Vi=t}function zu(t){t.return!==null&&(Nr(t,1),E1(t,1,0))}function Df(t){for(;t===Du;)Du=Xs[--Qs],Xs[Qs]=null,ac=Xs[--Qs],Xs[Qs]=null;for(;t===ro;)ro=li[--ci],li[ci]=null,Vi=li[--ci],li[ci]=null,$i=li[--ci],li[ci]=null}function T1(t,a){li[ci++]=$i,li[ci++]=Vi,li[ci++]=ro,$i=a.id,Vi=a.overflow,ro=t}var Pn=null,nn=null,vt=!1,oo=null,ui=!1,zf=Error(o(519));function so(t){var a=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ic(si(a,t)),zf}function A1(t){var a=t.stateNode,s=t.type,d=t.memoizedProps;switch(a[ln]=t,a[Nn]=d,s){case"dialog":bt("cancel",a),bt("close",a);break;case"iframe":case"object":case"embed":bt("load",a);break;case"video":case"audio":for(s=0;s<Nc.length;s++)bt(Nc[s],a);break;case"source":bt("error",a);break;case"img":case"image":case"link":bt("error",a),bt("load",a);break;case"details":bt("toggle",a);break;case"input":bt("invalid",a),bi(a,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":bt("invalid",a);break;case"textarea":bt("invalid",a),ot(a,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||d.suppressHydrationWarning===!0||Qy(a.textContent,s)?(d.popover!=null&&(bt("beforetoggle",a),bt("toggle",a)),d.onScroll!=null&&bt("scroll",a),d.onScrollEnd!=null&&bt("scrollend",a),d.onClick!=null&&(a.onclick=tn),a=!0):a=!1,a||so(t,!0)}function Lu(t){for(Pn=t.return;Pn;)switch(Pn.tag){case 5:case 31:case 13:ui=!1;return;case 27:case 3:ui=!0;return;default:Pn=Pn.return}}function Zs(t){if(t!==Pn)return!1;if(!vt)return Lu(t),vt=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||dp(t.type,t.memoizedProps)),s=!s),s&&nn&&so(t),Lu(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));nn=px(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));nn=px(t)}else a===27?(a=nn,So(t.type)?(t=bp,bp=null,nn=t):nn=a):nn=Pn?hi(t.stateNode.nextSibling):null;return!0}function as(){nn=Pn=null,vt=!1}function Lf(){var t=oo;return t!==null&&(_a===null?_a=t:_a.push.apply(_a,t),oo=null),t}function ic(t){oo===null?oo=[t]:oo.push(t)}var Bf=Pe(null),is=null,Er=null;function lo(t,a,s){He(Bf,a._currentValue),a._currentValue=s}function Tr(t){t._currentValue=Bf.current,Le(Bf)}function Bu(t,a,s){for(;t!==null;){var d=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,d!==null&&(d.childLanes|=a)):d!==null&&(d.childLanes&a)!==a&&(d.childLanes|=a),t===s)break;t=t.return}}function If(t,a,s,d){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var x=g.dependencies;if(x!==null){var M=g.child;x=x.firstContext;e:for(;x!==null;){var B=x;x=g;for(var W=0;W<a.length;W++)if(B.context===a[W]){x.lanes|=s,B=x.alternate,B!==null&&(B.lanes|=s),Bu(x.return,s,t),d||(M=null);break e}x=B.next}}else if(g.tag===18){if(M=g.return,M===null)throw Error(o(341));M.lanes|=s,x=M.alternate,x!==null&&(x.lanes|=s),Bu(M,s,t),M=null}else g.tag===13&&g.memoizedState!==null&&g.memoizedState.dehydrated===null?(g.lanes|=s,M=g.alternate,M!==null&&(M.lanes|=s),Bu(g.return,s,t),M=g.child,M=M!==null?M.sibling:null):M=g.child;if(M!==null)M.return=g;else for(M=g;M!==null;){if(M===t){M=null;break}if(g=M.sibling,g!==null){g.return=M.return,M=g;break}M=M.return}g=M}}function rs(t,a,s,d){t=null;for(var g=a,x=!1;g!==null;){if(!x){if((g.flags&524288)!==0)x=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var M=g.alternate;if(M===null)throw Error(o(387));if(M=M.memoizedProps,M!==null){var B=g.type;Ya(g.pendingProps.value,M.value)||(t!==null?t.push(B):t=[B])}}else if(g===ft.current){if(M=g.alternate,M===null)throw Error(o(387));M.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(wl):t=[wl])}g=g.return}return t!==null&&If(a,t,s,d),a.flags|=262144,t!==null}function Iu(t){for(t=t.firstContext;t!==null;){if(!Ya(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function os(t){is=t,Er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Yn(t){return M1(is,t)}function Pu(t,a){return is===null&&os(t),M1(t,a)}function M1(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Er===null){if(t===null)throw Error(o(308));Er=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else Er=Er.next=a;return s}var c8=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,d){t.push(d)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},u8=e.unstable_scheduleCallback,d8=e.unstable_NormalPriority,En={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new c8,data:new Map,refCount:0}}function rc(t){t.refCount--,t.refCount===0&&u8(d8,function(){t.controller.abort()})}function _1(t,a){if((t.pendingLanes&4194048)!==0){var s=t.transitionTypes;for(s===null&&(s=t.transitionTypes=[]),t=0;t<a.length;t++){var d=a[t];s.indexOf(d)===-1&&s.push(d)}}}var oc=null;function h8(t){var a=t.transitionTypes;return t.transitionTypes=null,a}var sc=null,qf=0,ss=0,Ws=null;function f8(t,a){if(sc===null){var s=sc=[];qf=0,ss=np(),Ws={status:"pending",value:void 0,then:function(d){s.push(d)}}}return qf++,a.then(R1,R1),a}function R1(){if(--qf===0&&(oc=null,sc!==null)){Ws!==null&&(Ws.status="fulfilled");var t=sc;sc=null,ss=0,Ws=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function m8(t,a){var s=[],d={status:"pending",value:null,reason:null,then:function(g){s.push(g)}};return t.then(function(){d.status="fulfilled",d.value=a;for(var g=0;g<s.length;g++)(0,s[g])(a)},function(g){for(d.status="rejected",d.reason=g,g=0;g<s.length;g++)(0,s[g])(void 0)}),d}var O1=ce.S;ce.S=function(t,a){if(Cy=Be(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&f8(t,a),oc!==null)for(var s=vl;s!==null;)_1(s,oc),s=s.next;if(s=t.types,s!==null){for(var d=vl;d!==null;)_1(d,s),d=d.next;if(ss!==0){d=oc,d===null&&(d=oc=[]);for(var g=0;g<s.length;g++){var x=s[g];d.indexOf(x)===-1&&d.push(x)}}}O1!==null&&O1(t,a)};var ls=Pe(null);function Ff(){var t=ls.current;return t!==null?t:Qt.pooledCache}function qu(t,a){a===null?He(ls,ls.current):He(ls,a.pool)}function D1(){var t=Ff();return t===null?null:{parent:En._currentValue,pool:t}}var Js=Error(o(460)),Hf=Error(o(474)),Fu=Error(o(542)),Hu={then:function(){}};function z1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function L1(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(tn,tn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,I1(t),t===void 0&&!("reason"in a)?Error(o(600)):t;default:if(typeof a.status=="string")a.then(tn,tn);else{if(t=Qt,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=a,t.status="pending",t.then(function(d){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=d}},function(d){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=d}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,I1(t),t}throw us=a,Js}}function cs(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(us=s,Js):s}}var us=null;function B1(){if(us===null)throw Error(o(459));var t=us;return us=null,t}function I1(t){if(t===Js||t===Fu)throw Error(o(483))}var el=null,lc=0;function Uu(t){var a=lc;return lc+=1,el===null&&(el=[]),L1(el,t,a)}function co(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function $u(t,a){throw a.$$typeof===I?Error(o(525)):(t=Object.prototype.toString.call(a),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function P1(t){function a(se,ne){if(t){var de=se.deletions;de===null?(se.deletions=[ne],se.flags|=16):de.push(ne)}}function s(se,ne){if(!t)return null;for(;ne!==null;)a(se,ne),ne=ne.sibling;return null}function d(se){for(var ne=new Map;se!==null;)se.key===null?ne.set(se.index,se):ne.set(se.key,se),se=se.sibling;return ne}function g(se,ne){return se=Cr(se,ne),se.index=0,se.sibling=null,se}function x(se,ne,de){return se.index=de,t?(de=se.alternate,de!==null?(de=de.index,de<ne?(se.flags|=2,ne):de):(se.flags|=134217730,ne)):(se.flags|=1048576,ne)}function M(se){return t&&se.alternate===null&&(se.flags|=134217730),se}function B(se,ne,de,we){return ne===null||ne.tag!==6?(ne=Rf(de,se.mode,we),ne.return=se,ne):(ne=g(ne,de),ne.return=se,ne)}function W(se,ne,de,we){var Ie=de.type;return Ie===P?(se=ve(se,ne,de.props.children,we,de.key),co(se,de),se):ne!==null&&(ne.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===z&&cs(Ie)===ne.type)?(ne=g(ne,de.props),co(ne,de),ne.return=se,ne):(ne=Ou(de.type,de.key,de.props,null,se.mode,we),co(ne,de),ne.return=se,ne)}function le(se,ne,de,we){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==de.containerInfo||ne.stateNode.implementation!==de.implementation?(ne=Of(de,se.mode,we),ne.return=se,ne):(ne=g(ne,de.children||[]),ne.return=se,ne)}function ve(se,ne,de,we,Ie){return ne===null||ne.tag!==7?(ne=ns(de,se.mode,we,Ie),ne.return=se,ne):(ne=g(ne,de),ne.return=se,ne)}function Se(se,ne,de){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Rf(""+ne,se.mode,de),ne.return=se,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case H:return de=Ou(ne.type,ne.key,ne.props,null,se.mode,de),co(de,ne),de.return=se,de;case O:return ne=Of(ne,se.mode,de),ne.return=se,ne;case z:return ne=cs(ne),Se(se,ne,de)}if(te(ne)||X(ne))return ne=ns(ne,se.mode,de,null),ne.return=se,ne;if(typeof ne.then=="function")return Se(se,Uu(ne),de);if(ne.$$typeof===q)return Se(se,Pu(se,ne),de);$u(se,ne)}return null}function re(se,ne,de,we){var Ie=ne!==null?ne.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Ie!==null?null:B(se,ne,""+de,we);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case H:return de.key===Ie?W(se,ne,de,we):null;case O:return de.key===Ie?le(se,ne,de,we):null;case z:return de=cs(de),re(se,ne,de,we)}if(te(de)||X(de))return Ie!==null?null:ve(se,ne,de,we,null);if(typeof de.then=="function")return re(se,ne,Uu(de),we);if(de.$$typeof===q)return re(se,ne,Pu(se,de),we);$u(se,de)}return null}function fe(se,ne,de,we,Ie){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return se=se.get(de)||null,B(ne,se,""+we,Ie);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case H:return se=se.get(we.key===null?de:we.key)||null,W(ne,se,we,Ie);case O:return se=se.get(we.key===null?de:we.key)||null,le(ne,se,we,Ie);case z:return we=cs(we),fe(se,ne,de,we,Ie)}if(te(we)||X(we))return se=se.get(de)||null,ve(ne,se,we,Ie,null);if(typeof we.then=="function")return fe(se,ne,de,Uu(we),Ie);if(we.$$typeof===q)return fe(se,ne,de,Pu(ne,we),Ie);$u(ne,we)}return null}function ze(se,ne,de,we){for(var Ie=null,Ct=null,Ke=ne,rt=ne=0,Mn=null;Ke!==null&&rt<de.length;rt++){Ke.index>rt?(Mn=Ke,Ke=null):Mn=Ke.sibling;var At=re(se,Ke,de[rt],we);if(At===null){Ke===null&&(Ke=Mn);break}t&&Ke&&At.alternate===null&&a(se,Ke),ne=x(At,ne,rt),Ct===null?Ie=At:Ct.sibling=At,Ct=At,Ke=Mn}if(rt===de.length)return s(se,Ke),vt&&Nr(se,rt),Ie;if(Ke===null){for(;rt<de.length;rt++)Ke=Se(se,de[rt],we),Ke!==null&&(ne=x(Ke,ne,rt),Ct===null?Ie=Ke:Ct.sibling=Ke,Ct=Ke);return vt&&Nr(se,rt),Ie}for(Ke=d(Ke);rt<de.length;rt++)Mn=fe(Ke,se,rt,de[rt],we),Mn!==null&&(t&&(At=Mn.alternate,At!==null&&Ke.delete(At.key===null?rt:At.key)),ne=x(Mn,ne,rt),Ct===null?Ie=Mn:Ct.sibling=Mn,Ct=Mn);return t&&Ke.forEach(function(Ao){return a(se,Ao)}),vt&&Nr(se,rt),Ie}function Ue(se,ne,de,we){if(de==null)throw Error(o(151));for(var Ie=null,Ct=null,Ke=ne,rt=ne=0,Mn=null,At=de.next();Ke!==null&&!At.done;rt++,At=de.next()){Ke.index>rt?(Mn=Ke,Ke=null):Mn=Ke.sibling;var Ao=re(se,Ke,At.value,we);if(Ao===null){Ke===null&&(Ke=Mn);break}t&&Ke&&Ao.alternate===null&&a(se,Ke),ne=x(Ao,ne,rt),Ct===null?Ie=Ao:Ct.sibling=Ao,Ct=Ao,Ke=Mn}if(At.done)return s(se,Ke),vt&&Nr(se,rt),Ie;if(Ke===null){for(;!At.done;rt++,At=de.next())At=Se(se,At.value,we),At!==null&&(ne=x(At,ne,rt),Ct===null?Ie=At:Ct.sibling=At,Ct=At);return vt&&Nr(se,rt),Ie}for(Ke=d(Ke);!At.done;rt++,At=de.next())At=fe(Ke,se,rt,At.value,we),At!==null&&(t&&(Mn=At.alternate,Mn!==null&&Ke.delete(Mn.key===null?rt:Mn.key)),ne=x(At,ne,rt),Ct===null?Ie=At:Ct.sibling=At,Ct=At);return t&&Ke.forEach(function(K7){return a(se,K7)}),vt&&Nr(se,rt),Ie}function ht(se,ne,de,we){if(typeof de=="object"&&de!==null&&de.type===P&&de.key===null&&de.props.ref===void 0&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case H:e:{for(var Ie=de.key;ne!==null;){if(ne.key===Ie){if(Ie=de.type,Ie===P){if(ne.tag===7){s(se,ne.sibling),we=g(ne,de.props.children),co(we,de),we.return=se,se=we;break e}}else if(ne.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===z&&cs(Ie)===ne.type){s(se,ne.sibling),we=g(ne,de.props),co(we,de),we.return=se,se=we;break e}s(se,ne);break}else a(se,ne);ne=ne.sibling}de.type===P?(we=ns(de.props.children,se.mode,we,de.key),co(we,de),we.return=se,se=we):(we=Ou(de.type,de.key,de.props,null,se.mode,we),co(we,de),we.return=se,se=we)}return M(se);case O:e:{for(Ie=de.key;ne!==null;){if(ne.key===Ie)if(ne.tag===4&&ne.stateNode.containerInfo===de.containerInfo&&ne.stateNode.implementation===de.implementation){s(se,ne.sibling),we=g(ne,de.children||[]),we.return=se,se=we;break e}else{s(se,ne);break}else a(se,ne);ne=ne.sibling}we=Of(de,se.mode,we),we.return=se,se=we}return M(se);case z:return de=cs(de),ht(se,ne,de,we)}if(te(de))return ze(se,ne,de,we);if(X(de)){if(Ie=X(de),typeof Ie!="function")throw Error(o(150));return de=Ie.call(de),Ue(se,ne,de,we)}if(typeof de.then=="function")return ht(se,ne,Uu(de),we);if(de.$$typeof===q)return ht(se,ne,Pu(se,de),we);$u(se,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,ne!==null&&ne.tag===6?(s(se,ne.sibling),we=g(ne,de),we.return=se,se=we):(s(se,ne),we=Rf(de,se.mode,we),we.return=se,se=we),M(se)):s(se,ne)}return function(se,ne,de,we){try{lc=0;var Ie=ht(se,ne,de,we);return el=null,Ie}catch(Ke){if(Ke===Js||Ke===Fu)throw Ke;var Ct=Ta(29,Ke,null,se.mode);return Ct.lanes=we,Ct.return=se,Ct}finally{}}}var ds=P1(!0),q1=P1(!1),uo=!1;function Uf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(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 ho(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function fo(t,a,s){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(Ot&2)!==0){var g=d.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),d.pending=a,a=Ru(t),k1(t,null,s),a}return _u(t,d,a,s),Ru(t)}function cc(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var d=a.lanes;d&=t.pendingLanes,s|=d,a.lanes=s,Vn(t,s)}}function Vf(t,a){var s=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var g=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var M={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?g=x=M:x=x.next=M,s=s.next}while(s!==null);x===null?g=x=a:x=x.next=a}else g=x=a;s={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var Gf=!1;function uc(){if(Gf){var t=Ws;if(t!==null)throw t}}function dc(t,a,s,d){Gf=!1;var g=t.updateQueue;uo=!1;var x=g.firstBaseUpdate,M=g.lastBaseUpdate,B=g.shared.pending;if(B!==null){g.shared.pending=null;var W=B,le=W.next;W.next=null,M===null?x=le:M.next=le,M=W;var ve=t.alternate;ve!==null&&(ve=ve.updateQueue,B=ve.lastBaseUpdate,B!==M&&(B===null?ve.firstBaseUpdate=le:B.next=le,ve.lastBaseUpdate=W))}if(x!==null){var Se=g.baseState;M=0,ve=le=W=null,B=x;do{var re=B.lane&-536870913,fe=re!==B.lane;if(fe?(St&re)===re:(d&re)===re){re!==0&&re===ss&&(Gf=!0),ve!==null&&(ve=ve.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var ze=t,Ue=B;re=a;var ht=s;switch(Ue.tag){case 1:if(ze=Ue.payload,typeof ze=="function"){Se=ze.call(ht,Se,re);break e}Se=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ue.payload,re=typeof ze=="function"?ze.call(ht,Se,re):ze,re==null)break e;Se=L({},Se,re);break e;case 2:uo=!0}}re=B.callback,re!==null&&(t.flags|=64,fe&&(t.flags|=8192),fe=g.callbacks,fe===null?g.callbacks=[re]:fe.push(re))}else fe={lane:re,tag:B.tag,payload:B.payload,callback:B.callback,next:null},ve===null?(le=ve=fe,W=Se):ve=ve.next=fe,M|=re;if(B=B.next,B===null){if(B=g.shared.pending,B===null)break;fe=B,B=fe.next,fe.next=null,g.lastBaseUpdate=fe,g.shared.pending=null}}while(!0);ve===null&&(W=Se),g.baseState=W,g.firstBaseUpdate=le,g.lastBaseUpdate=ve,x===null&&(g.shared.lanes=0),bo|=M,t.lanes=M,t.memoizedState=Se}}function F1(t,a){if(typeof t!="function")throw Error(o(191,t));t.call(a)}function H1(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)F1(s[t],a)}var mo=Pe(null),Vu=Pe(0);function U1(t,a){t=Or,He(Vu,t),He(mo,a),Or=t|a.baseLanes}function Yf(){He(Vu,Or),He(mo,mo.current)}function Kf(){Or=Vu.current,Le(mo),Le(Vu)}var Kn=Pe(null),aa=null;function po(t){var a=t.alternate;He(Xn,Xn.current&1),He(Kn,t),aa===null&&(a===null||mo.current!==null||a.memoizedState!==null)&&(aa=t)}function Xf(t){He(Xn,Xn.current),He(Kn,t),aa===null&&(aa=t)}function $1(t){t.tag===22?(He(Xn,Xn.current),He(Kn,t),aa===null&&(aa=t)):vo()}function vo(){He(Xn,Xn.current),He(Kn,Kn.current)}function Ka(t){Le(Kn),aa===t&&(aa=null),Le(Xn)}var Xn=Pe(0);function hc(t,a){He(Kn,Kn.current),He(Xn,a)}function Qf(t){Le(Xn),Le(Kn),aa===t&&(aa=null)}function Gu(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||yp(s)||xp(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 Ar=0,dt=null,Ut=null,Tn=null,Yu=!1,tl=!1,hs=!1,Ku=0,fc=0,nl=null,p8=0;function bn(){throw Error(o(321))}function Zf(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!Ya(t[s],a[s]))return!1;return!0}function Wf(t,a,s,d,g,x){return Ar=x,dt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,ce.H=t===null||t.memoizedState===null?E2:T2,hs=!1,x=s(d,g),hs=!1,tl&&(x=G1(a,s,d,g)),V1(t),x}function V1(t){ce.H=td;var a=Ut!==null&&Ut.next!==null;if(Ar=0,Tn=Ut=dt=null,Yu=!1,fc=0,nl=null,a)throw Error(o(300));t===null||An||(t=t.dependencies,t!==null&&Iu(t)&&(An=!0))}function G1(t,a,s,d){dt=t;var g=0;do{if(tl&&(nl=null),fc=0,tl=!1,25<=g)throw Error(o(301));if(g+=1,Tn=Ut=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}ce.H=k8,x=a(s,d)}while(tl);return x}function v8(){var t=ce.H,a=t.useState()[0];return a=typeof a.then=="function"?mc(a):a,t=t.useState()[0],(Ut!==null?Ut.memoizedState:null)!==t&&(dt.flags|=1024),a}function Jf(){var t=Ku!==0;return Ku=0,t}function em(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function tm(t){if(Yu){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Yu=!1}Ar=0,Tn=Ut=dt=null,tl=!1,fc=Ku=0,nl=null}function ga(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?dt.memoizedState=Tn=t:Tn=Tn.next=t,Tn}function kn(){if(Ut===null){var t=dt.alternate;t=t!==null?t.memoizedState:null}else t=Ut.next;var a=Tn===null?dt.memoizedState:Tn.next;if(a!==null)Tn=a,Ut=t;else{if(t===null)throw dt.alternate===null?Error(o(467)):Error(o(310));Ut=t,t={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Tn===null?dt.memoizedState=Tn=t:Tn=Tn.next=t}return Tn}function Xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mc(t){var a=fc;return fc+=1,nl===null&&(nl=[]),t=L1(nl,t,a),a=dt,(Tn===null?a.memoizedState:Tn.next)===null&&(a=a.alternate,ce.H=a===null||a.memoizedState===null?E2:T2),t}function Qu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return mc(t);if(t.$$typeof===ie)return;if(t.$$typeof===q)return Yn(t)}throw Error(o(438,String(t)))}function nm(t){var a=null,s=dt.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var d=dt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(a={data:d.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Xu(),dt.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),d=0;d<t;d++)s[d]=D;return a.index++,s}function Mr(t,a){return typeof a=="function"?a(t):a}function Zu(t){var a=kn();return am(a,Ut,t)}function am(t,a,s){var d=t.queue;if(d===null)throw Error(o(311));d.lastRenderedReducer=s;var g=t.baseQueue,x=d.pending;if(x!==null){if(g!==null){var M=g.next;g.next=x.next,x.next=M}a.baseQueue=g=x,d.pending=null}if(x=t.baseState,g===null)t.memoizedState=x;else{a=g.next;var B=M=null,W=null,le=a,ve=!1;do{var Se=le.lane&-536870913;if(Se!==le.lane?(St&Se)===Se:(Ar&Se)===Se){var re=le.revertLane;if(re===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Se===ss&&(ve=!0);else if((Ar&re)===re){le=le.next,re===ss&&(ve=!0);continue}else Se={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},W===null?(B=W=Se,M=x):W=W.next=Se,dt.lanes|=re,bo|=re;Se=le.action,hs&&s(x,Se),x=le.hasEagerState?le.eagerState:s(x,Se)}else re={lane:Se,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},W===null?(B=W=re,M=x):W=W.next=re,dt.lanes|=Se,bo|=Se;le=le.next}while(le!==null&&le!==a);if(W===null?M=x:W.next=B,!Ya(x,t.memoizedState)&&(An=!0,ve&&(s=Ws,s!==null)))throw s;t.memoizedState=x,t.baseState=M,t.baseQueue=W,d.lastRenderedState=x}return g===null&&(d.lanes=0),[t.memoizedState,d.dispatch]}function im(t){var a=kn(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var d=s.dispatch,g=s.pending,x=a.memoizedState;if(g!==null){s.pending=null;var M=g=g.next;do x=t(x,M.action),M=M.next;while(M!==g);Ya(x,a.memoizedState)||(An=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),s.lastRenderedState=x}return[x,d]}function Y1(t,a,s){var d=dt,g=kn(),x=vt;if(x){if(s===void 0)throw Error(o(407));s=s()}else s=a();var M=!Ya((Ut||g).memoizedState,s);if(M&&(g.memoizedState=s,An=!0),g=g.queue,sm(Q1.bind(null,d,g,t),[t]),t=g.getSnapshot!==a||M||Tn!==null&&(Tn.memoizedState.tag&1)!==0,al(t?9:8,{destroy:void 0},X1.bind(null,d,g,s,a),null),t){if(d.flags|=2048,Qt===null)throw Error(o(349));x||(Ar&127)!==0||K1(d,a,s)}return s}function K1(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=dt.updateQueue,a===null?(a=Xu(),dt.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function X1(t,a,s,d){a.value=s,a.getSnapshot=d,Z1(a)&&W1(t)}function Q1(t,a,s){return s(function(){Z1(a)&&W1(t)})}function Z1(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!Ya(t,s)}catch{return!0}}function W1(t){var a=ts(t,2);a!==null&&Ra(a,t,2)}function rm(t){var a=ga();if(typeof t=="function"){var s=t;if(t=s(),hs){sn(!0);try{s()}finally{sn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:t},a}function J1(t,a,s,d){return t.baseState=s,am(t,Ut,typeof d=="function"?d:Mr)}function g8(t,a,s,d,g){if(ed(t))throw Error(o(485));if(t=a.action,t!==null){var x={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){x.listeners.push(M)}};ce.T!==null?s(!0):x.isTransition=!1,d(x),s=a.pending,s===null?(x.next=a.pending=x,e2(a,x)):(x.next=s.next,a.pending=s.next=x)}}function e2(t,a){var s=a.action,d=a.payload,g=t.state;if(a.isTransition){var x=ce.T,M={};M.types=x!==null?x.types:null,ce.T=M;try{var B=s(g,d),W=ce.S;W!==null&&W(M,B),t2(t,a,B)}catch(le){om(t,a,le)}finally{x!==null&&M.types!==null&&(x.types=M.types),ce.T=x}}else try{x=s(g,d),t2(t,a,x)}catch(le){om(t,a,le)}}function t2(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){n2(t,a,d)},function(d){return om(t,a,d)}):n2(t,a,s)}function n2(t,a,s){a.status="fulfilled",a.value=s,a2(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,e2(t,s)))}function om(t,a,s){var d=t.pending;if(t.pending=null,d!==null){d=d.next;do a.status="rejected",a.reason=s,a2(a),a=a.next;while(a!==d)}t.action=null}function a2(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function i2(t,a){return a}function r2(t,a){if(vt){var s=Qt.formState;if(s!==null){e:{var d=dt;if(vt){if(nn){t:{for(var g=nn,x=ui;g.nodeType!==8;){if(!x){g=null;break t}if(g=hi(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){nn=hi(g.nextSibling),d=g.data==="F!";break e}}so(d)}d=!1}d&&(a=s[0])}}return s=ga(),s.memoizedState=s.baseState=a,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i2,lastRenderedState:a},s.queue=d,s=S2.bind(null,dt,d),d.dispatch=s,d=rm(!1),x=hm.bind(null,dt,!1,d.queue),d=ga(),g={state:a,dispatch:null,action:t,pending:null},d.queue=g,s=g8.bind(null,dt,g,x,s),g.dispatch=s,d.memoizedState=t,[a,s,!1]}function o2(t){var a=kn();return s2(a,Ut,t)}function s2(t,a,s){if(a=am(t,a,i2)[0],t=Zu(Mr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var d=mc(a)}catch(M){throw M===Js?Fu:M}else d=a;a=kn();var g=a.queue,x=g.dispatch;return s!==a.memoizedState&&(dt.flags|=2048,al(9,{destroy:void 0},y8.bind(null,g,s),null)),[d,x,t]}function y8(t,a){t.action=a}function l2(t){var a=kn(),s=Ut;if(s!==null)return s2(a,s,t);kn(),a=a.memoizedState,s=kn();var d=s.queue.dispatch;return s.memoizedState=t,[a,d,!1]}function al(t,a,s,d){return t={tag:t,create:s,deps:d,inst:a,next:null},a=dt.updateQueue,a===null&&(a=Xu(),dt.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(d=s.next,s.next=t,t.next=d,a.lastEffect=t),t}function c2(){return kn().memoizedState}function Wu(t,a,s,d){var g=ga();dt.flags|=t,g.memoizedState=al(1|a,{destroy:void 0},s,d===void 0?null:d)}function Ju(t,a,s,d){var g=kn();d=d===void 0?null:d;var x=g.memoizedState.inst;Ut!==null&&d!==null&&Zf(d,Ut.memoizedState.deps)?g.memoizedState=al(a,x,s,d):(dt.flags|=t,g.memoizedState=al(1|a,x,s,d))}function u2(t,a){Wu(8390656,8,t,a)}function sm(t,a){Ju(2048,8,t,a)}function x8(t){dt.flags|=4;var a=dt.updateQueue;if(a===null)a=Xu(),dt.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function d2(t){var a=kn().memoizedState;return x8({ref:a,nextImpl:t}),function(){if((Ot&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function h2(t,a){return Ju(4,2,t,a)}function f2(t,a){return Ju(4,4,t,a)}function m2(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 p2(t,a,s){s=s!=null?s.concat([t]):null,Ju(4,4,m2.bind(null,a,t),s)}function lm(){}function v2(t,a){var s=kn();a=a===void 0?null:a;var d=s.memoizedState;return a!==null&&Zf(a,d[1])?d[0]:(s.memoizedState=[t,a],t)}function g2(t,a){var s=kn();a=a===void 0?null:a;var d=s.memoizedState;if(a!==null&&Zf(a,d[1]))return d[0];if(d=t(),hs){sn(!0);try{t()}finally{sn(!1)}}return s.memoizedState=[d,a],d}function cm(t,a,s){return s===void 0||(Ar&1073741824)!==0&&(St&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=Ey(),dt.lanes|=t,bo|=t,s)}function y2(t,a,s,d){return Ya(s,a)?s:mo.current!==null?(t=cm(t,s,d),Ya(t,a)||(An=!0),t):(Ar&106)===0||(Ar&1073741824)!==0&&(St&261930)===0?(An=!0,t.memoizedState=s):(t=Ey(),dt.lanes|=t,bo|=t,a)}function x2(t,a,s,d,g){var x=J.p;J.p=x!==0&&8>x?x:8;var M=ce.T,B={};B.types=M!==null?M.types:null,ce.T=B,hm(t,!1,a,s);try{var W=g(),le=ce.S;if(le!==null&&le(B,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ve=m8(W,d);pc(t,a,ve,Wa(t))}else pc(t,a,d,Wa(t))}catch(Se){pc(t,a,{then:function(){},status:"rejected",reason:Se},Wa())}finally{J.p=x,M!==null&&B.types!==null&&(M.types=B.types),ce.T=M}}function b8(){}function um(t,a,s,d){if(t.tag!==5)throw Error(o(476));var g=b2(t).queue;x2(t,g,a,je,s===null?b8:function(){return j2(t),s(d)})}function b2(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:je,baseState:je,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:je},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function j2(t){var a=b2(t);a.next===null&&(a=t.alternate.memoizedState),pc(t,a.next.queue,{},Wa())}function dm(){return Yn(wl)}function w2(){return kn().memoizedState}function k2(){return kn().memoizedState}function j8(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=Wa();t=ho(s);var d=fo(a,t,s);d!==null&&(Ra(d,a,s),cc(d,a,s)),a={cache:Pf()},t.payload=a;return}a=a.return}}function w8(t,a,s){var d=Wa();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ed(t)?C2(a,s):(s=Mf(t,a,s,d),s!==null&&(Ra(s,t,d),N2(s,a,d)))}function S2(t,a,s){var d=Wa();pc(t,a,s,d)}function pc(t,a,s,d){var g={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ed(t))C2(a,g);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var M=a.lastRenderedState,B=x(M,s);if(g.hasEagerState=!0,g.eagerState=B,Ya(B,M))return _u(t,a,g,0),Qt===null&&Mu(),!1}catch{}finally{}if(s=Mf(t,a,g,d),s!==null)return Ra(s,t,d),N2(s,a,d),!0}return!1}function hm(t,a,s,d){if(d={lane:2,revertLane:np(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ed(t)){if(a)throw Error(o(479))}else a=Mf(t,s,d,2),a!==null&&Ra(a,t,2)}function ed(t){var a=t.alternate;return t===dt||a!==null&&a===dt}function C2(t,a){tl=Yu=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function N2(t,a,s){if((s&4194048)!==0){var d=a.lanes;d&=t.pendingLanes,s|=d,a.lanes=s,Vn(t,s)}}var td={readContext:Yn,use:Qu,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useLayoutEffect:bn,useInsertionEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useSyncExternalStore:bn,useId:bn,useHostTransitionStatus:bn,useFormState:bn,useActionState:bn,useOptimistic:bn,useMemoCache:bn,useCacheRefresh:bn,useEffectEvent:bn},E2={readContext:Yn,use:Qu,useCallback:function(t,a){return ga().memoizedState=[t,a===void 0?null:a],t},useContext:Yn,useEffect:u2,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,Wu(4194308,4,m2.bind(null,a,t),s)},useLayoutEffect:function(t,a){return Wu(4194308,4,t,a)},useInsertionEffect:function(t,a){Wu(4,2,t,a)},useMemo:function(t,a){var s=ga();a=a===void 0?null:a;var d=t();if(hs){sn(!0);try{t()}finally{sn(!1)}}return s.memoizedState=[d,a],d},useReducer:function(t,a,s){var d=ga();if(s!==void 0){var g=s(a);if(hs){sn(!0);try{s(a)}finally{sn(!1)}}}else g=a;return d.memoizedState=d.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},d.queue=t,t=t.dispatch=w8.bind(null,dt,t),[d.memoizedState,t]},useRef:function(t){var a=ga();return t={current:t},a.memoizedState=t},useState:function(t){t=rm(t);var a=t.queue,s=S2.bind(null,dt,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:lm,useDeferredValue:function(t,a){var s=ga();return cm(s,t,a)},useTransition:function(){var t=rm(!1);return t=x2.bind(null,dt,t.queue,!0,!1),ga().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var d=dt,g=ga();if(vt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),Qt===null)throw Error(o(349));(St&127)!==0||K1(d,a,s)}g.memoizedState=s;var x={value:s,getSnapshot:a};return g.queue=x,u2(Q1.bind(null,d,x,t),[t]),d.flags|=2048,al(9,{destroy:void 0},X1.bind(null,d,x,s,a),null),s},useId:function(){var t=ga(),a=Qt.identifierPrefix;if(vt){var s=Vi,d=$i;s=(d&~(1<<32-cn(d)-1)).toString(32)+s,a="_"+a+"R_"+s,s=Ku++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=p8++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:dm,useFormState:r2,useActionState:r2,useOptimistic:function(t){var a=ga();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=hm.bind(null,dt,!0,s),s.dispatch=a,[t,a]},useMemoCache:nm,useCacheRefresh:function(){return ga().memoizedState=j8.bind(null,dt)},useEffectEvent:function(t){var a=ga(),s={impl:t};return a.memoizedState=s,function(){if((Ot&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},T2={readContext:Yn,use:Qu,useCallback:v2,useContext:Yn,useEffect:sm,useImperativeHandle:p2,useInsertionEffect:h2,useLayoutEffect:f2,useMemo:g2,useReducer:Zu,useRef:c2,useState:function(){return Zu(Mr)},useDebugValue:lm,useDeferredValue:function(t,a){var s=kn();return y2(s,Ut.memoizedState,t,a)},useTransition:function(){var t=Zu(Mr)[0],a=kn().memoizedState;return[typeof t=="boolean"?t:mc(t),a]},useSyncExternalStore:Y1,useId:w2,useHostTransitionStatus:dm,useFormState:o2,useActionState:o2,useOptimistic:function(t,a){var s=kn();return J1(s,Ut,t,a)},useMemoCache:nm,useCacheRefresh:k2,useEffectEvent:d2},k8={readContext:Yn,use:Qu,useCallback:v2,useContext:Yn,useEffect:sm,useImperativeHandle:p2,useInsertionEffect:h2,useLayoutEffect:f2,useMemo:g2,useReducer:im,useRef:c2,useState:function(){return im(Mr)},useDebugValue:lm,useDeferredValue:function(t,a){var s=kn();return Ut===null?cm(s,t,a):y2(s,Ut.memoizedState,t,a)},useTransition:function(){var t=im(Mr)[0],a=kn().memoizedState;return[typeof t=="boolean"?t:mc(t),a]},useSyncExternalStore:Y1,useId:w2,useHostTransitionStatus:dm,useFormState:l2,useActionState:l2,useOptimistic:function(t,a){var s=kn();return Ut!==null?J1(s,Ut,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:nm,useCacheRefresh:k2,useEffectEvent:d2};function fm(t,a,s,d){a=t.memoizedState,s=s(d,a),s=s==null?a:L({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var mm={enqueueSetState:function(t,a,s){t=t._reactInternals;var d=Wa(),g=ho(d);g.payload=a,s!=null&&(g.callback=s),a=fo(t,g,d),a!==null&&(Ra(a,t,d),cc(a,t,d))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var d=Wa(),g=ho(d);g.tag=1,g.payload=a,s!=null&&(g.callback=s),a=fo(t,g,d),a!==null&&(Ra(a,t,d),cc(a,t,d))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=Wa(),d=ho(s);d.tag=2,a!=null&&(d.callback=a),a=fo(t,d,s),a!==null&&(Ra(a,t,s),cc(a,t,s))}};function A2(t,a,s,d,g,x,M){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,x,M):a.prototype&&a.prototype.isPureReactComponent?!tc(s,d)||!tc(g,x):!0}function M2(t,a,s,d){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,d),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,d),a.state!==t&&mm.enqueueReplaceState(a,a.state,null)}function fs(t,a){var s=a;if("ref"in a){s={};for(var d in a)d!=="ref"&&(s[d]=a[d])}if(t=t.defaultProps){s===a&&(s=L({},s));for(var g in t)s[g]===void 0&&(s[g]=t[g])}return s}function _2(t){Au(t)}function R2(t){console.error(t)}function O2(t){Au(t)}function nd(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(d){setTimeout(function(){throw d})}}function D2(t,a,s){try{var d=t.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function pm(t,a,s){return s=ho(s),s.tag=3,s.payload={element:null},s.callback=function(){nd(t,a)},s}function z2(t){return t=ho(t),t.tag=3,t}function L2(t,a,s,d){var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var x=d.value;t.payload=function(){return g(x)},t.callback=function(){D2(a,s,d)}}var M=s.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(t.callback=function(){D2(a,s,d),typeof g!="function"&&(jo===null?jo=new Set([this]):jo.add(this));var B=d.stack;this.componentDidCatch(d.value,{componentStack:B!==null?B:""})})}function S8(t,a,s,d,g){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(a=s.alternate,a!==null&&rs(a,s,g,!0),s=Kn.current,s!==null){switch(s.tag){case 31:case 13:case 19:return aa===null?kd():s.alternate===null&&jn===0&&(jn=3),s.flags&=-257,s.flags|=65536,s.lanes=g,d===Hu?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([d]):a.add(d),Jm(t,d,g)),!1;case 22:return s.flags|=65536,d===Hu?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([d]):s.add(d)),Jm(t,d,g)),!1}throw Error(o(435,s.tag))}return Jm(t,d,g),kd(),!1}if(vt)return a=Kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,d!==zf&&(t=Error(o(422),{cause:d}),ic(si(t,s)))):(d!==zf&&(a=Error(o(423),{cause:d}),ic(si(a,s))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,d=si(d,s),g=pm(t.stateNode,d,g),Vf(t,g),jn!==4&&(jn=2)),!1;var x=Error(o(520),{cause:d});if(x=si(x,s),kc===null?kc=[x]:kc.push(x),jn!==4&&(jn=2),a===null)return!0;d=si(d,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=g&-g,s.lanes|=t,t=pm(s.stateNode,d,t),Vf(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"&&(jo===null||!jo.has(x))))return s.flags|=65536,g&=-g,s.lanes|=g,g=z2(g),L2(g,t,s,d),Vf(s,g),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var vm=Error(o(461)),An=!1;function zn(t,a,s,d){a.child=t===null?q1(a,null,s,d):ds(a,t.child,s,d)}function B2(t,a,s,d,g){s=s.render;var x=a.ref;if("ref"in d){var M={};for(var B in d)B!=="ref"&&(M[B]=d[B])}else M=d;return os(a),d=Wf(t,a,s,M,x,g),B=Jf(),t!==null&&!An?(em(t,a,g),_r(t,a,g)):(vt&&B&&zu(a),a.flags|=1,zn(t,a,d,g),a.child)}function I2(t,a,s,d,g){if(t===null){var x=s.type;return typeof x=="function"&&!_f(x)&&x.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=x,P2(t,a,x,d,g)):(t=Ou(s.type,null,d,a,a.mode,g),t.ref=a.ref,t.return=a,a.child=t)}if(x=t.child,!Sm(t,g)){var M=x.memoizedProps;if(s=s.compare,s=s!==null?s:tc,s(M,d)&&t.ref===a.ref)return _r(t,a,g)}return a.flags|=1,t=Cr(x,d),t.ref=a.ref,t.return=a,a.child=t}function P2(t,a,s,d,g){if(t!==null){var x=t.memoizedProps;if(tc(x,d)&&t.ref===a.ref)if(An=!1,a.pendingProps=d=x,Sm(t,g))(t.flags&131072)!==0&&(An=!0);else return a.lanes=t.lanes,_r(t,a,g)}return gm(t,a,s,d,g)}function q2(t,a,s,d){var g=d.children,x=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(d=a.child=t.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~x}else d=0,a.child=null;return F2(t,a,x,s,d)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&qu(a,x!==null?x.cachePool:null),x!==null?U1(a,x):Yf(),$1(a);else return d=a.lanes=536870912,F2(t,a,x!==null?x.baseLanes|s:s,s,d)}else x!==null?(qu(a,x.cachePool),U1(a,x),vo(),a.memoizedState=null):(t!==null&&qu(a,null),Yf(),vo());return zn(t,a,g,s),a.child}function vc(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function F2(t,a,s,d,g){var x=Ff();return x=x===null?null:{parent:En._currentValue,pool:x},a.memoizedState={baseLanes:s,cachePool:x},t!==null&&qu(a,null),Yf(),$1(a),t!==null&&rs(t,a,d,!0),a.childLanes=g,null}function ad(t,a){return a=id({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function H2(t,a,s){return ds(a,t.child,null,s),t=ad(a,a.pendingProps),t.flags|=2,Ka(a),a.memoizedState=null,t}function C8(t,a,s){var d=a.pendingProps,g=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(vt){if(d.mode==="hidden")return t=ad(a,d),a.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},vc(null,t);if(Xf(a),(t=nn)?(t=mx(t,ui),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:ro!==null?{id:$i,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},s=C1(t),s.return=a,a.child=s,Pn=a,nn=null)):t=null,t===null)throw so(a);return a.lanes=536870912,null}return ad(a,d)}var x=t.memoizedState;if(x!==null){var M=x.dehydrated;if(Xf(a),g)if(a.flags&256)a.flags&=-257,a=H2(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(o(558));else if(An||rs(t,a,s,!1),g=(s&t.childLanes)!==0,An||g){if(mo.current===null){if(d=Qt,d!==null&&(M=gi(d,s),M!==0&&M!==x.retryLane))throw x.retryLane=M,ts(t,M),Ra(d,t,M),vm;kd()}a=H2(t,a,s)}else t=x.treeContext,nn=hi(M.nextSibling),Pn=a,vt=!0,oo=null,ui=!1,t!==null&&T1(a,t),a=ad(a,d),a.flags|=134221824;return a}return t=Cr(t.child,{mode:d.mode,children:d.children}),t.ref=a.ref,a.child=t,t.return=a,t}function il(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(o(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function gm(t,a,s,d,g){return os(a),s=Wf(t,a,s,d,void 0,g),d=Jf(),t!==null&&!An?(em(t,a,g),_r(t,a,g)):(vt&&d&&zu(a),a.flags|=1,zn(t,a,s,g),a.child)}function U2(t,a,s,d,g,x){return os(a),a.updateQueue=null,s=G1(a,d,s,g),V1(t),d=Jf(),t!==null&&!An?(em(t,a,x),_r(t,a,x)):(vt&&d&&zu(a),a.flags|=1,zn(t,a,s,x),a.child)}function $2(t,a,s,d,g){if(os(a),a.stateNode===null){var x=Ks,M=s.contextType;typeof M=="object"&&M!==null&&(x=Yn(M)),x=new s(d,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=mm,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=d,x.state=a.memoizedState,x.refs={},Uf(a),M=s.contextType,x.context=typeof M=="object"&&M!==null?Yn(M):Ks,x.state=a.memoizedState,M=s.getDerivedStateFromProps,typeof M=="function"&&(fm(a,s,M,d),x.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(M=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),M!==x.state&&mm.enqueueReplaceState(x,x.state,null),dc(a,d,x,g),uc(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),d=!0}else if(t===null){x=a.stateNode;var B=a.memoizedProps,W=fs(s,B);x.props=W;var le=x.context,ve=s.contextType;M=Ks,typeof ve=="object"&&ve!==null&&(M=Yn(ve));var Se=s.getDerivedStateFromProps;ve=typeof Se=="function"||typeof x.getSnapshotBeforeUpdate=="function",B=a.pendingProps!==B,ve||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(B||le!==M)&&M2(a,x,d,M),uo=!1;var re=a.memoizedState;x.state=re,dc(a,d,x,g),uc(),le=a.memoizedState,B||re!==le||uo?(typeof Se=="function"&&(fm(a,s,Se,d),le=a.memoizedState),(W=uo||A2(a,s,W,d,re,le,M))?(ve||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=d,a.memoizedState=le),x.props=d,x.state=le,x.context=M,d=W):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),d=!1)}else{x=a.stateNode,$f(t,a),M=a.memoizedProps,ve=fs(s,M),x.props=ve,Se=a.pendingProps,re=x.context,le=s.contextType,W=Ks,typeof le=="object"&&le!==null&&(W=Yn(le)),B=s.getDerivedStateFromProps,(le=typeof B=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(M!==Se||re!==W)&&M2(a,x,d,W),uo=!1,re=a.memoizedState,x.state=re,dc(a,d,x,g),uc();var fe=a.memoizedState;M!==Se||re!==fe||uo||t!==null&&t.dependencies!==null&&Iu(t.dependencies)?(typeof B=="function"&&(fm(a,s,B,d),fe=a.memoizedState),(ve=uo||A2(a,s,ve,d,re,fe,W)||t!==null&&t.dependencies!==null&&Iu(t.dependencies))?(le||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,fe,W),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,fe,W)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||M===t.memoizedProps&&re===t.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&re===t.memoizedState||(a.flags|=1024),a.memoizedProps=d,a.memoizedState=fe),x.props=d,x.state=fe,x.context=W,d=ve):(typeof x.componentDidUpdate!="function"||M===t.memoizedProps&&re===t.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&re===t.memoizedState||(a.flags|=1024),d=!1)}return x=d,il(t,a),d=(a.flags&128)!==0,x||d?(x=a.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,t!==null&&d?(a.child=ds(a,t.child,null,g),a.child=ds(a,null,s,g)):zn(t,a,s,g),a.memoizedState=x.state,t=a.child):t=_r(t,a,g),t}function V2(t,a,s,d){return as(),a.flags|=256,zn(t,a,s,d),a.child}var ym={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xm(t){return{baseLanes:t,cachePool:D1()}}function bm(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=Za),t}function G2(t,a,s){var d=a.pendingProps,g=!1,x=(a.flags&128)!==0,M;if((M=x)||(M=t!==null&&t.memoizedState===null?!1:(Xn.current&2)!==0),M&&(g=!0,a.flags&=-129),M=(a.flags&32)!==0,a.flags&=-33,t===null){if(vt){if(g?po(a):vo(),(t=nn)?(t=mx(t,ui),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:ro!==null?{id:$i,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},s=C1(t),s.return=a,a.child=s,Pn=a,nn=null)):t=null,t===null)throw so(a);return xp(t)?a.lanes=32:a.lanes=536870912,null}return x=d.children,d=d.fallback,g?(vo(),g=a.mode,x=id({mode:"hidden",children:x},g),d=ns(d,g,s,null),x.return=a,d.return=a,x.sibling=d,a.child=x,d=a.child,d.memoizedState=xm(s),d.childLanes=bm(t,M,s),a.memoizedState=ym,vc(null,d)):(po(a),jm(a,x))}var B=t.memoizedState;if(B!==null){var W=B.dehydrated;if(W!==null)return N8(t,a,x,M,d,W,B,s)}return g?(vo(),g=d.fallback,x=a.mode,B=t.child,W=B.sibling,d=Cr(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&1206910976,W!==null?g=Cr(W,g):(g=ns(g,x,s,null),g.flags|=2),g.return=a,d.return=a,d.sibling=g,a.child=d,vc(null,d),d=a.child,g=t.child.memoizedState,g===null?g=xm(s):(x=g.cachePool,x!==null?(B=En._currentValue,x=x.parent!==B?{parent:B,pool:B}:x):x=D1(),g={baseLanes:g.baseLanes|s,cachePool:x}),d.memoizedState=g,d.childLanes=bm(t,M,s),a.memoizedState=ym,vc(t.child,d)):(po(a),s=t.child,t=s.sibling,s=Cr(s,{mode:"visible",children:d.children}),s.return=a,s.sibling=null,t!==null&&(M=a.deletions,M===null?(a.deletions=[t],a.flags|=16):M.push(t)),a.child=s,a.memoizedState=null,s)}function jm(t,a){return a=id({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function id(t,a){return t=Ta(22,t,null,a),t.lanes=0,t}function rd(t,a,s){return ds(a,t.child,null,s),t=jm(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function N8(t,a,s,d,g,x,M,B){if(s)return a.flags&256?(po(a),a.flags&=-257,rd(t,a,B)):a.memoizedState!==null?(vo(),a.child=t.child,a.flags|=128,null):(vo(),x=g.fallback,M=a.mode,g=id({mode:"visible",children:g.children},M),x=ns(x,M,B,null),x.flags|=2,g.return=a,x.return=a,g.sibling=x,a.child=g,ds(a,t.child,null,B),g=a.child,g.memoizedState=xm(B),g.childLanes=bm(t,d,B),a.memoizedState=ym,vc(null,g));if(po(a),xp(x)){if(d=x.nextSibling&&x.nextSibling.dataset,d)var W=d.dgst;return d=W,d!==""&&(g=Error(o(419)),g.stack="",g.digest=d,ic({value:g,source:null,stack:null})),rd(t,a,B)}if(An||rs(t,a,B,!1),d=(B&t.childLanes)!==0,An||d){if(mo.current!==null)return rd(t,a,B);if(d=Qt,d!==null&&(g=gi(d,B),g!==0&&g!==M.retryLane))throw M.retryLane=g,ts(t,g),Ra(d,t,g),vm;return yp(x)||kd(),rd(t,a,B)}return yp(x)?(a.flags|=192,a.child=t.child,null):(t=M.treeContext,nn=hi(x.nextSibling),Pn=a,vt=!0,oo=null,ui=!1,t!==null&&T1(a,t),a=jm(a,g.children),a.flags|=134221824,a)}function Y2(t,a,s){t.lanes|=a;var d=t.alternate;d!==null&&(d.lanes|=a),Bu(t.return,a,s)}function K2(t){for(var a=null;t!==null;){var s=t.alternate;s!==null&&Gu(s)===null&&(a=t),t=t.sibling}return a}function od(t,a,s,d,g,x){var M=t.memoizedState;M===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:g,treeForkCount:x}:(M.isBackwards=a,M.rendering=null,M.renderingStartTime=0,M.last=d,M.tail=s,M.tailMode=g,M.treeForkCount=x)}function wm(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 km(t,a,s){var d=a.pendingProps,g=d.revealOrder,x=d.tail;d=d.children;var M=Xn.current;if(a.flags&128)return hc(a,M),null;var B=(M&2)!==0;if(B?(M=M&1|2,a.flags|=128):M&=1,hc(a,M),g==="backwards"&&t!==null?(wm(t),zn(t,a,d,s),wm(t)):zn(t,a,d,s),d=vt?ac:0,!B&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Y2(t,s,a);else if(t.tag===19)Y2(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(g){case"backwards":s=K2(a.child),s===null?(g=a.child,a.child=null):(g=s.sibling,s.sibling=null,wm(a)),od(a,!0,g,null,x,d);break;case"unstable_legacy-backwards":for(s=null,g=a.child,a.child=null;g!==null;){if(t=g.alternate,t!==null&&Gu(t)===null){a.child=g;break}t=g.sibling,g.sibling=s,s=g,g=t}od(a,!0,s,null,x,d);break;case"together":od(a,!1,null,null,void 0,d);break;case"independent":a.memoizedState=null;break;default:s=K2(a.child),s===null?(g=a.child,a.child=null):(g=s.sibling,s.sibling=null),od(a,!1,g,s,x,d)}return a.child}function X2(t,a,s){var d=a.pendingProps;return lo(a,a.type,d.value),zn(t,a,d.children,s),a.child}function _r(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),bo|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(rs(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(o(153));if(a.child!==null){for(t=a.child,s=Cr(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Cr(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function Sm(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Iu(t)))}function E8(t,a,s){switch(a.tag){case 3:Cn(a,a.stateNode.containerInfo),lo(a,En,t.memoizedState.cache),as();break;case 27:case 5:fn(a);break;case 4:Cn(a,a.stateNode.containerInfo);break;case 10:lo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Xf(a),null;break;case 13:var d=a.memoizedState;if(d!==null){if(d.dehydrated!==null)return po(a),a.flags|=128,null;d=rs(t,a,s,!1);var g=a.child.childLanes;return d||(s&g)!==0?G2(t,a,s):(po(a),t=_r(t,a,s),t!==null?t.sibling:null)}po(a);break;case 19:if(a.flags&128)return km(t,a,s);if(g=(t.flags&128)!==0,d=(s&a.childLanes)!==0,d||(rs(t,a,s,!1),d=(s&a.childLanes)!==0),g){if(d)return km(t,a,s);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),hc(a,Xn.current),d)break;return null;case 22:return a.lanes=0,q2(t,a,s,a.pendingProps);case 24:lo(a,En,t.memoizedState.cache)}return _r(t,a,s)}function Q2(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)An=!0;else{if(!Sm(t,s)&&(a.flags&128)===0)return An=!1,E8(t,a,s);An=(t.flags&131072)!==0}else An=!1,vt&&(a.flags&1048576)!==0&&E1(a,ac,a.index);switch(a.lanes=0,a.tag){case 16:e:{var d=a.pendingProps;if(t=cs(a.elementType),a.type=t,typeof t=="function")_f(t)?(d=fs(t,d),a.tag=1,a=$2(null,a,t,d,s)):(a.tag=0,a=gm(null,a,t,d,s));else{if(t!=null){var g=t.$$typeof;if(g===Q){a.tag=11,a=B2(null,a,t,d,s);break e}else if(g===ue){a.tag=14,a=I2(null,a,t,d,s);break e}else if(g===q){a.tag=10,a.type=t,a=X2(null,a,s);break e}}throw a=me(t)||t,Error(o(306,a,""))}}return a;case 0:return gm(t,a,a.type,a.pendingProps,s);case 1:return d=a.type,g=fs(d,a.pendingProps),$2(t,a,d,g,s);case 3:e:{if(Cn(a,a.stateNode.containerInfo),t===null)throw Error(o(387));d=a.pendingProps;var x=a.memoizedState;g=x.element,$f(t,a),dc(a,d,null,s);var M=a.memoizedState;if(d=M.cache,lo(a,En,d),d!==x.cache&&If(a,[En],s,!0),uc(),d=M.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:M.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=V2(t,a,d,s);break e}else if(d!==g){g=si(Error(o(424)),a),ic(g),a=V2(t,a,d,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(nn=hi(t.firstChild),Pn=a,vt=!0,oo=null,ui=!0,s=q1(a,null,d,s),a.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(as(),d===g){a=_r(t,a,s);break e}zn(t,a,d,s)}a=a.child}return a;case 26:return il(t,a),t===null?(s=jx(a.type,null,a.pendingProps,null))?a.memoizedState=s:vt||(a.stateNode=ex(a.type,a.pendingProps,Gt.current,a)):a.memoizedState=jx(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return fn(a),t===null&&vt&&(d=a.stateNode=gx(a.type,a.pendingProps,Gt.current),Pn=a,ui=!0,g=nn,So(a.type)?(bp=g,nn=hi(d.firstChild)):nn=g),zn(t,a,a.pendingProps.children,s),il(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&vt&&((g=d=nn)&&(d=j7(d,a.type,a.pendingProps,ui),d!==null?(a.stateNode=d,Pn=a,nn=hi(d.firstChild),ui=!1,g=!0):g=!1),g||so(a)),fn(a),g=a.type,x=a.pendingProps,M=t!==null?t.memoizedProps:null,d=x.children,dp(g,x)?d=null:M!==null&&dp(g,M)&&(a.flags|=32),a.memoizedState!==null&&(g=Wf(t,a,v8,null,null,s),wl._currentValue=g),il(t,a),zn(t,a,d,s),a.child;case 6:return t===null&&vt&&((t=s=nn)&&(s=w7(s,a.pendingProps,ui),s!==null?(a.stateNode=s,Pn=a,nn=null,t=!0):t=!1),t||so(a)),null;case 13:return G2(t,a,s);case 4:return Cn(a,a.stateNode.containerInfo),d=a.pendingProps,t===null?a.child=ds(a,null,d,s):zn(t,a,d,s),a.child;case 11:return B2(t,a,a.type,a.pendingProps,s);case 7:return d=a.pendingProps,il(t,a),zn(t,a,d,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 X2(t,a,s);case 9:return g=a.type._context,d=a.pendingProps.children,os(a),g=Yn(g),d=d(g),a.flags|=1,zn(t,a,d,s),a.child;case 14:return I2(t,a,a.type,a.pendingProps,s);case 15:return P2(t,a,a.type,a.pendingProps,s);case 19:return km(t,a,s);case 31:return C8(t,a,s);case 22:return q2(t,a,s,a.pendingProps);case 24:return os(a),d=Yn(En),t===null?(g=Ff(),g===null&&(g=Qt,x=Pf(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=s),g=x),a.memoizedState={parent:d,cache:g},Uf(a),lo(a,En,g)):((t.lanes&s)!==0&&($f(t,a),dc(a,null,null,s),uc()),g=t.memoizedState,x=a.memoizedState,g.parent!==d?(g={parent:d,cache:d},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),lo(a,En,d)):(d=x.cache,lo(a,En,d),d!==g.cache&&If(a,[En],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}),d=a.pendingProps,d.name!=null&&d.name!=="auto"?a.flags|=t===null?18882560:18874368:vt&&zu(a),t!==null&&t.memoizedProps.name!==d.name?a.flags|=4194816:il(t,a),zn(t,a,d.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Rr(t){t.flags|=4}function Cm(t,a,s,d,g){var x;if((x=(t.mode&32)!==0)&&(x=s===null?Cx(a,d):Cx(a,d)&&(d.src!==s.src||d.srcSet!==s.srcSet)),x){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(_y())t.flags|=8192;else throw us=Hu,Hf}else t.flags&=-16777217}function Z2(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Nx(a))if(_y())t.flags|=8192;else throw us=Hu,Hf}function sd(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Ha():536870912,t.lanes|=a,cl|=a)}function gc(t,a){if(!vt)switch(t.tailMode){case"visible":break;case"collapsed":for(var s=t.tail,d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:d.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 an(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,d=0;if(a)for(var g=t.child;g!==null;)s|=g.lanes|g.childLanes,d|=g.subtreeFlags&1206910976,d|=g.flags&1206910976,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)s|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=d,t.childLanes=s,a}function T8(t,a,s){var d=a.pendingProps;switch(Df(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(a),null;case 1:return an(a),null;case 3:return s=a.stateNode,d=null,t!==null&&(d=t.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Tr(En),wn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Zs(a)?Rr(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Lf())),an(a),null;case 26:var g=a.type,x=a.memoizedState;return t===null?(Rr(a),x!==null?(an(a),Z2(a,x)):(an(a),Cm(a,g,null,d,s))):x?x!==t.memoizedState?(Rr(a),an(a),Z2(a,x)):(an(a),a.flags&=-16777217):(t=t.memoizedProps,t!==d&&Rr(a),an(a),Cm(a,g,t,d,s)),null;case 27:if(ye(a),s=Gt.current,g=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==d&&Rr(a);else{if(!d){if(a.stateNode===null)throw Error(o(166));return an(a),a.subtreeFlags&=-33554433,null}t=at.current,Zs(a)?A1(a):(t=gx(g,d,s),a.stateNode=t,Rr(a))}return an(a),a.subtreeFlags&=-33554433,null;case 5:if(ye(a),g=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==d&&Rr(a);else{if(!d){if(a.stateNode===null)throw Error(o(166));return an(a),a.subtreeFlags&=-33554433,null}if(x=at.current,Zs(a))A1(a);else{var M=Tc(Gt.current);switch(x){case 1:x=M.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:x=M.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":x=M.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":x=M.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":x=M.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?M.createElement("select",{is:d.is}):M.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?M.createElement(g,{is:d.is}):M.createElement(g)}}x[ln]=a,x[Nn]=d;e:for(M=a.child;M!==null;){if(M.tag===5||M.tag===6)x.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===a)break e;for(;M.sibling===null;){if(M.return===null||M.return===a)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}a.stateNode=x;e:switch(Zn(x,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Rr(a)}}return an(a),a.subtreeFlags&=-33554433,Cm(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==d&&Rr(a);else{if(typeof d!="string"&&a.stateNode===null)throw Error(o(166));if(t=Gt.current,Zs(a)){if(t=a.stateNode,s=a.memoizedProps,d=null,g=Pn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}t[ln]=a,t=!!(t.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||Qy(t.nodeValue,s)),t||so(a,!0)}else t=Tc(t).createTextNode(d),t[ln]=a,a.stateNode=t}return an(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(d=Zs(a),s!==null){if(t===null){if(!d)throw Error(o(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[ln]=a}else as(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;an(a),t=!1}else s=Lf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(Ka(a),a):(Ka(a),null);if((a.flags&128)!==0)throw Error(o(558))}return an(a),null;case 13:if(d=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=Zs(a),d!==null&&d.dehydrated!==null){if(t===null){if(!g)throw Error(o(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));g[ln]=a}else as(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;an(a),g=!1}else g=Lf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(Ka(a),a):(Ka(a),null)}return Ka(a),(a.flags&128)!==0?(a.lanes=s,a):(s=d!==null,t=t!==null&&t.memoizedState!==null,s&&(d=a.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==g&&(d.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),sd(a,a.updateQueue),an(a),null);case 4:return wn(),t===null&&op(a.stateNode.containerInfo),a.flags|=67108864,an(a),null;case 10:return Tr(a.type),an(a),null;case 19:if(Qf(a),d=a.memoizedState,d===null)return an(a),null;if(g=(a.flags&128)!==0,x=d.rendering,x===null)if(g)gc(d,!1);else{if(jn!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(x=Gu(t),x!==null){for(a.flags|=128,gc(d,!1),t=x.updateQueue,a.updateQueue=t,sd(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)S1(s,t),s=s.sibling;return hc(a,Xn.current&1|2),vt&&Nr(a,d.treeForkCount),a.child}t=t.sibling}d.tail!==null&&Be()>xd&&(a.flags|=128,g=!0,gc(d,!1),a.lanes=4194304)}else{if(!g)if(t=Gu(x),t!==null){if(a.flags|=128,g=!0,t=t.updateQueue,a.updateQueue=t,sd(a,t),gc(d,!0),d.tail===null&&d.tailMode!=="collapsed"&&d.tailMode!=="visible"&&!x.alternate&&!vt)return an(a),null}else 2*Be()-d.renderingStartTime>xd&&s!==536870912&&(a.flags|=128,g=!0,gc(d,!1),a.lanes=4194304);d.isBackwards?(x.sibling=a.child,a.child=x):(t=d.last,t!==null?t.sibling=x:a.child=x,d.last=x)}if(d.tail!==null){t=d.tail;e:{for(s=t;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Be(),t.sibling=null,x=Xn.current,x=g?x&1|2:x&1,d.tailMode==="visible"||d.tailMode==="collapsed"||!s||vt?hc(a,x):(s=x,He(Kn,a),He(Xn,s),aa===null&&(aa=a)),vt&&Nr(a,d.treeForkCount),t}return an(a),null;case 22:case 23:return Ka(a),Kf(),d=a.memoizedState!==null,t!==null?t.memoizedState!==null!==d&&(a.flags|=8192):d&&(a.flags|=8192),d?(s&536870912)!==0&&(a.flags&128)===0&&(an(a),a.subtreeFlags&6&&(a.flags|=8192)):an(a),s=a.updateQueue,s!==null&&sd(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),d=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),d!==s&&(a.flags|=2048),t!==null&&Le(ls),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Tr(En),an(a),null;case 25:return null;case 30:return a.flags|=33554432,an(a),null}throw Error(o(156,a.tag))}function A8(t,a){switch(Df(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Tr(En),wn(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return ye(a),null;case 31:if(a.memoizedState!==null){if(Ka(a),a.alternate===null)throw Error(o(340));as()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(Ka(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(o(340));as()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Qf(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 wn(),null;case 10:return Tr(a.type),null;case 22:case 23:return Ka(a),Kf(),t!==null&&Le(ls),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Tr(En),null;case 25:return null;default:return null}}function W2(t,a){switch(Df(a),a.tag){case 3:Tr(En),wn();break;case 26:case 27:case 5:ye(a);break;case 4:wn();break;case 31:a.memoizedState!==null&&Ka(a);break;case 13:Ka(a);break;case 19:Qf(a);break;case 10:Tr(a.type);break;case 22:case 23:Ka(a),Kf(),t!==null&&Le(ls);break;case 24:Tr(En)}}function yc(t,a){try{var s=a.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var g=d.next;s=g;do{if((s.tag&t)===t){d=void 0;var x=s.create,M=s.inst;d=x(),M.destroy=d}s=s.next}while(s!==g)}}catch(B){It(a,a.return,B)}}function go(t,a,s){try{var d=a.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var x=g.next;d=x;do{if((d.tag&t)===t){var M=d.inst,B=M.destroy;if(B!==void 0){M.destroy=void 0,g=a;var W=s,le=B;try{le()}catch(ve){It(g,W,ve)}}}d=d.next}while(d!==x)}}catch(ve){It(a,a.return,ve)}}function J2(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{H1(a,s)}catch(d){It(t,t.return,d)}}}function ey(t,a,s){s.props=fs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(d){It(t,a,d)}}function Gi(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var d=t.stateNode;break;case 30:var g=t.stateNode,x=kr(t.memoizedProps,g);(g.ref===null||g.ref.name!==x)&&(g.ref=sx(x)),d=g.ref;break;case 7:if(t.stateNode===null){var M=new Ja(t);p(t.child,!1,x7,M,void 0,void 0),t.stateNode=M}d=t.stateNode;break;default:d=t.stateNode}typeof s=="function"?t.refCleanup=s(d):s.current=d}}catch(B){It(t,a,B)}}function Qn(t,a){var s=t.ref,d=t.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(g){It(t,a,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){It(t,a,g)}else s.current=null}function ld(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++)fx(t.stateNode,a[s])}function ty(t){for(var a=t.return;a!==null&&(Em(a)&&fx(t.stateNode,a.stateNode),!Nm(a));)a=a.return}function xc(t){for(var a=t.return;a!==null&&(Em(a)&&b7(t.stateNode,a.stateNode),!Nm(a));)a=a.return}function Nm(t){return t.tag===5||t.tag===3||t.tag===27}function Em(t){return t&&t.tag===7&&t.stateNode!==null}function Tm(t){var a=t.type,s=t.memoizedProps,d=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(g){It(t,t.return,g)}}function Am(t,a,s){try{var d=t.stateNode;t7(d,t.type,s,a),d[Nn]=a}catch(g){It(t,t.return,g)}}function ny(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&So(t.type)||t.tag===4}function Mm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ny(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&&So(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 _m(t,a,s,d){var g=t.tag;if(g===5||g===6)g=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(g,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(g),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=tn)),ld(t,d),Qe=!0;else if(g!==4&&(g===27&&(ld(t,d),d=null,So(t.type)&&(s=t.stateNode,a=null)),t=t.child,t!==null))for(_m(t,a,s,d),t=t.sibling;t!==null;)_m(t,a,s,d),t=t.sibling}function cd(t,a,s,d){var g=t.tag;if(g===5||g===6)g=t.stateNode,a?s.insertBefore(g,a):s.appendChild(g),ld(t,d),Qe=!0;else if(g!==4&&(g===27&&(ld(t,d),d=null,So(t.type)&&(s=t.stateNode)),t=t.child,t!==null))for(cd(t,a,s,d),t=t.sibling;t!==null;)cd(t,a,s,d),t=t.sibling}function ay(t){var a=t.stateNode,s=t.memoizedProps;try{for(var d=t.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);Zn(a,d,s),a[ln]=t,a[Nn]=s}catch(x){It(t,t.return,x)}}var ud=!1,Xa=null;function iy(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(ud=!0)}var Yi=null;function ry(){var t=Yi;return Yi=null,t}var Aa=0;function rl(t,a,s,d,g){return Aa=0,oy(t.child,a,s,d,g)}function oy(t,a,s,d,g){for(var x=!1;t!==null;){if(t.tag===5){var M=t.stateNode;if(d!==null){var B=mp(M);d.push(B),B.view&&(x=!0)}else x||mp(M).view&&(x=!0);ud=!0,rx(M,Aa===0?a:a+"_"+Aa,s),Aa++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&g||oy(t.child,a,s,d,g)&&(x=!0));t=t.sibling}return x}function Ki(t,a){for(;t!==null;)t.tag===5?ox(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a||Ki(t.child,a)),t=t.sibling}function dd(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(dd(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var a=t.memoizedProps;if(a.name==null||a.name==="auto")throw Error(o(544));var s=a.name;a=Sr(a.default,a.share),a!=="none"&&(rl(t,s,a,null,!1)||Ki(t.child,!1))}t=t.sibling}}function Rm(t,a){if(t.tag===30){var s=t.stateNode,d=t.memoizedProps,g=kr(d,s),x=Sr(d.default,s.paired?d.share:d.enter);x!=="none"?rl(t,g,x,null,!1)?(dd(t),s.paired||a||fl(t,d.onEnter)):Ki(t.child,!1):dd(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Rm(t,a),t=t.sibling;else dd(t)}function Om(t){if(Xa!==null&&Xa.size!==0){var a=Xa;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,d=s.name;if(d!=null&&d!=="auto"){var g=a.get(d);if(g!==void 0){var x=Sr(s.default,s.share);if(x!=="none"&&(rl(t,d,x,null,!1)?(x=t.stateNode,g.paired=x,x.paired=g,fl(t,s.onShare)):Ki(t.child,!1)),a.delete(d),a.size===0)break}}}Om(t)}t=t.sibling}}}function Dm(t){if(t.tag===30){var a=t.memoizedProps,s=kr(a,t.stateNode),d=Xa!==null?Xa.get(s):void 0,g=Sr(a.default,d!==void 0?a.share:a.exit);g!=="none"&&(rl(t,s,g,null,!1)?d!==void 0?(g=t.stateNode,d.paired=g,g.paired=d,Xa.delete(s),fl(t,a.onShare)):fl(t,a.onExit):Ki(t.child,!1)),Xa!==null&&Om(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Dm(t),t=t.sibling;else Xa!==null&&Om(t)}function sy(t){for(t=t.child;t!==null;){if(t.tag===30){var a=t.memoizedProps,s=kr(a,t.stateNode);a=Sr(a.default,a.update),t.flags&=-5,a!=="none"&&rl(t,s,a,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&sy(t);t=t.sibling}}function zm(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,Ki(t.child,!1))}zm(t)}t=t.sibling}}function hd(t){if(t.tag===30)t.stateNode.paired=null,Ki(t.child,!1),zm(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)hd(t),t=t.sibling;else zm(t)}function ly(t){for(t=t.child;t!==null;)t.tag===30?Ki(t.child,!1):(t.subtreeFlags&33554432)!==0&&ly(t),t=t.sibling}function Lm(t,a,s,d,g,x,M){for(var B=!1;a!==null;){if(a.tag===5){var W=a.stateNode;if(x!==null&&Aa<x.length){var le=x[Aa],ve=mp(W);(le.view||ve.view)&&(B=!0);var Se;if(Se=(t.flags&4)===0)if(ve.clip)Se=!0;else{Se=le.rect;var re=ve.rect;Se=Se.y!==re.y||Se.x!==re.x||Se.height!==re.height||Se.width!==re.width}Se&&(t.flags|=4),ve.abs?ve=!le.abs:(le=le.rect,ve=ve.rect,ve=le.height!==ve.height||le.width!==ve.width),ve&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&rx(W,Aa===0?s:s+"_"+Aa,g),B&&(t.flags&4)!==0||(Yi===null&&(Yi=[]),Yi.push(W,Aa===0?d:d+"_"+Aa,a.memoizedProps)),Aa++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&M?t.flags|=a.flags&32:Lm(t,a.child,s,d,g,x,M)&&(B=!0));a=a.sibling}return B}function cy(t,a){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,d=t.stateNode,g=kr(s,d),x=Sr(s.default,s.update),M;M=t.memoizedState,t.memoizedState=null,d=t;var B=t.child;Aa=0,g=Lm(d,B,g,g,x,M,!1),(t.flags&4)!==0&&g&&fl(t,s.onUpdate)}else(t.subtreeFlags&33554432)!==0&&cy(t);t=t.sibling}}var qn=!1,zt=!1,Xi=!1,Bm=!1,uy=typeof WeakSet=="function"?WeakSet:Set,Fn=null,Qi=!1,bc=!1,fd=!1,Im=!1;function M8(t,a,s){if(t=t.containerInfo,cp=kl,t=m1(t),Sf(t)){if("selectionStart"in t)var d={start:t.selectionStart,end:t.selectionEnd};else e:{d=(d=t.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var x=g.anchorOffset,M=g.focusNode;g=g.focusOffset;try{d.nodeType,M.nodeType}catch{d=null;break e}var B=0,W=-1,le=-1,ve=0,Se=0,re=t,fe=null;t:for(;;){for(var ze;re!==d||x!==0&&re.nodeType!==3||(W=B+x),re!==M||g!==0&&re.nodeType!==3||(le=B+g),re.nodeType===3&&(B+=re.nodeValue.length),(ze=re.firstChild)!==null;)fe=re,re=ze;for(;;){if(re===t)break t;if(fe===d&&++ve===x&&(W=B),fe===M&&++Se===g&&(le=B),(ze=re.nextSibling)!==null)break;re=fe,fe=re.parentNode}re=ze}d=W===-1||le===-1?null:{start:W,end:le}}else d=null}d=d||{start:0,end:0}}else d=null;for(up={focusedElem:t,selectionRange:d},kl=!1,s=(s&335544064)===s,Fn=a,a=s?9270:1024;Fn!==null;){if(t=Fn,s&&(d=t.deletions,d!==null))for(x=0;x<d.length;x++)s&&Dm(d[x]);if(t.alternate===null&&(t.flags&2)!==0)s&&iy(t),md(s);else{if(t.tag===22){if(d=t.alternate,t.memoizedState!==null){d!==null&&d.memoizedState===null&&s&&Dm(d),md(s);continue}else if(d!==null&&d.memoizedState!==null){s&&iy(t),md(s);continue}}d=t.child,(t.subtreeFlags&a)!==0&&d!==null?(d.return=t,Fn=d):(s&&sy(t),md(s))}}Xa=null}function md(t){for(;Fn!==null;){var a=Fn,s=t,d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((g&1024)!==0&&d!==null){s=void 0,g=d.memoizedProps,d=d.memoizedState;var x=a.stateNode;try{var M=fs(a.type,g);s=x.getSnapshotBeforeUpdate(M,d),x.__reactInternalSnapshotBeforeUpdate=s}catch(B){It(a,a.return,B)}}break;case 3:if((g&1024)!==0){if(d=a.stateNode.containerInfo,s=d.nodeType,s===9)gp(d);else if(s===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":gp(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&d!==null&&(s=kr(d.memoizedProps,d.stateNode),g=a.memoizedProps,g=Sr(g.default,g.update),g!=="none"&&rl(d,s,g,d.memoizedState=[],!0));break;default:if((g&1024)!==0)throw Error(o(163))}if(d=a.sibling,d!==null){d.return=a.return,Fn=d;break}Fn=a.return}}function dy(t,a,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Zi(t,s),d&4&&yc(5,s);break;case 1:if(Zi(t,s),d&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(M){It(s,s.return,M)}else{var g=fs(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(g,a,t.__reactInternalSnapshotBeforeUpdate)}catch(M){It(s,s.return,M)}}d&64&&J2(s),d&512&&Gi(s,s.return);break;case 3:if(Zi(t,s),d&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{H1(t,a)}catch(M){It(s,s.return,M)}}break;case 27:a===null&&d&4&&ay(s);case 26:case 5:Zi(t,s),a===null&&d&4&&Tm(s),d&512&&Gi(s,s.return);break;case 12:Zi(t,s);break;case 31:Zi(t,s),d&4&&py(t,s);break;case 13:Zi(t,s),d&4&&vy(t,s),d&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=H8.bind(null,s),k7(t,s))));break;case 22:if(d=s.memoizedState!==null||qn,!d){var x=a!==null&&a.memoizedState!==null||zt;a=qn,g=zt,qn=d,(zt=x)&&!g?(d=2,(s.subtreeFlags&8772)!==0&&(d|=1),Si(t,s,d)):Zi(t,s),qn=a,zt=g}break;case 30:Zi(t,s),d&512&&Gi(s,s.return);break;case 7:d&512&&Gi(s,s.return);default:Zi(t,s)}}function Pm(t,a){for(t=t.child;t!==null;)hy(t,a),t=t.sibling}function hy(t,a){switch(t.tag){case 5:case 26:try{var s=t.stateNode;if(a){var d=s.style;typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"}else{var g=t.stateNode,x=t.memoizedProps.style,M=x!=null&&x.hasOwnProperty("display")?x.display:null;g.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(W){It(t,t.return,W)}qm(t,a);break;case 6:try{t.stateNode.nodeValue=a?"":t.memoizedProps,Qe=!0}catch(W){It(t,t.return,W)}break;case 18:try{var B=t.stateNode;a?ix(B,!0):ix(t.stateNode,!1)}catch(W){It(t,t.return,W)}break;case 22:case 23:t.memoizedState===null&&Pm(t,a);break;default:Pm(t,a)}}function qm(t,a){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var s=t,d=a;switch(s.tag){case 4:hy(s,d);break e;case 22:s.memoizedState===null&&qm(s,d);break e;default:qm(s,d)}}t=t.sibling}}function fy(t){var a=t.alternate;a!==null&&(t.alternate=null,fy(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&to(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 dn=null,Ma=!1;function wi(t,a,s){for(s=s.child;s!==null;)my(t,a,s),s=s.sibling}function my(t,a,s){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ia,s)}catch{}switch(s.tag){case 26:zt||Qn(s,a),wi(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!zt&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:zt||Qn(s,a),xc(s);var d=dn,g=Ma;So(s.type)&&(dn=s.stateNode,Ma=!1),wi(t,a,s),yx(s.stateNode,s.type,s.memoizedProps),dn=d,Ma=g;break;case 5:zt||Qn(s,a),xc(s);case 6:if(s.tag===6&&xc(s),d=dn,g=Ma,dn=null,wi(t,a,s),dn=d,Ma=g,dn!==null)if(Ma)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(s.stateNode),Qe=!0}catch(x){It(s,a,x)}else try{dn.removeChild(s.stateNode),Qe=!0}catch(x){It(s,a,x)}break;case 18:dn!==null&&(Ma?(t=dn,ax(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Sl(t)):ax(dn,s.stateNode));break;case 4:d=dn,g=Ma,dn=s.stateNode.containerInfo,Ma=!0,wi(t,a,s),dn=d,Ma=g;break;case 0:case 11:case 14:case 15:go(2,s,a),zt||go(4,s,a),wi(t,a,s);break;case 1:zt||(Qn(s,a),d=s.stateNode,typeof d.componentWillUnmount=="function"&&ey(s,a,d)),wi(t,a,s);break;case 21:wi(t,a,s);break;case 22:zt=(d=zt)||s.memoizedState!==null,wi(t,a,s),zt=d;break;case 30:Qn(s,a),wi(t,a,s);break;case 7:zt||Qn(s,a),wi(t,a,s);break;default:wi(t,a,s)}}function py(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Sl(t)}catch(s){It(a,a.return,s)}}}function vy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Sl(t)}catch(s){It(a,a.return,s)}}function _8(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new uy),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new uy),a;default:throw Error(o(435,t.tag))}}function pd(t,a){var s=_8(t);a.forEach(function(d){if(!s.has(d)){s.add(d);var g=U8.bind(null,t,d);d.then(g,g)}})}function ya(t,a,s){var d=a.deletions;if(d!==null)for(var g=0;g<d.length;g++){var x=d[g],M=t,B=a,W=B;e:for(;W!==null;){switch(W.tag){case 27:if(So(W.type)){dn=W.stateNode,Ma=!1;break e}break;case 5:dn=W.stateNode,Ma=!1;break e;case 3:case 4:dn=W.stateNode.containerInfo,Ma=!0;break e}W=W.return}if(dn===null)throw Error(o(160));my(M,B,x),dn=null,Ma=!1,M=x.alternate,M!==null&&(M.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)gy(a,t,s),a=a.sibling}var ki=null;function gy(t,a,s){var d=t.alternate,g=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(g&4&&(d=t.updateQueue,d=d!==null?d.events:null,d!==null))for(var x=0;x<d.length;x++){var M=d[x];M.ref.impl=M.nextImpl}ya(a,t,s),xa(t),g&4&&(go(3,t,t.return),yc(3,t),go(5,t,t.return));break;case 1:ya(a,t,s),xa(t),g&512&&(zt||d===null||Qn(d,d.return)),g&64&&qn&&(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=ki,ya(a,t,s),xa(t),g&512&&(zt||d===null||Qn(d,d.return)),g&4)if(g=d!==null?d.memoizedState:null,s=t.memoizedState,d===null)if(s===null)if(t.stateNode===null)if(qn)t.stateNode=ex(t.type,t.memoizedProps,a.containerInfo,t);else{e:{a=t.type,s=t.memoizedProps,g=x.ownerDocument||x;t:switch(a){case"title":d=g.getElementsByTagName("title")[0],(!d||d[xr]||d[ln]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=g.createElement(a),g.head.insertBefore(d,g.querySelector("head > title"))),Zn(d,a,s),d[ln]=t,Ce(d),a=d;break e;case"link":if(x=Sx("link","href",g).get(a+(s.href||""))){for(M=0;M<x.length;M++)if(d=x[M],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(M,1);break t}}d=g.createElement(a),Zn(d,a,s),g.head.appendChild(d);break;case"meta":if(x=Sx("meta","content",g).get(a+(s.content||""))){for(M=0;M<x.length;M++)if(d=x[M],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(M,1);break t}}d=g.createElement(a),Zn(d,a,s),g.head.appendChild(d);break;default:throw Error(o(468,a))}d[ln]=t,Ce(d),a=d}t.stateNode=a}else qn||Sp(x,t.type,t.stateNode);else t.stateNode=kx(x,s,t.memoizedProps);else g!==s?(g===null?(a=d.stateNode,a===null||zt||a.parentNode.removeChild(a)):g.count--,s===null?qn||Sp(x,t.type,t.stateNode):kx(x,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Am(t,t.memoizedProps,d.memoizedProps);break;case 27:ya(a,t,s),xa(t),g&512&&(zt||d===null||Qn(d,d.return)),d!==null&&g&4&&Am(t,t.memoizedProps,d.memoizedProps);break;case 5:if(x=Xi,Xi=!1,ya(a,t,s),Xi=x,xa(t),g&512&&(zt||d===null||Qn(d,d.return)),t.flags&32){a=t.stateNode;try{pt(a,""),Qe=!0}catch(ve){It(t,t.return,ve)}}g&4&&t.stateNode!=null&&(a=t.memoizedProps,Am(t,a,d!==null?d.memoizedProps:a)),g&1024&&(Bm=!0);break;case 6:if(ya(a,t,s),xa(t),g&4){if(t.stateNode===null)throw Error(o(162));a=t.memoizedProps,s=t.stateNode;try{s.nodeValue=a,Qe=!0}catch(ve){It(t,t.return,ve)}}break;case 3:if(Qe=!1,Md=null,x=ki,ki=Ac(a.containerInfo),ya(a,t,s),ki=x,xa(t),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Sl(a.containerInfo)}catch(ve){It(t,t.return,ve)}Bm&&(Bm=!1,yy(t)),Qe=!1;break;case 4:g=Xi,Xi=qn,d=pn(),x=ki,ki=Ac(t.stateNode.containerInfo),ya(a,t,s),xa(t),ki=x,Qe&&bc&&(fd=!0),Qe=d,Xi=g;break;case 12:ya(a,t,s),xa(t);break;case 31:ya(a,t,s),xa(t),g&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,pd(t,a)));break;case 13:ya(a,t,s),xa(t),t.child.flags&8192&&t.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(yd=Be()),g&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,pd(t,a)));break;case 22:x=t.memoizedState!==null,M=d!==null&&d.memoizedState!==null;var B=qn,W=zt,le=Xi;qn=B||x,Xi=le||x,zt=W||M,ya(a,t,s),zt=W,Xi=le,qn=B,xa(t),g&8192&&(a=t.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,!x||d===null||M||qn||zt||(a=M||zt,s=qn,d=zt,qn=x||qn,zt=a,yo(t,2),qn=s,zt=d),!x&&Xi||Pm(t,x)),g&4&&(a=t.updateQueue,a!==null&&(s=a.retryQueue,s!==null&&(a.retryQueue=null,pd(t,s))));break;case 19:ya(a,t,s),xa(t),g&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,pd(t,a)));break;case 30:g&512&&(zt||d===null||Qn(d,d.return)),g=pn(),x=bc,M=(s&335544064)===s,B=t.memoizedProps,bc=M&&Sr(B.default,B.update)!=="none",ya(a,t,s),xa(t),M&&d!==null&&Qe&&(t.flags|=4),bc=x,Qe=g;break;case 21:break;case 7:g&512&&(zt||d===null||Qn(d,d.return)),d&&d.stateNode!==null&&(d.stateNode._fragmentFiber=t);default:ya(a,t,s),xa(t)}}function xa(t){var a=t.flags;if(a&2){try{for(var s,d=t.return;d!==null;){if(ny(d)){s=d;break}d=d.return}d=null;for(var g=t.return;g!==null;){if(Em(g)){var x=g.stateNode;d===null?d=[x]:d.push(x)}if(Nm(g))break;g=g.return}var M=d;if(s==null)throw Error(o(160));switch(s.tag){case 27:var B=s.stateNode,W=Mm(t);cd(t,W,B,M);break;case 5:var le=s.stateNode;s.flags&32&&(pt(le,""),s.flags&=-33);var ve=Mm(t);cd(t,ve,le,M);break;case 3:case 4:var Se=s.stateNode.containerInfo,re=Mm(t);_m(t,re,Se,M);break;default:throw Error(o(161))}}catch(fe){It(t,t.return,fe)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function yy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;yy(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,kl=!0,a.reset(),kl=!1),t=t.sibling}}function ol(t,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)xy(a,t),a=a.sibling;else cy(a)}function xy(t,a){var s=t.alternate;if(s===null)Rm(t,!1);else switch(t.tag){case 3:if(Im=Qi=!1,ry(),ol(a,t),!Qi&&!fd){if(t=Yi,t!==null)for(var d=0;d<t.length;d+=3){s=t[d];var g=t[d+1];ox(s,t[d+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+g+")"})}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"})),Im=!0}Yi=null;break;case 5:ol(a,t);break;case 4:d=Qi,Qi=!1,ol(a,t),Qi&&(fd=!0),Qi=d;break;case 22:t.memoizedState===null&&(s.memoizedState!==null?Rm(t,!1):ol(a,t));break;case 30:d=Qi,g=ry(),Qi=!1,ol(a,t),Qi&&(t.flags|=4);var x=t.memoizedProps,M=t.stateNode;a=kr(x,M),M=kr(s.memoizedProps,M);var B=Sr(x.default,x.update);B==="none"?a=!1:(x=s.memoizedState,s.memoizedState=null,s=t.child,Aa=0,a=Lm(t,s,a,M,B,x,!0),Aa!==(x===null?0:x.length)&&(t.flags|=32)),(t.flags&4)!==0&&a?(fl(t,t.memoizedProps.onUpdate),Yi=g):g!==null&&(g.push.apply(g,Yi),Yi=g),Qi=(t.flags&32)!==0?!0:d;break;default:ol(a,t)}}function Zi(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)dy(t,a.alternate,a),a=a.sibling}function yo(t,a){for(t=t.child;t!==null;){var s=t,d=a;switch(s.tag){case 0:case 11:case 14:case 15:go(4,s,s.return),yo(s,d);break;case 1:Qn(s,s.return);var g=s.stateNode;typeof g.componentWillUnmount=="function"&&ey(s,s.return,g),yo(s,d);break;case 27:(d&2)!==0&&yx(s.stateNode,s.type,s.memoizedProps);case 5:Qn(s,s.return),s.tag!==5&&s.tag!==27||xc(s),yo(s,d);break;case 6:xc(s);break;case 26:Qn(s,s.return),g=s.stateNode,s.memoizedState!==null||g===null||zt||g.parentNode.removeChild(g),yo(s,d);break;case 22:s.memoizedState===null&&yo(s,d);break;case 30:Qn(s,s.return),yo(s,d);break;case 7:Qn(s,s.return);default:yo(s,d)}t=t.sibling}}function Si(t,a,s){for(s=(a.subtreeFlags&8772)!==0?s:s&-2,a=a.child;a!==null;){var d=a.alternate,g=t,x=a,M=x.flags,B=(s&1)!==0;switch(x.tag){case 0:case 11:case 15:Si(g,x,s),yc(4,x);break;case 1:if(Si(g,x,s),d=x,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ve){It(d,d.return,ve)}if(d=x,g=d.updateQueue,g!==null){var W=d.stateNode;try{var le=g.shared.hiddenCallbacks;if(le!==null)for(g.shared.hiddenCallbacks=null,g=0;g<le.length;g++)F1(le[g],W)}catch(ve){It(d,d.return,ve)}}B&&M&64&&J2(x),Gi(x,x.return);break;case 27:(s&2)!==0&&ay(x);case 5:x.tag!==5&&x.tag!==27||ty(x),Si(g,x,s),B&&d===null&&M&4&&Tm(x),Gi(x,x.return);break;case 6:ty(x);break;case 26:W=x.stateNode,x.memoizedState!==null||W===null||qn||Sp(Ac(W.ownerDocument),x.type,W),Si(g,x,s),B&&d===null&&M&4&&Tm(x),Gi(x,x.return);break;case 12:Si(g,x,s);break;case 31:Si(g,x,s),B&&M&4&&py(g,x);break;case 13:Si(g,x,s),B&&M&4&&vy(g,x);break;case 22:x.memoizedState===null&&Si(g,x,s),Gi(x,x.return);break;case 30:Si(g,x,s),Gi(x,x.return);break;case 7:Gi(x,x.return);default:Si(g,x,s)}a=a.sibling}}function Fm(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&&rc(s))}function Hm(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&rc(t))}function di(t,a,s,d){var g=(s&335544064)===s;if(a.subtreeFlags&(g?10262:10256))for(a=a.child;a!==null;)by(t,a,s,d),a=a.sibling;else g&&ly(a)}function by(t,a,s,d){var g=(s&335544064)===s;g&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&hd(a);var x=a.flags;switch(a.tag){case 0:case 11:case 15:di(t,a,s,d),x&2048&&yc(9,a);break;case 1:di(t,a,s,d);break;case 3:di(t,a,s,d),g&&Im&&(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&&rc(x)));break;case 12:if(x&2048){di(t,a,s,d),x=a.stateNode;try{var M=a.memoizedProps,B=M.id,W=M.onPostCommit;typeof W=="function"&&W(B,a.alternate===null?"mount":"update",x.passiveEffectDuration,-0)}catch(le){It(a,a.return,le)}}else di(t,a,s,d);break;case 31:di(t,a,s,d);break;case 13:di(t,a,s,d);break;case 23:break;case 22:M=a.stateNode,B=a.alternate,a.memoizedState!==null?(g&&B!==null&&B.memoizedState===null&&hd(B),M._visibility&2?di(t,a,s,d):jc(t,a)):(g&&B!==null&&B.memoizedState!==null&&hd(a),M._visibility&2?di(t,a,s,d):(M._visibility|=2,sl(t,a,s,d,(a.subtreeFlags&10256)!==0||!1))),x&2048&&Fm(B,a);break;case 24:di(t,a,s,d),x&2048&&Hm(a.alternate,a);break;case 30:g&&(x=a.alternate,x!==null&&(Ki(x.child,!0),Ki(a.child,!0))),di(t,a,s,d);break;default:di(t,a,s,d)}}function sl(t,a,s,d,g){for(g=g&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=t,M=a,B=s,W=d,le=M.flags;switch(M.tag){case 0:case 11:case 15:sl(x,M,B,W,g),yc(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?sl(x,M,B,W,g):jc(x,M):(ve._visibility|=2,sl(x,M,B,W,g)),g&&le&2048&&Fm(M.alternate,M);break;case 24:sl(x,M,B,W,g),g&&le&2048&&Hm(M.alternate,M);break;default:sl(x,M,B,W,g)}a=a.sibling}}function jc(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,d=a,g=d.flags;switch(d.tag){case 22:jc(s,d),g&2048&&Fm(d.alternate,d);break;case 24:jc(s,d),g&2048&&Hm(d.alternate,d);break;default:jc(s,d)}a=a.sibling}}var ms=8192;function ps(t,a,s){if(t.subtreeFlags&ms)for(t=t.child;t!==null;)jy(t,a,s),t=t.sibling}function jy(t,a,s){switch(t.tag){case 26:ps(t,a,s),t.flags&ms&&(t.memoizedState!==null?B7(s,ki,t.memoizedState,t.memoizedProps):(t=t.stateNode,(a&335544128)===a&&Tx(s,t)));break;case 5:ps(t,a,s),t.flags&ms&&(t=t.stateNode,(a&335544128)===a&&Tx(s,t));break;case 3:case 4:var d=ki;ki=Ac(t.stateNode.containerInfo),ps(t,a,s),ki=d;break;case 22:t.memoizedState===null&&(d=t.alternate,d!==null&&d.memoizedState!==null?(d=ms,ms=16777216,ps(t,a,s),ms=d):ps(t,a,s));break;case 30:if((t.flags&ms)!==0&&(d=t.memoizedProps.name,d!=null&&d!=="auto")){var g=t.stateNode;g.paired=null,Xa===null&&(Xa=new Map),Xa.set(d,g)}ps(t,a,s);break;default:ps(t,a,s)}}function wy(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 wc(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var d=a[s];Fn=d,Sy(d,t)}wy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ky(t),t=t.sibling}function ky(t){switch(t.tag){case 0:case 11:case 15:wc(t),t.flags&2048&&go(9,t,t.return);break;case 3:wc(t);break;case 12:wc(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,vd(t)):wc(t);break;default:wc(t)}}function vd(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var d=a[s];Fn=d,Sy(d,t)}wy(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:go(8,a,a.return),vd(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,vd(a));break;default:vd(a)}t=t.sibling}}function Sy(t,a){for(;Fn!==null;){var s=Fn;switch(s.tag){case 0:case 11:case 15:go(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:rc(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,Fn=d;else e:for(s=t;Fn!==null;){d=Fn;var g=d.sibling,x=d.return;if(fy(d),d===s){Fn=null;break e}if(g!==null){g.return=x,Fn=g;break e}Fn=x}}}var R8={getCacheForType:function(t){var a=Yn(En),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Yn(En).controller.signal}},O8=typeof WeakMap=="function"?WeakMap:Map,Ot=0,Qt=null,xt=null,St=0,Bt=0,Qa=null,xo=!1,ll=!1,Um=!1,Or=0,jn=0,bo=0,vs=0,gd=0,Za=0,cl=0,kc=null,_a=null,$m=!1,yd=0,Cy=0,xd=1/0,bd=null,jo=null,vn=0,Ci=null,gs=null,Wi=0,Vm=0,Gm=null,Ny=null,ul=null,dl=null,hl=null,Sc=0,jd=null;function Wa(){return(Ot&2)!==0&&St!==0?St&-St:ce.T!==null?np():ha()}function Ey(){if(Za===0)if((St&536870912)===0||vt){var t=ua;ua<<=1,(ua&3932160)===0&&(ua=262144),Za=t}else Za=536870912;return t=Kn.current,t!==null&&(t.flags|=32),Za}function fl(t,a){if(a!=null){var s=t.stateNode,d=s.ref;d===null&&(d=s.ref=sx(kr(t.memoizedProps,s))),dl===null&&(dl=[]),dl.push(a.bind(null,d))}}function Ra(t,a,s){(t===Qt&&(Bt===2||Bt===9)||t.cancelPendingCommit!==null)&&(ml(t,0),wo(t,St,Za,!1)),Ua(t,s),((Ot&2)===0||t!==Qt)&&(t===Qt&&((Ot&2)===0&&(vs|=s),jn===4&&wo(t,St,Za,!1)),Ji(t))}function Ty(t,a,s){if((Ot&6)!==0)throw Error(o(327));var d=!s&&(a&127)===0&&(a&t.expiredLanes)===0||Na(t,a),g=d?L8(t,a):Km(t,a,!0),x=d;do{if(g===0){ll&&!d&&wo(t,a,0,!1);break}else{if(s=t.current.alternate,x&&!D8(s)){g=Km(t,a,!1),x=!1;continue}if(g===2){if(x=a,t.errorRecoveryDisabledLanes&x)var M=0;else M=t.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){a=M;e:{var B=t;g=kc;var W=B.current.memoizedState.isDehydrated;if(W&&(ml(B,M).flags|=256),M=Km(B,M,!1),M!==2&&M!==6){if(Um&&!W){B.errorRecoveryDisabledLanes|=x,vs|=x,g=4;break e}x=_a,_a=g,x!==null&&(_a===null?_a=x:_a.push.apply(_a,x))}g=M}if(x=!1,g!==2)continue}}if(g===1){ml(t,0),wo(t,a,0,!0);break}e:{switch(d=t,x=g,x){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:wo(d,a,Za,!xo);break e;case 2:_a=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(g=yd+300-Be(),10<g)){if(wo(d,a,Za,!xo),Ca(d,0,!0)!==0)break e;Wi=a,d.timeoutHandle=fp(Ay.bind(null,d,s,_a,bd,$m,a,Za,vs,cl,xo,x,"Throttled",-0,0),g);break e}Ay(d,s,_a,bd,$m,a,Za,vs,cl,xo,x,null,-0,0)}}break}while(!0);Ji(t)}function Ay(t,a,s,d,g,x,M,B,W,le,ve,Se,re,fe){t.timeoutHandle=-1;var ze=a.subtreeFlags,Ue=(x&335544064)===x;if(Se=null,(Ue||ze&8192||(ze&16785408)===16785408)&&(Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Xa=null,jy(a,x,Se),Ue&&(ze=Se,Ue=t.containerInfo,Ue=(Ue.nodeType===9?Ue:Ue.ownerDocument).__reactViewTransition,Ue!=null&&(ze.count++,ze.waitingForViewTransition=!0,ze=Rc.bind(ze),Ue.finished.then(ze,ze))),ze=(x&62914560)===x?yd-Be():(x&4194048)===x?Cy-Be():0,ze=I7(Se,ze),ze!==null)){Wi=x,t.cancelPendingCommit=ze(By.bind(null,t,a,x,s,d,g,M,B,W,le,ve,Se,null,re,fe)),wo(t,x,M,!le);return}By(t,a,x,s,d,g,M,B,W,le,ve,Se)}function D8(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 d=0;d<s.length;d++){var g=s[d],x=g.getSnapshot;g=g.value;try{if(!Ya(x(),g))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 wo(t,a,s,d){a=gt(t,a),a&=~gd,a&=~vs,t.suspendedLanes|=a,t.pingedLanes&=~a,d&&(t.warmLanes|=a),d=t.expirationTimes;for(var g=a;0<g;){var x=31-cn(g),M=1<<x;d[x]=-1,g&=~M}s!==0&&$a(t,s,a)}function wd(){return(Ot&6)===0?(Cc(0),!1):!0}function Ym(){if(xt!==null){if(Bt===0)var t=xt.return;else t=xt,Er=is=null,tm(t),el=null,lc=0,t=xt;for(;t!==null;)W2(t.alternate,t),t=t.return;xt=null}}function ml(t,a){var s=t.timeoutHandle;return s!==-1&&(t.timeoutHandle=-1,i7(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Wi=0,Ym(),Qt=t,xt=s=Cr(t.current,null),St=a,Bt=0,Qa=null,xo=!1,ll=Na(t,a),Um=!1,cl=Za=gd=vs=bo=jn=0,_a=kc=null,$m=!1,Or=gt(t,a),Mu(),s}function My(t,a){dt=null,ce.H=td,a===Js||a===Fu?(a=B1(),Bt=3):a===Hf?(a=B1(),Bt=4):Bt=a===vm?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Qa=a,xt===null&&(jn=1,nd(t,si(a,t.current)))}function _y(){var t=Kn.current;return t===null?!0:(St&4194048)===St?aa===null:(St&62914560)===St||(St&536870912)!==0?t===aa:!1}function Ry(){var t=ce.H;return ce.H=td,t===null?td:t}function Oy(){var t=ce.A;return ce.A=R8,t}function kd(){jn=4,xo||(St&4194048)!==St&&Kn.current!==null||(ll=!0),(bo&134217727)===0&&(vs&134217727)===0||Qt===null||wo(Qt,St,Za,!1)}function Km(t,a,s){var d=Ot;Ot|=2;var g=Ry(),x=Oy();(Qt!==t||St!==a)&&(bd=null,ml(t,a)),a=!1;var M=jn;e:do try{if(Bt!==0&&xt!==null){var B=xt,W=Qa;switch(Bt){case 8:Ym(),M=6;break e;case 3:case 2:case 9:case 6:Kn.current===null&&(a=!0);var le=Bt;if(Bt=0,Qa=null,pl(t,B,W,le),s&&ll){M=0;break e}break;default:le=Bt,Bt=0,Qa=null,pl(t,B,W,le)}}z8(),M=jn;break}catch(ve){My(t,ve)}while(!0);return a&&t.shellSuspendCounter++,Er=is=null,Ot=d,ce.H=g,ce.A=x,xt===null&&(Qt=null,St=0,Mu()),M}function z8(){for(;xt!==null;)Dy(xt)}function L8(t,a){var s=Ot;Ot|=2;var d=Ry(),g=Oy();Qt!==t||St!==a?(bd=null,xd=Be()+500,ml(t,a)):ll=Na(t,a);e:do try{if(Bt!==0&&xt!==null){a=xt;var x=Qa;t:switch(Bt){case 1:Bt=0,Qa=null,pl(t,a,x,1);break;case 2:case 9:if(z1(x)){Bt=0,Qa=null,zy(a);break}a=function(){Bt!==2&&Bt!==9||Qt!==t||(Bt=7),Ji(t)},x.then(a,a);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:z1(x)?(Bt=0,Qa=null,zy(a)):(Bt=0,Qa=null,pl(t,a,x,7));break;case 5:var M=null;switch(xt.tag){case 26:M=xt.memoizedState;case 5:case 27:var B=xt;if(M?Nx(M):B.stateNode.complete){Bt=0,Qa=null;var W=B.sibling;if(W!==null)xt=W;else{var le=B.return;le!==null?(xt=le,Sd(le)):xt=null}break t}}Bt=0,Qa=null,pl(t,a,x,5);break;case 6:Bt=0,Qa=null,pl(t,a,x,6);break;case 8:Ym(),jn=6;break e;default:throw Error(o(462))}}B8();break}catch(ve){My(t,ve)}while(!0);return Er=is=null,ce.H=d,ce.A=g,Ot=s,xt!==null?0:(Qt=null,St=0,Mu(),jn)}function B8(){for(;xt!==null&&!Oe();)Dy(xt)}function Dy(t){var a=Q2(t.alternate,t,Or);t.memoizedProps=t.pendingProps,a===null?Sd(t):xt=a}function zy(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=U2(s,a,a.pendingProps,a.type,void 0,St);break;case 11:a=U2(s,a,a.pendingProps,a.type.render,a.ref,St);break;case 5:tm(a);var d=a;d===Pn&&(vt?(Lu(d),d.tag===5&&d.stateNode!=null&&(nn=d.stateNode)):(Lu(d),vt=!0));default:W2(s,a),a=xt=S1(a,Or),a=Q2(s,a,Or)}t.memoizedProps=t.pendingProps,a===null?Sd(t):xt=a}function pl(t,a,s,d){Er=is=null,tm(a),el=null,lc=0;var g=a.return;try{if(S8(t,g,a,s,St)){jn=1,nd(t,si(s,t.current)),xt=null;return}}catch(x){if(g!==null)throw xt=g,x;jn=1,nd(t,si(s,t.current)),xt=null;return}a.flags&32768?(vt||d===1?t=!0:ll||(St&536870912)!==0?t=!1:(xo=t=!0,(d===2||d===9||d===3||d===6)&&(d=Kn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Ly(a,t)):Sd(a)}function Sd(t){var a=t;do{if((a.flags&32768)!==0){Ly(a,xo);return}t=a.return;var s=T8(a.alternate,a,Or);if(s!==null){xt=s;return}if(a=a.sibling,a!==null){xt=a;return}xt=a=t}while(a!==null);jn===0&&(jn=5)}function Ly(t,a){do{var s=A8(t.alternate,t);if(s!==null){s.flags&=32767,xt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){xt=t;return}xt=t=s}while(t!==null);jn=6,xt=null}function By(t,a,s,d,g,x,M,B,W,le,ve,Se){t.cancelPendingCommit=null;do Cd();while(vn!==0);if((Ot&6)!==0)throw Error(o(327));if(a!==null){if(a===t.current)throw Error(o(177));t===Qt&&(xt=Qt=null,St=0),gs=a,Ci=t,Wi=s,Gm=g,Ny=d,I8(t,a,s,M,B,W,Se)}}function I8(t,a,s,d,g,x,M){var B=a.lanes|a.childLanes;if(Vm=B,B|=Af,da(t,s,B,d,g,x),dl=null,(s&335544064)===s?(hl=h8(t),d=10262):(hl=null,d=10256),(a.subtreeFlags&d)!==0||(a.flags&d)!==0?(t.callbackNode=null,t.callbackPriority=0,$8(Yt,function(){return Wm(),null})):(t.callbackNode=null,t.callbackPriority=0),ud=!1,d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=ce.T,ce.T=null,g=J.p,J.p=2,x=Ot,Ot|=4;try{M8(t,a,s)}finally{Ot=x,J.p=g,ce.T=d}}vn=1,ud?ul=u7(M,t.containerInfo,hl,Xm,Qm,q8,Zm,Wm,P8):(Xm(),Qm(),Zm())}function P8(t){if(vn!==0){var a=Ci.onRecoverableError;a(t,{componentStack:null})}}function q8(){vn===3&&(vn=0,xy(gs,Ci),vn=4)}function Xm(){if(vn===1){vn=0;var t=Ci,a=gs,s=Wi,d=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||d){d=ce.T,ce.T=null;var g=J.p;J.p=2;var x=Ot;Ot|=4;try{bc=fd=!1,gy(a,t,s),s=up;var M=m1(t.containerInfo),B=s.focusedElem,W=s.selectionRange;if(M!==B&&B&&B.ownerDocument&&f1(B.ownerDocument.documentElement,B)){if(W!==null&&Sf(B)){var le=W.start,ve=W.end;if(ve===void 0&&(ve=le),"selectionStart"in B)B.selectionStart=le,B.selectionEnd=Math.min(ve,B.value.length);else{var Se=B.ownerDocument||document,re=Se&&Se.defaultView||window;if(re.getSelection){var fe=re.getSelection(),ze=B.textContent.length,Ue=Math.min(W.start,ze),ht=W.end===void 0?Ue:Math.min(W.end,ze);!fe.extend&&Ue>ht&&(M=ht,ht=Ue,Ue=M);var se=h1(B,Ue),ne=h1(B,ht);if(se&&ne&&(fe.rangeCount!==1||fe.anchorNode!==se.node||fe.anchorOffset!==se.offset||fe.focusNode!==ne.node||fe.focusOffset!==ne.offset)){var de=Se.createRange();de.setStart(se.node,se.offset),fe.removeAllRanges(),Ue>ht?(fe.addRange(de),fe.extend(ne.node,ne.offset)):(de.setEnd(ne.node,ne.offset),fe.addRange(de))}}}}for(Se=[],fe=B;fe=fe.parentNode;)fe.nodeType===1&&Se.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<Se.length;B++){var we=Se[B];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}kl=!!cp,up=cp=null}finally{Ot=x,J.p=g,ce.T=d}}t.current=a,vn=2}}function Qm(){if(vn===2){vn=0;var t=Ci,a=gs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=ce.T,ce.T=null;var d=J.p;J.p=2;var g=Ot;Ot|=4;try{dy(t,a.alternate,a)}finally{Ot=g,J.p=d,ce.T=s}}vn=3}}function Zm(){if(vn===4||vn===3){vn=0;var t=ul;ul=null,qe();var a=Ci,s=gs,d=Wi,g=Ny,x=(d&335544064)===d?10262:10256;if((s.subtreeFlags&x)!==0||(s.flags&x)!==0?vn=5:(vn=0,gs=Ci=null,Iy(a,a.pendingLanes)),x=a.pendingLanes,x===0&&(jo=null),Ea(d),s=s.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ia,s,void 0,(s.current.flags&128)===128)}catch{}if(g!==null){s=ce.T,x=J.p,J.p=2,ce.T=null;try{for(var M=a.onRecoverableError,B=0;B<g.length;B++){var W=g[B];M(W.value,{componentStack:W.stack})}}finally{ce.T=s,J.p=x}}if(g=dl,M=hl,hl=null,g!==null&&(dl=null,M===null&&(M=[]),t!==null))for(W=0;W<g.length;W++)s=(0,g[W])(M),s!==void 0&&t.finished.finally(s);(Wi&3)!==0&&Cd(),Ji(a),x=a.pendingLanes,(d&261930)!==0&&(x&42)!==0?a===jd?Sc++:(Sc=0,jd=a):(Sc=0,jd=null),Cc(0)}}function Iy(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,rc(a)))}function Cd(){return ul!==null&&(ul.skipTransition(),ul=null),Xm(),Qm(),Zm(),Wm()}function Wm(){if(vn!==5)return!1;var t=Ci,a=Vm;Vm=0;var s=Ea(Wi),d=ce.T,g=J.p;try{J.p=32>s?32:s,ce.T=null,s=Gm,Gm=null;var x=Ci,M=Wi;if(vn=0,gs=Ci=null,Wi=0,(Ot&6)!==0)throw Error(o(331));var B=Ot;if(Ot|=4,ky(x.current),by(x,x.current,M,s),Ot=B,Cc(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ia,x)}catch{}return!0}finally{J.p=g,ce.T=d,Iy(t,a)}}function Py(t,a,s){a=si(s,a),a=pm(t.stateNode,a,2),t=fo(t,a,2),t!==null&&(Ua(t,2),Ji(t))}function It(t,a,s){if(t.tag===3)Py(t,t,s);else for(;a!==null;){if(a.tag===3){Py(a,t,s);break}else if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(jo===null||!jo.has(d))){t=si(s,t),s=z2(2),d=fo(a,s,2),d!==null&&(L2(s,d,a,t),Ua(d,2),Ji(d));break}}a=a.return}}function Jm(t,a,s){var d=t.pingCache;if(d===null){d=t.pingCache=new O8;var g=new Set;d.set(a,g)}else g=d.get(a),g===void 0&&(g=new Set,d.set(a,g));g.has(s)||(Um=!0,g.add(s),t=F8.bind(null,t,a,s),a.then(t,t))}function F8(t,a,s){var d=t.pingCache;d!==null&&d.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Qt===t&&(St&s)===s&&((jn===4||jn===3&&(St&62914560)===St&&300>Be()-yd)&&(Ot&2)===0?ml(t,0):gd|=s,cl===St&&(cl=0)),Ji(t)}function qy(t,a){a===0&&(a=Ha()),t=ts(t,a),t!==null&&(Ua(t,a),Ji(t))}function H8(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),qy(t,s)}function U8(t,a){var s=0;switch(t.tag){case 31:case 13:var d=t.stateNode,g=t.memoizedState;g!==null&&(s=g.retryLane);break;case 19:d=t.stateNode;break;case 22:d=t.stateNode._retryCache;break;default:throw Error(o(314))}d!==null&&d.delete(a),qy(t,s)}function $8(t,a){return ge(t,a)}var vl=null,gl=null,ep=!1,Nd=!1,tp=!1,ko=0;function Ji(t){t!==gl&&t.next===null&&(gl===null?vl=gl=t:gl=gl.next=t),Nd=!0,ep||(ep=!0,G8())}function Cc(t,a){if(!tp&&Nd){tp=!0;do for(var s=!1,d=vl;d!==null;){if(t!==0){var g=d.pendingLanes;if(g===0)var x=0;else{var M=d.suspendedLanes,B=d.pingedLanes;x=(1<<31-cn(42|t)+1)-1,x&=g&~(M&~B),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,$y(d,x))}else x=St,x=Ca(d,d===Qt?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||Na(d,x)||(s=!0,$y(d,x));d=d.next}while(s);tp=!1}}function V8(){Fy()}function Fy(){Nd=ep=!1;var t=0;ko!==0&&a7()&&(t=ko);for(var a=Be(),s=null,d=vl;d!==null;){var g=d.next,x=Hy(d,a);x===0?(d.next=null,s===null?vl=g:s.next=g,g===null&&(gl=s)):(s=d,(t!==0||(x&3)!==0)&&(Nd=!0)),d=g}vn!==0&&vn!==5||Cc(t),ko!==0&&(ko=0)}function Hy(t,a){for(var s=t.suspendedLanes,d=t.pingedLanes,g=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var M=31-cn(x),B=1<<M,W=g[M];W===-1?((B&s)===0||(B&d)!==0)&&(g[M]=qi(B,a)):W<=a&&(t.expiredLanes|=B),x&=~B}if(a=Qt,s=St,s=Ca(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d=t.callbackNode,s===0||t===a&&(Bt===2||Bt===9)||t.cancelPendingCommit!==null)return d!==null&&d!==null&&Ee(d),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Na(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(d!==null&&Ee(d),Ea(s)){case 2:case 8:s=Ba;break;case 32:s=Yt;break;case 268435456:s=Pi;break;default:s=Yt}return d=Uy.bind(null,t),s=ge(s,d),t.callbackPriority=a,t.callbackNode=s,a}return d!==null&&d!==null&&Ee(d),t.callbackPriority=2,t.callbackNode=null,2}function Uy(t,a){if(vn!==0&&vn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Cd()&&t.callbackNode!==s)return null;var d=St;return d=Ca(t,t===Qt?d:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d===0?null:(Ty(t,d,a),Hy(t,Be()),t.callbackNode!=null&&t.callbackNode===s?Uy.bind(null,t):null)}function $y(t,a){if(Cd())return null;Ty(t,a,!0)}function G8(){r7(function(){(Ot&6)!==0?ge($n,V8):Fy()})}function np(){if(ko===0){var t=ss;t===0&&(t=ai,ai<<=1,(ai&261888)===0&&(ai=256)),ko=t}return ko}function Vy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ht(t)}function Y8(t,a,s,d,g){if(a==="submit"&&s&&s.stateNode===g){var x=Vy((g[Nn]||null).action),M=d.submitter;M&&(a=(a=M[Nn]||null)?Vy(a.formAction):M.getAttribute("formAction"),a!==null&&(x=a,M=null));var B=new Nu("action","action",null,d,g);t.push({event:B,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ko!==0){var W=new FormData(g,M);um(s,{pending:!0,data:W,method:g.method,action:x},null,W)}}else typeof x=="function"&&(B.preventDefault(),W=new FormData(g,M),um(s,{pending:!0,data:W,method:g.method,action:x},x,W))},currentTarget:g}]})}}for(var ap=0;ap<Tf.length;ap++){var ip=Tf[ap],K8=ip.toLowerCase(),X8=ip[0].toUpperCase()+ip.slice(1);ji(K8,"on"+X8)}ji(g1,"onAnimationEnd"),ji(y1,"onAnimationIteration"),ji(x1,"onAnimationStart"),ji("dblclick","onDoubleClick"),ji("focusin","onFocus"),ji("focusout","onBlur"),ji(i8,"onTransitionRun"),ji(r8,"onTransitionStart"),ji(o8,"onTransitionCancel"),ji(b1,"onTransitionEnd"),Dt("onMouseEnter",["mouseout","mouseover"]),Dt("onMouseLeave",["mouseout","mouseover"]),Dt("onPointerEnter",["pointerout","pointerover"]),Dt("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),Q8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function Gy(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var d=t[s],g=d.event;d=d.listeners;e:{var x=void 0;if(a)for(var M=d.length-1;0<=M;M--){var B=d[M],W=B.instance,le=B.currentTarget;if(B=B.listener,W!==x&&g.isPropagationStopped())break e;x=B,g.currentTarget=le;try{x(g)}catch(ve){Au(ve)}g.currentTarget=null,x=W}else for(M=0;M<d.length;M++){if(B=d[M],W=B.instance,le=B.currentTarget,B=B.listener,W!==x&&g.isPropagationStopped())break e;x=B,g.currentTarget=le;try{x(g)}catch(ve){Au(ve)}g.currentTarget=null,x=W}}}}function bt(t,a){var s=a[Go];s===void 0&&(s=a[Go]=new Set);var d=t+"__bubble";s.has(d)||(Yy(a,t,2,!1),s.add(d))}function rp(t,a,s){var d=0;a&&(d|=4),Yy(s,t,d,a)}var Ed="_reactListening"+Math.random().toString(36).slice(2);function op(t){if(!t[Ed]){t[Ed]=!0,st.forEach(function(s){s!=="selectionchange"&&(Q8.has(s)||rp(s,!1,t),rp(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Ed]||(a[Ed]=!0,rp("selectionchange",!1,a))}}function Yy(t,a,s,d){switch(Lx(a)){case 2:var g=H7;break;case 8:g=U7;break;default:g=Np}s=g.bind(null,a,s,t),g=void 0,!Wo||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),d?g!==void 0?t.addEventListener(a,s,{capture:!0,passive:g}):t.addEventListener(a,s,!0):g!==void 0?t.addEventListener(a,s,{passive:g}):t.addEventListener(a,s,!1)}function sp(t,a,s,d,g){var x=d;if((a&1)===0&&(a&2)===0&&d!==null)e:for(;;){if(d===null)return;var M=d.tag;if(M===3||M===4){var B=d.stateNode.containerInfo;if(B===g)break;if(M===4)for(M=d.return;M!==null;){var W=M.tag;if((W===3||W===4)&&M.stateNode.containerInfo===g)return;M=M.return}for(;B!==null;){if(M=Va(B),M===null)return;if(W=M.tag,W===5||W===6||W===26||W===27){d=x=M;continue e}B=B.parentNode}}d=d.return}Zo(function(){var le=x,ve=Qo(s),Se=[];e:{var re=j1.get(t);if(re!==void 0){var fe=Nu,ze=t;switch(t){case"keypress":if(Su(s)===0)break e;case"keydown":case"keyup":fe=DC;break;case"focusin":ze="focus",fe=yf;break;case"focusout":ze="blur",fe=yf;break;case"beforeblur":case"afterblur":fe=yf;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":fe=Qg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=wC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=PC;break;case g1:case y1:case x1:fe=CC;break;case b1:fe=FC;break;case"scroll":case"scrollend":fe=bC;break;case"wheel":fe=UC;break;case"copy":case"cut":case"paste":fe=EC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Wg;break;case"submit":fe=BC;break;case"toggle":case"beforetoggle":fe=VC}var Ue=(a&4)!==0,ht=!Ue&&(t==="scroll"||t==="scrollend"),se=Ue?re!==null?re+"Capture":null:re;Ue=[];for(var ne=le,de;ne!==null;){var we=ne;if(de=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||de===null||se===null||(we=wr(ne,se),we!=null&&Ue.push(Ec(ne,we,de))),ht)break;ne=ne.return}0<Ue.length&&(re=new fe(re,ze,null,s,ve),Se.push({event:re,listeners:Ue}))}}if((a&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",fe&&s!==Xo&&(ze=s.relatedTarget||s.fromElement)&&(Va(ze)||ze[fa]))break e;(re||fe)&&(ze=ve.window===ve?ve:(fe=ve.ownerDocument)?fe.defaultView||fe.parentWindow:window,re?(fe=s.relatedTarget||s.toElement,re=le,fe=fe?Va(fe):null,fe!==null&&(ht=c(fe),Ue=fe.tag,fe!==ht||Ue!==5&&Ue!==27&&Ue!==6)&&(fe=null)):(re=null,fe=le),re!==fe&&(Ue=Qg,we="onMouseLeave",se="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(Ue=Wg,we="onPointerLeave",se="onPointerEnter",ne="pointer"),ht=re==null?ze:pe(re),de=fe==null?ze:pe(fe),ze=new Ue(we,ne+"leave",re,s,ve),ze.target=ht,ze.relatedTarget=de,we=null,Va(ve)===le&&(Ue=new Ue(se,ne+"enter",fe,s,ve),Ue.target=de,Ue.relatedTarget=ht,we=Ue),ht=we,Ue=re&&fe?_(re,fe,Z8):null,re!==null&&Ky(Se,ze,re,Ue,!1),fe!==null&&ht!==null&&Ky(Se,ht,fe,Ue,!0)))}e:{if(re=le?pe(le):window,fe=re.nodeName&&re.nodeName.toLowerCase(),fe==="select"||fe==="input"&&re.type==="file")var Ie=o1;else if(i1(re))if(s1)Ie=t8;else{Ie=JC;var Ct=WC}else fe=re.nodeName,!fe||fe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?le&&en(le.elementType)&&(Ie=o1):Ie=e8;if(Ie&&(Ie=Ie(t,le))){r1(Se,Ie,s,ve);break e}Ct&&Ct(t,re,le)}switch(Ct=le?pe(le):window,t){case"focusin":(i1(Ct)||Ct.contentEditable==="true")&&(Vs=Ct,Cf=le,nc=null);break;case"focusout":nc=Cf=Vs=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,p1(Se,s,ve);break;case"selectionchange":if(a8)break;case"keydown":case"keyup":p1(Se,s,ve)}var Ke;if(bf)e:{switch(t){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else $s?n1(t,s)&&(rt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(rt="onCompositionStart");rt&&(Jg&&s.locale!=="ko"&&($s||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&$s&&(Ke=Kg()):(ao=ve,pf="value"in ao?ao.value:ao.textContent,$s=!0)),Ct=Td(le,rt),0<Ct.length&&(rt=new Zg(rt,t,null,s,ve),Se.push({event:rt,listeners:Ct}),Ke?rt.data=Ke:(Ke=a1(s),Ke!==null&&(rt.data=Ke)))),(Ke=YC?KC(t,s):XC(t,s))&&(rt=Td(le,"onBeforeInput"),0<rt.length&&(Ct=new Zg("onBeforeInput","beforeinput",null,s,ve),Se.push({event:Ct,listeners:rt}),Ct.data=Ke)),Y8(Se,t,le,s,ve)}Gy(Se,a)})}function Ec(t,a,s){return{instance:t,listener:a,currentTarget:s}}function Td(t,a){for(var s=a+"Capture",d=[];t!==null;){var g=t,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=wr(t,s),g!=null&&d.unshift(Ec(t,g,x)),g=wr(t,a),g!=null&&d.push(Ec(t,g,x))),t.tag===3)return d;t=t.return}return[]}function Z8(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ky(t,a,s,d,g){for(var x=a._reactName,M=[];s!==null&&s!==d;){var B=s,W=B.alternate,le=B.stateNode;if(B=B.tag,W!==null&&W===d)break;B!==5&&B!==26&&B!==27||le===null||(W=le,g?(le=wr(s,x),le!=null&&M.unshift(Ec(s,le,W))):g||(le=wr(s,x),le!=null&&M.push(Ec(s,le,W)))),s=s.return}M.length!==0&&t.push({event:a,listeners:M})}var W8=/\r\n?/g,J8=/\u0000|\uFFFD/g;function Xy(t){return(typeof t=="string"?t:""+t).replace(W8,`
49
+ `).replace(J8,"")}function Qy(t,a){return a=Xy(a),Xy(t)===a}function Pt(t,a,s,d,g,x){switch(s){case"children":if(typeof d=="string")a==="body"||a==="textarea"&&d===""||pt(t,d);else if(typeof d=="number"||typeof d=="bigint")a!=="body"&&pt(t,""+d);else return;break;case"className":ma(t,"class",d);break;case"tabIndex":ma(t,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ma(t,s,d);break;case"style":yt(t,d,x);return;case"data":if(a!=="object"){ma(t,"data",d);break}case"src":case"href":if(d===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(s);break}d=Ht(d),t.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="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"&&Pt(t,a,"name",g.name,g,null),Pt(t,a,"formEncType",g.formEncType,g,null),Pt(t,a,"formMethod",g.formMethod,g,null),Pt(t,a,"formTarget",g.formTarget,g,null)):(Pt(t,a,"encType",g.encType,g,null),Pt(t,a,"method",g.method,g,null),Pt(t,a,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(s);break}d=Ht(d),t.setAttribute(s,d);break;case"onClick":d!=null&&(t.onclick=tn);return;case"onScroll":d!=null&&bt("scroll",t);return;case"onScrollEnd":d!=null&&bt("scrollend",t);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(s=d.__html,s!=null){if(g.children!=null)throw Error(o(60));(x!=null?x.__html:void 0)!==s&&(t.innerHTML=s)}}break;case"multiple":t.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":t.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){t.removeAttribute("xlink:href");break}s=Ht(d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,d):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":d&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":d===!0?t.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,d):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?t.setAttribute(s,d):t.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?t.removeAttribute(s):t.setAttribute(s,d);break;case"popover":bt("beforetoggle",t),bt("toggle",t),Kt(t,"popover",d);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Kt(t,"is",d);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=Xt.get(s)||s,Kt(t,s,d);else return}Qe=!0}function lp(t,a,s,d,g,x){switch(s){case"style":yt(t,d,x);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(s=d.__html,s!=null){if(g.children!=null)throw Error(o(60));(x!=null?x.__html:void 0)!==s&&(t.innerHTML=s)}}break;case"children":if(typeof d=="string")pt(t,d);else if(typeof d=="number"||typeof d=="bigint")pt(t,""+d);else return;break;case"onScroll":d!=null&&bt("scroll",t);return;case"onScrollEnd":d!=null&&bt("scrollend",t);return;case"onClick":d!=null&&(t.onclick=tn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ge.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(g=s.endsWith("Capture"),x=s.slice(2,g?s.length-7:void 0),a=t[Nn]||null,a=a!=null?a[s]:null,typeof a=="function"&&t.removeEventListener(x,a,g),typeof d=="function")){typeof a!="function"&&a!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(x,d,g);break e}Qe=!0,s in t?t[s]=d:d===!0?t.setAttribute(s,""):Kt(t,s,d)}return}Qe=!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":bt("error",t),bt("load",t);var d=!1,g=!1,x;for(x in s)if(s.hasOwnProperty(x)){var M=s[x];if(M!=null)switch(x){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Pt(t,a,x,M,s,null)}}g&&Pt(t,a,"srcSet",s.srcSet,s,null),d&&Pt(t,a,"src",s.src,s,null);return;case"input":bt("invalid",t);var B=x=M=g=null,W=null,le=null;for(d in s)if(s.hasOwnProperty(d)){var ve=s[d];if(ve!=null)switch(d){case"name":g=ve;break;case"type":M=ve;break;case"checked":W=ve;break;case"defaultChecked":le=ve;break;case"value":x=ve;break;case"defaultValue":B=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(o(137,a));break;default:Pt(t,a,d,ve,s,null)}}bi(t,x,B,W,le,M,g,!1);return;case"select":bt("invalid",t),d=M=x=null;for(g in s)if(s.hasOwnProperty(g)&&(B=s[g],B!=null))switch(g){case"value":x=B;break;case"defaultValue":M=B;break;case"multiple":d=B;default:Pt(t,a,g,B,s,null)}a=x,s=M,t.multiple=!!d,a!=null?be(t,!!d,a,!1):s!=null&&be(t,!!d,s,!0);return;case"textarea":bt("invalid",t),x=g=d=null;for(M in s)if(s.hasOwnProperty(M)&&(B=s[M],B!=null))switch(M){case"value":d=B;break;case"defaultValue":g=B;break;case"children":x=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(91));break;default:Pt(t,a,M,B,s,null)}ot(t,d,g,x);return;case"option":for(W in s)if(s.hasOwnProperty(W)&&(d=s[W],d!=null))switch(W){case"selected":t.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Pt(t,a,W,d,s,null)}return;case"dialog":bt("beforetoggle",t),bt("toggle",t),bt("cancel",t),bt("close",t);break;case"iframe":case"object":bt("load",t);break;case"video":case"audio":for(d=0;d<Nc.length;d++)bt(Nc[d],t);break;case"image":bt("error",t),bt("load",t);break;case"details":bt("toggle",t);break;case"embed":case"source":case"link":bt("error",t),bt("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(le in s)if(s.hasOwnProperty(le)&&(d=s[le],d!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Pt(t,a,le,d,s,null)}return;default:if(en(a)){for(ve in s)s.hasOwnProperty(ve)&&(d=s[ve],d!==void 0&&lp(t,a,ve,d,s,void 0));return}}for(B in s)s.hasOwnProperty(B)&&(d=s[B],d!=null&&Pt(t,a,B,d,s,null))}var e7={};function t7(t,a,s,d){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,x=null,M=null,B=null,W=null,le=null,ve=null;for(fe in s){var Se=s[fe];if(s.hasOwnProperty(fe)&&Se!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":W=Se;default:d.hasOwnProperty(fe)||Pt(t,a,fe,null,d,Se)}}for(var re in d){var fe=d[re];if(Se=s[re],d.hasOwnProperty(re)&&(fe!=null||Se!=null))switch(re){case"type":fe!==Se&&(Qe=!0),x=fe;break;case"name":fe!==Se&&(Qe=!0),g=fe;break;case"checked":fe!==Se&&(Qe=!0),le=fe;break;case"defaultChecked":fe!==Se&&(Qe=!0),ve=fe;break;case"value":fe!==Se&&(Qe=!0),M=fe;break;case"defaultValue":fe!==Se&&(Qe=!0),B=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,a));break;default:fe!==Se&&Pt(t,a,re,fe,d,Se)}}Dn(t,M,B,W,le,ve,x,g);return;case"select":fe=M=B=re=null;for(x in s)if(W=s[x],s.hasOwnProperty(x)&&W!=null)switch(x){case"value":break;case"multiple":fe=W;default:d.hasOwnProperty(x)||Pt(t,a,x,null,d,W)}for(g in d)if(x=d[g],W=s[g],d.hasOwnProperty(g)&&(x!=null||W!=null))switch(g){case"value":x!==W&&(Qe=!0),re=x;break;case"defaultValue":x!==W&&(Qe=!0),B=x;break;case"multiple":x!==W&&(Qe=!0),M=x;default:x!==W&&Pt(t,a,g,x,d,W)}a=B,s=M,d=fe,re!=null?be(t,!!s,re,!1):!!d!=!!s&&(a!=null?be(t,!!s,a,!0):be(t,!!s,s?[]:"",!1));return;case"textarea":fe=re=null;for(B in s)if(g=s[B],s.hasOwnProperty(B)&&g!=null&&!d.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:Pt(t,a,B,null,d,g)}for(M in d)if(g=d[M],x=s[M],d.hasOwnProperty(M)&&(g!=null||x!=null))switch(M){case"value":g!==x&&(Qe=!0),re=g;break;case"defaultValue":g!==x&&(Qe=!0),fe=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:g!==x&&Pt(t,a,M,g,d,x)}Te(t,re,fe);return;case"option":for(var ze in s)if(re=s[ze],s.hasOwnProperty(ze)&&re!=null&&!d.hasOwnProperty(ze))switch(ze){case"selected":t.selected=!1;break;default:Pt(t,a,ze,null,d,re)}for(W in d)if(re=d[W],fe=s[W],d.hasOwnProperty(W)&&re!==fe&&(re!=null||fe!=null))switch(W){case"selected":re!==fe&&(Qe=!0),t.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Pt(t,a,W,re,d,fe)}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 Ue in s)re=s[Ue],s.hasOwnProperty(Ue)&&re!=null&&!d.hasOwnProperty(Ue)&&Pt(t,a,Ue,null,d,re);for(le in d)if(re=d[le],fe=s[le],d.hasOwnProperty(le)&&re!==fe&&(re!=null||fe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,a));break;default:Pt(t,a,le,re,d,fe)}return;default:if(en(a)){for(var ht in s)re=s[ht],s.hasOwnProperty(ht)&&re!==void 0&&!d.hasOwnProperty(ht)&&lp(t,a,ht,void 0,d,re);for(ve in d)re=d[ve],fe=s[ve],!d.hasOwnProperty(ve)||re===fe||re===void 0&&fe===void 0||lp(t,a,ve,re,d,fe);return}}for(var se in s)re=s[se],s.hasOwnProperty(se)&&re!=null&&!d.hasOwnProperty(se)&&Pt(t,a,se,null,d,re);for(Se in d)re=d[Se],fe=s[Se],!d.hasOwnProperty(Se)||re===fe||re==null&&fe==null||Pt(t,a,Se,re,d,fe)}function Zy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n7(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var g=s[d],x=g.transferSize,M=g.initiatorType,B=g.duration;if(x&&B&&Zy(M)){for(M=0,B=g.responseEnd,d+=1;d<s.length;d++){var W=s[d],le=W.startTime;if(le>B)break;var ve=W.transferSize,Se=W.initiatorType;ve&&Zy(Se)&&(W=W.responseEnd,M+=ve*(W<B?1:(B-le)/(W-le)))}if(--d,a+=8*(x+M)/(g.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 cp=null,up=null;function Tc(t){return t.nodeType===9?t:t.ownerDocument}function Wy(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 Jy(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 ex(t,a,s,d){return s=Tc(s).createElement(t),s[ln]=d,s[Nn]=a,Zn(s,t,a),Ce(s),s}function dp(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 hp=null;function a7(){var t=window.event;return t&&t.type==="popstate"?t===hp?!1:(hp=t,!0):(hp=null,!1)}var fp=typeof setTimeout=="function"?setTimeout:void 0,i7=typeof clearTimeout=="function"?clearTimeout:void 0,tx=typeof Promise=="function"?Promise:void 0,nx=typeof requestAnimationFrame=="function"?requestAnimationFrame:fp,r7=typeof queueMicrotask=="function"?queueMicrotask:typeof tx<"u"?function(t){return tx.resolve(null).then(t).catch(o7)}:fp;function o7(t){setTimeout(function(){throw t})}function So(t){return t==="head"}function ax(t,a){var s=a,d=0;do{var g=s.nextSibling;if(t.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"||s==="/&"){if(d===0){t.removeChild(g),Sl(a);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")jp(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,jp(s);for(var x=s.firstChild;x;){var M=x.nextSibling,B=x.nodeName;x[xr]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=M}}else s==="body"&&jp(t.ownerDocument.body);s=g}while(s);Sl(a)}function ix(t,a){var s=t;t=0;do{var d=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||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=d}while(s)}function rx(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 d=1;else for(var g=d=0;g<a.length;g++){var x=a[g];0<x.width&&0<x.height&&d++}d===1&&(t=t.style,t.display=a.length===1?"inline-block":"block",t.marginTop="-"+s.paddingTop,t.marginBottom="-"+s.paddingBottom)}}function ox(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 s7(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 mp(t){var a=t.getBoundingClientRect(),s=getComputedStyle(t);return s7(a,s,t)}function l7(t){return t.documentElement.clientHeight}function c7(t){this.addEventListener("load",t),this.addEventListener("error",t)}function u7(t,a,s,d,g,x,M,B,W){var le=a.nodeType===9?a:a.ownerDocument;try{var ve=le.startViewTransition({update:function(){var re=le.defaultView,fe=re.navigation&&re.navigation.transition,ze=le.fonts.status;d();var Ue=[];if(ze==="loaded"&&(l7(le),le.fonts.status==="loading"&&Ue.push(le.fonts.ready)),ze=Ue.length,t!==null)for(var ht=t.suspenseyImages,se=0,ne=0;ne<ht.length;ne++){var de=ht[ne];if(!de.complete){var we=de.getBoundingClientRect();if(0<we.bottom&&0<we.right&&we.top<re.innerHeight&&we.left<re.innerWidth){if(se+=Ex(de),se>_d){Ue.length=ze;break}de=new Promise(c7.bind(de)),Ue.push(de)}}}if(0<Ue.length)return re=Promise.race([Promise.all(Ue),new Promise(function(Ie){return setTimeout(Ie,500)})]).then(g,g),(fe?Promise.allSettled([fe.finished,re]):re).then(x,x);if(g(),fe)return fe.finished.then(x,x);x()},types:s});le.__reactViewTransition=ve;var Se=[];return ve.ready.then(function(){for(var re=le.documentElement.getAnimations({subtree:!0}),fe=0;fe<re.length;fe++){var ze=re[fe],Ue=ze.effect,ht=Ue.pseudoElement;if(ht!=null&&ht.startsWith("::view-transition")){Se.push(ze),ze=Ue.getKeyframes();for(var se=ht=void 0,ne=!0,de=0;de<ze.length;de++){var we=ze[de],Ie=we.width;if(ht===void 0)ht=Ie;else if(ht!==Ie){ne=!1;break}if(Ie=we.height,se===void 0)se=Ie;else if(se!==Ie){ne=!1;break}delete we.width,delete we.height,we.transform==="none"&&delete we.transform}ne&&ht!==void 0&&se!==void 0&&(Ue.setKeyframes(ze),ne=getComputedStyle(Ue.target,Ue.pseudoElement),ne.width!==ht||ne.height!==se)&&(ne=ze[0],ne.width=ht,ne.height=se,ne=ze[ze.length-1],ne.width=ht,ne.height=se,Ue.setKeyframes(ze))}}M()},function(re){le.__reactViewTransition===ve&&(le.__reactViewTransition=null);try{if(typeof re=="object"&&re!==null)switch(re.name){case"InvalidStateError":(re.message==="View transition was skipped because document visibility state is hidden."||re.message==="Skipping view transition because document visibility state has become hidden."||re.message==="Skipping view transition because viewport size changed."||re.message==="Transition was aborted because of invalid state")&&(re=null)}re!==null&&W(re)}finally{d(),g(),M()}}),ve.finished.finally(function(){for(var re=0;re<Se.length;re++)Se[re].cancel();le.__reactViewTransition===ve&&(le.__reactViewTransition=null),B()}),ve}catch{return d(),g(),M(),null}}function ys(t,a){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+a+")"}ys.prototype.animate=function(t,a){return a=typeof a=="number"?{duration:a}:L({},a),a.pseudoElement=this._selector,this._scope.animate(t,a)},ys.prototype.getAnimations=function(){for(var t=this._scope,a=this._selector,s=t.getAnimations({subtree:!0}),d=[],g=0;g<s.length;g++){var x=s[g].effect;x!==null&&x.target===t&&x.pseudoElement===a&&d.push(s[g])}return d},ys.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function sx(t){return{name:t,group:new ys("group",t),imagePair:new ys("image-pair",t),old:new ys("old",t),new:new ys("new",t)}}function Ja(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Ja.prototype.addEventListener=function(t,a,s){var d=null,g=null;if(!(s!=null&&typeof s!="boolean"&&(d=s.signal||null,d!==null&&d.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var x=this._eventListeners;if(cx(x,t,a,s)===-1){var M=this,B=a;s!=null&&typeof s!="boolean"&&s.once===!0&&(B=function(W){M.removeEventListener(t,a,s),typeof a=="function"?a.call(this,W):a.handleEvent(W)}),d!==null&&(g=M.removeEventListener.bind(M,t,a,s),d.addEventListener("abort",g,{once:!0}),g=d.removeEventListener.bind(d,"abort",g)),d=yl(s),x.push({type:t,listener:a,optionsOrUseCapture:s,attachedListener:B,cleanup:g}),p(this._fragmentFiber.child,!1,d7,t,B,d)}this._eventListeners=x}};function d7(t,a,s,d){return N(t).addEventListener(a,s,d),!1}Ja.prototype.removeEventListener=function(t,a,s){var d=this._eventListeners;if(d!==null&&(a=cx(d,t,a,s),a!==-1)){var g=d[a];s=g.attachedListener;var x=g.cleanup;g=yl(g.optionsOrUseCapture),p(this._fragmentFiber.child,!1,h7,t,s,g),d.splice(a,1),x!==null&&x()}};function h7(t,a,s,d){return N(t).removeEventListener(a,s,d),!1}function yl(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function lx(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function cx(t,a,s,d){if(t.length===0)return-1;d=lx(d);for(var g=0;g<t.length;g++){var x=t[g];if(x.type===a&&x.listener===s&&lx(x.optionsOrUseCapture)===d)return g}return-1}Ja.prototype.dispatchEvent=function(t){var a=w(this._fragmentFiber);if(a===null)return!0;a=N(a);var s=this._eventListeners;if(s!==null&&0<s.length||!t.bubbles){var d=a.nodeType===9?a.createComment(""):document.createTextNode("");if(s)for(var g=0;g<s.length;g++){var x=s[g];d.addEventListener(x.type,x.attachedListener,yl(x.optionsOrUseCapture))}if(a.appendChild(d),t=d.dispatchEvent(t),s)for(g=0;g<s.length;g++)x=s[g],d.removeEventListener(x.type,x.attachedListener,yl(x.optionsOrUseCapture));return a.removeChild(d),t}return a.dispatchEvent(t)},Ja.prototype.focus=function(t){p(this._fragmentFiber.child,!0,ux,t,void 0,void 0)};function ux(t,a){return t.tag===6?!1:(t=N(t),S7(t,a))}Ja.prototype.focusLast=function(t){var a=[];p(this._fragmentFiber.child,!0,pp,a,void 0,void 0);for(var s=a.length-1;0<=s&&!ux(a[s],t);s--);};function pp(t,a){return a.push(t),!1}Ja.prototype.blur=function(){var t=w(this._fragmentFiber);t!==null&&(t=N(t),t=Tc(t).activeElement,t!==null&&p(this._fragmentFiber.child,!1,f7,t,void 0,void 0))};function f7(t,a){return t.tag===6?!1:(t=N(t),t===a||t.contains(a)?(a.blur(),!0):!1)}Ja.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),p(this._fragmentFiber.child,!1,m7,t,void 0,void 0)};function m7(t,a){return t.tag===6||(t=N(t),a.observe(t)),!1}Ja.prototype.unobserveUsing=function(t){var a=this._observers;if(a!==null&&a.has(t)){a.delete(t),p(this._fragmentFiber.child,!1,p7,t,void 0,void 0);for(var s=a=0;s<Ni.length;s++){var d=Ni[s];d.fragmentInstance===this&&d.observer===t?t.unobserve(d.instance):Ni[a++]=d}Ni.length=a}};function p7(t,a){return t.tag===6||(t=N(t),a.unobserve(t)),!1}var Ni=[],vp=!1;function v7(t,a,s){Ni.push({fragmentInstance:t,observer:a,instance:s}),vp||(vp=!0,C7(function(){vp=!1;var d=Ni;Ni=[];for(var g=0;g<d.length;g++){var x=d[g];x.observer.unobserve(x.instance)}}))}Ja.prototype.getClientRects=function(){var t=[];return p(this._fragmentFiber.child,!1,g7,t,void 0,void 0),t};function g7(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}Ja.prototype.getRootNode=function(t){var a=w(this._fragmentFiber);return a===null?this:N(a).getRootNode(t)},Ja.prototype.compareDocumentPosition=function(t){var a=w(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];p(this._fragmentFiber.child,!1,pp,s,void 0,void 0);var d=N(a);if(s.length===0){if(s=d,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 g=d=s.compareDocumentPosition(t);return s===t?g=Node.DOCUMENT_POSITION_CONTAINS:d&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=k(a)[1],s===null?g=Node.DOCUMENT_POSITION_PRECEDING:(t=N(s).compareDocumentPosition(t),g=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),g|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=N(s[0]),g=N(s[s.length-1]);var x=b(this._fragmentFiber)?a.parentElement:d;if(x==null)return Node.DOCUMENT_POSITION_DISCONNECTED;d=x.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,x=x.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY;var M=a.compareDocumentPosition(t),B=g.compareDocumentPosition(t),W=M&Node.DOCUMENT_POSITION_CONTAINED_BY||B&Node.DOCUMENT_POSITION_CONTAINED_BY;return B=d&&x&&M&Node.DOCUMENT_POSITION_FOLLOWING&&B&Node.DOCUMENT_POSITION_PRECEDING,a=d&&a===t||x&&g===t||W||B?Node.DOCUMENT_POSITION_CONTAINED_BY:!d&&a===t||!x&&g===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:M,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||y7(a,this._fragmentFiber,s[0],s[s.length-1],t)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function y7(t,a,s,d,g){var x=Va(g);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=g.ownerDocument,g===x||g===x.documentElement||g===x.body;e:{for(x=a,a=w(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=_(s,x,R),a===null?a=!1:(p(a,!0,E,x,s),x=C,C=null,a=x!==null)),a):t&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!x)&&!(a=x===d)&&(a=_(d,x,R),a===null?a=!1:(p(a,!0,T,x,d),x=C,A=C=null,a=x!==null)),a):!1}function dx(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)}Ja.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(o(566));var a=[];p(this._fragmentFiber.child,!1,pp,a,void 0,void 0);var s=t!==!1;if(a.length===0){var d=k(this._fragmentFiber);if(d=s?d[1]||d[0]||w(this._fragmentFiber):d[0]||d[1],d===null)return;if(d.tag===6){t=N(d),dx(t,s);return}if(d=N(d),d.nodeType!==9){if(d.nodeType===11){s="host"in d?d.host:null,s!==null&&s.scrollIntoView(t);return}d.scrollIntoView(t)}}for(d=s?a.length-1:0;d!==(s?-1:a.length);){var g=a[d];g.tag===6?(g=N(g),dx(g,s)):N(g).scrollIntoView(t),d+=s?-1:1}};function x7(t,a){return t=N(t),hx(t,a),!1}function hx(t,a){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(a)}function fx(t,a){var s=a._eventListeners;if(s!==null)for(var d=0;d<s.length;d++){var g=s[d];t.addEventListener(g.type,g.attachedListener,yl(g.optionsOrUseCapture))}t.nodeType!==3&&(s=a._observers,s!==null&&s.forEach(function(x){for(var M=0,B=0;B<Ni.length;B++){var W=Ni[B];(W.fragmentInstance!==a||W.observer!==x||W.instance!==t)&&(Ni[M++]=W)}Ni.length=M,x.observe(t)}),hx(t,a))}function b7(t,a){var s=a._eventListeners;if(s!==null)for(var d=0;d<s.length;d++){var g=s[d];t.removeEventListener(g.type,g.attachedListener,yl(g.optionsOrUseCapture))}t.nodeType!==3&&(s=a._observers,s!==null&&s.forEach(function(x){typeof x.rootMargin=="string"?v7(a,x,t):x.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(a))}function gp(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":gp(s),to(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function j7(t,a,s,d){for(;t.nodeType===1;){var g=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!d&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(d){if(!t[xr])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!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var x=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=hi(t.nextSibling),t===null)break}return null}function w7(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=hi(t.nextSibling),t===null))return null;return t}function mx(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=hi(t.nextSibling),t===null))return null;return t}function yp(t){return t.data==="$?"||t.data==="$~"}function xp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function k7(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var d=function(){a(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),t._reactRetry=d}}function hi(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 bp=null;function px(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return hi(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function vx(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 S7(t,a){function s(){d=!0}if(t.ownerDocument.activeElement===t)return!0;var d=!1;try{t.ownerDocument.addEventListener("focus",s,!0),(t.focus||HTMLElement.prototype.focus).call(t,a)}finally{t.ownerDocument.removeEventListener("focus",s,!0)}return d}function C7(t){nx(function(){nx(function(a){return t(a)})})}function gx(t,a,s){switch(a=Tc(s),t){case"html":if(t=a.documentElement,!t)throw Error(o(452));return t;case"head":if(t=a.head,!t)throw Error(o(453));return t;case"body":if(t=a.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function yx(t,a,s){for(var d in s){var g=s[d];s.hasOwnProperty(d)&&g!=null&&Pt(t,a,d,null,e7,g)}s.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===tn&&(t.onclick=null),to(t)}function jp(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);to(t)}var fi=new Map,xx=new Set;function Ac(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 Dr=J.d;J.d={f:N7,r:E7,D:T7,C:A7,L:M7,m:_7,X:O7,S:R7,M:D7};function N7(){var t=Dr.f(),a=wd();return t||a}function E7(t){var a=br(t);a!==null&&a.tag===5&&a.type==="form"?j2(a):Dr.r(t)}var xl=typeof document>"u"?null:document;function bx(t,a,s){var d=xl;if(d&&typeof a=="string"&&a){var g=Ft(a);g='link[rel="'+t+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),xx.has(g)||(xx.add(g),t={rel:t,crossOrigin:s,href:a},d.querySelector(g)===null&&(a=d.createElement("link"),Zn(a,"link",t),Ce(a),d.head.appendChild(a)))}}function T7(t){Dr.D(t),bx("dns-prefetch",t,null)}function A7(t,a){Dr.C(t,a),bx("preconnect",t,a)}function M7(t,a,s){Dr.L(t,a,s);var d=xl;if(d&&t&&a){var g='link[rel="preload"][as="'+Ft(a)+'"]';a==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+Ft(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+Ft(s.imageSizes)+'"]')):g+='[href="'+Ft(t)+'"]';var x=g;switch(a){case"style":x=bl(t);break;case"script":x=jl(t)}if(!(fi.has(x)||(t=L({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),fi.set(x,t),d.querySelector(g)!==null||a==="style"&&d.querySelector(Mc(x))||a==="script"&&d.querySelector(_c(x))))){var M=d.createElement("link");Zn(M,"link",t),a==="style"&&(M[eo]=!0,M.onload=M.onerror=function(){Ve(M)}),Ce(M),d.head.appendChild(M)}}}function _7(t,a){Dr.m(t,a);var s=xl;if(s&&t){var d=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+Ft(d)+'"][href="'+Ft(t)+'"]',x=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=jl(t)}if(!fi.has(x)&&(t=L({rel:"modulepreload",href:t},a),fi.set(x,t),s.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(_c(x)))return}d=s.createElement("link"),Zn(d,"link",t),Ce(d),s.head.appendChild(d)}}}function R7(t,a,s){Dr.S(t,a,s);var d=xl;if(d&&t){var g=Ne(d).hoistableStyles,x=bl(t);a=a||"default";var M=g.get(x);if(!M){var B={loading:0,preload:null};if(M=d.querySelector(Mc(x)))B.loading=5;else{t=L({rel:"stylesheet",href:t,"data-precedence":a},s),(s=fi.get(x))&&wp(t,s);var W=M=d.createElement("link");Ce(W),Zn(W,"link",t),W._p=new Promise(function(le,ve){W.onload=le,W.onerror=ve}),W.addEventListener("load",function(){B.loading|=1}),W.addEventListener("error",function(){B.loading|=2}),B.loading|=4,Ad(M,a,d)}M={type:"stylesheet",instance:M,count:1,state:B},g.set(x,M)}}}function O7(t,a){Dr.X(t,a);var s=xl;if(s&&t){var d=Ne(s).hoistableScripts,g=jl(t),x=d.get(g);x||(x=s.querySelector(_c(g)),x||(t=L({src:t,async:!0},a),(a=fi.get(g))&&kp(t,a),x=s.createElement("script"),Ce(x),Zn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(g,x))}}function D7(t,a){Dr.M(t,a);var s=xl;if(s&&t){var d=Ne(s).hoistableScripts,g=jl(t),x=d.get(g);x||(x=s.querySelector(_c(g)),x||(t=L({src:t,async:!0,type:"module"},a),(a=fi.get(g))&&kp(t,a),x=s.createElement("script"),Ce(x),Zn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(g,x))}}function jx(t,a,s,d){var g=(g=Gt.current)?Ac(g):null;if(!g)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=bl(s.href),a=Ne(g).hoistableStyles,d=a.get(s),d||(d={type:"style",instance:null,count:0,state:null},a.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=bl(s.href);var x=Ne(g).hoistableStyles,M=x.get(t);if(M||(g=g.ownerDocument||g,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,M),(x=g.querySelector(Mc(t)))?x._p||(M.instance=x,M.state.loading=5):(x=fi.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},fi.set(t,x)),z7(g,t,x,M.state))),a&&d===null)throw Error(o(528,""));return M}if(a&&d!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(s=jl(s),a=Ne(g).hoistableScripts,d=a.get(s),d||(d={type:"script",instance:null,count:0,state:null},a.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function bl(t){return'href="'+Ft(t)+'"'}function Mc(t){return'link[rel="stylesheet"]['+t+"]"}function wx(t){return L({},t,{"data-precedence":t.precedence,precedence:null})}function z7(t,a,s,d){if(a=t.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[eo]!==!0){d.loading=1;return}}else a=t.createElement("link"),a[eo]=!0,a.onload=a.onerror=Ve.bind(null,a),Zn(a,"link",s),Ce(a),t.head.appendChild(a);d.preload=a,a.addEventListener("load",function(){return d.loading|=1}),a.addEventListener("error",function(){return d.loading|=2})}function jl(t){return'[src="'+Ft(t)+'"]'}function _c(t){return"script[async]"+t}function kx(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var d=t.querySelector('style[data-href~="'+Ft(s.href)+'"]');if(d)return a.instance=d,Ce(d),d;var g=L({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(t.ownerDocument||t).createElement("style"),Ce(d),Zn(d,"style",g),Ad(d,s.precedence,t),a.instance=d;case"stylesheet":g=bl(s.href);var x=t.querySelector(Mc(g));if(x)return a.state.loading|=4,a.instance=x,Ce(x),x;d=wx(s),(g=fi.get(g))&&wp(d,g),x=(t.ownerDocument||t).createElement("link"),Ce(x);var M=x;return M._p=new Promise(function(B,W){M.onload=B,M.onerror=W}),Zn(x,"link",d),a.state.loading|=4,Ad(x,s.precedence,t),a.instance=x;case"script":return x=jl(s.src),(g=t.querySelector(_c(x)))?(a.instance=g,Ce(g),g):(d=s,(g=fi.get(x))&&(d=L({},s),kp(d,g)),t=t.ownerDocument||t,g=t.createElement("script"),Ce(g),Zn(g,"link",d),t.head.appendChild(g),a.instance=g);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(d=a.instance,a.state.loading|=4,Ad(d,s.precedence,t));return a.instance}function Ad(t,a,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,x=g,M=0;M<d.length;M++){var B=d[M];if(B.dataset.precedence===a)x=B;else if(x!==g)break}x?x.parentNode.insertBefore(t,x.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function wp(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function kp(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var Md=null;function Sx(t,a,s){if(Md===null){var d=new Map,g=Md=new Map;g.set(s,d)}else g=Md,d=g.get(s),d||(d=new Map,g.set(s,d));if(d.has(t))return d;for(d.set(t,null),s=s.getElementsByTagName(t),g=0;g<s.length;g++){var x=s[g];if(!(x[xr]||x[ln]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var M=x.getAttribute(a)||"";M=t+M;var B=d.get(M);B?B.push(x):d.set(M,[x])}}return d}function Sp(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function L7(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 Cx(t,a){return t==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function Nx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ex(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Tx(t,a){typeof a.decode=="function"&&(t.imgCount++,a.complete||(t.imgBytes+=Ex(a),t.suspenseyImages.push(a)),t=P7.bind(t),a.decode().then(t,t))}function B7(t,a,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=bl(d.href),x=a.querySelector(Mc(g));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Rc.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=x,Ce(x);return}x=a.ownerDocument||a,d=wx(d),(g=fi.get(g))&&wp(d,g),x=x.createElement("link"),Ce(x);var M=x;M._p=new Promise(function(B,W){M.onload=B,M.onerror=W}),Zn(x,"link",d),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=Rc.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var _d=0;function I7(t,a){return t.stylesheets&&t.count===0&&Od(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var d=setTimeout(function(){if(t.stylesheets&&Od(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+a);0<t.imgBytes&&_d===0&&(_d=62500*n7());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Od(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>_d?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function Ax(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)Od(t,t.stylesheets);else if(t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}}}function Rc(){this.count--,Ax(this)}function P7(){this.imgCount--,Ax(this)}var Rd=null;function Od(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Rd=new Map,a.forEach(q7,t),Rd=null,Rc.call(t))}function q7(t,a){if(!(a.state.loading&4)){var s=Rd.get(t);if(s)var d=s.get(null);else{s=new Map,Rd.set(t,s);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<g.length;x++){var M=g[x];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(s.set(M.dataset.precedence,M),d=M)}d&&s.set(null,d)}g=a.instance,M=g.getAttribute("data-precedence"),x=s.get(M)||d,x===d&&s.set(null,g),s.set(M,g),this.count++,d=Rc.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),x?x.parentNode.insertBefore(g,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),a.state.loading|=4}}var wl={$$typeof:q,Provider:null,Consumer:null,_currentValue:je,_currentValue2:je,_threadCount:0};function F7(t,a,s,d,g,x,M,B,W){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=Fi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fi(0),this.hiddenUpdates=Fi(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.transitionTypes=null,this.incompleteTransitions=new Map}function Mx(t,a,s,d,g,x,M,B,W,le,ve,Se){return t=new F7(t,a,s,M,W,le,ve,Se,B),a=1,x===!0&&(a|=24),x=Ta(3,null,null,a),t.current=x,x.stateNode=t,a=Pf(),a.refCount++,t.pooledCache=a,a.refCount++,x.memoizedState={element:d,isDehydrated:s,cache:a},Uf(x),t}function _x(t){return t?(t=Ks,t):Ks}function Rx(t,a,s,d,g,x){g=_x(g),d.context===null?d.context=g:d.pendingContext=g,d=ho(a),d.payload={element:s},x=x===void 0?null:x,x!==null&&(d.callback=x),s=fo(t,d,a),s!==null&&(Ra(s,t,a),cc(s,t,a))}function Ox(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Cp(t,a){Ox(t,a),(t=t.alternate)&&Ox(t,a)}function Dx(t){if(t.tag===13||t.tag===31){var a=ts(t,67108864);a!==null&&Ra(a,t,67108864),Cp(t,67108864)}}function zx(t){if(t.tag===13||t.tag===31){var a=Wa();a=yi(a);var s=ts(t,a);s!==null&&Ra(s,t,a),Cp(t,a)}}var kl=!0;function H7(t,a,s,d){var g=ce.T;ce.T=null;var x=J.p;try{J.p=2,Np(t,a,s,d)}finally{J.p=x,ce.T=g}}function U7(t,a,s,d){var g=ce.T;ce.T=null;var x=J.p;try{J.p=8,Np(t,a,s,d)}finally{J.p=x,ce.T=g}}function Np(t,a,s,d){if(kl){var g=Ep(d);if(g===null)sp(t,a,d,Dd,s),Bx(t,d);else if(V7(g,t,a,s,d))d.stopPropagation();else if(Bx(t,d),a&4&&-1<$7.indexOf(t)){for(;g!==null;){var x=br(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var M=Fa(x.pendingLanes);if(M!==0){var B=x;for(B.pendingLanes|=2,B.entangledLanes|=2;M;){var W=1<<31-cn(M);B.entanglements[1]|=W,M&=~W}Ji(x),(Ot&6)===0&&(xd=Be()+500,Cc(0))}}break;case 31:case 13:B=ts(x,2),B!==null&&Ra(B,x,2),wd(),Cp(x,2)}if(x=Ep(d),x===null&&sp(t,a,d,Dd,s),x===g)break;g=x}g!==null&&d.stopPropagation()}else sp(t,a,d,null,s)}}function Ep(t){return t=Qo(t),Tp(t)}var Dd=null;function Tp(t){if(Dd=null,t=Va(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=u(a),t!==null)return t;t=null}else if(s===31){if(t=h(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 Dd=t,null}function Lx(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(mt()){case $n:return 2;case Ba:return 8;case Yt:case Vo:return 32;case Pi:return 268435456;default:return 32}default:return 32}}var Ap=!1,Co=null,No=null,Eo=null,Oc=new Map,Dc=new Map,To=[],$7="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 Bx(t,a){switch(t){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":No=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":Oc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dc.delete(a.pointerId)}}function zc(t,a,s,d,g,x){return t===null||t.nativeEvent!==x?(t={blockedOn:a,domEventName:s,eventSystemFlags:d,nativeEvent:x,targetContainers:[g]},a!==null&&(a=br(a),a!==null&&Dx(a)),t):(t.eventSystemFlags|=d,a=t.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),t)}function V7(t,a,s,d,g){switch(a){case"focusin":return Co=zc(Co,t,a,s,d,g),!0;case"dragenter":return No=zc(No,t,a,s,d,g),!0;case"mouseover":return Eo=zc(Eo,t,a,s,d,g),!0;case"pointerover":var x=g.pointerId;return Oc.set(x,zc(Oc.get(x)||null,t,a,s,d,g)),!0;case"gotpointercapture":return x=g.pointerId,Dc.set(x,zc(Dc.get(x)||null,t,a,s,d,g)),!0}return!1}function Ix(t){var a=Va(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){t.blockedOn=a,Hi(t.priority,function(){zx(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Hi(t.priority,function(){zx(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 zd(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Ep(t.nativeEvent);if(s===null){s=t.nativeEvent;var d=new s.constructor(s.type,s);Xo=d,s.target.dispatchEvent(d),Xo=null}else return a=br(s),a!==null&&Dx(a),t.blockedOn=s,!1;a.shift()}return!0}function Px(t,a,s){zd(t)&&s.delete(a)}function G7(){Ap=!1,Co!==null&&zd(Co)&&(Co=null),No!==null&&zd(No)&&(No=null),Eo!==null&&zd(Eo)&&(Eo=null),Oc.forEach(Px),Dc.forEach(Px)}function Ld(t,a){t.blockedOn===a&&(t.blockedOn=null,Ap||(Ap=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,G7)))}var Bd=null;function qx(t){Bd!==t&&(Bd=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Bd===t&&(Bd=null);for(var a=0;a<t.length;a+=3){var s=t[a],d=t[a+1],g=t[a+2];if(typeof d!="function"){if(Tp(d||s)===null)continue;break}var x=br(s);x!==null&&(t.splice(a,3),a-=3,um(x,{pending:!0,data:g,method:s.method,action:d},d,g))}}))}function Sl(t){function a(W){return Ld(W,t)}Co!==null&&Ld(Co,t),No!==null&&Ld(No,t),Eo!==null&&Ld(Eo,t),Oc.forEach(a),Dc.forEach(a);for(var s=0;s<To.length;s++){var d=To[s];d.blockedOn===t&&(d.blockedOn=null)}for(;0<To.length&&(s=To[0],s.blockedOn===null);)Ix(s),s.blockedOn===null&&To.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var g=s[d],x=s[d+1],M=g[Nn]||null;if(typeof x=="function")M||qx(s);else if(M){var B=null;if(x&&x.hasAttribute("formAction")){if(g=x,M=x[Nn]||null)B=M.formAction;else if(Tp(g)!==null)continue}else B=M.action;typeof B=="function"?s[d+1]=B:(s.splice(d,3),d-=3),qx(s)}}}function Fx(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(M){return g=M})},focusReset:"manual",scroll:"manual"})}function a(){g!==null&&(g(),g=null),d||setTimeout(s,20)}function s(){if(!d&&!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 d=!1,g=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),g!==null&&(g(),g=null)}}}function Mp(t){this._internalRoot=t}Id.prototype.render=Mp.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current,d=Wa();Rx(s,d,t,a,null,null)},Id.prototype.unmount=Mp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Rx(t.current,2,null,t,null,null),wd(),a[fa]=null}};function Id(t){this._internalRoot=t}Id.prototype.unstable_scheduleHydration=function(t){if(t){var a=ha();t={blockedOn:null,target:t,priority:a};for(var s=0;s<To.length&&a!==0&&a<To[s].priority;s++);To.splice(s,0,t),s===0&&Ix(t)}};var Hx=n.version;if(Hx!=="19.3.0")throw Error(o(527,Hx,"19.3.0"));J.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=v(a),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Y7={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pd.isDisabled&&Pd.supportsFiber)try{Ia=Pd.inject(Y7),Et=Pd}catch{}}return Bc.createRoot=function(t,a){if(!l(t))throw Error(o(299));var s=!1,d="",g=_2,x=R2,M=O2;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError)),a=Mx(t,1,!1,null,null,s,d,null,g,x,M,Fx),t[fa]=a.current,op(t),new Mp(a)},Bc.hydrateRoot=function(t,a,s){if(!l(t))throw Error(o(299));var d=!1,g="",x=_2,M=R2,B=O2,W=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(M=s.onCaughtError),s.onRecoverableError!==void 0&&(B=s.onRecoverableError),s.formState!==void 0&&(W=s.formState)),a=Mx(t,1,!0,a,s??null,d,g,W,x,M,B,Fx),a.context=_x(null),s=a.current,d=Wa(),d=yi(d),g=ho(d),g.callback=null,fo(s,g,d),s=d,a.current.lanes=s,Ua(a,s),Ji(a),t[fa]=a.current,op(t),new Id(a)},Bc.version="19.3.0",Bc}var tb;function oN(){if(tb)return Dp.exports;tb=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(),Dp.exports=rN(),Dp.exports}var sN=oN();const lN={"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"},cN={"settings.title":"Settings","settings.sections":"Settings sections","settings.general":"General","settings.models":"Models","settings.usage":"Usage","settings.network":"Network","settings.secrets":"Secrets","settings.connectors":"Connectors","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}"},uN={"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}","desktop.someone":"Someone","desktop.attachment":"Sent an attachment"},dN={"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"},hN={"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"},fN={"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.jobList.running":"Listing background commands","npc.live.jobList.ok":"Listed background commands","npc.live.jobList.failed":"Couldn't list background commands","npc.live.jobRead.running":"Reading output of {target}","npc.live.jobRead.ok":"Read output of {target}","npc.live.jobRead.failed":"Couldn't read {target}","npc.live.jobWait.running":"Waiting for {target}","npc.live.jobWait.ok":"Waited for {target}","npc.live.jobWait.failed":"Waiting for {target} failed","npc.live.jobStop.running":"Stopping {target}","npc.live.jobStop.ok":"Stopped {target}","npc.live.jobStop.failed":"Couldn't stop {target}","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.handoff.running":"Handing off context","npc.live.handoff.ok":"Handed off context","npc.live.handoff.failed":"Couldn't hand off context","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}"},mN={"environment.title":"Work environment","environment.own":"Docker sandbox","environment.ownVm":"VM sandbox","environment.container":"Container","environment.vm":"Virtual machine","environment.image":"Image","environment.mount":"Workspace mount","environment.external":"External environments","envs.sandboxOf":"{name}'s sandbox","enterCard.title":"Request to enter {name}","envs.search":"Search environments","envs.noMatch":"No matching environments","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_libvirt":"libvirt or QEMU isn't installed","environment.type.why.stopped":"the libvirt service isn't running","environment.type.why.denied":"no permission to use libvirt","environment.type.why.no_tools":"qemu-img or cloud-localds 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":"libvirt KVM check failed","environment.type.recheck":"Check again","environment.type.vmTitle":"Make {name}'s sandbox a virtual machine?","environment.type.vmBody":"The sandbox becomes a full Linux virtual machine with systemd, Docker and its own workspace disk: workspace files are imported, software installed in the container is removed. The first switch builds the VM template, which takes a few minutes.","environment.type.containerTitle":"Make {name}'s sandbox a container?","environment.type.containerBody":"The sandbox is made afresh as a container: workspace files are exported back and kept; software installed in the VM, 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":"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."},pN={"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"},vN={"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.connectors":"Connectors","access.searchConnectors":"Search connectors","access.noConnectors":"No connectors granted.","access.allConnectors":"Every connector is granted.","access.noConnectorsYet":"No connectors yet.","access.manageConnectors":"Manage connectors","access.loadFailed":"Couldn't load access."},gN={"connectors.addCustom":"Custom MCP","connectors.connectedSection":"Connected","connectors.availableSection":"Available","connectors.connect":"Connect","connectors.addAccount":"Add account","connectors.connectedAccounts":{one:"{count} account connected",other:"{count} accounts connected"},"connectors.reconnect":"Reconnect","connectors.presetReconnectHint":"Disconnect this connection and add the account again to sign in with fresh credentials.","connectors.disconnect":"Disconnect","connectors.delete":"Delete connector","connectors.deleteTitle":"Delete {name}?","connectors.deleteBody":"Bots will no longer be able to use this connector. Its usage log is kept.","connectors.deleteConfirm":"Delete","connectors.name":"Name","connectors.optionalName":"Label (optional)","connectors.accountNamePlaceholder":"e.g. {name} · Work","connectors.identifier":"Identifier","connectors.namePlaceholder":"e.g. Internal MCP","connectors.url":"Server URL","connectors.urlPlaceholder":"https://example.com/mcp","connectors.auth":"Authentication","connectors.authOAuth":"OAuth","connectors.authHeaders":"Headers","connectors.authNone":"None","connectors.advancedOAuth":"Custom OAuth client (optional)","connectors.oauthClientId":"Client ID","connectors.oauthClientSecret":"Client Secret","connectors.headerName":"Header name","connectors.headerValue":"Value","connectors.addHeader":"Add header","connectors.headersSaved":"Saved headers: {names}","connectors.statusConnected":"Connected","connectors.statusNeedsAuth":"Needs sign-in","connectors.statusError":"Error","connectors.statusDisconnected":"Disconnected","connectors.toolCount":{one:"{count} tool",other:"{count} tools"},"connectors.toolsSummary":"Tools ({count})","connectors.searchTools":"Filter tools…","connectors.noTools":"No tools discovered yet.","connectors.noMatchingTools":"No matching tools","connectors.readOnlyTag":"Read","connectors.writeTag":"Write","connectors.refreshTools":"Refresh","connectors.usesSummary":"Recent activity ({count})","connectors.connectionSettings":"Connection settings","connectors.accountSettings":"Account settings","connectors.useOk":"Done","connectors.useError":"Failed","connectors.useDenied":"Declined","connectors.deletedBot":"Deleted Bot","connectors.tokenLabel":"Personal access token","connectors.tokenPlaceholder":"ghp_… or github_pat_…","connectors.useToken":"Use a token instead","connectors.useWebSignIn":"Sign in on the web","connectors.envHint":"For web sign-in, set {variables} in .env, register {callback} as the callback URL, and restart Jarvy.","connectors.gmailEnvHint":"Set {variables} in .env, register {callback} as the callback URL, and restart Jarvy.","connectors.copyCallback":"Copy callback URL","connectors.copied":"Copied","connectors.oauthWaiting":"Finish sign-in in the browser window.","connectors.openBrowser":"Open sign-in page","connectors.copyAuthUrl":"Copy sign-in link","connectors.multiAccountOAuthHint":"Adding another {name} account? Open the sign-in link in a private window or another browser profile so it doesn't reuse your current session, or use a token.","connectors.manualFallback":"Paste callback URL","connectors.manualPlaceholder":"http://127.0.0.1:8080/api/connectors/oauth/callback?code=…","connectors.manualSubmit":"Complete","connectorCard.grantTitle":"Allow {name}","connectorCard.account":"Account","connectorCard.disconnected":"Disconnected","connectorCard.revoked":"Access revoked","connectorCard.emailKind":"Email","connectorCard.from":"From","connectorCard.to":"To","connectorCard.cc":"Cc","connectorCard.ccPlaceholder":"name@example.com","connectorCard.subjectPlaceholder":"Subject","connectorCard.bodyPlaceholder":"Write your message…","connectorCard.discard":"Discard","connectorCard.send":"Send","connectorCard.sent":"Sent","connectorCard.confirmed":"Confirmed","connectorCard.discarded":"Discarded","connectorCard.expired":"Expired","connectorCard.showMore":"Show full text","connectorCard.showLess":"Collapse","connectorCard.showAllFields":"Show all {count} fields","connectorCard.showFewerFields":"Show fewer fields","connectorCard.toggleDetails":"Show or hide details","connectorAction.create_issue":"Create issue","connectorAction.update_issue":"Update issue","connectorAction.create_comment":"Add comment","connectorAction.send_email":"Send email","connectorAction.create_draft":"Save draft","connectorField.title":"Title","connectorField.name":"Name","connectorField.subject":"Subject","connectorField.team":"Team","connectorField.project":"Project","connectorField.description":"Description","connectorField.body":"Body","connectorField.content":"Content","connectorField.message":"Message","connectorField.text":"Text","connectorField.comment":"Comment","connectorField.from":"From","connectorField.to":"To","connectorField.cc":"Cc","connectorField.bcc":"Bcc","connectorField.priority":"Priority","connectorField.status":"Status","connectorField.assignee":"Assignee","connectorField.labels":"Labels","connectorField.parent":"Parent","connectorField.url":"URL","connectorField.owner":"Owner","connectorField.repo":"Repository","connectorField.number":"Number","error.connectorMissing":"Connector not found. It may have been disconnected.","error.connectorSlugInvalid":"Use lowercase letters, digits, hyphens or underscores, starting with a letter.","error.connectorUrlInvalid":"Enter a valid http(s) URL without embedded credentials.","error.connectorHeadersInvalid":"Enter valid HTTP header names and values.","error.connectorOAuthFailed":"Authorization did not complete: {detail}","error.connectorClientMissing":"Set the provider's OAuth client variables in .env and restart Jarvy.","error.connectorAuthRequired":"Authorization failed or expired. Check the token or sign in again.","error.connectorUnreachable":"Could not reach the connector service."},yN={"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.deviceMissing":"This computer wasn't found. It may have been unpaired.","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}","devices.connect":"Connect a computer","devices.kindMachine":"SSH machine","devices.kindDevice":"Computer","devices.connectHint":"On the computer to connect, run this in a terminal that has Node 22 or later. The first run checks Jarvy's certificate fingerprint and asks you to sign in.","devices.connectWindows":"Windows (PowerShell)","devices.connectOther":"macOS and Linux","devices.connectAfter":"Once connected it appears among the environments. Bots can use it after you grant it to them, and only while the command runs.","devices.state":"Status","devices.online":"Online","devices.paused":"Paused","devices.offline":"Offline","devices.seen":"Last online {time}","devices.system":"System","devices.client":"Client","devices.shell":"Shell","devices.shellAuto":"Automatic","devices.shellBash":"Git Bash","devices.shellBashOther":"bash","devices.shellPowershell":"PowerShell","devices.shellMissing":"not found","devices.noShell":"Neither Git Bash nor PowerShell was found on this computer, so Bots can't run commands there.","devices.unpair":"Unpair","devices.unpairTitle":"Unpair {name}?","devices.unpairBody":"Its token stops working at once and it disconnects. Bots working there go back to their default environment. To connect it again, sign in on that computer again.","devices.unpairConfirm":"Unpair","devices.platform.win32":"Windows","devices.platform.darwin":"macOS","devices.platform.linux":"Linux","devices.copied":"Copied"},xN={"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."},bN={"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."},jN={"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","inputs.job":"Command {id} {status}: {command}","inputs.jobExit":"exit {code}","inputs.jobStatus.done":"finished","inputs.jobStatus.failed":"failed","inputs.jobStatus.stopped":"stopped","inputs.jobStatus.timed_out":"timed out","inputs.runningJobs":{one:"{count} command running: {list}",other:"{count} commands running: {list}"},"inputs.handoffContinue":"Continued automatically after context handoff","inputs.context":"Context watermark: {used} / {window} tokens"},wN={"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"},kN={...lN,...cN,...uN,...dN,...hN,...fN,...mN,...pN,...vN,...gN,...yN,...xN,...bN,...jN,...wN},SN={"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 信息"},CN={"settings.title":"设置","settings.sections":"设置分类","settings.general":"通用","settings.models":"模型","settings.usage":"用量","settings.network":"网络","settings.secrets":"密钥","settings.connectors":"连接器","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} 重置"},NN={"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}","desktop.someone":"有人","desktop.attachment":"发送了附件"},EN={"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":"回复线程"},TN={"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} 的沙箱"},AN={"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.jobList.running":"在看后台命令列表","npc.live.jobList.ok":"看了后台命令列表","npc.live.jobList.failed":"没查到后台命令列表","npc.live.jobRead.running":"在读 {target} 的输出","npc.live.jobRead.ok":"读了 {target} 的输出","npc.live.jobRead.failed":"没读到 {target} 的输出","npc.live.jobWait.running":"在等 {target}","npc.live.jobWait.ok":"等了 {target}","npc.live.jobWait.failed":"等待 {target} 出错了","npc.live.jobStop.running":"在停掉 {target}","npc.live.jobStop.ok":"停掉了 {target}","npc.live.jobStop.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.handoff.running":"在交接上下文","npc.live.handoff.ok":"交接好了上下文","npc.live.handoff.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}"},MN={"environment.title":"工作环境","environment.own":"Docker 沙箱","environment.ownVm":"虚拟机沙箱","environment.container":"容器","environment.vm":"虚拟机","environment.image":"镜像","environment.mount":"工作区挂载点","environment.external":"外部环境","envs.sandboxOf":"{name} 的沙箱","enterCard.title":"请求进入 {name}","envs.search":"搜索环境","envs.noMatch":"无匹配的环境","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_libvirt":"没有安装 libvirt 或 QEMU","environment.type.why.stopped":"libvirt 服务未启动","environment.type.why.denied":"无权限使用 libvirt","environment.type.why.no_tools":"缺少 qemu-img 或 cloud-localds","environment.type.why.no_kvm":"没有 KVM","environment.type.why.busy":"硬件虚拟化正被其他虚拟机软件(如 VirtualBox)占用","environment.type.why.failed":"libvirt KVM 检查未通过","environment.type.recheck":"重新检查","environment.type.vmTitle":"把 {name} 的沙箱换成虚拟机?","environment.type.vmBody":"沙箱会换成完整的 Linux 虚拟机(含 systemd、Docker 与独立工作区磁盘)。现有工作区文件会自动导入,容器中安装的软件会清除。第一次切换会构建虚拟机模板,可能需要几分钟。","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":"磁盘","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} 核,或不限制。"},_N={"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"},RN={"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.connectors":"连接器","access.searchConnectors":"搜索连接器","access.noConnectors":"未授权任何连接器。","access.allConnectors":"所有连接器都已授权。","access.noConnectorsYet":"还没有连接器。","access.manageConnectors":"管理连接器","access.loadFailed":"无法读取授权情况。"},ON={"connectors.addCustom":"自定义 MCP","connectors.connectedSection":"已连接","connectors.availableSection":"可连接","connectors.connect":"连接","connectors.addAccount":"添加账号","connectors.connectedAccounts":{one:"已连接 {count} 个账号",other:"已连接 {count} 个账号"},"connectors.reconnect":"重新连接","connectors.presetReconnectHint":"如需更新凭据或重新登录,请先断开此连接再重新添加。","connectors.disconnect":"断开连接","connectors.delete":"删除连接器","connectors.deleteTitle":"删除「{name}」?","connectors.deleteBody":"已授权的 Bot 将无法继续使用它,调用记录会保留。","connectors.deleteConfirm":"删除","connectors.name":"名称","connectors.optionalName":"名称(可选)","connectors.accountNamePlaceholder":"例如:{name} · 工作","connectors.identifier":"标识","connectors.namePlaceholder":"例如:内部 MCP","connectors.url":"服务地址","connectors.urlPlaceholder":"https://example.com/mcp","connectors.auth":"认证方式","connectors.authOAuth":"OAuth","connectors.authHeaders":"请求头","connectors.authNone":"无认证","connectors.advancedOAuth":"自定义 OAuth 客户端(可选)","connectors.oauthClientId":"Client ID","connectors.oauthClientSecret":"Client Secret","connectors.headerName":"请求头名称","connectors.headerValue":"值","connectors.addHeader":"添加请求头","connectors.headersSaved":"已保存请求头:{names}","connectors.statusConnected":"已连接","connectors.statusNeedsAuth":"待授权","connectors.statusError":"连接异常","connectors.statusDisconnected":"未连接","connectors.toolCount":{one:"{count} 个工具",other:"{count} 个工具"},"connectors.toolsSummary":"工具({count})","connectors.searchTools":"筛选工具…","connectors.noTools":"暂未发现工具。","connectors.noMatchingTools":"没有匹配的工具","connectors.readOnlyTag":"只读","connectors.writeTag":"写","connectors.refreshTools":"刷新","connectors.usesSummary":"调用记录({count})","connectors.connectionSettings":"连接配置","connectors.accountSettings":"账号设置","connectors.useOk":"成功","connectors.useError":"失败","connectors.useDenied":"已拦截","connectors.deletedBot":"已删除的 Bot","connectors.tokenLabel":"个人访问令牌","connectors.tokenPlaceholder":"ghp_… 或 github_pat_…","connectors.useToken":"改用访问令牌","connectors.useWebSignIn":"改用网页登录","connectors.envHint":"如需网页登录,在 .env 中设置 {variables},将 {callback} 填为回调地址后重启 Jarvy。","connectors.gmailEnvHint":"在 .env 中设置 {variables},将 {callback} 填为回调地址后重启 Jarvy。","connectors.copyCallback":"复制回调地址","connectors.copied":"已复制","connectors.oauthWaiting":"请在打开的浏览器页面中完成授权。","connectors.openBrowser":"打开授权页","connectors.copyAuthUrl":"复制授权链接","connectors.multiAccountOAuthHint":"要连接另一个 {name} 账号?建议在无痕窗口或另一个浏览器配置中打开授权链接(避免复用当前登录态),或改用访问令牌。","connectors.manualFallback":"手动粘贴回调地址","connectors.manualPlaceholder":"http://127.0.0.1:8080/api/connectors/oauth/callback?code=…","connectors.manualSubmit":"完成授权","connectorCard.grantTitle":"授权使用 {name}","connectorCard.account":"账号","connectorCard.disconnected":"连接已断开","connectorCard.revoked":"权限已撤销","connectorCard.emailKind":"邮件","connectorCard.from":"发件人","connectorCard.to":"收件人","connectorCard.cc":"抄送","connectorCard.ccPlaceholder":"name@example.com","connectorCard.subjectPlaceholder":"邮件主题","connectorCard.bodyPlaceholder":"填写内容…","connectorCard.discard":"丢弃","connectorCard.send":"发送","connectorCard.sent":"已发送","connectorCard.confirmed":"已确认","connectorCard.discarded":"已丢弃","connectorCard.expired":"已失效","connectorCard.showMore":"展开全文","connectorCard.showLess":"收起","connectorCard.showAllFields":"展开全部 {count} 个字段","connectorCard.showFewerFields":"收起部分字段","connectorCard.toggleDetails":"展开或收起详情","connectorAction.create_issue":"创建 Issue","connectorAction.update_issue":"更新 Issue","connectorAction.create_comment":"发表评论","connectorAction.send_email":"发送邮件","connectorAction.create_draft":"保存草稿","connectorField.title":"标题","connectorField.name":"名称","connectorField.subject":"主题","connectorField.team":"团队","connectorField.project":"项目","connectorField.description":"描述","connectorField.body":"正文","connectorField.content":"内容","connectorField.message":"消息","connectorField.text":"文本","connectorField.comment":"评论","connectorField.from":"发件人","connectorField.to":"收件人","connectorField.cc":"抄送","connectorField.bcc":"密送","connectorField.priority":"优先级","connectorField.status":"状态","connectorField.assignee":"负责人","connectorField.labels":"标签","connectorField.parent":"父级","connectorField.url":"URL","connectorField.owner":"仓库属主","connectorField.repo":"仓库","connectorField.number":"编号","error.connectorMissing":"找不到这个连接器,它可能已被断开。","error.connectorSlugInvalid":"标识只能包含小写字母、数字、连字符和下划线,且以字母开头。","error.connectorUrlInvalid":"请输入有效的 http(s) 地址,不要包含内嵌凭据。","error.connectorHeadersInvalid":"请输入合法的 HTTP 请求头名称和值。","error.connectorOAuthFailed":"授权未完成:{detail}","error.connectorClientMissing":"请先在 .env 中配置该连接器的 OAuth 客户端变量并重启 Jarvy。","error.connectorAuthRequired":"授权失败或已过期,请检查令牌或重新登录。","error.connectorUnreachable":"无法连接到该服务。"},DN={"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.deviceMissing":"找不到这台电脑,它可能已解除配对。","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}","devices.connect":"连接电脑","devices.kindMachine":"SSH 机器","devices.kindDevice":"电脑","devices.connectHint":"在要接入的电脑上,打开装有 Node 22 或更高版本的终端,运行下面的命令。首次运行时会核对 Jarvy 的证书指纹,并要求登录。","devices.connectWindows":"Windows(PowerShell)","devices.connectOther":"macOS 和 Linux","devices.connectAfter":"接入后会出现在环境列表中。授权给 Bot 后,Bot 才能使用这台电脑,且仅在命令运行期间可用。","devices.state":"状态","devices.online":"在线","devices.paused":"已暂停","devices.offline":"离线","devices.seen":"最后在线 {time}","devices.system":"系统","devices.client":"客户端","devices.shell":"Shell","devices.shellAuto":"自动","devices.shellBash":"Git Bash","devices.shellBashOther":"bash","devices.shellPowershell":"PowerShell","devices.shellMissing":"未找到","devices.noShell":"这台电脑上没有找到 Git Bash 或 PowerShell,Bot 无法在这里执行命令。","devices.unpair":"解除配对","devices.unpairTitle":"解除 {name} 的配对?","devices.unpairBody":"这台电脑的令牌会立即失效,连接随之断开。正在使用它的 Bot 会回到默认环境。如需再次接入,要在那台电脑上重新登录。","devices.unpairConfirm":"解除配对","devices.platform.win32":"Windows","devices.platform.darwin":"macOS","devices.platform.linux":"Linux","devices.copied":"已复制"},zN={"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":"给任务起个名字,写上要做什么。"},LN={"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} 中已无空闲端口,请在「设置 › 网络」中扩大范围。"},BN={"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":"可用环境","inputs.job":"后台命令 {id} {status}:{command}","inputs.jobExit":"退出码 {code}","inputs.jobStatus.done":"已完成","inputs.jobStatus.failed":"失败","inputs.jobStatus.stopped":"已停止","inputs.jobStatus.timed_out":"已超时","inputs.runningJobs":{one:"后台运行中({count}):{list}",other:"后台运行中({count}):{list}"},"inputs.handoffContinue":"上下文交接后自动继续","inputs.context":"上下文水位:{used} / {window} tokens"},IN={"botCard.agent":"管家 Bot","botCard.state":"状态","botCard.worksIn":"工作环境","botCard.sandbox":"沙箱","botCard.onMachine":"机器 {name}","botCard.message":"发消息","botCard.info":"Bot 信息","botCard.open":"打开 {name} 的资料卡"},PN={...SN,...CN,...NN,...EN,...TN,...AN,...MN,..._N,...RN,...ON,...DN,...zN,...LN,...BN,...IN},qw=["en","zh"],Fw={en:kN,zh:PN},uu={en:"en",zh:"zh-CN"},Hw="jarvy-locale";function qN(){var i;const e=localStorage.getItem(Hw);if(e==="en"||e==="zh")return e;const n=((i=navigator.languages)!=null&&i.length?navigator.languages:[navigator.language]).map(o=>o.toLowerCase()).find(o=>/^(en|zh)\b/.test(o));return n!=null&&n.startsWith("zh")?"zh":"en"}let or=qN();document.documentElement.lang=uu[or];const O0=new Set,sr=()=>or;function Uw(e){if(e!==or){or=e,localStorage.setItem(Hw,e),document.documentElement.lang=uu[e];for(const n of O0)n()}}function $w(){return j.useSyncExternalStore(e=>(O0.add(e),()=>{O0.delete(e)}),sr)}const D0=(e,n)=>Fw[e][n==="name"?"locale.name":"locale.short"];function Vw(e,n){const i=Fw[or][e];return typeof i=="string"?i:new Intl.PluralRules(uu[or]).select(Number(n))==="one"?i.one:i.other}function m(e,n){const i=Vw(e,n==null?void 0:n.count);return n?i.replace(/\{(\w+)\}/g,(o,l)=>l in n?String(n[l]):o):i}const ta=(e,n)=>new Date(e).toLocaleString(uu[or],n),Oo=e=>ta(e,{hour:or==="zh"?"2-digit":"numeric",minute:"2-digit"}),qh=e=>{const n=new Date(e).getFullYear()===new Date().getFullYear();return ta(e,{year:n?void 0:"numeric",month:or==="zh"?"numeric":"short",day:"numeric"})},la=(e,n)=>new Intl.NumberFormat(uu[or],n).format(e);function Tv(e,n){return Vw(e,n.count).split(/\{(\w+)\}/).map((i,o)=>r.jsx(j.Fragment,{children:o%2?n[i]??`{${i}}`:i},o))}class lr extends Error{constructor(n,i,o,l){super(i),this.status=n,this.code=o,this.params=l}}async function xe(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(m("api.offline"))}const o=await i.json().catch(()=>({}));if(!i.ok)throw Gw(i.status,o);return o}const Gw=(e,n)=>{const i=typeof n=="object"&&n!==null?n:{};return new lr(e,i.error===void 0?`HTTP ${e}`:String(i.error),typeof i.code=="string"?i.code:void 0,i.params)};function FN(e,n,i,o){return new Promise((l,c)=>{const u=new XMLHttpRequest;if(o!=null&&o.aborted){c(new DOMException("Upload cancelled","AbortError"));return}o==null||o.addEventListener("abort",()=>u.abort(),{once:!0}),u.onabort=()=>c(new DOMException("Upload cancelled","AbortError")),u.open("POST",`/api/chats/${e}/attachments`),u.setRequestHeader("Content-Type",n.type||"application/octet-stream"),u.setRequestHeader("X-File-Name",encodeURIComponent(n.name)),u.upload.onprogress=h=>{h.lengthComputable&&(i==null||i(h.loaded/h.total))},u.onerror=()=>c(new Error(m("api.offline"))),u.onload=()=>{let h={};try{h=JSON.parse(u.responseText)}catch{}u.status>=200&&u.status<300?l(h):c(Gw(u.status,h))},u.send(n)})}async function HN(e,n=0){const i=[];let o=n;for(;;){const l=await xe(`/chats/${e}/messages?after=${o}&limit=1000`);if(i.push(...l.messages),!l.hasMore)return{messages:i};if(l.nextSequence<=o)throw new Error(m("api.historyFailed"));o=l.nextSequence}}const Ye=e=>JSON.stringify(e),ae={me:()=>xe("/me"),search:(e,n)=>xe(`/search?q=${encodeURIComponent(e)}${n?`&in=${n}`:""}&limit=60`),login:(e,n)=>xe("/login",{method:"POST",body:Ye({username:e,password:n})}),logout:()=>xe("/logout",{method:"POST"}),bots:()=>xe("/bots"),createBot:e=>xe("/bots",{method:"POST",body:Ye({name:e})}),saveBot:(e,n)=>xe(`/bots/${e}`,{method:"PUT",body:Ye(n)}),modelOptions:()=>xe("/model-options"),selectBotModel:(e,n,i,o,l)=>xe(`/bots/${e}/model`,{method:"PUT",body:Ye({connectionId:n,modelId:i,thinkingLevel:o,language:l})}),answerQuestion:(e,n,i)=>xe(`/chats/${e}/questions/${n}`,{method:"POST",body:Ye(i)}),setBotColor:(e,n)=>xe(`/bots/${e}/color`,{method:"PUT",body:Ye({color:n})}),chats:()=>xe("/chats"),createChat:e=>xe("/chats",{method:"POST",body:Ye({botId:e})}),deleteChat:e=>xe(`/chats/${e}`,{method:"DELETE"}),members:()=>xe("/members"),sections:()=>xe("/sections"),createSection:e=>xe("/sections",{method:"POST",body:Ye(e)}),updateSection:(e,n)=>xe(`/sections/${e}`,{method:"PATCH",body:Ye(n)}),deleteSection:e=>xe(`/sections/${e}`,{method:"DELETE"}),createChannel:e=>xe("/channels",{method:"POST",body:Ye(e)}),updateChannel:(e,n)=>xe(`/chats/${e}`,{method:"PATCH",body:Ye(n)}),addMember:(e,n)=>xe(`/chats/${e}/members`,{method:"POST",body:Ye({memberId:n})}),removeMember:(e,n)=>xe(`/chats/${e}/members/${n}`,{method:"DELETE"}),setAdmin:(e,n,i)=>xe(`/chats/${e}/members/${n}/admin`,{method:"PUT",body:Ye({admin:i})}),setNote:(e,n)=>xe(`/chats/${e}/note`,{method:"PUT",body:Ye({text:n})}),markRead:(e,n)=>xe(`/chats/${e}/read`,{method:"POST",body:Ye({sequence:n})}),messages:HN,latestMessages:(e,n)=>xe(`/chats/${e}/messages?tail=${n}`),olderMessages:(e,n,i)=>xe(`/chats/${e}/messages?before=${n}&limit=${i}`),send:(e,n,i,o,l=!1,c,u=[])=>xe(`/chats/${e}/messages`,{method:"POST",body:Ye({content:n,attachmentIds:i,clientMessageId:o,...l?{alsoToChannel:l}:{},...c?{replyTo:c}:{},...u.length?{quotes:u}:{}})}),fold:(e,n)=>xe(`/messages/${e}/fold`,{method:"PUT",body:Ye({folded:n})}),react:(e,n,i)=>xe(`/messages/${e}/reaction`,{method:"PUT",body:Ye({emoji:n,on:i})}),pin:(e,n)=>xe(`/chats/${e}/pin`,{method:"PUT",body:Ye({pinned:n})}),mute:(e,n)=>xe(`/chats/${e}/mute`,{method:"PUT",body:Ye({muted:n})}),deleteBot:(e,n)=>xe(`/bots/${e}${n?"?files=delete":""}`,{method:"DELETE"}),chat:e=>xe(`/chats/${e}`),message:e=>xe(`/messages/${e}`),openThread:e=>xe(`/messages/${e}/thread`,{method:"POST"}),channelThreads:e=>xe(`/chats/${e}/threads`),followedThreads:({filter:e,sort:n,cursor:i})=>xe(`/threads?${new URLSearchParams({filter:e,sort:n,...i?{cursor:i}:{}})}`),followedThread:e=>xe(`/threads/${e}`),updateThread:(e,n)=>xe(`/chats/${e}`,{method:"PATCH",body:Ye(n)}),follow:(e,n)=>xe(`/chats/${e}/follow`,{method:"PUT",body:Ye({following:n})}),botDirects:e=>xe(`/members/${e}/dms`),tasks:e=>xe(`/bots/${e}/tasks`),createTask:(e,n)=>xe(`/bots/${e}/tasks`,{method:"POST",body:Ye(n)}),updateTask:(e,n,i)=>xe(`/bots/${e}/tasks/${n}`,{method:"PUT",body:Ye(i)}),setTaskOn:(e,n,i)=>xe(`/bots/${e}/tasks/${n}/${i?"resume":"pause"}`,{method:"POST"}),deleteTask:(e,n)=>xe(`/bots/${e}/tasks/${n}`,{method:"DELETE"}),botSubscriptions:e=>xe(`/members/${e}/subscriptions`),controlBot:(e,n)=>xe(`/bots/${e}/${n}`,{method:"POST"}),grantBotMachine:(e,n,i)=>xe(`/bots/${e}/environment`,{method:"PUT",body:Ye({machineId:n,granted:i})}),grantBotSandbox:(e,n,i)=>xe(`/bots/${e}/environment`,{method:"PUT",body:Ye({sandboxId:n,granted:i})}),agentActions:(e,n)=>xe(`/bots/${e}/actions${n?`?before=${n}`:""}`),machines:()=>xe("/environments"),scanMachine:e=>xe("/environments/scan",{method:"POST",body:Ye(e)}),addMachine:e=>xe("/environments",{method:"POST",body:Ye(e)}),prepareMachineKey:()=>xe("/environments/keys",{method:"POST"}),setMachinePassword:(e,n)=>xe(`/environments/${e}/password`,{method:"PUT",body:Ye({password:n})}),updateMachine:(e,n)=>xe(`/environments/${e}`,{method:"PUT",body:Ye(n)}),checkMachine:e=>xe(`/environments/${e}/check`,{method:"POST"}),trustMachine:(e,n)=>xe(`/environments/${e}/trust`,{method:"POST",body:Ye({fingerprints:n})}),deleteMachine:(e,n=!1)=>xe(`/environments/${e}${n?"?force=1":""}`,{method:"DELETE"}),grantMachine:(e,n,i)=>xe(`/environments/${e}/grants/${n}`,{method:"PUT",body:Ye({granted:i})}),devices:()=>xe("/environments/devices"),updateDevice:(e,n)=>xe(`/environments/devices/${e}`,{method:"PUT",body:Ye(n)}),deleteDevice:e=>xe(`/environments/devices/${e}`,{method:"DELETE"}),grantDevice:(e,n,i)=>xe(`/environments/devices/${e}/grants/${n}`,{method:"PUT",body:Ye({granted:i})}),fulfilMachine:(e,n,i)=>xe(`/environments/requests/${e}/${n}`,{method:"POST",body:Ye(i)}),computer:(e,n)=>xe(`/bots/${e}/computer/${n}`,{method:"POST"}),setComputerType:(e,n)=>xe(`/bots/${e}/computer/type`,{method:"PUT",body:Ye({type:n})}),vmSupport:()=>xe("/environments/vm"),checkVmSupport:()=>xe("/environments/vm/check",{method:"POST"}),setComputerLimits:(e,n)=>xe(`/bots/${e}/computer/limits`,{method:"PUT",body:Ye(n)}),computerResources:e=>xe(`/bots/${e}/computer/resources`),connection:()=>xe("/connection"),setConnection:e=>xe("/connection",{method:"PUT",body:Ye({allowHttp:e})}),setPortRange:e=>xe("/connection",{method:"PUT",body:Ye({ports:e})}),ports:e=>xe(`/bots/${e}/ports`),unpublishPort:(e,n)=>xe(`/bots/${e}/ports/${n}`,{method:"DELETE"}),secrets:()=>xe("/secrets"),createSecret:e=>xe("/secrets",{method:"POST",body:Ye(e)}),updateSecret:(e,n)=>xe(`/secrets/${e}`,{method:"PUT",body:Ye(n)}),deleteSecret:e=>xe(`/secrets/${e}`,{method:"DELETE"}),grantSecret:(e,n,i)=>xe(`/secrets/${e}/grants/${n}`,{method:"PUT",body:Ye({granted:i})}),secretUses:e=>xe(`/secrets/${e}/uses`),fulfilSecret:(e,n,i)=>xe(`/secrets/requests/${e}/${n}`,{method:"POST",body:Ye(i)}),connectors:()=>xe("/connectors"),startPresetOAuth:(e,n,i)=>xe(`/connectors/presets/${e}/oauth/start`,{method:"POST",body:Ye({redirectUri:n,...i?{name:i}:{}})}),presetOAuthStatus:e=>xe(`/connectors/oauth/flows/${e}`),completePresetOAuth:(e,n)=>xe(`/connectors/oauth/flows/${e}/complete`,{method:"POST",body:Ye(n)}),cancelPresetOAuth:e=>xe(`/connectors/oauth/flows/${e}`,{method:"DELETE"}),connectPresetToken:(e,n,i)=>xe(`/connectors/presets/${e}/token`,{method:"POST",body:Ye({token:n,name:i})}),createConnector:e=>xe("/connectors",{method:"POST",body:Ye(e)}),updateConnector:(e,n)=>xe(`/connectors/${e}`,{method:"PUT",body:Ye(n)}),deleteConnector:e=>xe(`/connectors/${e}`,{method:"DELETE"}),probeConnector:e=>xe(`/connectors/${e}/probe`,{method:"POST"}),disconnectConnector:e=>xe(`/connectors/${e}/disconnect`,{method:"POST"}),startConnectorOAuth:(e,n)=>xe(`/connectors/${e}/oauth/start`,{method:"POST",body:Ye({redirectUri:n})}),completeConnectorOAuth:(e,n)=>xe(`/connectors/${e}/oauth/complete`,{method:"POST",body:Ye(n)}),connectorOAuthStatus:e=>xe(`/connectors/${e}/oauth/status`),grantConnector:(e,n,i)=>xe(`/connectors/${e}/grants/${n}`,{method:"PUT",body:Ye({granted:i})}),connectorUses:e=>xe(`/connectors/${e}/uses`),fulfilConnectorAuth:(e,n,i)=>xe(`/connectors/requests/${e}/${n}`,{method:"POST",body:Ye({scope:i})}),botStatus:e=>xe(`/bots/${e}/status`),uploadAttachment:FN,removeAttachment:e=>xe(`/attachments/${e}`,{method:"DELETE"}),authStatus:e=>xe(`/model-connections/${e}/auth`),authStart:e=>xe(`/model-connections/${e}/auth`,{method:"POST"}),authCancel:e=>xe(`/model-connections/${e}/auth`,{method:"DELETE"}),authInput:(e,n,i)=>xe(`/model-connections/${e}/auth/input`,{method:"POST",body:Ye({promptId:n,value:i})}),authLogout:e=>xe(`/model-connections/${e}/auth/logout`,{method:"POST"}),modelCatalog:e=>xe(`/model-connections/${e}/catalog`),connectionQuota:(e,n=!1)=>xe(`/model-connections/${e}/quota${n?"?refresh=1":""}`),modelResetPlan:e=>xe(`/model-connections/${e}/reset`),resetModelConnection:e=>xe(`/model-connections/${e}/reset`,{method:"POST"}),providerModels:e=>xe(`/model-providers/${encodeURIComponent(e)}/models`),modelProviders:()=>xe("/model-providers"),autoconfigModel:e=>xe("/model-autoconfig",{method:"POST",body:Ye(e)}),discoverModels:e=>xe("/model-discovery",{method:"POST",body:Ye(e)}),modelConnections:()=>xe("/model-connections"),createModelConnection:e=>xe("/model-connections",{method:"POST",body:Ye(e)}),updateModelConnection:(e,n)=>xe(`/model-connections/${e}`,{method:"PUT",body:Ye(n)}),deleteModelConnection:e=>xe(`/model-connections/${e}`,{method:"DELETE"}),saveModelCredential:(e,n,i=!1)=>xe(`/model-connections/${e}/credential`,{method:"PUT",body:Ye({apiKey:n,remove:i})}),saveConnectionModel:(e,n,i)=>xe(`/model-connections/${e}/models`,{method:i?"PUT":"POST",body:Ye({model:n,originalId:i})}),deleteConnectionModel:(e,n)=>xe(`/model-connections/${e}/models`,{method:"DELETE",body:Ye({modelId:n})})},nb=4*1024**3,UN=["normal","happy","sad","angry","dizzy"],$N=["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 VN=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 GN(e,n,i=[]){if(n==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:VN(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 YN=e=>{let n="",i=!1;for(const o of e){if(o==="-"||o==="_"||o<=" "){i=n.length>0;continue}n.length===0?n+=o.toLowerCase():n+=i?o.toUpperCase():o,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 KN=e=>{const n=YN(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 z0=(...e)=>e.filter((n,i,o)=>!!n&&n.trim()!==""&&o.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 xs={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 Ip(e){return e!=null}function XN(e,n={}){var w,b;const i=n.attributeNames??{},o=k=>i[k]??k,l=e.size??e.width??xs.width,c=e.size??e.height??xs.height,u=((w=e.aliases)==null?void 0:w.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],h=[...e.name?[`lucide-${e.name}`]:[],...u],f=((b=n.className)==null?void 0:b.split(" ").filter(Boolean))??[],v=n.includeDefaultClasses===!1?z0(...f):z0("lucide",...h,...f),y=n.absoluteStrokeWidth?Number(n.strokeWidth??xs["stroke-width"])*Number(e.size??e.width??xs.width)/Number(n.size??n.width??xs.width):n.strokeWidth??xs["stroke-width"];return["svg",{...Object.entries(xs).reduce((k,[S,N])=>(k[o(S)]=N,k),{}),..."color"in n&&n.color&&{[o("stroke")]:n.color},..."size"in n&&Ip(n.size)&&{[o("width")]:n.size,[o("height")]:n.size},..."width"in n&&Ip(n.width)&&{[o("width")]:n.width},..."height"in n&&Ip(n.height)&&{[o("height")]:n.height},[o("stroke-width")]:y,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${l} ${c}`,...n.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in n&&n.attributes},e.node.map(k=>{const[S,N,C]=k,A=n.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...N}:N;return C?[S,A,C]:[S,A]})]}/**
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 QN(e,n={}){return XN(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 ZN=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},WN=j.createContext({}),JN=()=>j.useContext(WN),e9=j.forwardRef(({color:e,size:n,width:i,height:o,strokeWidth:l,absoluteStrokeWidth:c,nonScalingStroke:u,className:h="",children:f,iconNode:v=[],icon:y={node:v,aliases:[],size:24},...p},w)=>{const{size:b=24,strokeWidth:k=2,absoluteStrokeWidth:S=!1,nonScalingStroke:N=!1,color:C="currentColor",className:A=""}=JN()??{},E=!!f||ZN(p),[T,R,_=[]]=QN(y,{color:e??C,width:i??n??b,height:o??n??b,strokeWidth:l??k,absoluteStrokeWidth:c??S,nonScalingStroke:u??N,className:z0(A,h),hasA11yProp:E,attributes:p});return j.createElement(T,{ref:w,...R},[..._.map(([L,I])=>j.createElement(L,I)),...Array.isArray(f)?f:[f]])});/**
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 Me(e,n=[],i=[]){const o=typeof e=="string"?GN(e,n,i):e,l=j.forwardRef(({className:c,...u},h)=>j.createElement(e9,{ref:h,icon:o,className:c,...u}));return o.name&&(l.displayName=KN(o.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 Yw={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"}]]};Yw.node;const t9=Me(Yw);/**
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 Kw={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"}]]};Kw.node;const n9=Me(Kw);/**
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 Xw={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"}]]};Xw.node;const a9=Me(Xw);/**
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 Qw={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Qw.node;const Av=Me(Qw);/**
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 Zw={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};Zw.node;const Jc=Me(Zw);/**
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 Ww={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Ww.node;const i9=Me(Ww);/**
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 Jw={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"}]]};Jw.node;const r9=Me(Jw);/**
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 e4={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"}]]};e4.node;const o9=Me(e4);/**
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 t4={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"}]]};t4.node;const L0=Me(t4);/**
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 n4={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"}]]};n4.node;const s9=Me(n4);/**
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 a4={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"}]]};a4.node;const l9=Me(a4);/**
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 i4={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"]};i4.node;const c9=Me(i4);/**
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 r4={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r4.node;const na=Me(r4);/**
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 o4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};o4.node;const Di=Me(o4);/**
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 s4={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};s4.node;const Mv=Me(s4);/**
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 l4={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};l4.node;const Ti=Me(l4);/**
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 c4={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};c4.node;const u9=Me(c4);/**
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 u4={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};u4.node;const d9=Me(u4);/**
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 d4={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"]};d4.node;const h9=Me(d4);/**
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 h4={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"}]]};h4.node;const f9=Me(h4);/**
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 f4={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"}]]};f4.node;const Os=Me(f4);/**
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 m4={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"}]]};m4.node;const m9=Me(m4);/**
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 p4={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"}]]};p4.node;const _v=Me(p4);/**
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 v4={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"]};v4.node;const p9=Me(v4);/**
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 g4={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"}]]};g4.node;const v9=Me(g4);/**
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 y4={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"}]]};y4.node;const Ll=Me(y4);/**
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 x4={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"}]]};x4.node;const Rv=Me(x4);/**
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 b4={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"}]]};b4.node;const Ov=Me(b4);/**
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 j4={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"]};j4.node;const g9=Me(j4);/**
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 w4={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"]};w4.node;const y9=Me(w4);/**
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 k4={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"]};k4.node;const x9=Me(k4);/**
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 S4={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"]};S4.node;const b9=Me(S4);/**
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 C4={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"}]]};C4.node;const j9=Me(C4);/**
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 N4={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"}]]};N4.node;const w9=Me(N4);/**
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 E4={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"}]]};E4.node;const k9=Me(E4);/**
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 T4={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"}]]};T4.node;const S9=Me(T4);/**
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 A4={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"}]]};A4.node;const C9=Me(A4);/**
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 M4={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"}]]};M4.node;const N9=Me(M4);/**
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 _4={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"}]]};_4.node;const E9=Me(_4);/**
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 R4={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"}]]};R4.node;const T9=Me(R4);/**
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 O4={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"}]]};O4.node;const A9=Me(O4);/**
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 D4={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"}]]};D4.node;const M9=Me(D4);/**
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 z4={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"}]]};z4.node;const Dv=Me(z4);/**
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 L4={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"}]]};L4.node;const jh=Me(L4);/**
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 B4={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]};B4.node;const I4=Me(B4);/**
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 P4={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"}]]};P4.node;const _9=Me(P4);/**
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 q4={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"}]]};q4.node;const R9=Me(q4);/**
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 F4={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};F4.node;const H4=Me(F4);/**
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 U4={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"}]]};U4.node;const O9=Me(U4);/**
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 $4={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};$4.node;const ab=Me($4);/**
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 V4={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"}]]};V4.node;const D9=Me(V4);/**
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 G4={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"]};G4.node;const Y4=Me(G4);/**
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 K4={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"}]]};K4.node;const zv=Me(K4);/**
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 X4={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"}]]};X4.node;const z9=Me(X4);/**
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 Q4={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"}]]};Q4.node;const L9=Me(Q4);/**
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 Z4={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"}]]};Z4.node;const W4=Me(Z4);/**
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 J4={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"}]]};J4.node;const B9=Me(J4);/**
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 e3={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};e3.node;const Lv=Me(e3);/**
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 t3={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"}]]};t3.node;const I9=Me(t3);/**
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 n3={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"}]]};n3.node;const P9=Me(n3);/**
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 a3={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"]};a3.node;const q9=Me(a3);/**
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 i3={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"}]]};i3.node;const Fh=Me(i3);/**
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 r3={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"}]]};r3.node;const F9=Me(r3);/**
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 o3={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"}]]};o3.node;const H9=Me(o3);/**
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 s3={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"}]]};s3.node;const B0=Me(s3);/**
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 l3={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"}]]};l3.node;const U9=Me(l3);/**
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 c3={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};c3.node;const u3=Me(c3);/**
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 d3={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};d3.node;const Mi=Me(d3);/**
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 h3={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"}]]};h3.node;const $9=Me(h3);/**
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 f3={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"}]]};f3.node;const du=Me(f3);/**
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 m3={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"}]]};m3.node;const V9=Me(m3);/**
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 p3={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"}]]};p3.node;const v3=Me(p3);/**
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 g3={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};g3.node;const Io=Me(g3);/**
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 y3={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"}]]};y3.node;const Bl=Me(y3);/**
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 x3={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"}]]};x3.node;const G9=Me(x3);/**
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 b3={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"}]]};b3.node;const Y9=Me(b3);/**
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 j3={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"}]]};j3.node;const K9=Me(j3);/**
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 w3={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"}]]};w3.node;const X9=Me(w3);/**
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 k3={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"}]]};k3.node;const Q9=Me(k3);/**
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:"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"]};S3.node;const C3=Me(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 N3={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"}]]};N3.node;const Z9=Me(N3);/**
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 E3={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"]};E3.node;const T3=Me(E3);/**
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 A3={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"}]]};A3.node;const W9=Me(A3);/**
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 M3={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"]};M3.node;const wh=Me(M3);/**
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 _3={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"]};_3.node;const Hh=Me(_3);/**
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 R3={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"}]]};R3.node;const J9=Me(R3);/**
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 O3={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"}]]};O3.node;const eE=Me(O3);/**
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 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 tE=Me(D3);/**
540
+ * @license lucide-react v1.47.0 - ISC
541
+ *
542
+ * This source code is licensed under the ISC license.
543
+ * See the LICENSE file in the root directory of this source tree.
544
+ */const z3={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"}]]};z3.node;const nE=Me(z3);/**
545
+ * @license lucide-react v1.47.0 - ISC
546
+ *
547
+ * This source code is licensed under the ISC license.
548
+ * See the LICENSE file in the root directory of this source tree.
549
+ */const L3={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"]};L3.node;const aE=Me(L3);/**
550
+ * @license lucide-react v1.47.0 - ISC
551
+ *
552
+ * This source code is licensed under the ISC license.
553
+ * See the LICENSE file in the root directory of this source tree.
554
+ */const B3={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"}]]};B3.node;const iE=Me(B3);/**
555
+ * @license lucide-react v1.47.0 - ISC
556
+ *
557
+ * This source code is licensed under the ISC license.
558
+ * See the LICENSE file in the root directory of this source tree.
559
+ */const I3={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};I3.node;const Fl=Me(I3),P3={list:(e,n)=>xe(`/bots/${e}/activity${n===void 0?"":`?before=${encodeURIComponent(n)}`}`),message:(e,n)=>xe(`/bots/${e}/activity/messages/${n}`)};function q3(e){var n,i,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(i=q3(e[n]))&&(o&&(o+=" "),o+=i)}else for(i in e)e[i]&&(o&&(o+=" "),o+=i);return o}function rE(){for(var e,n,i=0,o="",l=arguments.length;i<l;i++)(e=arguments[i])&&(n=q3(e))&&(o&&(o+=" "),o+=n);return o}const ib=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rb=rE,Bv=(e,n)=>i=>{var o;if((n==null?void 0:n.variants)==null)return rb(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:l,defaultVariants:c}=n,u=Object.keys(l).map(v=>{const y=i==null?void 0:i[v],p=c==null?void 0:c[v];if(y===null)return null;const w=ib(y)||ib(p);return l[v][w]}),h=i&&Object.entries(i).reduce((v,y)=>{let[p,w]=y;return w===void 0||(v[p]=w),v},{}),f=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((v,y)=>{let{class:p,className:w,...b}=y;return Object.entries(b).every(k=>{let[S,N]=k;return Array.isArray(N)?N.includes({...c,...h}[S]):{...c,...h}[S]===N})?[...v,p,w]:v},[]);return rb(e,u,f,i==null?void 0:i.class,i==null?void 0:i.className)},F3=48,fr=(e,n=0)=>{const i=new Int32Array(e.length);for(let o=0;o<e.length;o++)i[o]=e.charCodeAt(o)-F3-n;return i},Uh=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},Do=e=>{const n=new Int32Array(e.length);let i=0;for(let o=0;o<e.length;o++){const l=e.charCodeAt(o)-F3;i+=l>>>1^-(l&1),n[o]=i}return n},oE=384,sE=[],Cs=Uh(fr("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),lE=Uh(fr(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),cE="@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",uE=(()=>{const e=Cs.length-1,n=new Int32Array(e);for(let l=e-1;l>=0;l--){let c=1,u=l+1;for(let h=Cs[l];h<Cs[l+1];h++)c+=n[u],u+=n[u];n[l]=c}const i=new Int32Array(Cs[e]);let o=0;for(let l=0;l<e;l++){let c=l+1;for(let u=Cs[l];u<Cs[l+1];u++)i[o++]=c,c+=n[c]}return i})(),dE=fr("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),hE=Uh(fr("123333359346463635126536711576")),fE=fr("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),mE=fr("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),pE=Do("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),vE=(()=>{const e=new Int32Array(319).fill(-1),n=Do("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),i=Do("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let o=0;o<n.length;o++)e[n[o]]=i[o];return e})(),gE="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 o=0;o<n.length;o++)n[o]=i+n[o];return n}),ob=Do("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),yE=Do("ɠ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"),xE=Do("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),H3=new Int32Array(995),U3=new Int32Array(995),$3=new Int32Array(995);let I0="";const P0=new Int32Array(1038);{const e=new Map;let n=0,i=0;for(let o=0;o<ob.length;o++)for(const l of gE[xE[o]]){let c=e.get(l);c===void 0&&(c=n++,e.set(l,c),P0[c*2]=I0.length,P0[c*2+1]=l.length,I0+=l),H3[i]=ob[o],U3[i]=yE[o],$3[i]=c,i++}}const bE=Do("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),jE=Uh(fr("1::24444432:442:44:44>222222:44:4421322511111311111114")),wE=Do("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"),kE=fr("ij"),SE=fr("—"),CE=fr("1"),NE="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var EE={GROUP_COUNT:oE,customValidatorNames:sE,edgeStart:Cs,labelStart:lE,labelText:cE,edgeTarget:uE,nodeGroup:dE,nodeVlist:vE,vlistPat:hE,vlistOps:fE,vlistRef:mE,vlistGroup:pE,litAnchor:H3,litGroup:U3,litPool:$3,poolOffsets:P0,poolText:I0,adjGid:bE,adjStart:jE,adjTgt:wE,patGid:kE,patTgt:SE,postfixLookupGroups:CE,orderSensitiveModifiers:NE};const TE="line"in new Error,er=-1,bs=-1,Pp=(e,n,i)=>{let o=2166136261;for(let l=n;l<i;l++)o=Math.imul(o^e.charCodeAt(l),16777619);return o},uh=(e,n,i)=>{const o=i-n;let l=Math.imul(o,2654435761)^e.charCodeAt(n);if(o>3){const c=o>>2,u=o>>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+u)<<8^e.charCodeAt(n+u+c)<<16^e.charCodeAt(i-3),3266489909),l^=e.charCodeAt(i-2)<<8^e.charCodeAt(i-1)<<16;for(let h=n+3,f=i-4;h<n+8&&h<f;h++,f--)l=Math.imul(l^e.charCodeAt(h)^e.charCodeAt(f)<<8,16777619)}return l^l>>>15|0},AE=(e,n,i={})=>{const{GROUP_COUNT:o,edgeStart:l,labelStart:c,labelText:u,edgeTarget:h,nodeGroup:f,nodeVlist:v,vlistPat:y,vlistOps:p,vlistRef:w,vlistGroup:b,litAnchor:k,litGroup:S,litPool:N,poolOffsets:C,poolText:A,adjGid:E,adjStart:T,adjTgt:R,patGid:_,patTgt:L,postfixLookupGroups:I,customValidatorNames:H,orderSensitiveModifiers:O}=e,P=new Int32Array(o).fill(-1);for(let pe=0;pe<E.length;pe++)P[E[pe]]=pe;let U=0;for(let pe=0;pe+1<T.length;pe++){const Ne=T[pe+1]-T[pe];Ne>U&&(U=Ne)}let Y=32;for(;Y<2*(1+U+_.length);)Y<<=1;const K=new Int32Array(w.length+1);for(let pe=0;pe<w.length;pe++)K[pe+1]=K[pe]+y[w[pe]+1]-y[w[pe]];const q=new Uint8Array(o);for(let pe=0;pe<I.length;pe++)q[I[pe]]=1;const Q=l.length-1,V=new Uint8Array(Q);let Z=0,ue=!0;for(let pe=0;pe<k.length;pe++){V[k[pe]]=1;const Ne=C[N[pe]*2+1];Ne>Z&&(Z=Ne);const Ce=A.charCodeAt(C[N[pe]*2]);(Ce===91||Ce===40)&&(ue=!1)}let z=1;for(;z<k.length*2;)z<<=1;const he=new Int32Array(z).fill(-1);for(let pe=0;pe<k.length;pe++){const Ne=C[N[pe]*2];let Ce=(Pp(A,Ne,Ne+C[N[pe]*2+1])^Math.imul(k[pe],2654435761)|0)&z-1;for(;he[Ce]!==-1;)Ce=Ce+1&z-1;he[Ce]=pe}const oe=(pe,Ne,Ce,Ve)=>{let st=(Pp(Ne,Ce,Ve)^Math.imul(pe,2654435761)|0)&z-1;const Ge=Ve-Ce;for(;;){const nt=he[st];if(nt===-1)return-1;if(k[nt]===pe&&C[N[nt]*2+1]===Ge){const Dt=C[N[nt]*2];let Rt=!0;for(let Ze=0;Ze<Ge;Ze++)if(A.charCodeAt(Dt+Ze)!==Ne.charCodeAt(Ce+Ze)){Rt=!1;break}if(Rt)return S[nt]}st=st+1&z-1}},D=i.cacheSize??8192,F=i.prefix??e.prefix??"",ie=F===""?"":F+":",$=ie.length,X=(H??[]).map(pe=>{throw new Error("cn: missing validator "+pe)}),ee=/\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$/,me=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ce=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let J=0,je=-1,Re=-1,De=-1,Pe=-1;const Le=pe=>pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===95,He=pe=>/\s/.test(String.fromCharCode(pe)),at=(pe,Ne,Ce)=>{if(J=0,je=-1,Ce-Ne<3)return;const Ve=pe.charCodeAt(Ne),st=pe.charCodeAt(Ce-1);if(Ve===91&&st===93)J=1;else if(Ve===40&&st===41)J=2;else return;De=Ne+1,Pe=Ce-1;let Ge=Ne+1;if(Le(pe.charCodeAt(Ge))){for(Ge++;Ge<Ce-1;){const nt=pe.charCodeAt(Ge);if(!Le(nt)&&nt!==45)break;Ge++}Ge<Ce-2&&pe.charCodeAt(Ge)===58&&(je=Ne+1,Re=Ge,De=Ge+1)}},Lt=(pe,Ne,Ce,Ve)=>{if(Ce-Ne!==Ve.length)return!1;for(let st=0;st<Ve.length;st++)if(pe.charCodeAt(Ne+st)!==Ve.charCodeAt(st))return!1;return!0},Gt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ft=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cn=pe=>!!pe&&!Number.isNaN(Number(pe)),wn=(pe,Ne,Ce)=>{if(Ce-Ne<11||!Lt(pe,Ne,Ne+10,"@container"))return!1;if(pe.charCodeAt(Ne+10)===47)return Ce-Ne>=12;const Ve=pe.charCodeAt(Ne+11);return Ve===115&&Ce-Ne>=17&&Lt(pe,Ne+10,Ne+16,"-size/")||Ve===110&&Ce-Ne>=19&&Lt(pe,Ne+10,Ne+18,"-normal/")},fn=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ye="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(pe=>pe.split(" ")),_e=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],We=(pe,Ne,Ce,Ve)=>{if(pe>=10){if(pe>=25)return X[pe-25](Ne.slice(Ce,Ve));const st=pe-10;if(J!==fn[st])return!1;if(je>=0){for(const Ge of ye[st])if(Lt(Ne,je,Re,Ge))return!0;return!1}switch(_e[st]){case 0:return!1;case 1:return!0;case 2:{const Ge=Ne.slice(De,Pe);return ee.test(Ge)&&!me.test(Ge)}case 3:return Cn(Ne.slice(De,Pe));case 4:return ce.test(Ne.slice(De,Pe));default:return te.test(Ne.slice(De,Pe))}}switch(pe){case 0:return!0;case 1:return J===0;case 2:return J===1;case 3:return J===2;case 4:return Gt.test(Ne.slice(Ce,Ve));case 5:return Cn(Ne.slice(Ce,Ve));case 6:{const st=Ne.slice(Ce,Ve);return!!st&&Number.isInteger(Number(st))}case 7:return Ve>Ce&&Ne.charCodeAt(Ve-1)===37&&Cn(Ne.slice(Ce,Ve-1));case 8:return ft.test(Ne.slice(Ce,Ve));default:return wn(Ne,Ce,Ve)}},tt=new Set(typeof O=="string"?O.split(" "):O),ct=(pe,Ne,Ce,Ve,st,Ge)=>{const nt=Pp(Ne,Ce,Ve)^(st?2654435769:0)|0;let Dt=pe.get(nt);if(Dt!==void 0)e:for(let Je=0;Je<Dt.length;Je++){const Nt=Dt[Je];if(!(Nt.imp!==st||Nt.k.length!==Ve-Ce)){for(let Qe=0;Qe<Nt.k.length;Qe++)if(Nt.k.charCodeAt(Qe)!==Ne.charCodeAt(Ce+Qe))continue e;return Nt.id}}else pe.set(nt,Dt=[]);const Rt=Ne.slice(Ce,Ve),Ze=Ge(Rt);return Dt.push({k:Rt,imp:st,id:Ze}),Ze};let on=new Map,On=new Map,yn=2;const Bn=4096,ge=(pe,Ne)=>{const Ce=[];let Ve=0,st=0,Ge=0;for(let Ze=0;Ze<pe.length;Ze++){const Je=pe.charCodeAt(Ze);Ve===0&&st===0&&Je===58?(Ce.push(pe.slice(Ge,Ze)),Ge=Ze+1):Je===91?Ve++:Je===93?Ve--:Je===40?st++:Je===41&&st--}Ce.push(pe.slice(Ge));let nt=Ce[0];if(Ce.length>1){const Ze=[];let Je=[];for(const Nt of Ce)Nt.charCodeAt(0)===91||tt.has(Nt)?(Je.length&&(Ze.push(...Je.sort()),Je=[]),Ze.push(Nt)):Je.push(Nt);Je.length&&Ze.push(...Je.sort()),nt=Ze.join(":")}const Dt=Ne?nt+" !":nt;let Rt=On.get(Dt);return Rt===void 0&&On.set(Dt,Rt=yn++),Rt};let Ee=new Map,Oe=o;const qe=o+4096,Be=()=>Oe++,mt=2097152,$n=8192,Ba=new Int32Array($n),Yt=new Array($n).fill(null),Vo=new Int32Array($n),Pi=new Int32Array($n),gr=new Uint8Array($n);let Jr=0;const Ia=(pe,Ne,Ce,Ve,st,Ge,nt,Dt)=>{let Rt=pe;if(Yt[pe]!==null)if(Yt[pe|1]===null)Rt=pe|1;else if((Jr++&3)===0)Rt=pe|Jr>>2&1;else return;Yt[Rt]=Ne.slice(Ce,Ve),Ba[Rt]=st,Vo[Rt]=Ge,Pi[Rt]=nt,gr[Rt]=Dt},Et=()=>Yt.fill(null);let sn=256,cn=[new Int32Array(sn),new Int32Array(sn),new Int32Array(sn),new Int32Array(sn)],[Pa,qa,ka,ai]=cn,ua=new Uint8Array(sn),Sa=new Uint8Array(sn);const Fa=()=>{sn*=2,cn=cn.map(Ne=>{const Ce=new Int32Array(sn);return Ce.set(Ne),Ce}),[Pa,qa,ka,ai]=cn;const pe=new Uint8Array(sn);pe.set(ua),ua=pe,Sa=new Uint8Array(sn)};let Ca=64,Na=new Int32Array(Ca),gt=new Int32Array(Ca);const qi=new Int32Array(o);let Ha=2048,Fi=21,Ua=new Float64Array(Ha),da=new Int32Array(Ha),$a=0;const Vn=(pe,Ne)=>{if(pe===0&&Ne<o)return qi[Ne]===$a?1:(qi[Ne]=$a,0);const Ce=pe*2097152+Ne+1;let Ve=Math.imul(Ce,2654435761)>>>Fi;for(;da[Ve]===$a;){if(Ua[Ve]===Ce)return 1;Ve=Ve+1&Ha-1}return Ua[Ve]=Ce,da[Ve]=$a,0},gi=(pe,Ne,Ce,Ve,st)=>{if(Ce-Ne>=2&&pe.charCodeAt(Ne)===91&&pe.charCodeAt(Ce-1)===93){let Ge=-1;for(let nt=Ne+1;nt<Ce-1;nt++)if(pe.charCodeAt(nt)===58){Ge=nt;break}return Ge===-1||Ge===Ne+1?er:ct(Ee,pe,Ne+1,Ge,0,Be)}if(Ve>=0&&f[Ve]>=0)return f[Ve];for(let Ge=st-1;Ge>=0;Ge--){const nt=gt[Ge];if(nt>Ce)continue;const Dt=Na[Ge],Rt=Ce-nt;if(V[Dt]===1&&Rt>0&&Rt<=Z){const Kt=pe.charCodeAt(nt);if(ue===!1||Kt!==91&&Kt!==40){const ma=oe(Dt,pe,nt,Ce);if(ma>=0)return ma}}const Ze=v[Dt];if(Ze<0)continue;const Je=w[Ze],Nt=y[Je],Qe=y[Je+1];if(Nt===Qe)continue;at(pe,nt,Ce);const pn=K[Ze]-Nt;for(let Kt=Nt;Kt<Qe;Kt++)if(We(p[Kt],pe,nt,Ce))return b[pn+Kt]}return er},yi=pe=>{const Ne=pe.length;let Ce=0,Ve=0,st=!1;(yn>Bn||on.size>Bn)&&(on=new Map,On=new Map,yn=2,Et()),Oe>qe&&(Ee=new Map,Oe=o,Et());let Ge=0;for(;Ge<Ne;){let Ze=pe.charCodeAt(Ge);if(Ze===32||Ze>=9&&Ze<=13||Ze>=160&&He(Ze)){Ze!==32&&(st=!0),Ge++;continue}const Je=Ge;let Nt=0;for(;Ge<Ne;){if(Ze=pe.charCodeAt(Ge),Ze<=32){if(Ze===32)break;if(Ze>=9&&Ze<=13){st=!0;break}}else if(Ze>=160&&He(Ze)){st=!0;break}Nt=Math.imul(Nt^Ze,16777619),Ge++}const Qe=Ge,pn=Qe-Je;Ce===sn&&Fa();const Kt=Ce++;Pa[Kt]=Je,qa[Kt]=Qe,Ve+=pn,Nt^=Math.imul(pn,2654435761);const ma=Nt^Nt>>>15|0,xn=ma&8190;{let Tt=-1;if(Ba[xn]===ma&&Yt[xn]!==null&&Yt[xn].length===pn?Tt=xn:Ba[xn|1]===ma&&Yt[xn|1]!==null&&Yt[xn|1].length===pn&&(Tt=xn|1),Tt>=0){const In=Yt[Tt];let ri=!0;for(let Ga=0;Ga<pn;Ga++)if(In.charCodeAt(Ga)!==pe.charCodeAt(Je+Ga)){ri=!1;break}if(ri){ka[Kt]=Vo[Tt],ai[Kt]=Pi[Tt],ua[Kt]=gr[Tt];continue}}}let Jt=Je;if($!==0){if(Qe-Je<=$||!pe.startsWith(ie,Je)){ka[Kt]=er,Ia(xn,pe,Je,Qe,ma,er,0,0);continue}Jt=Je+$}let no=0,Yo=0,ii=-1,jr=-1;for(let Tt=Jt;Tt<Qe;Tt++){const In=pe.charCodeAt(Tt);if(no===0&&Yo===0){if(In===58){ii=Tt;continue}if(In===47){jr=Tt;continue}}In===91?no++:In===93?no--:In===40?Yo++:In===41&&Yo--}const Ko=ii>=Jt?ii+1:Jt;let Ft=Ko,Dn=Qe,bi=!1,G=0;Dn>Ft&&pe.charCodeAt(Dn-1)===33?(bi=!0,Dn--):Dn>Ft&&pe.charCodeAt(Ft)===33&&(bi=!0,Ft++,G=1);let be=-1;jr>Ko&&(be=jr+G,be>=Dn&&(be=-1));let Te=Ft;Dn-Ft>1&&pe.charCodeAt(Ft)===45&&(Te=Ft+1);let ot=0,pt=0,un=0,it=-1,yt=0;(v[0]>=0||V[0]===1)&&(Na[0]=0,gt[0]=Te,yt=1);let en=bs,Xt=0;for(let Tt=Te;Tt<Dn;Tt++)if(Tt===be&&(en=pt<un?bs:ot,Xt=yt),ot!==bs){const In=pe.charCodeAt(Tt);let ri=-1;if(pt<un)u.charCodeAt(pt)===In?(pt++,pt===un&&(ri=ot=it)):ot=bs;else{const Ga=l[ot],Zo=l[ot+1];let wr=bs;for(let Gn=Ga;Gn<Zo;Gn++){const Wo=c[Gn];if(u.charCodeAt(Wo)===In){c[Gn+1]-Wo===1?ri=wr=h[Gn]:(pt=Wo+1,un=c[Gn+1],it=h[Gn],wr=ot);break}}ot=wr}if(ri>=0&&(v[ri]>=0||V[ri]===1)&&Tt+1<Dn&&pe.charCodeAt(Tt+1)===45){if(yt===Ca){Ca*=2;const Ga=new Int32Array(Ca);Ga.set(Na),Na=Ga;const Zo=new Int32Array(Ca);Zo.set(gt),gt=Zo}Na[yt]=ri,gt[yt]=Tt+2,yt++}}be===Dn&&(en=pt<un?bs:ot,Xt=yt);const pa=pt<un?bs:ot;let Ht,tn=!1;if(be>=0)if(tn=!0,Ht=gi(pe,Ft,be,en,Xt),Ht!==er&&Ht<o&&q[Ht]){const Tt=gi(pe,Ft,Dn,pa,yt);Tt!==er&&Tt!==Ht&&(Ht=Tt,tn=!1)}else Ht===er&&(Ht=gi(pe,Ft,Dn,pa,yt),tn=!1);else Ht=gi(pe,Ft,Dn,pa,yt);let Xo=0,Qo=0;Ht===er?ka[Kt]=er:(Qo=tn?1:0,Xo=Jt>=ii?bi?1:0:ct(on,pe,Jt,ii,bi?1:0,Tt=>ge(Tt,bi)),ka[Kt]=Ht,ua[Kt]=Qo,ai[Kt]=Xo),Ia(xn,pe,Je,Qe,ma,Ht,Xo,Qo)}if(Ce===0)return"";if(Ce===1)return Pa[0]===0&&qa[0]===Ne?pe:pe.slice(Pa[0],qa[0]);if(Ce*Y>Ha){for(;Ce*Y>Ha;)Ha<<=1,Fi--;Ua=new Float64Array(Ha),da=new Int32Array(Ha)}if(yn>=mt||Oe>=mt)throw new Error("cn: too many distinct classes in one merge");$a=$a+1|0,$a===0&&(qi.fill(0),da.fill(0),$a=1);let nt=!1;for(let Ze=Ce-1;Ze>=0;Ze--){const Je=ka[Ze];if(Je===er){Sa[Ze]=1;continue}const Nt=ai[Ze];if(Vn(Nt,Je)===1){Sa[Ze]=0,nt=!0;continue}if(Sa[Ze]=1,Je<o){const Qe=P[Je];if(Qe>=0)for(let pn=T[Qe];pn<T[Qe+1];pn++)Vn(Nt,R[pn]);if(ua[Ze]&1)for(let pn=0;pn<_.length;pn++)_[pn]===Je&&Vn(Nt,L[pn])}}if(!nt&&!st&&Ne===Ve+Ce-1)return pe;let Dt="",Rt=0;for(;Rt<Ce;){if(!Sa[Rt]){Rt++;continue}const Ze=Pa[Rt];let Je=qa[Rt],Nt=Rt+1;for(;Nt<Ce&&Sa[Nt]&&Pa[Nt]===Je+1&&pe.charCodeAt(Je)===32;)Je=qa[Nt],Nt++;Dt.length>0&&(Dt+=" "),Dt+=pe.slice(Ze,Je),Rt=Nt}return Dt},Ea=16384,ha=new Int32Array(Ea*2);let Hi=0,mn=1,ln=Object.create(null),Nn=Object.create(null),fa=new Map,Go=new Map,xi=0,yr=0;const Ui=()=>{Hi^=Ea,mn=mn+1|0,yr=0},xr=pe=>{let Ne=ln[pe];if(Ne!==void 0)return Ne;const Ce=uh(pe,0,pe.length),Ve=(Ce&16383)+Hi,st=ha[Ve]===(Ce^mn)||ha[Ve^Ea]===(Ce^mn-1);return st&&(Ne=Nn[pe],Ne!==void 0)?(ln[pe]=Ne,Ne):(Ne=yi(pe),st?(ln[pe]=Ne,++xi>D&&(xi=0,Nn=ln,ln=Object.create(null),Ui())):(ha[Ve]=Ce^mn,++yr>Ea&&Ui()),Ne)},eo=pe=>{let Ne=fa.get(pe);if(Ne!==void 0)return Ne;const Ce=uh(pe,0,pe.length),Ve=(Ce&16383)+Hi,st=ha[Ve]===(Ce^mn)||ha[Ve^Ea]===(Ce^mn-1);return st&&(Ne=Go.get(pe),Ne!==void 0)?(fa.set(pe,Ne),Ne):(Ne=yi(pe),st?(fa.set(pe,Ne),++xi>D&&(xi=0,Go=fa,fa=new Map,Ui())):(ha[Ve]=Ce^mn,++yr>Ea&&Ui()),Ne)},to=pe=>{const Ne=uh(pe,0,pe.length),Ce=(Ne&16383)+Hi;return ha[Ce]===(Ne^mn)||ha[Ce^Ea]===(Ne^mn-1)?!0:(ha[Ce]=Ne^mn,++yr>Ea&&Ui(),!1)},Va=D===0?yi:TE?pe=>{const Ne=fa.get(pe);return Ne!==void 0?Ne:eo(pe)}:xr;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Va(arguments[0]):Va(_E.apply(null,arguments))},mergeString:Va,seenBefore:D===0?()=>!1:to,mergeUncached:yi}},kh=(e,n)=>{if(!e)return"";if(typeof e=="string")return e;let i="";if(typeof e.length=="number"&&(!n||Array.isArray(e))){const o=e;for(let l=0;l<o.length;l++){const c=o[l];if(!c)continue;const u=typeof c=="string"?c:kh(c,n);u&&(i&&(i+=" "),i+=u)}return i}if(n){if(typeof e=="number")return""+e;if(typeof e=="object")for(const o in e)e[o]&&(i&&(i+=" "),i+=o)}return i},ME=(e,n)=>{let i="";for(let o=0;o<e.length;o++){const l=e[o];if(!l)continue;const c=typeof l=="string"?l:kh(l,n);c&&(i&&(i+=" "),i+=c)}return i},_E=function(){return ME(arguments,!1)},RE=256,sb=16,OE=1024,qp=4096,DE=(e,n)=>{const i=n===void 0?()=>!0:n.seenBefore,o=n===void 0?e:n.mergeUncached;let l=new Map,c=new Map,u=0,h=null,f=null,v=[],y=[],p=0;const w=(C,A,E)=>{f===null&&(f=new Array(qp).fill(""),v=new Array(qp).fill(""),y=new Array(qp).fill(""));const T=uh(C,0,C.length)&4094;if(f[T]===C&&v[T]===A)return y[T];if(f[T|1]===C&&v[T|1]===A)return y[T|1];const R=e(E?A+" "+C:C),_=f[T]===""?T:T|(f[T|1]===""?1:p++&1);return f[_]=C,v[_]=A,y[_]=R,R},b=(C,A,E,T)=>{let R=0;if(A){if(A!==C.a0)return!1;R=1}if(E){if(E!==(R===0?C.a0:C.a1))return!1;R++}if(T){if(T!==(R===0?C.a0:R===1?C.a1:C.a2))return!1;R++}return R===C.t},k=(C,A)=>{const E=C.a;let T=0;for(let R=0;R<A.length;R++){const _=A[R];if(_){if(_!==E[T])return!1;T++}}return T===C.t},S=(C,A)=>{const E=C.length,T=h===null?null:h.n;if(!A){if(T!==null&&k(T,C))return h=T,T.r;if(h!==null&&h!==T&&k(h,C))return h.r}let R="",_=-1,L=0,I=!1;for(let P=0;P<E;P++){let U=C[P];if(U){if(typeof U!="string"){if(U=C[P]=kh(U,!0),!U)continue;I=!0}_<0&&(R=U,_=P),L++}}if(L===0)return"";if(L===1)return e(R);if(I){if(T!==null&&k(T,C))return h=T,T.r;if(h!==null&&h!==T&&k(h,C))return h.r}let H=l.get(R);H===void 0&&(H=c.get(R),H!==void 0&&l.set(R,H));let O=null;if(H!==void 0){if(H.skip>0){H.skip--,h=null;let U=R;for(let Y=_+1;Y<E;Y++){const K=C[Y];K&&(U+=" "+K)}return w(U,"",!1)}const P=H.e;e:for(let U=0;U<P.length;U++){const Y=P[U];if(Y.t!==L)continue;const K=Y.a;let q=1;for(let Q=_+1;Q<E;Q++){const V=C[Q];if(V&&V!==K[q++])continue e}O=Y;break}O!==null&&(H.miss=0)}if(O===null){let P=R;const U=[R];for(let K=_+1;K<E;K++){const q=C[K];q&&(P+=" "+q,U.push(q))}if(!i(P))return o(P);O={r:e(P),t:U.length,a0:U[0],a1:U[1],a2:U[2]??"",a:U,n:null},H===void 0?l.set(R,H={e:[],miss:0,skip:0,at:0}):++H.miss>sb&&(H.miss=sb,H.skip=OE,H.e.length=0,H.at=0);const Y=H.e;Y.length<RE?Y.push(O):(Y[H.at]=O,H.at=H.at+1&255),++u>1e3&&(u=0,c=l,l=new Map)}return h!==null&&h!==O&&(h.n=O),h=O,O.r},N=C=>Array.isArray(C)?S(C.slice(),!1):e(kh(C,!0));return function(C,A,E){const T=arguments.length;if((T|1)===3){const L=h;if(L!==null){const I=L.n;if(I!==null&&b(I,C,A,E))return h=I,I.r;if(L!==I&&b(L,C,A,E))return L.r}if(T===2&&typeof A=="string"&&A!==""){const I=l.get(C);if(I!==void 0&&I.skip>0)return I.skip--,h=null,w(A,C,!0)}return S([C,A,E],!0)}if(T===1)return typeof C=="string"?e(C):N(C);const R=h;if(R!==null){const L=R.n;if(L!==null){const I=L.a;let H=0,O=!0;for(let P=0;P<T;P++){const U=arguments[P];if(U){if(U!==I[H]){O=!1;break}H++}}if(O&&H===L.t)return h=L,L.r}if(R!==L){const I=R.a;let H=0,O=!0;for(let P=0;P<T;P++){const U=arguments[P];if(U){if(U!==I[H]){O=!1;break}H++}}if(O&&H===R.t)return R.r}}const _=[];for(let L=0;L<T;L++)_.push(arguments[L]);return S(_,!0)}},lb=AE(EE),Ln=DE(lb.mergeString,lb);var Po=Pw(),zE=Object.defineProperty,Iv=(e,n)=>zE(e,"name",{value:n,configurable:!0});function q0(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}Iv(q0,"setRef");function V3(...e){return n=>{let i=!1;const o=e.map(l=>{const c=q0(l,n);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let l=0;l<o.length;l++){const c=o[l];typeof c=="function"?c():q0(e[l],null)}}}}Iv(V3,"composeRefs");function qt(...e){return j.useCallback(V3(...e),e)}Iv(qt,"useComposedRefs");var LE=Object.defineProperty,Li=(e,n)=>LE(e,"name",{value:n,configurable:!0});function cr(e){const n=j.forwardRef((i,o)=>{let{children:l,...c}=i,u=null,h=!1;const f=[];F0(l)&&typeof qd=="function"&&(l=qd(l._payload)),j.Children.forEach(l,w=>{var b;if(X3(w)){h=!0;const k=w;let S="child"in k.props?k.props.child:k.props.children;F0(S)&&typeof qd=="function"&&(S=qd(S._payload)),u=PE(k,S),f.push((b=u==null?void 0:u.props)==null?void 0:b.children)}else f.push(w)}),u?u=j.cloneElement(u,void 0,f):!h&&j.Children.count(l)===1&&j.isValidElement(l)&&(u=l);const v=u?K3(u):void 0,y=qt(o,v);if(!u){if(l||l===0)throw new Error(h?HE(e):FE(e));return l}const p=Y3(c,u.props??{});return u.type!==j.Fragment&&(p.ref=o?y:v),j.cloneElement(u,p)});return n.displayName=`${e}.Slot`,n}Li(cr,"createSlot");var BE=cr("Slot"),G3=Symbol.for("radix.slottable");function IE(e){const n=Li(i=>"child"in i?i.children(i.child):i.children,"Slottable");return n.displayName=`${e}.Slottable`,n.__radixId=G3,n}Li(IE,"createSlottable");var PE=Li((e,n)=>{if("child"in e.props){const i=e.props.child;return j.isValidElement(i)?j.cloneElement(i,void 0,e.props.children(i.props.children)):null}return j.isValidElement(n)?n:null},"getSlottableElementFromSlottable");function Y3(e,n){const i={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?i[o]=(...h)=>{const f=c(...h);return l(...h),f}:l&&(i[o]=l):o==="style"?i[o]={...l,...c}:o==="className"&&(i[o]=[l,c].filter(Boolean).join(" "))}return{...e,...i}}Li(Y3,"mergeProps");function K3(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.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)}Li(K3,"getElementRef");function X3(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===G3}Li(X3,"isSlottable");var qE=Symbol.for("react.lazy");function F0(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qE&&"_payload"in e&&Q3(e._payload)}Li(F0,"isLazyComponent");function Q3(e){return typeof e=="object"&&e!==null&&"then"in e}Li(Q3,"isPromiseLike");var FE=Li(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),HE=Li(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),qd=cu[" use ".trim().toString()],UE=Object.defineProperty,$E=(e,n)=>UE(e,"name",{value:n,configurable:!0}),VE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hn=VE.reduce((e,n)=>{const i=cr(`Primitive.${n}`),o=j.forwardRef((l,c)=>{const{asChild:u,...h}=l,f=u?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(f,{...h,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function Z3(e,n){e&&Po.flushSync(()=>e.dispatchEvent(n))}$E(Z3,"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"}),YE=Object.defineProperty,pi=(e,n)=>YE(e,"name",{value:n,configurable:!0});function KE(e,n){const i=j.createContext(n);i.displayName=e+"Context";const o=pi(c=>{const{children:u,...h}=c,f=j.useMemo(()=>h,Object.values(h));return r.jsx(i.Provider,{value:f,children:u})},"Provider");o.displayName=e+"Provider";function l(c,u={}){const{optional:h=!1}=u,f=j.useContext(i);if(f)return f;if(n!==void 0)return n;if(!h)throw new Error(`\`${c}\` must be used within \`${e}\``)}return pi(l,"useContext"),[o,l]}pi(KE,"createContext");function qo(e,n=[]){let i=[];function o(c,u){const h=j.createContext(u);h.displayName=c+"Context";const f=i.length;i=[...i,u];const v=pi(p=>{var C;const{scope:w,children:b,...k}=p,S=((C=w==null?void 0:w[e])==null?void 0:C[f])||h,N=j.useMemo(()=>k,Object.values(k));return r.jsx(S.Provider,{value:N,children:b})},"Provider");v.displayName=c+"Provider";function y(p,w,b={}){var C;const{optional:k=!1}=b,S=((C=w==null?void 0:w[e])==null?void 0:C[f])||h,N=j.useContext(S);if(N)return N;if(u!==void 0)return u;if(!k)throw new Error(`\`${p}\` must be used within \`${c}\``)}return pi(y,"useContext"),[v,y]}pi(o,"createContext");const l=pi(()=>{const c=i.map(u=>j.createContext(u));return pi(function(h){const f=(h==null?void 0:h[e])||c;return j.useMemo(()=>({[`__scope${e}`]:{...h,[e]:f}}),[h,f])},"useScope")},"createScope");return l.scopeName=e,[o,W3(l,...n)]}pi(qo,"createContextScope");function W3(...e){const n=e[0];if(e.length===1)return n;const i=pi(()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return pi(function(c){const u=o.reduce((h,{useScope:f,scopeName:v})=>{const p=f(c)[`__scope${v}`];return{...h,...p}},{});return j.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])},"useComposedScopes")},"createScope");return i.scopeName=n.scopeName,i}pi(W3,"composeContextScopes");var XE=Object.defineProperty,Un=(e,n)=>XE(e,"name",{value:n,configurable:!0});function J3(e){const n=e+"CollectionProvider",[i,o]=qo(n),[l,c]=i(n,{collectionRef:{current:null},itemMap:new Map}),u=Un(S=>{const{scope:N,children:C}=S,A=j.useRef(null),E=j.useRef(new Map).current;return r.jsx(l,{scope:N,itemMap:E,collectionRef:A,children:C})},"CollectionProvider");u.displayName=n;const h=e+"CollectionSlot",f=cr(h),v=j.forwardRef((S,N)=>{const{scope:C,children:A}=S,E=c(h,C),T=qt(N,E.collectionRef);return r.jsx(f,{ref:T,children:A})});v.displayName=h;const y=e+"CollectionItemSlot",p="data-radix-collection-item",w=cr(y),b=j.forwardRef((S,N)=>{const{scope:C,children:A,...E}=S,T=j.useRef(null),R=qt(N,T),_=c(y,C);return j.useEffect(()=>(_.itemMap.set(T,{ref:T,...E}),()=>void _.itemMap.delete(T))),r.jsx(w,{[p]:"",ref:R,children:A})});b.displayName=y;function k(S){const N=c(e+"CollectionConsumer",S);return j.useCallback(()=>{const A=N.collectionRef.current;if(!A)return[];const E=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(N.itemMap.values()).sort((_,L)=>E.indexOf(_.ref.current)-E.indexOf(L.ref.current))},[N.collectionRef,N.itemMap])}return Un(k,"useCollection"),[{Provider:u,Slot:v,ItemSlot:b},k,o]}Un(J3,"createCollection");var cb=new WeakMap,_n,ti,Fp=(ti=class extends Map{constructor(i){super(i);Vx(this,_n);_p(this,_n,[...super.keys()]),cb.set(this,!0)}set(i,o){return cb.get(this)&&(this.has(i)?ia(this,_n)[ia(this,_n).indexOf(i)]=i:ia(this,_n).push(i)),super.set(i,o),this}insert(i,o,l){const c=this.has(o),u=ia(this,_n).length,h=Pv(i);let f=h>=0?h:u+h;const v=f<0||f>=u?-1:f;if(v===this.size||c&&v===this.size-1||v===-1)return this.set(o,l),this;const y=this.size+(c?0:1);h<0&&f++;const p=[...ia(this,_n)];let w,b=!1;for(let k=f;k<y;k++)if(f===k){let S=p[k];p[k]===o&&(S=p[k+1]),c&&this.delete(o),w=this.get(S),this.set(o,l)}else{!b&&p[k-1]===o&&(b=!0);const S=p[b?k:k-1],N=w;w=this.get(S),this.delete(S),this.set(S,N)}return this}with(i,o,l){const c=new ti(this);return c.insert(i,o,l),c}before(i){const o=ia(this,_n).indexOf(i)-1;if(!(o<0))return this.entryAt(o)}setBefore(i,o,l){const c=ia(this,_n).indexOf(i);return c===-1?this:this.insert(c,o,l)}after(i){let o=ia(this,_n).indexOf(i);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(i,o,l){const c=ia(this,_n).indexOf(i);return c===-1?this:this.insert(c+1,o,l)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return _p(this,_n,[]),super.clear()}delete(i){const o=super.delete(i);return o&&ia(this,_n).splice(ia(this,_n).indexOf(i),1),o}deleteAt(i){const o=this.keyAt(i);return o!==void 0?this.delete(o):!1}at(i){const o=dh(ia(this,_n),i);if(o!==void 0)return this.get(o)}entryAt(i){const o=dh(ia(this,_n),i);if(o!==void 0)return[o,this.get(o)]}indexOf(i){return ia(this,_n).indexOf(i)}keyAt(i){return dh(ia(this,_n),i)}from(i,o){const l=this.indexOf(i);if(l===-1)return;let c=l+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(i,o){const l=this.indexOf(i);if(l===-1)return;let c=l+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(i,o){let l=0;for(const c of this){if(Reflect.apply(i,o,[c,l,this]))return c;l++}}findIndex(i,o){let l=0;for(const c of this){if(Reflect.apply(i,o,[c,l,this]))return l;l++}return-1}filter(i,o){const l=[];let c=0;for(const u of this)Reflect.apply(i,o,[u,c,this])&&l.push(u),c++;return new ti(l)}map(i,o){const l=[];let c=0;for(const u of this)l.push([u[0],Reflect.apply(i,o,[u,c,this])]),c++;return new ti(l)}reduce(...i){const[o,l]=i;let c=0,u=l??this.at(0);for(const h of this)c===0&&i.length===1?u=h:u=Reflect.apply(o,this,[u,h,c,this]),c++;return u}reduceRight(...i){const[o,l]=i;let c=l??this.at(-1);for(let u=this.size-1;u>=0;u--){const h=this.at(u);u===this.size-1&&i.length===1?c=h:c=Reflect.apply(o,this,[c,h,u,this])}return c}toSorted(i){const o=[...this.entries()].sort(i);return new ti(o)}toReversed(){const i=new ti;for(let o=this.size-1;o>=0;o--){const l=this.keyAt(o),c=this.get(l);i.set(l,c)}return i}toSpliced(...i){const o=[...this.entries()];return o.splice(...i),new ti(o)}slice(i,o){const l=new ti;let c=this.size-1;if(i===void 0)return l;i<0&&(i=i+this.size),o!==void 0&&o>0&&(c=o-1);for(let u=i;u<=c;u++){const h=this.keyAt(u),f=this.get(h);l.set(h,f)}return l}every(i,o){let l=0;for(const c of this){if(!Reflect.apply(i,o,[c,l,this]))return!1;l++}return!0}some(i,o){let l=0;for(const c of this){if(Reflect.apply(i,o,[c,l,this]))return!0;l++}return!1}},_n=new WeakMap,Un(ti,"OrderedDict"),ti);function dh(e,n){if("at"in Array.prototype)return Array.prototype.at.call(e,n);const i=ek(e,n);return i===-1?void 0:e[i]}Un(dh,"at");function ek(e,n){const i=e.length,o=Pv(n),l=o>=0?o:i+o;return l<0||l>=i?-1:l}Un(ek,"toSafeIndex");function Pv(e){return e!==e||e===0?0:Math.trunc(e)}Un(Pv,"toSafeInteger");function QE(e){const n=e+"CollectionProvider",[i,o]=qo(n),[l,c]=i(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Fp,setItemMap:Un(()=>{},"setItemMap")}),u=Un(({state:E,...T})=>E?r.jsx(f,{...T,state:E}):r.jsx(h,{...T}),"CollectionProvider");u.displayName=n;const h=Un(E=>{const T=N();return r.jsx(f,{...E,state:T})},"CollectionInit");h.displayName=n+"Init";const f=Un(E=>{const{scope:T,children:R,state:_}=E,L=j.useRef(null),[I,H]=j.useState(null),O=qt(L,H),[P,U]=_;return j.useEffect(()=>{if(!I)return;const Y=ak(()=>{});return Y.observe(I,{childList:!0,subtree:!0}),()=>{Y.disconnect()}},[I]),r.jsx(l,{scope:T,itemMap:P,setItemMap:U,collectionRef:O,collectionRefObject:L,collectionElement:I,children:R})},"CollectionProviderImpl");f.displayName=n+"Impl";const v=e+"CollectionSlot",y=cr(v),p=j.forwardRef((E,T)=>{const{scope:R,children:_}=E,L=c(v,R),I=qt(T,L.collectionRef);return r.jsx(y,{ref:I,children:_})});p.displayName=v;const w=e+"CollectionItemSlot",b="data-radix-collection-item",k=cr(w),S=j.forwardRef((E,T)=>{const{scope:R,children:_,...L}=E,I=j.useRef(null),[H,O]=j.useState(null),P=qt(T,I,O),U=c(w,R),{setItemMap:Y}=U,K=j.useRef(L);tk(K.current,L)||(K.current=L);const q=K.current;return j.useEffect(()=>{const Q=q;return Y(V=>H?V.has(H)?V.set(H,{...Q,element:H}).toSorted(H0):(V.set(H,{...Q,element:H}),V.toSorted(H0)):V),()=>{Y(V=>!H||!V.has(H)?V:(V.delete(H),new Fp(V)))}},[H,q,Y]),r.jsx(k,{[b]:"",ref:P,children:_})});S.displayName=w;function N(){return j.useState(new Fp)}Un(N,"useInitCollection");function C(E){const{itemMap:T}=c(e+"CollectionConsumer",E);return T}return Un(C,"useCollection"),[{Provider:u,Slot:p,ItemSlot:S},{createCollectionScope:o,useCollection:C,useInitCollection:N}]}Un(QE,"createCollection");function tk(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),o=Object.keys(n);if(i.length!==o.length)return!1;for(const l of i)if(!Object.prototype.hasOwnProperty.call(n,l)||e[l]!==n[l])return!1;return!0}Un(tk,"shallowEqual");function nk(e,n){return!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Un(nk,"isElementPreceding");function H0(e,n){return!e[1].element||!n[1].element?0:nk(e[1].element,n[1].element)?-1:1}Un(H0,"sortByDocumentPosition");function ak(e){return new MutationObserver(i=>{for(const o of i)if(o.type==="childList"){e();return}})}Un(ak,"getChildListObserver");var ZE=Object.defineProperty,Hl=(e,n)=>ZE(e,"name",{value:n,configurable:!0}),ik=!!(typeof window<"u"&&window.document&&window.document.createElement);function _t(e,n,{checkForDefaultPrevented:i=!0}={}){return Hl(function(l){if(e==null||e(l),i===!1||!l||!l.defaultPrevented)return n==null?void 0:n(l)},"handleEvent")}Hl(_t,"composeEventHandlers");function WE(e){var n;if(!ik)throw new Error("Cannot access window outside of the DOM");return((n=e==null?void 0:e.ownerDocument)==null?void 0:n.defaultView)??window}Hl(WE,"getOwnerWindow");function U0(e){if(!ik)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Hl(U0,"getOwnerDocument");function rk(e,n=!1){const{activeElement:i}=U0(e);if(!(i!=null&&i.nodeName))return null;if(ok(i)&&i.contentDocument)return rk(i.contentDocument.body,n);if(n){const o=i.getAttribute("aria-activedescendant");if(o){const l=U0(i).getElementById(o);if(l)return l}}return i}Hl(rk,"getActiveElement");function ok(e){return e.tagName==="IFRAME"}Hl(ok,"isFrame");var ea=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},JE=Object.defineProperty,eT=(e,n)=>JE(e,"name",{value:n,configurable:!0}),ub=cu[" useEffectEvent ".trim().toString()],db=cu[" useInsertionEffect ".trim().toString()];function sk(e){if(typeof ub=="function")return ub(e);const n=j.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof db=="function"?db(()=>{n.current=e}):ea(()=>{n.current=e}),j.useMemo(()=>((...i)=>{var o;return(o=n.current)==null?void 0:o.call(n,...i)}),[])}eT(sk,"useEffectEvent");var tT=Object.defineProperty,hu=(e,n)=>tT(e,"name",{value:n,configurable:!0}),nT=cu[" useInsertionEffect ".trim().toString()]||ea;function eu({prop:e,defaultProp:n,onChange:i=hu(()=>{},"onChange"),caller:o}){const[l,c,u]=lk({defaultProp:n,onChange:i}),h=e!==void 0,f=h?e:l,v=j.useCallback(y=>{var p;if(h){const w=ck(y)?y(e):y;w!==e&&((p=u.current)==null||p.call(u,w))}else c(y)},[h,e,c,u]);return[f,v]}hu(eu,"useControllableState");function lk({defaultProp:e,onChange:n}){const[i,o]=j.useState(e),l=j.useRef(i),c=j.useRef(n);return nT(()=>{c.current=n},[n]),j.useEffect(()=>{var u;l.current!==i&&((u=c.current)==null||u.call(c,i),l.current=i)},[i,l]),[i,o,c]}hu(lk,"useUncontrolledState");function ck(e){return typeof e=="function"}hu(ck,"isFunction");var hb=Symbol("RADIX:SYNC_STATE");function aT(e,n,i,o){const{prop:l,defaultProp:c,onChange:u,caller:h}=n,f=l!==void 0,v=sk(u),y=[{...i,state:c}];o&&y.push(o);const[p,w]=j.useReducer((N,C)=>{if(C.type===hb)return{...N,state:C.state};const A=e(N,C);return f&&!Object.is(A.state,N.state)&&v(A.state),A},...y),b=p.state,k=j.useRef(b);j.useEffect(()=>{k.current!==b&&(k.current=b,f||v(b))},[b,k,f]);const S=j.useMemo(()=>l!==void 0?{...p,state:l}:p,[p,l]);return j.useEffect(()=>{f&&!Object.is(l,p.state)&&w({type:hb,state:l})},[l,p.state,f]),[S,w]}hu(aT,"useControllableStateReducer");var iT=Object.defineProperty,Ur=(e,n)=>iT(e,"name",{value:n,configurable:!0});function uk(e,n){return j.useReducer((i,o)=>n[i][o]??i,e)}Ur(uk,"useStateMachine");var mr=Ur(e=>{const{present:n,children:i}=e,o=dk(n),l=typeof i=="function"?i({present:o.isPresent}):j.Children.only(i),c=hk(o.ref,fk(l));return typeof i=="function"||o.isPresent?j.cloneElement(l,{ref:c}):null},"Presence");function dk(e){const[n,i]=j.useState(),o=j.useRef(null),l=j.useRef(e),c=j.useRef("none"),u=j.useRef(void 0),h=e?"mounted":"unmounted",[f,v]=uk(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{f==="mounted"?(c.current=u.current??_l(o.current),u.current=void 0):c.current="none"},[f]),ea(()=>{const y=o.current,p=l.current;if(p!==e){const b=c.current,k=_l(y);e?(u.current=k,v("MOUNT")):k==="none"||(y==null?void 0:y.display)==="none"?v("UNMOUNT"):v(p&&b!==k?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,v]),ea(()=>{if(n){let y;const p=n.ownerDocument.defaultView??window,w=Ur(k=>{const N=_l(o.current).includes(CSS.escape(k.animationName));if(k.target===n&&N&&(v("ANIMATION_END"),!l.current)){const C=n.style.animationFillMode;n.style.animationFillMode="forwards",y=p.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=C)})}},"handleAnimationEnd"),b=Ur(k=>{k.target===n&&(c.current=_l(o.current))},"handleAnimationStart");return n.addEventListener("animationstart",b),n.addEventListener("animationcancel",w),n.addEventListener("animationend",w),()=>{p.clearTimeout(y),n.removeEventListener("animationstart",b),n.removeEventListener("animationcancel",w),n.removeEventListener("animationend",w)}}else v("ANIMATION_END")},[n,v]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:j.useCallback(y=>{if(y){const p=getComputedStyle(y);o.current=p,u.current=_l(p)}else o.current=null;i(y)},[])}}Ur(dk,"usePresence");function $0(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}Ur($0,"setRef");function hk(...e){const n=j.useRef(e);return n.current=e,j.useCallback(i=>{const o=n.current;let l=!1;const c=o.map(u=>{const h=$0(u,i);return!l&&typeof h=="function"&&(l=!0),h});if(l)return()=>{for(let u=0;u<c.length;u++){const h=c[u];typeof h=="function"?h():$0(o[u],null)}}},[])}Ur(hk,"useStableComposedRefs");function _l(e){return(e==null?void 0:e.animationName)||"none"}Ur(_l,"getAnimationName");function fk(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.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)}Ur(fk,"getElementRef");var rT=Object.defineProperty,oT=(e,n)=>rT(e,"name",{value:n,configurable:!0}),sT=cu[" useId ".trim().toString()]||(()=>{}),lT=0;function As(e){const[n,i]=j.useState(sT());return ea(()=>{e||i(o=>o??String(lT++))},[e]),e||(n?`radix-${n}`:"")}oT(As,"useId");var cT=Object.defineProperty,uT=(e,n)=>cT(e,"name",{value:n,configurable:!0}),dT=j.createContext(void 0);function qv(e){const n=j.useContext(dT);return e||n||"ltr"}uT(qv,"useDirection");var hT=Object.defineProperty,fT=(e,n)=>hT(e,"name",{value:n,configurable:!0});function Jn(e){const n=j.useRef(e);return j.useEffect(()=>{n.current=e}),j.useMemo(()=>((...i)=>{var o;return(o=n.current)==null?void 0:o.call(n,...i)}),[])}fT(Jn,"useCallbackRef");var mT=Object.defineProperty,Hn=(e,n)=>mT(e,"name",{value:n,configurable:!0}),V0="dismissableLayer.update",pT="dismissableLayer.pointerDownOutside",vT="dismissableLayer.focusOutside",fb,mk=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Fv=j.forwardRef(Hn(function(n,i){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:l=!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:f,onDismiss:v,...y}=n,p=j.useContext(mk),[w,b]=j.useState(null),k=(w==null?void 0:w.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=j.useState({}),N=qt(i,b),C=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),E=A?C.indexOf(A):-1,T=w?C.indexOf(w):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,_=T>=E,L=j.useRef(!1),I=vk(U=>{u==null||u(U),f==null||f(U),U.defaultPrevented||v==null||v()},{ownerDocument:k,deferPointerDownOutside:l,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:j.useCallback(U=>{if(!(U instanceof Node))return!1;const Y=[...p.branches].some(K=>K.contains(U));return _&&!Y},[p.branches,_])}),H=gk(U=>{if(l&&L.current)return;const Y=U.target;[...p.branches].some(q=>q.contains(Y))||(h==null||h(U),f==null||f(U),U.defaultPrevented||v==null||v())},k),O=w?T===C.length-1:!1,P=Jn(U=>{U.key==="Escape"&&(c==null||c(U),!U.defaultPrevented&&v&&(U.preventDefault(),v()))});return j.useEffect(()=>{if(O)return k.addEventListener("keydown",P,{capture:!0}),()=>k.removeEventListener("keydown",P,{capture:!0})},[k,O,P]),j.useEffect(()=>{if(w)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(fb=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(w)),p.layers.add(w),G0(),()=>{o&&(p.layersWithOutsidePointerEventsDisabled.delete(w),p.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=fb))}},[w,k,o,p]),j.useEffect(()=>()=>{w&&(p.layers.delete(w),p.layersWithOutsidePointerEventsDisabled.delete(w),G0())},[w,p]),j.useEffect(()=>{const U=Hn(()=>S({}),"handleUpdate");return document.addEventListener(V0,U),()=>document.removeEventListener(V0,U)},[]),r.jsx(hn.div,{...y,ref:N,style:{pointerEvents:R?_?"auto":"none":void 0,...n.style},onFocusCapture:_t(n.onFocusCapture,H.onFocusCapture),onBlurCapture:_t(n.onBlurCapture,H.onBlurCapture),onPointerDownCapture:_t(n.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function pk(){const e=j.useContext(mk),[n,i]=j.useState(null);return j.useEffect(()=>{if(n)return e.dismissableSurfaces.add(n),()=>{e.dismissableSurfaces.delete(n)}},[n,e.dismissableSurfaces]),i}Hn(pk,"useDismissableLayerSurface");var gT=Hn(()=>!0,"IS_TRUE");function vk(e,n){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:l,dismissableSurfaces:c,shouldHandlePointerDownOutside:u=gT}=n,h=Jn(e),f=j.useRef(!1),v=j.useRef(!1),y=j.useRef(new Map),p=j.useRef(()=>{});return j.useEffect(()=>{function w(){v.current=!1,l.current=!1,y.current.clear()}Hn(w,"resetOutsideInteraction");function b(){return Array.from(y.current.values()).some(Boolean)}Hn(b,"isOutsideInteractionIntercepted");function k(E){if(!v.current)return;const T=E.target;T instanceof Node&&[...c].some(_=>_.contains(T))||y.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{v.current&&p.current()},0)}Hn(k,"handleInteractionCapture");function S(E){v.current&&y.current.set(E.type,!1)}Hn(S,"handleInteractionBubble");const N=Hn(E=>{if(E.target&&!f.current){let T=function(){i.removeEventListener("click",p.current);const _=b();w(),_||Hv(pT,h,R,{discrete:!0})};if(Hn(T,"handleAndDispatchPointerDownOutsideEvent"),!u(E.target)){i.removeEventListener("click",p.current),w(),f.current=!1;return}const R={originalEvent:E};v.current=!0,l.current=o&&E.button===0,y.current.clear(),!o||E.button!==0?T():(i.removeEventListener("click",p.current),p.current=T,i.addEventListener("click",p.current,{once:!0}))}else i.removeEventListener("click",p.current),w();f.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 A=window.setTimeout(()=>{i.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(A),i.removeEventListener("pointerdown",N),i.removeEventListener("click",p.current);for(const E of C)i.removeEventListener(E,k,!0),i.removeEventListener(E,S)}},[i,h,o,l,c,u]),{onPointerDownCapture:Hn(()=>f.current=!0,"onPointerDownCapture")}}Hn(vk,"usePointerDownOutside");function gk(e,n=globalThis==null?void 0:globalThis.document){const i=Jn(e),o=j.useRef(!1);return j.useEffect(()=>{const l=Hn(c=>{c.target&&!o.current&&Hv(vT,i,{originalEvent:c},{discrete:!1})},"handleFocus");return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,i]),{onFocusCapture:Hn(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Hn(()=>o.current=!1,"onBlurCapture")}}Hn(gk,"useFocusOutside");function G0(){const e=new CustomEvent(V0);document.dispatchEvent(e)}Hn(G0,"dispatchUpdate");function Hv(e,n,i,{discrete:o}){const l=i.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&l.addEventListener(e,n,{once:!0}),o?Z3(l,c):l.dispatchEvent(c)}Hn(Hv,"handleAndDispatchCustomEvent");var yT=Object.defineProperty,wa=(e,n)=>yT(e,"name",{value:n,configurable:!0}),Hp="focusScope.autoFocusOnMount",Up="focusScope.autoFocusOnUnmount",mb={bubbles:!1,cancelable:!0},Uv=j.forwardRef(wa(function(n,i){const{loop:o=!1,trapped:l=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...h}=n,[f,v]=j.useState(null),y=Jn(c),p=Jn(u),w=j.useRef(null),b=qt(i,v),k=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(l){let N=function(T){if(k.paused||!f)return;const R=T.target;f.contains(R)?w.current=R:Br(w.current,{select:!0})},C=function(T){if(k.paused||!f)return;const R=T.relatedTarget;R!==null&&(f.contains(R)||Br(w.current,{select:!0}))},A=function(T){if(document.activeElement===document.body)for(const _ of T)_.removedNodes.length>0&&Br(f)};wa(N,"handleFocusIn"),wa(C,"handleFocusOut"),wa(A,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",C);const E=new MutationObserver(A);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",C),E.disconnect()}}},[l,f,k.paused]),j.useEffect(()=>{if(f){pb.add(k);const N=document.activeElement;if(!f.contains(N)){const A=new CustomEvent(Hp,mb);f.addEventListener(Hp,y),f.dispatchEvent(A),A.defaultPrevented||(yk(kk($v(f)),{select:!0}),document.activeElement===N&&Br(f))}return()=>{f.removeEventListener(Hp,y),setTimeout(()=>{const A=new CustomEvent(Up,mb);f.addEventListener(Up,p),f.dispatchEvent(A),A.defaultPrevented||Br(N??document.body,{select:!0}),f.removeEventListener(Up,p),pb.remove(k)},0)}}},[f,y,p,k]);const S=j.useCallback(N=>{if(!o&&!l||k.paused)return;const C=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,A=document.activeElement;if(C&&A){const E=N.currentTarget,[T,R]=xk(E);T&&R?!N.shiftKey&&A===R?(N.preventDefault(),o&&Br(T,{select:!0})):N.shiftKey&&A===T&&(N.preventDefault(),o&&Br(R,{select:!0})):A===E&&N.preventDefault()}},[o,l,k.paused]);return r.jsx(hn.div,{tabIndex:-1,...h,ref:b,onKeyDown:S})},"FocusScope"));function yk(e,{select:n=!1}={}){const i=document.activeElement;for(const o of e)if(Br(o,{select:n}),document.activeElement!==i)return}wa(yk,"focusFirst");function xk(e){const n=$v(e),i=Y0(n,e),o=Y0(n.reverse(),e);return[i,o]}wa(xk,"getTabbableEdges");function $v(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:wa(o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;i.nextNode();)n.push(i.currentNode);return n}wa($v,"getTabbableCandidates");function Y0(e,n){const i=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const o of e)if(!(i?!o.checkVisibility({checkVisibilityCSS:!0}):bk(o,{upTo:n})))return o}wa(Y0,"findVisible");function bk(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}wa(bk,"isHidden");function jk(e){return e instanceof HTMLInputElement&&"select"in e}wa(jk,"isSelectableInput");function Br(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&jk(e)&&n&&e.select()}}wa(Br,"focus");var pb=wk();function wk(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=K0(e,n),e.unshift(n)},remove(n){var i;e=K0(e,n),(i=e[0])==null||i.resume()}}}wa(wk,"createFocusScopesStack");function K0(e,n){const i=[...e],o=i.indexOf(n);return o!==-1&&i.splice(o,1),i}wa(K0,"arrayRemove");function kk(e){return e.filter(n=>n.tagName!=="A")}wa(kk,"removeLinks");var xT=Object.defineProperty,bT=(e,n)=>xT(e,"name",{value:n,configurable:!0}),Vv=j.forwardRef(bT(function(n,i){var f;const{container:o,...l}=n,[c,u]=j.useState(!1);ea(()=>u(!0),[]);const h=o||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return h?Po.createPortal(r.jsx(hn.div,{...l,ref:i}),h):null},"Portal")),jT=Object.defineProperty,Gv=(e,n)=>jT(e,"name",{value:n,configurable:!0}),Fd=0,tr=null;function wT(e){return fu(),e.children}Gv(wT,"FocusGuards");function fu(){j.useEffect(()=>{tr||(tr={start:X0(),end:X0()});const{start:e,end:n}=tr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Fd++,()=>{Fd===1&&(tr==null||tr.start.remove(),tr==null||tr.end.remove(),tr=null),Fd=Math.max(0,Fd-1)}},[])}Gv(fu,"useFocusGuards");function X0(){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}Gv(X0,"createFocusGuard");var ar=function(){return ar=Object.assign||function(n){for(var i,o=1,l=arguments.length;o<l;o++){i=arguments[o];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(n[c]=i[c])}return n},ar.apply(this,arguments)};function Sk(e,n){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(i[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(i[o[l]]=e[o[l]]);return i}function kT(e,n,i){if(i||arguments.length===2)for(var o=0,l=n.length,c;o<l;o++)(c||!(o in n))&&(c||(c=Array.prototype.slice.call(n,0,o)),c[o]=n[o]);return e.concat(c||Array.prototype.slice.call(n))}var hh="right-scroll-bar-position",fh="width-before-scroll-bar",ST="with-scroll-bars-hidden",CT="--removed-body-scroll-bar-size";function $p(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function NT(e,n){var i=j.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(o){var l=i.value;l!==o&&(i.value=o,i.callback(o,l))}}}})[0];return i.callback=n,i.facade}var ET=typeof window<"u"?j.useLayoutEffect:j.useEffect,vb=new WeakMap;function TT(e,n){var i=NT(null,function(o){return e.forEach(function(l){return $p(l,o)})});return ET(function(){var o=vb.get(i);if(o){var l=new Set(o),c=new Set(e),u=i.current;l.forEach(function(h){c.has(h)||$p(h,null)}),c.forEach(function(h){l.has(h)||$p(h,u)})}vb.set(i,e)},[e]),i}function AT(e){return e}function MT(e,n){n===void 0&&(n=AT);var i=[],o=!1,l={read:function(){if(o)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 u=n(c,o);return i.push(u),function(){i=i.filter(function(h){return h!==u})}},assignSyncMedium:function(c){for(o=!0;i.length;){var u=i;i=[],u.forEach(c)}i={push:function(h){return c(h)},filter:function(){return i}}},assignMedium:function(c){o=!0;var u=[];if(i.length){var h=i;i=[],h.forEach(c),u=i}var f=function(){var y=u;u=[],y.forEach(c)},v=function(){return Promise.resolve().then(f)};v(),i={push:function(y){u.push(y),v()},filter:function(y){return u=u.filter(y),i}}}};return l}function _T(e){e===void 0&&(e={});var n=MT(null);return n.options=ar({async:!0,ssr:!1},e),n}var Ck=function(e){var n=e.sideCar,i=Sk(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return j.createElement(o,ar({},i))};Ck.isSideCarExport=!0;function RT(e,n){return e.useMedium(n),Ck}var Nk=_T(),Vp=function(){},$h=j.forwardRef(function(e,n){var i=j.useRef(null),o=j.useState({onScrollCapture:Vp,onWheelCapture:Vp,onTouchMoveCapture:Vp}),l=o[0],c=o[1],u=e.forwardProps,h=e.children,f=e.className,v=e.removeScrollBar,y=e.enabled,p=e.shards,w=e.sideCar,b=e.noRelative,k=e.noIsolation,S=e.inert,N=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,E=e.gapMode,T=Sk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=w,_=TT([i,n]),L=ar(ar({},T),l);return j.createElement(j.Fragment,null,y&&j.createElement(R,{sideCar:Nk,removeScrollBar:v,shards:p,noRelative:b,noIsolation:k,inert:S,setCallbacks:c,allowPinchZoom:!!N,lockRef:i,gapMode:E}),u?j.cloneElement(j.Children.only(h),ar(ar({},L),{ref:_})):j.createElement(A,ar({},L,{className:f,ref:_}),h))});$h.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$h.classNames={fullWidth:fh,zeroRight:hh};var OT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function DT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=OT();return n&&e.setAttribute("nonce",n),e}function zT(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function LT(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var BT=function(){var e=0,n=null;return{add:function(i){e==0&&(n=DT())&&(zT(n,i),LT(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},IT=function(){var e=BT();return function(n,i){j.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},Ek=function(){var e=IT(),n=function(i){var o=i.styles,l=i.dynamic;return e(o,l),null};return n},PT={left:0,top:0,right:0,gap:0},Gp=function(e){return parseInt(e||"",10)||0},qT=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[Gp(i),Gp(o),Gp(l)]},FT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PT;var n=qT(e),i=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-i+n[2]-n[0])}},HT=Ek(),Dl="data-scroll-locked",UT=function(e,n,i,o){var l=e.left,c=e.top,u=e.right,h=e.gap;return i===void 0&&(i="margin"),`
560
+ .`.concat(ST,` {
561
+ overflow: hidden `).concat(o,`;
562
+ padding-right: `).concat(h,"px ").concat(o,`;
563
+ }
564
+ body[`).concat(Dl,`] {
565
+ overflow: hidden `).concat(o,`;
566
+ overscroll-behavior: contain;
567
+ `).concat([n&&"position: relative ".concat(o,";"),i==="margin"&&`
568
+ padding-left: `.concat(l,`px;
569
+ padding-top: `).concat(c,`px;
570
+ padding-right: `).concat(u,`px;
571
+ margin-left:0;
572
+ margin-top:0;
573
+ margin-right: `).concat(h,"px ").concat(o,`;
574
+ `),i==="padding"&&"padding-right: ".concat(h,"px ").concat(o,";")].filter(Boolean).join(""),`
575
+ }
576
+
577
+ .`).concat(hh,` {
578
+ right: `).concat(h,"px ").concat(o,`;
579
+ }
580
+
581
+ .`).concat(fh,` {
582
+ margin-right: `).concat(h,"px ").concat(o,`;
583
+ }
584
+
585
+ .`).concat(hh," .").concat(hh,` {
586
+ right: 0 `).concat(o,`;
587
+ }
588
+
589
+ .`).concat(fh," .").concat(fh,` {
590
+ margin-right: 0 `).concat(o,`;
591
+ }
592
+
593
+ body[`).concat(Dl,`] {
594
+ `).concat(CT,": ").concat(h,`px;
595
+ }
596
+ `)},gb=function(){var e=parseInt(document.body.getAttribute(Dl)||"0",10);return isFinite(e)?e:0},$T=function(){j.useEffect(function(){return document.body.setAttribute(Dl,(gb()+1).toString()),function(){var e=gb()-1;e<=0?document.body.removeAttribute(Dl):document.body.setAttribute(Dl,e.toString())}},[])},VT=function(e){var n=e.noRelative,i=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;$T();var c=j.useMemo(function(){return FT(l)},[l]);return j.createElement(HT,{styles:UT(c,!n,l,i?"":"!important")})},Q0=!1;if(typeof window<"u")try{var Hd=Object.defineProperty({},"passive",{get:function(){return Q0=!0,!0}});window.addEventListener("test",Hd,Hd),window.removeEventListener("test",Hd,Hd)}catch{Q0=!1}var Cl=Q0?{passive:!1}:!1,GT=function(e){return e.tagName==="TEXTAREA"},Tk=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")},YT=function(e){return Tk(e,"overflowY")},KT=function(e){return Tk(e,"overflowX")},yb=function(e,n){var i=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=Ak(e,o);if(l){var c=Mk(e,o),u=c[1],h=c[2];if(u>h)return!0}o=o.parentNode}while(o&&o!==i.body);return!1},XT=function(e){var n=e.scrollTop,i=e.scrollHeight,o=e.clientHeight;return[n,i,o]},QT=function(e){var n=e.scrollLeft,i=e.scrollWidth,o=e.clientWidth;return[n,i,o]},Ak=function(e,n){return e==="v"?YT(n):KT(n)},Mk=function(e,n){return e==="v"?XT(n):QT(n)},ZT=function(e,n){return e==="h"&&n==="rtl"?-1:1},WT=function(e,n,i,o,l){var c=ZT(e,window.getComputedStyle(n).direction),u=c*o,h=i.target,f=n.contains(h),v=!1,y=u>0,p=0,w=0;do{if(!h)break;var b=Mk(e,h),k=b[0],S=b[1],N=b[2],C=S-N-c*k;(k||C)&&Ak(e,h)&&(p+=C,w+=k);var A=h.parentNode;h=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&h!==document.body||f&&(n.contains(h)||n===h));return(y&&Math.abs(p)<1||!y&&Math.abs(w)<1)&&(v=!0),v},Ud=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xb=function(e){return[e.deltaX,e.deltaY]},bb=function(e){return e&&"current"in e?e.current:e},JT=function(e,n){return e[0]===n[0]&&e[1]===n[1]},eA=function(e){return`
597
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
598
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
599
+ `)},tA=0,Nl=[];function nA(e){var n=j.useRef([]),i=j.useRef([0,0]),o=j.useRef(),l=j.useState(tA++)[0],c=j.useState(Ek)[0],u=j.useRef(e);j.useEffect(function(){u.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=kT([e.lockRef.current],(e.shards||[]).map(bb),!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 h=j.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var C=Ud(S),A=i.current,E="deltaX"in S?S.deltaX:A[0]-C[0],T="deltaY"in S?S.deltaY:A[1]-C[1],R,_=S.target,L=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in S&&L==="h"&&_.type==="range")return!1;var I=window.getSelection(),H=I&&I.anchorNode,O=H?H===_||H.contains(_):!1;if(O)return!1;var P=yb(L,_);if(!P)return!0;if(P?R=L:(R=L==="v"?"h":"v",P=yb(L,_)),!P)return!1;if(!o.current&&"changedTouches"in S&&(E||T)&&(o.current=R),!R)return!0;var U=o.current||R;return WT(U,N,S,U==="h"?E:T)},[]),f=j.useCallback(function(S){var N=S;if(!(!Nl.length||Nl[Nl.length-1]!==c)){var C="deltaY"in N?xb(N):Ud(N),A=n.current.filter(function(R){return R.name===N.type&&(R.target===N.target||N.target===R.shadowParent)&&JT(R.delta,C)})[0];if(A&&A.should){N.cancelable&&N.preventDefault();return}if(!A){var E=(u.current.shards||[]).map(bb).filter(Boolean).filter(function(R){return R.contains(N.target)}),T=E.length>0?h(N,E[0]):!u.current.noIsolation;T&&N.cancelable&&N.preventDefault()}}},[]),v=j.useCallback(function(S,N,C,A){var E={name:S,delta:N,target:C,should:A,shadowParent:aA(C)};n.current.push(E),setTimeout(function(){n.current=n.current.filter(function(T){return T!==E})},1)},[]),y=j.useCallback(function(S){i.current=Ud(S),o.current=void 0},[]),p=j.useCallback(function(S){v(S.type,xb(S),S.target,h(S,e.lockRef.current))},[]),w=j.useCallback(function(S){v(S.type,Ud(S),S.target,h(S,e.lockRef.current))},[]);j.useEffect(function(){return Nl.push(c),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:w}),document.addEventListener("wheel",f,Cl),document.addEventListener("touchmove",f,Cl),document.addEventListener("touchstart",y,Cl),function(){Nl=Nl.filter(function(S){return S!==c}),document.removeEventListener("wheel",f,Cl),document.removeEventListener("touchmove",f,Cl),document.removeEventListener("touchstart",y,Cl)}},[]);var b=e.removeScrollBar,k=e.inert;return j.createElement(j.Fragment,null,k?j.createElement(c,{styles:eA(l)}):null,b?j.createElement(VT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aA(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const iA=RT(Nk,nA);var Vh=j.forwardRef(function(e,n){return j.createElement($h,ar({},e,{ref:n,sideCar:iA}))});Vh.classNames=$h.classNames;var rA=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},El=new WeakMap,$d=new WeakMap,Vd={},Yp=0,_k=function(e){return e&&(e.host||_k(e.parentNode))},oA=function(e,n){return n.map(function(i){if(e.contains(i))return i;var o=_k(i);return o&&e.contains(o)?o:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},sA=function(e,n,i,o){var l=oA(n,Array.isArray(e)?e:[e]);Vd[i]||(Vd[i]=new WeakMap);var c=Vd[i],u=[],h=new Set,f=new Set(l),v=function(p){!p||h.has(p)||(h.add(p),v(p.parentNode))};l.forEach(v);var y=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(w){if(h.has(w))y(w);else try{var b=w.getAttribute(o),k=b!==null&&b!=="false",S=(El.get(w)||0)+1,N=(c.get(w)||0)+1;El.set(w,S),c.set(w,N),u.push(w),S===1&&k&&$d.set(w,!0),N===1&&w.setAttribute(i,"true"),k||w.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",w,C)}})};return y(n),h.clear(),Yp++,function(){u.forEach(function(p){var w=El.get(p)-1,b=c.get(p)-1;El.set(p,w),c.set(p,b),w||($d.has(p)||p.removeAttribute(o),$d.delete(p)),b||p.removeAttribute(i)}),Yp--,Yp||(El=new WeakMap,El=new WeakMap,$d=new WeakMap,Vd={})}},Yv=function(e,n,i){i===void 0&&(i="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=rA(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),sA(o,l,i,"aria-hidden")):function(){return null}},lA=Object.defineProperty,Bi=(e,n)=>lA(e,"name",{value:n,configurable:!0}),Kv="Dialog",[Rk,G$]=qo(Kv),[cA,Xr]=Rk(Kv),uA=Bi(e=>{const{__scopeDialog:n,children:i,open:o,defaultOpen:l,onOpenChange:c,modal:u=!0}=e,h=j.useRef(null),f=j.useRef(null),[v,y]=eu({prop:o,defaultProp:l??!1,onChange:c,caller:Kv}),[p,w]=j.useState(0),[b,k]=j.useState(0);return r.jsx(cA,{scope:n,triggerRef:h,contentRef:f,contentId:As(),titleId:As(),descriptionId:As(),titlePresent:p>0,descriptionPresent:b>0,setTitleCount:w,setDescriptionCount:k,open:v,onOpenChange:y,onOpenToggle:j.useCallback(()=>y(S=>!S),[y]),modal:u,children:i})},"Dialog"),Ok="DialogPortal",[dA,Dk]=Rk(Ok,{forceMount:void 0}),hA=Bi(e=>{const{__scopeDialog:n,forceMount:i,children:o,container:l}=e,c=Xr(Ok,n);return r.jsx(dA,{scope:n,forceMount:i,children:j.Children.map(o,u=>r.jsx(mr,{present:i||c.open,children:r.jsx(Vv,{asChild:!0,container:l,children:u})}))})},"DialogPortal"),Z0="DialogOverlay",fA=j.forwardRef(Bi(function(n,i){const o=Dk(Z0,n.__scopeDialog),{forceMount:l=o.forceMount,...c}=n,u=Xr(Z0,n.__scopeDialog);return u.modal?r.jsx(mr,{present:l||u.open,children:r.jsx(pA,{...c,ref:i})}):null},"DialogOverlay")),mA=cr("DialogOverlay.RemoveScroll"),pA=j.forwardRef(Bi(function(n,i){const{__scopeDialog:o,...l}=n,c=Xr(Z0,o),u=pk(),h=qt(i,u);return r.jsx(Vh,{as:mA,allowPinchZoom:!0,shards:[c.contentRef],children:r.jsx(hn.div,{"data-state":Xv(c.open),...l,ref:h,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),tu="DialogContent",vA=j.forwardRef(Bi(function(n,i){const o=Dk(tu,n.__scopeDialog),{forceMount:l=o.forceMount,...c}=n,u=Xr(tu,n.__scopeDialog);return r.jsx(mr,{present:l||u.open,children:u.modal?r.jsx(gA,{...c,ref:i}):r.jsx(yA,{...c,ref:i})})},"DialogContent")),gA=j.forwardRef(Bi(function(n,i){const o=Xr(tu,n.__scopeDialog),l=j.useRef(null),c=qt(i,o.contentRef,l);return j.useEffect(()=>{const u=l.current;if(u)return Yv(u)},[]),r.jsx(zk,{...n,ref:c,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:_t(n.onCloseAutoFocus,u=>{var h;u.preventDefault(),(h=o.triggerRef.current)==null||h.focus()}),onPointerDownOutside:_t(n.onPointerDownOutside,u=>{const h=u.detail.originalEvent,f=h.button===0&&h.ctrlKey===!0;(h.button===2||f)&&u.preventDefault()}),onFocusOutside:_t(n.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),yA=j.forwardRef(Bi(function(n,i){const o=Xr(tu,n.__scopeDialog),l=j.useRef(!1),c=j.useRef(!1);return r.jsx(zk,{...n,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var h,f;(h=n.onCloseAutoFocus)==null||h.call(n,u),u.defaultPrevented||(l.current||(f=o.triggerRef.current)==null||f.focus(),u.preventDefault()),l.current=!1,c.current=!1},onInteractOutside:u=>{var v,y;(v=n.onInteractOutside)==null||v.call(n,u),u.defaultPrevented||(l.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const h=u.target;((y=o.triggerRef.current)==null?void 0:y.contains(h))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})},"DialogContentNonModal")),zk=j.forwardRef(Bi(function(n,i){const{__scopeDialog:o,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:u,...h}=n,f=Xr(tu,o);return fu(),r.jsx(r.Fragment,{children:r.jsx(Uv,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:c,onUnmountAutoFocus:u,children:r.jsx(Fv,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":Xv(f.open),...h,ref:i,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),xA="DialogTitle",bA=j.forwardRef(Bi(function(n,i){const{__scopeDialog:o,...l}=n,c=Xr(xA,o),{setTitleCount:u}=c;return ea(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),r.jsx(hn.h2,{id:c.titleId,...l,ref:i})},"DialogTitle")),jA="DialogClose",wA=j.forwardRef(Bi(function(n,i){const{__scopeDialog:o,...l}=n,c=Xr(jA,o);return r.jsx(hn.button,{type:"button",...l,ref:i,onClick:_t(n.onClick,()=>c.onOpenChange(!1))})},"DialogClose"));function Xv(e){return e?"open":"closed"}Bi(Xv,"getState");var kA=Object.defineProperty,SA=(e,n)=>kA(e,"name",{value:n,configurable:!0});function Lk(e){const[n,i]=j.useState(void 0);return ea(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let u,h;if("borderBoxSize"in c){const f=c.borderBoxSize,v=Array.isArray(f)?f[0]:f;u=v.inlineSize,h=v.blockSize}else u=e.offsetWidth,h=e.offsetHeight;i({width:u,height:h})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else i(void 0)},[e]),n}SA(Lk,"useSize");const CA=["top","right","bottom","left"],zo=Math.min,qr=Math.max,Sh=Math.round,Gd=Math.floor,Fr=e=>({x:e,y:e}),NA={left:"right",right:"left",bottom:"top",top:"bottom"};function Bk(e,n,i){return qr(e,zo(n,i))}function $r(e,n){return typeof e=="function"?e(n):e}function Lo(e){return e.split("-")[0]}function Ul(e){return e.split("-")[1]}function Qv(e){return e==="x"?"y":"x"}function Zv(e){return e==="y"?"height":"width"}function rr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Wv(e){return Qv(rr(e))}function EA(e,n,i){i===void 0&&(i=!1);const o=Ul(e),l=Wv(e),c=Zv(l);let u=l==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(u=Ch(u)),[u,Ch(u)]}function TA(e){const n=Ch(e);return[W0(e),n,W0(n)]}function W0(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jb=["left","right"],wb=["right","left"],AA=["top","bottom"],MA=["bottom","top"];function _A(e,n,i){switch(e){case"top":case"bottom":return i?n?wb:jb:n?jb:wb;case"left":case"right":return n?AA:MA;default:return[]}}function RA(e,n,i,o){const l=Ul(e);let c=_A(Lo(e),i==="start",o);return l&&(c=c.map(u=>u+"-"+l),n&&(c=c.concat(c.map(W0)))),c}function Ch(e){const n=Lo(e);return NA[n]+e.slice(n.length)}function OA(e){var n,i,o,l;return{top:(n=e.top)!=null?n:0,right:(i=e.right)!=null?i:0,bottom:(o=e.bottom)!=null?o:0,left:(l=e.left)!=null?l:0}}function Ik(e){return typeof e!="number"?OA(e):{top:e,right:e,bottom:e,left:e}}function Nh(e){const{x:n,y:i,width:o,height:l}=e;return{width:o,height:l,top:i,left:n,right:n+o,bottom:i+l,x:n,y:i}}function kb(e,n,i){let{reference:o,floating:l}=e;const c=rr(n),u=Wv(n),h=Zv(u),f=Lo(n),v=c==="y",y=o.x+o.width/2-l.width/2,p=o.y+o.height/2-l.height/2,w=o[h]/2-l[h]/2;let b;switch(f){case"top":b={x:y,y:o.y-l.height};break;case"bottom":b={x:y,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:p};break;case"left":b={x:o.x-l.width,y:p};break;default:b={x:o.x,y:o.y}}const k=Ul(n);return k&&(b[u]+=w*(k==="end"?1:-1)*(i&&v?-1:1)),b}async function DA(e,n){var i;n===void 0&&(n={});const{x:o,y:l,platform:c,rects:u,elements:h,strategy:f}=e,{boundary:v="clippingAncestors",rootBoundary:y="viewport",elementContext:p="floating",altBoundary:w=!1,padding:b=0}=$r(n,e),k=Ik(b),N=h[w?p==="floating"?"reference":"floating":p],C=Nh(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(h.floating)),boundary:v,rootBoundary:y,strategy:f})),A=p==="floating"?{x:o,y:l,width:u.floating.width,height:u.floating.height}:u.reference,E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),T=await(c.isElement==null?void 0:c.isElement(E))&&await(c.getScale==null?void 0:c.getScale(E))||{x:1,y:1},R=Nh(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:E,strategy:f}):A);return{top:(C.top-R.top+k.top)/T.y,bottom:(R.bottom-C.bottom+k.bottom)/T.y,left:(C.left-R.left+k.left)/T.x,right:(R.right-C.right+k.right)/T.x}}const zA=50,LA=async(e,n,i)=>{const{placement:o="bottom",strategy:l="absolute",middleware:c=[],platform:u}=i,h=u.detectOverflow?u:{...u,detectOverflow:DA},f=await(u.isRTL==null?void 0:u.isRTL(n));let v=await u.getElementRects({reference:e,floating:n,strategy:l}),{x:y,y:p}=kb(v,o,f),w=o,b=0;const k={};for(let S=0;S<c.length;S++){const N=c[S];if(!N)continue;const{name:C,fn:A}=N,{x:E,y:T,data:R,reset:_}=await A({x:y,y:p,initialPlacement:o,placement:w,strategy:l,middlewareData:k,rects:v,platform:h,elements:{reference:e,floating:n}});y=E??y,p=T??p,k[C]={...k[C],...R},_&&b<zA&&(b++,typeof _=="object"&&(_.placement&&(w=_.placement),_.rects&&(v=_.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:l}):_.rects),{x:y,y:p}=kb(v,w,f)),S=-1)}return{x:y,y:p,placement:w,strategy:l,middlewareData:k}},BA=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:o,placement:l,rects:c,platform:u,elements:h,middlewareData:f}=n,{element:v,padding:y=0}=$r(e,n)||{};if(v==null)return{};const p=Ik(y),w={x:i,y:o},b=Wv(l),k=Zv(b),S=await u.getDimensions(v),N=b==="y",C=N?"top":"left",A=N?"bottom":"right",E=N?"clientHeight":"clientWidth",T=c.reference[k]+c.reference[b]-w[b]-c.floating[k],R=w[b]-c.reference[b],_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(v));let L=_?_[E]:0;(!L||!await(u.isElement==null?void 0:u.isElement(_)))&&(L=h.floating[E]||c.floating[k]);const I=T/2-R/2,H=L/2-S[k]/2-1,O=zo(p[C],H),P=zo(p[A],H),U=L-S[k]-P,Y=L/2-S[k]/2+I,K=Bk(O,Y,U),q=!f.arrow&&Ul(l)!=null&&Y!==K&&c.reference[k]/2-(Y<O?O:P)-S[k]/2<0,Q=q?Y<O?Y-O:Y-U:0;return{[b]:w[b]+Q,data:{[b]:K,centerOffset:Y-K-Q,...q&&{alignmentOffset:Q}},reset:q}}}),IA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,o;const{placement:l,middlewareData:c,rects:u,initialPlacement:h,platform:f,elements:v}=n,{mainAxis:y=!0,crossAxis:p=!0,fallbackPlacements:w,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:S=!0,...N}=$r(e,n);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const C=Lo(l),A=rr(h),E=Lo(h)===h,T=await(f.isRTL==null?void 0:f.isRTL(v.floating)),R=w||(E||!S?[Ch(h)]:TA(h)),_=k!=="none";!w&&_&&R.push(...RA(h,S,k,T));const L=[h,...R],I=await f.detectOverflow(n,N),H=[];let O=((o=c.flip)==null?void 0:o.overflows)||[];if(y&&H.push(I[C]),p){const K=EA(l,u,T);H.push(I[K[0]],I[K[1]])}if(O=[...O,{placement:l,overflows:H}],!H.every(K=>K<=0)){var P,U;const K=(((P=c.flip)==null?void 0:P.index)||0)+1,q=L[K];if(q&&(!(p==="alignment"?A!==rr(q):!1)||O.every(Z=>rr(Z.placement)===A?Z.overflows[0]>0:!0)))return{data:{index:K,overflows:O},reset:{placement:q}};let Q=(U=O.filter(V=>V.overflows[0]<=0).sort((V,Z)=>V.overflows[1]-Z.overflows[1])[0])==null?void 0:U.placement;if(!Q)switch(b){case"bestFit":{var Y;const V=(Y=O.filter(Z=>{if(_){const ue=rr(Z.placement);return ue===A||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,z)=>ue+z,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:Y[0];V&&(Q=V);break}case"initialPlacement":Q=h;break}if(l!==Q)return{reset:{placement:Q}}}return{}}}};function Sb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Cb(e){return CA.some(n=>e[n]>=0)}const PA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i,platform:o}=n,{strategy:l="referenceHidden",...c}=$r(e,n);switch(l){case"referenceHidden":{const u=await o.detectOverflow(n,{...c,elementContext:"reference"}),h=Sb(u,i.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:Cb(h)}}}case"escaped":{const u=await o.detectOverflow(n,{...c,altBoundary:!0}),h=Sb(u,i.floating);return{data:{escapedOffsets:h,escaped:Cb(h)}}}default:return{}}}}},Pk=new Set(["left","top"]);async function qA(e,n){const{placement:i,platform:o,elements:l}=e,c=await(o.isRTL==null?void 0:o.isRTL(l.floating)),u=Lo(i),h=Ul(i),f=rr(i)==="y",v=Pk.has(u)?-1:1,y=c&&f?-1:1,p=$r(n,e);let{mainAxis:w,crossAxis:b,alignmentAxis:k}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return h&&typeof k=="number"&&(b=h==="end"?k*-1:k),f?{x:b*y,y:w*v}:{x:w*v,y:b*y}}const FA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,o;const{x:l,y:c,placement:u,middlewareData:h}=n,f=await qA(n,e);return u===((i=h.offset)==null?void 0:i.placement)&&(o=h.arrow)!=null&&o.alignmentOffset?{}:{x:l+f.x,y:c+f.y,data:{...f,placement:u}}}}},HA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:o,placement:l,platform:c}=n,{mainAxis:u=!0,crossAxis:h=!1,limiter:f={fn:A=>{let{x:E,y:T}=A;return{x:E,y:T}}},...v}=$r(e,n),y={x:i,y:o},p=await c.detectOverflow(n,v),w=rr(l),b=Qv(w);let k=y[b],S=y[w];const N=(A,E)=>Bk(E+p[A==="y"?"top":"left"],E,E-p[A==="y"?"bottom":"right"]);u&&(k=N(b,k)),h&&(S=N(w,S));const C=f.fn({...n,[b]:k,[w]:S});return{...C,data:{x:C.x-i,y:C.y-o,enabled:{[b]:u,[w]:h}}}}}},UA=function(e){return e===void 0&&(e={}),{options:e,fn(n){var i,o;const{x:l,y:c,placement:u,rects:h,middlewareData:f}=n,{offset:v=0,mainAxis:y=!0,crossAxis:p=!0}=$r(e,n),w={x:l,y:c},b=rr(u),k=Qv(b);let S=w[k],N=w[b];const C=$r(v,n),A=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(i=C.mainAxis)!=null?i:0,crossAxis:(o=C.crossAxis)!=null?o:0};if(y){const R=k==="y"?"height":"width",_=h.reference[k]-h.floating[R]+A.mainAxis,L=h.reference[k]+h.reference[R]-A.mainAxis;S<_?S=_:S>L&&(S=L)}if(p){var E,T;const R=k==="y"?"width":"height",_=Pk.has(Lo(u)),L=h.reference[b]-h.floating[R]+(_&&((E=f.offset)==null?void 0:E[b])||0)+(_?0:A.crossAxis),I=h.reference[b]+h.reference[R]+(_?0:((T=f.offset)==null?void 0:T[b])||0)-(_?A.crossAxis:0);N<L?N=L:N>I&&(N=I)}return{[k]:S,[b]:N}}}},$A=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:i,rects:o,platform:l,elements:c}=n,{apply:u=()=>{},...h}=$r(e,n),f=await l.detectOverflow(n,h),v=Lo(i),y=Ul(i),p=rr(i)==="y",{width:w,height:b}=o.floating;let k,S;v==="top"||v==="bottom"?(k=v,S=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(S=v,k=y==="end"?"top":"bottom");const N=b-f.top-f.bottom,C=w-f.left-f.right,A=zo(b-f[k],N),E=zo(w-f[S],C),T=n.middlewareData.shift,R=!T;let _=A,L=E;T!=null&&T.enabled.x&&(L=C),T!=null&&T.enabled.y&&(_=N),R&&!y&&(p?L=w-2*qr(f.left,f.right):_=b-2*qr(f.top,f.bottom)),await u({...n,availableWidth:L,availableHeight:_});const I=await l.getDimensions(c.floating);return w!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function Gh(){return typeof window<"u"}function $l(e){return qk(e)?(e.nodeName||"").toLowerCase():"#document"}function za(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Qr(e){var n;return(n=(qk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function qk(e){return Gh()?e instanceof Node||e instanceof za(e).Node:!1}function ur(e){return Gh()?e instanceof Element||e instanceof za(e).Element:!1}function Fo(e){return Gh()?e instanceof HTMLElement||e instanceof za(e).HTMLElement:!1}function Nb(e){return!Gh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof za(e).ShadowRoot}function Yh(e){const{overflow:n,overflowX:i,overflowY:o,display:l}=dr(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+i)&&l!=="inline"&&l!=="contents"}function VA(e){return/^(table|td|th)$/.test($l(e))}function Kh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const GA=/transform|translate|scale|rotate|perspective|filter/,YA=/paint|layout|strict|content/,js=e=>!!e&&e!=="none";let Kp;function Jv(e){const n=ur(e)?dr(e):e;return js(n.transform)||js(n.translate)||js(n.scale)||js(n.rotate)||js(n.perspective)||!eg()&&(js(n.backdropFilter)||js(n.filter))||GA.test(n.willChange||"")||YA.test(n.contain||"")}function KA(e){let n=Ds(e);for(;Fo(n)&&!nu(n);){if(Jv(n))return n;if(Kh(n))return null;n=Ds(n)}return null}function eg(){return Kp==null&&(Kp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kp}function nu(e){return/^(html|body|#document)$/.test($l(e))}function dr(e){return za(e).getComputedStyle(e)}function Xh(e){return ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ds(e){if($l(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Nb(e)&&e.host||Qr(e);return Nb(n)?n.host:n}function Fk(e){const n=Ds(e);return nu(n)?(e.ownerDocument||e).body:Fo(n)&&Yh(n)?n:Fk(n)}function au(e,n,i){var o;n===void 0&&(n=[]),i===void 0&&(i=!0);const l=Fk(e),c=l===((o=e.ownerDocument)==null?void 0:o.body),u=za(l);if(c){const h=J0(u);return n.concat(u,u.visualViewport||[],Yh(l)?l:[],h&&i?au(h):[])}else return n.concat(l,au(l,[],i))}function J0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hk(e){const n=dr(e);let i=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const l=Fo(e),c=l?e.offsetWidth:i,u=l?e.offsetHeight:o,h=Sh(i)!==c||Sh(o)!==u;return h&&(i=c,o=u),{width:i,height:o,$:h}}function tg(e){return ur(e)?e:e.contextElement}function zl(e){const n=tg(e);if(!Fo(n))return Fr(1);const i=n.getBoundingClientRect(),{width:o,height:l,$:c}=Hk(n);let u=(c?Sh(i.width):i.width)/o,h=(c?Sh(i.height):i.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const XA=Fr(0);function Uk(e){const n=za(e);return!eg()||!n.visualViewport?XA:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function QA(e,n,i){return n===void 0&&(n=!1),!!i&&n&&i===za(e)}function zs(e,n,i,o){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=e.getBoundingClientRect(),c=tg(e);let u=Fr(1);n&&(o?ur(o)&&(u=zl(o)):u=zl(e));const h=QA(c,i,o)?Uk(c):Fr(0);let f=(l.left+h.x)/u.x,v=(l.top+h.y)/u.y,y=l.width/u.x,p=l.height/u.y;if(c&&o){const w=za(c),b=ur(o)?za(o):o;let k=w,S=J0(k);for(;S&&b!==k;){const N=zl(S),C=S.getBoundingClientRect(),A=dr(S),E=C.left+(S.clientLeft+parseFloat(A.paddingLeft))*N.x,T=C.top+(S.clientTop+parseFloat(A.paddingTop))*N.y;f*=N.x,v*=N.y,y*=N.x,p*=N.y,f+=E,v+=T,k=za(S),S=J0(k)}}return Nh({width:y,height:p,x:f,y:v})}function Qh(e,n){const i=Xh(e).scrollLeft;return n?n.left+i:zs(Qr(e)).left+i}function $k(e,n){const i=e.getBoundingClientRect(),o=i.left+n.scrollLeft-Qh(e,i),l=i.top+n.scrollTop;return{x:o,y:l}}function ZA(e){let{elements:n,rect:i,offsetParent:o,strategy:l}=e;const c=l==="fixed",u=Qr(o),h=n?Kh(n.floating):!1;if(o===u||h&&c)return i;let f={scrollLeft:0,scrollTop:0},v=Fr(1);const y=Fr(0),p=Fo(o);if((p||!c)&&(($l(o)!=="body"||Yh(u))&&(f=Xh(o)),p)){const b=zs(o);v=zl(o),y.x=b.x+o.clientLeft,y.y=b.y+o.clientTop}const w=u&&!p&&!c?$k(u,f):Fr(0);return{width:i.width*v.x,height:i.height*v.y,x:i.x*v.x-f.scrollLeft*v.x+y.x+w.x,y:i.y*v.y-f.scrollTop*v.y+y.y+w.y}}function WA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function JA(e){const n=Xh(e),i=e.ownerDocument.body,o=qr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=qr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+Qh(e);const u=-n.scrollTop;return dr(i).direction==="rtl"&&(c+=qr(e.clientWidth,i.clientWidth)-o),{width:o,height:l,x:c,y:u}}const eM=25;function tM(e,n,i){i===void 0&&(i="viewport");const o=i==="layoutViewport",l=za(e),c=Qr(e),u=l.visualViewport;let h=c.clientWidth,f=c.clientHeight,v=0,y=0;if(u){const w=!eg()||n==="fixed";o?w||(v=-u.offsetLeft,y=-u.offsetTop):(h=u.width,f=u.height,w&&(v=u.offsetLeft,y=u.offsetTop))}if(Qh(c)<=0){const w=c.ownerDocument,b=w.body,k=getComputedStyle(b),S=w.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<=eM&&(h-=C)}return{width:h,height:f,x:v,y}}function nM(e,n){const i=zs(e,!0,n==="fixed"),o=i.top+e.clientTop,l=i.left+e.clientLeft,c=zl(e),u=e.clientWidth*c.x,h=e.clientHeight*c.y,f=l*c.x,v=o*c.y;return{width:u,height:h,x:f,y:v}}function Eb(e,n,i){let o;if(n==="viewport"||n==="layoutViewport")o=tM(e,i,n);else if(n==="document")o=JA(Qr(e));else if(ur(n))o=nM(n,i);else{const l=Uk(e);o={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return Nh(o)}function aM(e,n){const i=n.get(e);if(i)return i;let o=au(e,[],!1).filter(h=>ur(h)&&$l(h)!=="body"),l=null;const c=dr(e).position==="fixed";let u=c?Ds(e):e;for(;ur(u)&&!nu(u);){const h=dr(u),f=Jv(u),v=l?l.position:c?"fixed":"";!f&&(v==="fixed"||v==="absolute"&&h.position==="static")?o=o.filter(p=>p!==u):l=h,u=Ds(u)}return n.set(e,o),o}function iM(e){let{element:n,boundary:i,rootBoundary:o,strategy:l}=e;const u=[...i==="clippingAncestors"?Kh(n)?[]:aM(n,this._c):[].concat(i),o],h=Eb(n,u[0],l);let f=h.top,v=h.right,y=h.bottom,p=h.left;for(let w=1;w<u.length;w++){const b=Eb(n,u[w],l);f=qr(b.top,f),v=zo(b.right,v),y=zo(b.bottom,y),p=qr(b.left,p)}return{width:v-p,height:y-f,x:p,y:f}}function rM(e){const{width:n,height:i}=Hk(e);return{width:n,height:i}}function oM(e,n,i){const o=Fo(n),l=Qr(n),c=i==="fixed",u=zs(e,!0,c,n);let h={scrollLeft:0,scrollTop:0};const f=Fr(0);if((o||!c)&&(($l(n)!=="body"||Yh(l))&&(h=Xh(n)),o)){const w=zs(n,!0,c,n);f.x=w.x+n.clientLeft,f.y=w.y+n.clientTop}!o&&l&&(f.x=Qh(l));const v=l&&!o&&!c?$k(l,h):Fr(0),y=u.left+h.scrollLeft-f.x-v.x,p=u.top+h.scrollTop-f.y-v.y;return{x:y,y:p,width:u.width,height:u.height}}function Xp(e){return dr(e).position==="static"}function Tb(e,n){if(!Fo(e)||dr(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Qr(e)===i&&(i=i.ownerDocument.body),i}function Vk(e,n){const i=za(e);if(Kh(e))return i;if(!Fo(e)){let l=Ds(e);for(;l&&!nu(l);){if(ur(l)&&!Xp(l))return l;l=Ds(l)}return i}let o=Tb(e,n);for(;o&&VA(o)&&Xp(o);)o=Tb(o,n);return o&&nu(o)&&Xp(o)&&!Jv(o)?i:o||KA(e)||i}const sM=async function(e){const n=this.getOffsetParent||Vk,i=this.getDimensions,o=await i(e.floating);return{reference:oM(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lM(e){return dr(e).direction==="rtl"}const cM={convertOffsetParentRelativeRectToViewportRelativeRect:ZA,getDocumentElement:Qr,getClippingRect:iM,getOffsetParent:Vk,getElementRects:sM,getClientRects:WA,getDimensions:rM,getScale:zl,isElement:ur,isRTL:lM};function Gk(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function uM(e,n,i){let o=null,l;const c=Qr(e);function u(){var y;clearTimeout(l),(y=o)==null||y.disconnect(),o=null}function h(y,p){y===void 0&&(y=!1),p===void 0&&(p=1),u();const w=e.getBoundingClientRect(),{left:b,top:k,width:S,height:N}=w;if(y||n(),!S||!N)return;const C=Gd(k),A=Gd(c.clientWidth-(b+S)),E=Gd(c.clientHeight-(k+N)),T=Gd(b),_={rootMargin:-C+"px "+-A+"px "+-E+"px "+-T+"px",threshold:qr(0,zo(1,p))||1};let L=!0;function I(H){const O=H[0].intersectionRatio;if(!Gk(w,e.getBoundingClientRect()))return h();if(O!==p){if(!L)return h();O?h(!1,O):l=setTimeout(()=>{h(!1,1e-7)},1e3)}L=!1}try{o=new IntersectionObserver(I,{..._,root:c.ownerDocument})}catch{o=new IntersectionObserver(I,_)}o.observe(e)}const f=za(e),v=()=>h(i);return f.addEventListener("resize",v),h(!0),()=>{f.removeEventListener("resize",v),u()}}function dM(e,n,i,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,v=tg(e),y=l||c?[...v?au(v):[],...n?au(n):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",i),c&&C.addEventListener("resize",i)});const p=v&&h?uM(v,i,c):null;let w=-1,b=null;u&&(b=new ResizeObserver(C=>{let[A]=C;A&&A.target===v&&b&&n&&(b.unobserve(n),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(n)})),i()}),v&&!f&&b.observe(v),n&&b.observe(n));let k,S=f?zs(e):null;f&&N();function N(){const C=zs(e);S&&!Gk(S,C)&&i(),S=C,k=requestAnimationFrame(N)}return i(),()=>{var C;y.forEach(A=>{l&&A.removeEventListener("scroll",i),c&&A.removeEventListener("resize",i)}),p==null||p(),(C=b)==null||C.disconnect(),b=null,f&&cancelAnimationFrame(k)}}const hM=FA,fM=HA,mM=IA,pM=$A,vM=PA,Ab=BA,gM=UA,yM=(e,n,i)=>{const o=new Map,l=i??{},c={...cM,...l.platform,_c:o};return LA(e,n,{...l,platform:c})};var xM=typeof document<"u",bM=function(){},mh=xM?j.useLayoutEffect:bM;function Eh(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,o,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(o=i;o--!==0;)if(!Eh(e[o],n[o]))return!1;return!0}if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(o=i;o--!==0;)if(!{}.hasOwnProperty.call(n,l[o]))return!1;for(o=i;o--!==0;){const c=l[o];if(!(c==="_owner"&&e.$$typeof)&&!Eh(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function Yk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mb(e,n){const i=Yk(e);return Math.round(n*i)/i}function Qp(e){const n=j.useRef(e);return mh(()=>{n.current=e}),n}function jM(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:l,elements:{reference:c,floating:u}={},transform:h=!0,whileElementsMounted:f,open:v}=e,[y,p]=j.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[w,b]=j.useState(o);Eh(w,o)||b(o);const[k,S]=j.useState(null),[N,C]=j.useState(null),A=j.useCallback(Z=>{Z!==_.current&&(_.current=Z,S(Z))},[]),E=j.useCallback(Z=>{Z!==L.current&&(L.current=Z,C(Z))},[]),T=c||k,R=u||N,_=j.useRef(null),L=j.useRef(null),I=j.useRef(y),H=f!=null,O=Qp(f),P=Qp(l),U=Qp(v),Y=j.useCallback(()=>{if(!_.current||!L.current)return;const Z={placement:n,strategy:i,middleware:w};P.current&&(Z.platform=P.current),yM(_.current,L.current,Z).then(ue=>{const z={...ue,isPositioned:U.current!==!1};K.current&&!Eh(I.current,z)&&(I.current=z,Po.flushSync(()=>{p(z)}))})},[w,n,i,P,U]);mh(()=>{v===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(Z=>({...Z,isPositioned:!1})))},[v]);const K=j.useRef(!1);mh(()=>(K.current=!0,()=>{K.current=!1}),[]),mh(()=>{if(T&&(_.current=T),R&&(L.current=R),T&&R){if(O.current)return O.current(T,R,Y);Y()}},[T,R,Y,O,H]);const q=j.useMemo(()=>({reference:_,floating:L,setReference:A,setFloating:E}),[A,E]),Q=j.useMemo(()=>({reference:T,floating:R}),[T,R]),V=j.useMemo(()=>{const Z={position:i,left:0,top:0};if(!Q.floating)return Z;const ue=Mb(Q.floating,y.x),z=Mb(Q.floating,y.y);return h?{...Z,transform:"translate("+ue+"px, "+z+"px)",...Yk(Q.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ue,top:z}},[i,h,Q.floating,y.x,y.y]);return j.useMemo(()=>({...y,update:Y,refs:q,elements:Q,floatingStyles:V}),[y,Y,q,Q,V])}const wM=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:o,padding:l}=typeof e=="function"?e(i):e;return o&&n(o)?o.current!=null?Ab({element:o.current,padding:l}).fn(i):{}:o?Ab({element:o,padding:l}).fn(i):{}}}},kM=(e,n)=>{const i=hM(e);return{name:i.name,fn:i.fn,options:[e,n]}},SM=(e,n)=>{const i=fM(e);return{name:i.name,fn:i.fn,options:[e,n]}},CM=(e,n)=>({fn:gM(e).fn,options:[e,n]}),NM=(e,n)=>{const i=mM(e);return{name:i.name,fn:i.fn,options:[e,n]}},EM=(e,n)=>{const i=pM(e);return{name:i.name,fn:i.fn,options:[e,n]}},TM=(e,n)=>{const i=vM(e);return{name:i.name,fn:i.fn,options:[e,n]}},AM=(e,n)=>{const i=wM(e);return{name:i.name,fn:i.fn,options:[e,n]}};var MM=Object.defineProperty,_o=(e,n)=>MM(e,"name",{value:n,configurable:!0}),Kk="Popper",[Xk,Zh]=qo(Kk),[_M,Qk]=Xk(Kk),RM=_o(e=>{const{__scopePopper:n,children:i}=e,[o,l]=j.useState(null),[c,u]=j.useState(void 0);return r.jsx(_M,{scope:n,anchor:o,onAnchorChange:l,placementState:c,setPlacementState:u,children:i})},"Popper"),OM="PopperAnchor",DM=j.forwardRef(_o(function(n,i){const{__scopePopper:o,virtualRef:l,...c}=n,u=Qk(OM,o),h=j.useRef(null),f=u.onAnchorChange,v=j.useCallback(S=>{h.current=S,S&&f(S)},[f]),y=qt(i,v),p=j.useRef(null);j.useEffect(()=>{if(!l)return;const S=p.current;p.current=l.current,S!==p.current&&f(p.current)});const w=u.placementState&&Wh(u.placementState),b=w==null?void 0:w[0],k=w==null?void 0:w[1];return l?null:r.jsx(hn.div,{"data-radix-popper-side":b,"data-radix-popper-align":k,...c,ref:y})},"PopperAnchor")),Zk="PopperContent",[zM,Y$]=Xk(Zk),LM=j.forwardRef(_o(function(n,i){var me,te,ce,J,je,Re,De;const{__scopePopper:o,side:l="bottom",sideOffset:c=0,align:u="center",alignOffset:h=0,arrowPadding:f=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:p=0,sticky:w="partial",hideWhenDetached:b=!1,updatePositionStrategy:k="optimized",onPlaced:S,...N}=n,C=Qk(Zk,o),[A,E]=j.useState(null),T=qt(i,E),[R,_]=j.useState(null),L=Lk(R),I=(L==null?void 0:L.width)??0,H=(L==null?void 0:L.height)??0,O=l+(u!=="center"?"-"+u:""),P=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},U=Array.isArray(y)?y:[y],Y=U.length>0,K={padding:P,boundary:U.filter(Wk),altBoundary:Y},{refs:q,floatingStyles:Q,placement:V,isPositioned:Z,middlewareData:ue}=jM({strategy:"fixed",placement:O,whileElementsMounted:_o((...Pe)=>dM(...Pe,{animationFrame:k==="always"}),"whileElementsMounted"),elements:{reference:C.anchor},middleware:[kM({mainAxis:c+H,alignmentAxis:h}),v&&SM({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?CM():void 0,...K}),v&&NM({...K}),EM({...K,apply:_o(({elements:Pe,rects:Le,availableWidth:He,availableHeight:at})=>{const{width:Lt,height:Gt}=Le.reference,ft=Pe.floating.style;ft.setProperty("--radix-popper-available-width",`${He}px`),ft.setProperty("--radix-popper-available-height",`${at}px`),ft.setProperty("--radix-popper-anchor-width",`${Lt}px`),ft.setProperty("--radix-popper-anchor-height",`${Gt}px`)},"apply")}),R&&AM({element:R,padding:f}),BM({arrowWidth:I,arrowHeight:H}),b&&TM({strategy:"referenceHidden",...K,boundary:Y?K.boundary:void 0})]}),z=C.setPlacementState;ea(()=>(z(V),()=>{z(void 0)}),[V,z]);const[he,oe]=Wh(V),D=Jn(S);ea(()=>{Z&&(D==null||D())},[Z,D]);const F=(me=ue.arrow)==null?void 0:me.x,ie=(te=ue.arrow)==null?void 0:te.y,$=((ce=ue.arrow)==null?void 0:ce.centerOffset)!==0,[X,ee]=j.useState();return ea(()=>{A&&ee(window.getComputedStyle(A).zIndex)},[A]),r.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:Z?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(J=ue.transformOrigin)==null?void 0:J.x,(je=ue.transformOrigin)==null?void 0:je.y].join(" "),...((Re=ue.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:r.jsx(zM,{scope:o,placedSide:he,placedAlign:oe,onArrowChange:_,arrowX:F,arrowY:ie,shouldHideArrow:$,children:r.jsx(hn.div,{"data-side":he,"data-align":oe,...N,ref:T,style:{...N.style,animation:Z?(De=N.style)==null?void 0:De.animation:"none"}})})})},"PopperContent"));function Wk(e){return e!==null}_o(Wk,"isNotNull");var BM=_o(e=>({name:"transformOrigin",options:e,fn(n){var N,C,A;const{placement:i,rects:o,middlewareData:l}=n,u=((N=l.arrow)==null?void 0:N.centerOffset)!==0,h=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[v,y]=Wh(i),p={start:"0%",center:"50%",end:"100%"}[y],w=(((C=l.arrow)==null?void 0:C.x)??0)+h/2,b=(((A=l.arrow)==null?void 0:A.y)??0)+f/2;let k="",S="";return v==="bottom"?(k=u?p:`${w}px`,S=`${-f}px`):v==="top"?(k=u?p:`${w}px`,S=`${o.floating.height+f}px`):v==="right"?(k=`${-f}px`,S=u?p:`${b}px`):v==="left"&&(k=`${o.floating.width+f}px`,S=u?p:`${b}px`),{data:{x:k,y:S}}}}),"transformOrigin");function Wh(e){const[n,i="center"]=e.split("-");return[n,i]}_o(Wh,"getSideAndAlignFromPlacement");var Jk=RM,e5=DM,t5=LM,IM=Object.defineProperty,PM=(e,n)=>IM(e,"name",{value:n,configurable:!0}),qM=j.forwardRef(PM(function(n,i){return r.jsx(hn.label,{...n,ref:i,onMouseDown:o=>{var c;o.target.closest("button, input, select, textarea")||((c=n.onMouseDown)==null||c.call(n,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),FM=qM,HM=Object.defineProperty,UM=(e,n)=>HM(e,"name",{value:n,configurable:!0});function n5(e){const n=j.useRef({value:e,previous:e});return j.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}UM(n5,"usePrevious");var $M=Object.defineProperty,VM=(e,n)=>$M(e,"name",{value:n,configurable:!0});function Th(e,[n,i]){return Math.min(i,Math.max(n,e))}VM(Th,"clamp");var GM=Object.defineProperty,Ho=(e,n)=>GM(e,"name",{value:n,configurable:!0}),ng="Popover",[a5,K$]=qo(ng,[Zh]),ag=Zh(),[YM,Vl]=a5(ng),KM=Ho(e=>{const{__scopePopover:n,children:i,open:o,defaultOpen:l,onOpenChange:c,modal:u=!1}=e,h=ag(n),f=j.useRef(null),[v,y]=j.useState(!1),[p,w]=eu({prop:o,defaultProp:l??!1,onChange:c,caller:ng});return r.jsx(Jk,{...h,children:r.jsx(YM,{scope:n,contentId:As(),triggerRef:f,open:p,onOpenChange:w,onOpenToggle:j.useCallback(()=>w(b=>!b),[w]),hasCustomAnchor:v,onCustomAnchorAdd:j.useCallback(()=>y(!0),[]),onCustomAnchorRemove:j.useCallback(()=>y(!1),[]),modal:u,children:i})})},"Popover"),XM="PopoverTrigger",QM=j.forwardRef(Ho(function(n,i){const{__scopePopover:o,...l}=n,c=Vl(XM,o),u=ag(o),h=qt(i,c.triggerRef),f=r.jsx(hn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":ig(c.open),...l,ref:h,onClick:_t(n.onClick,c.onOpenToggle)});return c.hasCustomAnchor?f:r.jsx(e5,{asChild:!0,...u,children:f})},"PopoverTrigger")),i5="PopoverPortal",[ZM,WM]=a5(i5,{forceMount:void 0}),JM=Ho(e=>{const{__scopePopover:n,forceMount:i,children:o,container:l}=e,c=Vl(i5,n);return r.jsx(ZM,{scope:n,forceMount:i,children:r.jsx(mr,{present:i||c.open,children:r.jsx(Vv,{asChild:!0,container:l,children:o})})})},"PopoverPortal"),iu="PopoverContent",e_=j.forwardRef(Ho(function(n,i){const o=WM(iu,n.__scopePopover),{forceMount:l=o.forceMount,...c}=n,u=Vl(iu,n.__scopePopover);return r.jsx(mr,{present:l||u.open,children:u.modal?r.jsx(n_,{...c,ref:i}):r.jsx(a_,{...c,ref:i})})},"PopoverContent")),t_=cr("PopoverContent.RemoveScroll"),n_=j.forwardRef(Ho(function(n,i){const o=Vl(iu,n.__scopePopover),l=j.useRef(null),c=qt(i,l),u=j.useRef(!1);return j.useEffect(()=>{const h=l.current;if(h)return Yv(h)},[]),r.jsx(Vh,{as:t_,allowPinchZoom:!0,children:r.jsx(r5,{...n,ref:c,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(n.onCloseAutoFocus,h=>{var f;h.preventDefault(),u.current||(f=o.triggerRef.current)==null||f.focus()}),onPointerDownOutside:_t(n.onPointerDownOutside,h=>{const f=h.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0,y=f.button===2||v;u.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:_t(n.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),a_=j.forwardRef(Ho(function(n,i){const o=Vl(iu,n.__scopePopover),l=j.useRef(!1),c=j.useRef(!1);return r.jsx(r5,{...n,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var h,f;(h=n.onCloseAutoFocus)==null||h.call(n,u),u.defaultPrevented||(l.current||(f=o.triggerRef.current)==null||f.focus(),u.preventDefault()),l.current=!1,c.current=!1},onInteractOutside:u=>{var v,y;(v=n.onInteractOutside)==null||v.call(n,u),u.defaultPrevented||(l.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const h=u.target;((y=o.triggerRef.current)==null?void 0:y.contains(h))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})},"PopoverContentNonModal")),r5=j.forwardRef(Ho(function(n,i){const{__scopePopover:o,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:p,...w}=n,b=Vl(iu,o),k=ag(o);return fu(),r.jsx(Uv,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:c,onUnmountAutoFocus:u,children:r.jsx(Fv,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:p,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:y,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:r.jsx(t5,{"data-state":ig(b.open),role:"dialog",id:b.contentId,...k,...w,ref:i,style:{...w.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 ig(e){return e?"open":"closed"}Ho(ig,"getState");var Jh=KM,ef=QM,tf=JM,nf=e_,i_=Object.defineProperty,wt=(e,n)=>i_(e,"name",{value:n,configurable:!0});function o5(e,n){return j.useReducer((i,o)=>n[i][o]??i,e)}wt(o5,"useStateMachine");var s5="ScrollArea",[l5,X$]=qo(s5),[r_,vi]=l5(s5),o_=j.forwardRef(wt(function(n,i){const{__scopeScrollArea:o,type:l="hover",dir:c,scrollHideDelay:u=600,...h}=n,[f,v]=j.useState(null),[y,p]=j.useState(null),[w,b]=j.useState(null),[k,S]=j.useState(null),[N,C]=j.useState(null),[A,E]=j.useState(0),[T,R]=j.useState(0),[_,L]=j.useState(!1),[I,H]=j.useState(!1),O=qt(i,v),P=qv(c);return r.jsx(r_,{scope:o,type:l,dir:P,scrollHideDelay:u,scrollArea:f,viewport:y,onViewportChange:p,content:w,onContentChange:b,scrollbarX:k,onScrollbarXChange:S,scrollbarXEnabled:_,onScrollbarXEnabledChange:L,scrollbarY:N,onScrollbarYChange:C,scrollbarYEnabled:I,onScrollbarYEnabledChange:H,onCornerWidthChange:E,onCornerHeightChange:R,children:r.jsx(hn.div,{dir:P,...h,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":T+"px",...n.style}})})},"ScrollArea")),s_="ScrollAreaViewport",l_=j.forwardRef(wt(function(n,i){const{__scopeScrollArea:o,children:l,nonce:c,...u}=n,h=vi(s_,o),f=j.useRef(null),v=qt(i,f,h.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx(c_,{nonce:c}),r.jsx(hn.div,{"data-radix-scroll-area-viewport":"",...u,ref:v,style:{overflowX:h.scrollbarXEnabled?"scroll":"hidden",overflowY:h.scrollbarYEnabled?"scroll":"hidden",...n.style},children:r.jsx("div",{ref:h.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})},"ScrollAreaViewport")),c_=j.memo(wt(function({nonce:n}){return r.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),Zr="ScrollAreaScrollbar",u_=j.forwardRef(wt(function(n,i){const{forceMount:o,...l}=n,c=vi(Zr,n.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:h}=c,f=n.orientation==="horizontal";return j.useEffect(()=>(f?u(!0):h(!0),()=>{f?u(!1):h(!1)}),[f,u,h]),c.type==="hover"?r.jsx(d_,{...l,ref:i,forceMount:o}):c.type==="scroll"?r.jsx(h_,{...l,ref:i,forceMount:o}):c.type==="auto"?r.jsx(c5,{...l,ref:i,forceMount:o}):c.type==="always"?r.jsx(rg,{...l,ref:i,"data-state":"visible"}):null},"ScrollAreaScrollbar")),d_=j.forwardRef(wt(function(n,i){const{forceMount:o,...l}=n,c=vi(Zr,n.__scopeScrollArea),[u,h]=j.useState(!1);return j.useEffect(()=>{const f=c.scrollArea;let v=0;if(f){const y=wt(()=>{window.clearTimeout(v),h(!0)},"handlePointerEnter"),p=wt(()=>{v=window.setTimeout(()=>h(!1),c.scrollHideDelay)},"handlePointerLeave");return f.addEventListener("pointerenter",y),f.addEventListener("pointerleave",p),()=>{window.clearTimeout(v),f.removeEventListener("pointerenter",y),f.removeEventListener("pointerleave",p)}}},[c.scrollArea,c.scrollHideDelay]),r.jsx(mr,{present:o||u,children:r.jsx(c5,{"data-state":u?"visible":"hidden",...l,ref:i})})},"ScrollAreaScrollbarHover")),h_=j.forwardRef(wt(function(n,i){const{forceMount:o,...l}=n,c=vi(Zr,n.__scopeScrollArea),u=n.orientation==="horizontal",h=pu(()=>v("SCROLL_END"),100),[f,v]=o5("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 j.useEffect(()=>{if(f==="idle"){const y=window.setTimeout(()=>v("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(y)}},[f,c.scrollHideDelay,v]),j.useEffect(()=>{const y=c.viewport,p=u?"scrollLeft":"scrollTop";if(y){let w=y[p];const b=wt(()=>{const k=y[p];w!==k&&(v("SCROLL"),h()),w=k},"handleScroll");return y.addEventListener("scroll",b),()=>y.removeEventListener("scroll",b)}},[c.viewport,u,v,h]),r.jsx(mr,{present:o||f!=="hidden",children:r.jsx(rg,{"data-state":f==="hidden"?"hidden":"visible",...l,ref:i,onPointerEnter:_t(n.onPointerEnter,()=>v("POINTER_ENTER")),onPointerLeave:_t(n.onPointerLeave,()=>v("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),c5=j.forwardRef(wt(function(n,i){const o=vi(Zr,n.__scopeScrollArea),{forceMount:l,...c}=n,[u,h]=j.useState(!1),f=n.orientation==="horizontal",v=pu(()=>{if(o.viewport){const y=o.viewport.offsetWidth<o.viewport.scrollWidth,p=o.viewport.offsetHeight<o.viewport.scrollHeight;h(f?y:p)}},10);return Ls(o.viewport,v),Ls(o.content,v),r.jsx(mr,{present:l||u,children:r.jsx(rg,{"data-state":u?"visible":"hidden",...c,ref:i})})},"ScrollAreaScrollbarAuto")),rg=j.forwardRef(wt(function(n,i){const{orientation:o="vertical",...l}=n,c=vi(Zr,n.__scopeScrollArea),u=j.useRef(null),h=j.useRef(0),[f,v]=j.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),y=og(f.viewport,f.content),p={...l,sizes:f,onSizesChange:v,hasThumb:y>0&&y<1,onThumbChange:wt(b=>u.current=b,"onThumbChange"),onThumbPointerUp:wt(()=>h.current=0,"onThumbPointerUp"),onThumbPointerDown:wt(b=>h.current=b,"onThumbPointerDown")};function w(b,k){return f5(b,h.current,f,k)}return wt(w,"getScrollPosition"),o==="horizontal"?r.jsx(f_,{...p,ref:i,onThumbPositionChange:()=>{if(c.viewport&&u.current){const b=c.viewport.scrollLeft,k=tv(b,f,c.dir);u.current.style.transform=`translate3d(${k}px, 0, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollLeft=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollLeft=w(b,c.dir))}}):o==="vertical"?r.jsx(m_,{...p,ref:i,onThumbPositionChange:()=>{if(c.viewport&&u.current){const b=c.viewport.scrollTop,k=tv(b,f);u.current.style.transform=`translate3d(0, ${k}px, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollTop=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollTop=w(b))}}):null},"ScrollAreaScrollbarVisible")),f_=j.forwardRef(wt(function(n,i){const{sizes:o,onSizesChange:l,...c}=n,u=vi(Zr,n.__scopeScrollArea),[h,f]=j.useState(),v=j.useRef(null),y=qt(i,v,u.onScrollbarXChange);return j.useEffect(()=>{v.current&&f(getComputedStyle(v.current))},[v]),r.jsx(d5,{"data-orientation":"horizontal",...c,ref:y,sizes:o,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":mu(o)+"px",...n.style},onThumbPointerDown:p=>n.onThumbPointerDown(p.x),onDragScroll:p=>n.onDragScroll(p.x),onWheelScroll:(p,w)=>{if(u.viewport){const b=u.viewport.scrollLeft+p.deltaX;n.onWheelScroll(b),lg(b,w)&&p.preventDefault()}},onResize:()=>{v.current&&u.viewport&&h&&l({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:v.current.clientWidth,paddingStart:ru(h.paddingLeft),paddingEnd:ru(h.paddingRight)}})}})},"ScrollAreaScrollbarX")),m_=j.forwardRef(wt(function(n,i){const{sizes:o,onSizesChange:l,...c}=n,u=vi(Zr,n.__scopeScrollArea),[h,f]=j.useState(),v=j.useRef(null),y=qt(i,v,u.onScrollbarYChange);return j.useEffect(()=>{v.current&&f(getComputedStyle(v.current))},[v]),r.jsx(d5,{"data-orientation":"vertical",...c,ref:y,sizes:o,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":mu(o)+"px",...n.style},onThumbPointerDown:p=>n.onThumbPointerDown(p.y),onDragScroll:p=>n.onDragScroll(p.y),onWheelScroll:(p,w)=>{if(u.viewport){const b=u.viewport.scrollTop+p.deltaY;n.onWheelScroll(b),lg(b,w)&&p.preventDefault()}},onResize:()=>{v.current&&u.viewport&&h&&l({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:v.current.clientHeight,paddingStart:ru(h.paddingTop),paddingEnd:ru(h.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[p_,u5]=l5(Zr),d5=j.forwardRef(wt(function(n,i){const{__scopeScrollArea:o,sizes:l,hasThumb:c,onThumbChange:u,onThumbPointerUp:h,onThumbPointerDown:f,onThumbPositionChange:v,onDragScroll:y,onWheelScroll:p,onResize:w,...b}=n,k=vi(Zr,o),[S,N]=j.useState(null),C=qt(i,N),A=j.useRef(null),E=j.useRef(""),T=k.viewport,R=l.content-l.viewport,_=Jn(p),L=Jn(v),I=pu(w,10);function H(O){if(A.current){const P=O.clientX-A.current.left,U=O.clientY-A.current.top;y({x:P,y:U})}}return wt(H,"handleDragScroll"),j.useEffect(()=>{const O=wt(P=>{const U=P.target;(S==null?void 0:S.contains(U))&&_(P,R)},"handleWheel");return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[T,S,R,_]),j.useEffect(L,[l,L]),Ls(S,I),Ls(k.content,I),r.jsx(p_,{scope:o,scrollbar:S,hasThumb:c,onThumbChange:Jn(u),onThumbPointerUp:Jn(h),onThumbPositionChange:L,onThumbPointerDown:Jn(f),children:r.jsx(hn.div,{...b,ref:C,style:{position:"absolute",...b.style},onPointerDown:_t(n.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),A.current=S.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k.viewport&&(k.viewport.style.scrollBehavior="auto"),H(O))}),onPointerMove:_t(n.onPointerMove,H),onPointerUp:_t(n.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=E.current,k.viewport&&(k.viewport.style.scrollBehavior=""),A.current=null})})})},"ScrollAreaScrollbarImpl")),ev="ScrollAreaThumb",v_=j.forwardRef(wt(function(n,i){const{forceMount:o,...l}=n,c=u5(ev,n.__scopeScrollArea);return r.jsx(mr,{present:o||c.hasThumb,children:r.jsx(g_,{ref:i,...l})})},"ScrollAreaThumb")),g_=j.forwardRef(wt(function(n,i){const{__scopeScrollArea:o,style:l,...c}=n,u=vi(ev,o),h=u5(ev,o),{onThumbPositionChange:f}=h,v=qt(i,h.onThumbChange),y=j.useRef(void 0),p=pu(()=>{y.current&&(y.current(),y.current=void 0)},100);return j.useEffect(()=>{const w=u.viewport;if(w){const b=wt(()=>{if(p(),!y.current){const k=b_(w,f);y.current=k,f()}},"handleScroll");return f(),w.addEventListener("scroll",b),()=>w.removeEventListener("scroll",b)}},[u.viewport,p,f]),r.jsx(hn.div,{"data-state":h.hasThumb?"visible":"hidden",...c,ref:v,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:_t(n.onPointerDownCapture,w=>{const k=w.target.getBoundingClientRect(),S=w.clientX-k.left,N=w.clientY-k.top;h.onThumbPointerDown({x:S,y:N})}),onPointerUp:_t(n.onPointerUp,h.onThumbPointerUp)})},"ScrollAreaThumbImpl")),h5="ScrollAreaCorner",y_=j.forwardRef(wt(function(n,i){const o=vi(h5,n.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?r.jsx(x_,{...n,ref:i}):null},"ScrollAreaCorner")),x_=j.forwardRef(wt(function(n,i){const{__scopeScrollArea:o,...l}=n,c=vi(h5,o),[u,h]=j.useState(0),[f,v]=j.useState(0),y=!!(u&&f),{onCornerWidthChange:p,onCornerHeightChange:w}=c;return Ls(c.scrollbarX,()=>{var k;const b=((k=c.scrollbarX)==null?void 0:k.offsetHeight)||0;c.onCornerHeightChange(b),v(b)}),Ls(c.scrollbarY,()=>{var k;const b=((k=c.scrollbarY)==null?void 0:k.offsetWidth)||0;c.onCornerWidthChange(b),h(b)}),j.useEffect(()=>()=>{p(0),w(0)},[p,w]),y?r.jsx(hn.div,{...l,ref:i,style:{width:u,height:f,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null},"ScrollAreaCornerImpl"));function ru(e){return e?parseInt(e,10):0}wt(ru,"toInt");function og(e,n){const i=e/n;return isNaN(i)?0:i}wt(og,"getThumbRatio");function mu(e){const n=og(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-i)*n;return Math.max(o,18)}wt(mu,"getThumbSize");function f5(e,n,i,o="ltr"){const l=mu(i),c=l/2,u=n||c,h=l-u,f=i.scrollbar.paddingStart+u,v=i.scrollbar.size-i.scrollbar.paddingEnd-h,y=i.content-i.viewport,p=o==="ltr"?[0,y]:[y*-1,0];return sg([f,v],p)(e)}wt(f5,"getScrollPositionFromPointer");function tv(e,n,i="ltr"){const o=mu(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,c=n.scrollbar.size-l,u=n.content-n.viewport,h=c-o,f=i==="ltr"?[0,u]:[u*-1,0],v=Th(e,f);return sg([0,u],[0,h])(v)}wt(tv,"getThumbOffsetFromScroll");function sg(e,n){return i=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(e[1]-e[0]);return n[0]+o*(i-e[0])}}wt(sg,"linearScale");function lg(e,n){return e>0&&e<n}wt(lg,"isScrollingWithinScrollbarBounds");var b_=wt((e,n=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},o=0;return wt((function l(){const c={left:e.scrollLeft,top:e.scrollTop},u=i.left!==c.left,h=i.top!==c.top;(u||h)&&n(),i=c,o=window.requestAnimationFrame(l)}),"loop")(),()=>window.cancelAnimationFrame(o)},"addUnlinkedScrollListener");function pu(e,n){const i=Jn(e),o=j.useRef(0);return j.useEffect(()=>()=>window.clearTimeout(o.current),[]),j.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(i,n)},[i,n])}wt(pu,"useDebounceCallback");function Ls(e,n){const i=Jn(n);ea(()=>{let o=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(i)});return l.observe(e),()=>{window.cancelAnimationFrame(o),l.unobserve(e)}}},[e,i])}wt(Ls,"useResizeObserver");var j_=o_,w_=l_,k_=y_,S_=Object.defineProperty,$t=(e,n)=>S_(e,"name",{value:n,configurable:!0}),C_=[" ","Enter","ArrowUp","ArrowDown"],N_=[" ","Enter"],Il="Select",[af,cg,E_]=J3(Il),[Fs,Q$]=qo(Il,[E_,Zh]),ug=Zh(),[T_,Uo]=Fs(Il),[A_,M_]=Fs(Il);function m5(e){const{__scopeSelect:n,children:i,open:o,defaultOpen:l,onOpenChange:c,value:u,defaultValue:h,onValueChange:f,dir:v,name:y,autoComplete:p,disabled:w,required:b,form:k,internal_do_not_use_render:S}=e,N=ug(n),[C,A]=j.useState(null),[E,T]=j.useState(null),[R,_]=j.useState(!1),L=qv(v),[I,H]=eu({prop:o,defaultProp:l??!1,onChange:c,caller:Il}),[O,P]=eu({prop:u,defaultProp:h,onChange:f,caller:Il}),U=j.useRef(null),Y=j.useRef(O);j.useEffect(()=>{const oe=k?C==null?void 0:C.ownerDocument.getElementById(k):C==null?void 0:C.form;if(oe instanceof HTMLFormElement){const D=$t(()=>P(Y.current),"reset");return oe.addEventListener("reset",D),()=>oe.removeEventListener("reset",D)}},[k,C,P]);const K=C?!!k||!!C.closest("form"):!0,[q,Q]=j.useState(new Set),V=As(),Z=Array.from(q).map(oe=>oe.props.value).join(";"),ue=j.useCallback(oe=>{Q(D=>new Set(D).add(oe))},[]),z=j.useCallback(oe=>{Q(D=>{const F=new Set(D);return F.delete(oe),F})},[]),he={required:b,trigger:C,onTriggerChange:A,valueNode:E,onValueNodeChange:T,valueNodeHasChildren:R,onValueNodeHasChildrenChange:_,contentId:V,value:O,onValueChange:P,open:I,onOpenChange:H,dir:L,triggerPointerDownPosRef:U,disabled:w,name:y,autoComplete:p,form:k,nativeOptions:q,nativeSelectKey:Z,isFormControl:K};return r.jsx(Jk,{...N,children:r.jsx(T_,{scope:n,...he,children:r.jsx(af.Provider,{scope:n,children:r.jsx(A_,{scope:n,onNativeOptionAdd:ue,onNativeOptionRemove:z,children:g5(S)?S(he):i})})})})}$t(m5,"SelectProvider");var __=$t(e=>{const{__scopeSelect:n,children:i,...o}=e;return r.jsx(m5,{__scopeSelect:n,...o,internal_do_not_use_render:({isFormControl:l})=>r.jsxs(r.Fragment,{children:[i,l?r.jsx(nR,{__scopeSelect:n}):null]})})},"Select"),R_="SelectTrigger",O_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,disabled:l=!1,...c}=n,u=ug(o),h=Uo(R_,o),f=h.disabled||l,v=qt(i,h.onTriggerChange),y=cg(o),p=j.useRef("touch"),[w,b,k]=dg(N=>{const C=y().filter(T=>!T.disabled),A=C.find(T=>T.value===h.value),E=hg(C,N,A);E!==void 0&&h.onValueChange(E.value)}),S=$t(N=>{f||(h.onOpenChange(!0),k()),N&&(h.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})},"handleOpen");return r.jsx(e5,{asChild:!0,...u,children:r.jsx(hn.button,{type:"button",role:"combobox","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":vu(h.value)?"":void 0,...c,ref:v,onClick:_t(c.onClick,N=>{N.currentTarget.focus(),p.current!=="mouse"&&S(N)}),onPointerDown:_t(c.onPointerDown,N=>{p.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:_t(c.onKeyDown,N=>{const C=w.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&b(N.key),!(C&&N.key===" ")&&C_.includes(N.key)&&(S(),N.preventDefault())})})})},"SelectTrigger")),D_="SelectValue",z_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,className:l,style:c,children:u,placeholder:h="",...f}=n,v=Uo(D_,o),{onValueNodeHasChildrenChange:y}=v,p=u!==void 0,w=qt(i,v.onValueNodeChange);ea(()=>{y(p)},[y,p]);const b=vu(v.value);return r.jsx(hn.span,{...f,asChild:b?!1:f.asChild,ref:w,style:{pointerEvents:"none"},children:r.jsx(j.Fragment,{children:b?h:u},b?"placeholder":"value")})},"SelectValue")),L_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,children:l,...c}=n;return r.jsx(hn.span,{"aria-hidden":!0,...c,ref:i,children:l||"▼"})},"SelectIcon")),B_="SelectPortal",[I_,P_]=Fs(B_,{forceMount:void 0}),q_=$t(e=>{const{__scopeSelect:n,forceMount:i,...o}=e;return r.jsx(I_,{scope:e.__scopeSelect,forceMount:i,children:r.jsx(Vv,{asChild:!0,...o})})},"SelectPortal"),Bs="SelectContent",F_=j.forwardRef($t(function(n,i){const o=P_(Bs,n.__scopeSelect),{forceMount:l=o.forceMount,...c}=n,u=Uo(Bs,n.__scopeSelect),[h,f]=j.useState();return ea(()=>{f(new DocumentFragment)},[]),r.jsx(mr,{present:l||u.open,children:({present:v})=>v?r.jsx($_,{...c,ref:i}):r.jsx(H_,{...c,fragment:h})})},"SelectContent")),H_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,children:l,fragment:c}=n;return c?Po.createPortal(r.jsx(p5,{scope:o,children:r.jsx(af.Slot,{scope:o,children:r.jsx("div",{ref:i,children:l})})}),c):null},"SelectContentFragment")),Ei=10,[p5,rf]=Fs(Bs),U_=cr("SelectContent.RemoveScroll"),$_=j.forwardRef($t(function(n,i){const{__scopeSelect:o}=n,{position:l="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:h,side:f,sideOffset:v,align:y,alignOffset:p,arrowPadding:w,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:C,...A}=n,E=Uo(Bs,o),[T,R]=j.useState(null),[_,L]=j.useState(null),I=qt(i,R),[H,O]=j.useState(null),[P,U]=j.useState(null),Y=cg(o),[K,q]=j.useState(!1),Q=j.useRef(!1);j.useEffect(()=>{if(T)return Yv(T)},[T]),fu();const V=j.useCallback(ee=>{const[me,...te]=Y().map(je=>je.ref.current),[ce]=te.slice(-1),J=document.activeElement;for(const je of ee)if(je===J||(je==null||je.scrollIntoView({block:"nearest"}),je===me&&_&&(_.scrollTop=0),je===ce&&_&&(_.scrollTop=_.scrollHeight),je==null||je.focus(),document.activeElement!==J))return},[Y,_]),Z=j.useCallback(()=>V([H,T]),[V,H,T]);j.useEffect(()=>{K&&Z()},[K,Z]);const{onOpenChange:ue,triggerPointerDownPosRef:z}=E;j.useEffect(()=>{if(T){let ee={x:0,y:0};const me=$t(ce=>{var J,je;ee={x:Math.abs(Math.round(ce.pageX)-(((J=z.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((je=z.current)==null?void 0:je.y)??0))}},"handlePointerMove"),te=$t(ce=>{ee.x<=10&&ee.y<=10?ce.preventDefault():ce.composedPath().includes(T)||ue(!1),document.removeEventListener("pointermove",me),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",te,{capture:!0})}}},[T,ue,z]),j.useEffect(()=>{const ee=$t(()=>ue(!1),"close");return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[ue]);const[he,oe]=dg(ee=>{const me=Y().filter(J=>!J.disabled),te=me.find(J=>J.ref.current===document.activeElement),ce=hg(me,ee,te);ce&&setTimeout(()=>{var J;return(J=ce.ref.current)==null?void 0:J.focus()})}),D=j.useCallback((ee,me,te)=>{const ce=!Q.current&&!te;(E.value!==void 0&&E.value===me||ce)&&(O(ee),ce&&(Q.current=!0))},[E.value]),F=j.useCallback(()=>T==null?void 0:T.focus(),[T]),ie=j.useCallback((ee,me,te)=>{const ce=!Q.current&&!te;(E.value!==void 0&&E.value===me||ce)&&U(ee)},[E.value]),$=l==="popper"?_b:V_,X=$===_b?{side:f,sideOffset:v,align:y,alignOffset:p,arrowPadding:w,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:C}:{};return r.jsx(p5,{scope:o,content:T,viewport:_,onViewportChange:L,itemRefCallback:D,selectedItem:H,onItemLeave:F,itemTextRefCallback:ie,focusSelectedItem:Z,selectedItemText:P,position:l,isPositioned:K,searchRef:he,children:r.jsx(Vh,{as:U_,allowPinchZoom:!0,children:r.jsx(Uv,{asChild:!0,trapped:E.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:_t(c,ee=>{var me;(me=E.trigger)==null||me.focus({preventScroll:!0}),ee.preventDefault()}),children:r.jsx(Fv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:r.jsx($,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ee=>ee.preventDefault(),...A,...X,onPlaced:()=>q(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:_t(A.onKeyDown,ee=>{const me=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!me&&ee.key.length===1&&oe(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let ce=Y().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const J=ee.target,je=ce.indexOf(J);ce=ce.slice(je+1)}setTimeout(()=>V(ce)),ee.preventDefault()}})})})})})})},"SelectContentImpl")),V_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,onPlaced:l,...c}=n,u=Uo(Bs,o),h=rf(Bs,o),[f,v]=j.useState(null),[y,p]=j.useState(null),w=qt(i,p),b=cg(o),k=j.useRef(!1),S=j.useRef(!0),{viewport:N,selectedItem:C,selectedItemText:A,focusSelectedItem:E}=h,T=j.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&y&&N&&C&&A){const I=u.trigger.getBoundingClientRect(),H=y.getBoundingClientRect(),O=u.valueNode.getBoundingClientRect(),P=A.getBoundingClientRect();if(u.dir!=="rtl"){const J=P.left-H.left,je=O.left-J,Re=I.left-je,De=I.width+Re,Pe=Math.max(De,H.width),Le=window.innerWidth-Ei,He=Th(je,[Ei,Math.max(Ei,Le-Pe)]);f.style.minWidth=De+"px",f.style.left=He+"px"}else{const J=H.right-P.right,je=window.innerWidth-O.right-J,Re=window.innerWidth-I.right-je,De=I.width+Re,Pe=Math.max(De,H.width),Le=window.innerWidth-Ei,He=Th(je,[Ei,Math.max(Ei,Le-Pe)]);f.style.minWidth=De+"px",f.style.right=He+"px"}const U=b(),Y=window.innerHeight-Ei*2,K=N.scrollHeight,q=window.getComputedStyle(y),Q=parseInt(q.borderTopWidth,10),V=parseInt(q.paddingTop,10),Z=parseInt(q.borderBottomWidth,10),ue=parseInt(q.paddingBottom,10),z=Q+V+K+ue+Z,he=Math.min(C.offsetHeight*5,z),oe=window.getComputedStyle(N),D=parseInt(oe.paddingTop,10),F=parseInt(oe.paddingBottom,10),ie=I.top+I.height/2-Ei,$=Y-ie,X=C.offsetHeight/2,ee=C.offsetTop+X,me=Q+V+ee,te=z-me;if(me<=ie){const J=U.length>0&&C===U[U.length-1].ref.current;f.style.bottom="0px";const je=y.clientHeight-N.offsetTop-N.offsetHeight,Re=Math.max($,X+(J?F:0)+je+Z),De=me+Re;f.style.height=De+"px"}else{const J=U.length>0&&C===U[0].ref.current;f.style.top="0px";const Re=Math.max(ie,Q+N.offsetTop+(J?D:0)+X)+te;f.style.height=Re+"px",N.scrollTop=me-ie+N.offsetTop}f.style.margin=`${Ei}px 0`,f.style.minHeight=he+"px",f.style.maxHeight=Y+"px",l==null||l(),requestAnimationFrame(()=>k.current=!0)}},[b,u.trigger,u.valueNode,f,y,N,C,A,u.dir,l]);ea(()=>T(),[T]);const[R,_]=j.useState();ea(()=>{y&&_(window.getComputedStyle(y).zIndex)},[y]);const L=j.useCallback(I=>{I&&S.current===!0&&(T(),E==null||E(),S.current=!1)},[T,E]);return r.jsx(G_,{scope:o,contentWrapper:f,shouldExpandOnScrollRef:k,onScrollButtonChange:L,children:r.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:r.jsx(hn.div,{...c,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})},"SelectItemAlignedPosition")),_b=j.forwardRef($t(function(n,i){const{__scopeSelect:o,align:l="start",collisionPadding:c=Ei,...u}=n,h=ug(o);return r.jsx(t5,{...h,...u,ref:i,align:l,collisionPadding:c,style:{boxSizing:"border-box",...u.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_,Y_]=Fs(Bs,{}),Rb="SelectViewport",K_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,nonce:l,...c}=n,u=rf(Rb,o),h=Y_(Rb,o),f=qt(i,u.onViewportChange),v=j.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(af.Slot,{scope:o,children:r.jsx(hn.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:_t(c.onScroll,y=>{const p=y.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:b}=h;if(b!=null&&b.current&&w){const k=Math.abs(v.current-p.scrollTop);if(k>0){const S=window.innerHeight-Ei*2,N=parseFloat(w.style.minHeight),C=parseFloat(w.style.height),A=Math.max(N,C);if(A<S){const E=A+k,T=Math.min(S,E),R=E-T;w.style.height=T+"px",w.style.bottom==="0px"&&(p.scrollTop=R>0?R:0,w.style.justifyContent="flex-end")}}}v.current=p.scrollTop})})})]})},"SelectViewport")),X_="SelectGroup",[Z$,W$]=Fs(X_),nv="SelectItem",[Q_,v5]=Fs(nv),Z_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,value:l,disabled:c=!1,textValue:u,...h}=n,f=Uo(nv,o),v=rf(nv,o),y=f.value===l,[p,w]=j.useState(u??""),[b,k]=j.useState(!1),S=Jn(T=>{var R;return(R=v.itemRefCallback)==null?void 0:R.call(v,T,l,c)}),N=qt(i,S),C=As(),A=j.useRef("touch"),E=$t(()=>{c||(f.onValueChange(l),f.onOpenChange(!1))},"handleSelect");return r.jsx(Q_,{scope:o,value:l,disabled:c,textId:C,isSelected:y,onItemTextChange:j.useCallback(T=>{w(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:r.jsx(af.ItemSlot,{scope:o,value:l,disabled:c,textValue:p,children:r.jsx(hn.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,...h,ref:N,onFocus:_t(h.onFocus,()=>k(!0)),onBlur:_t(h.onBlur,()=>k(!1)),onClick:_t(h.onClick,()=>{A.current!=="mouse"&&E()}),onPointerUp:_t(h.onPointerUp,()=>{A.current==="mouse"&&E()}),onPointerDown:_t(h.onPointerDown,T=>{A.current=T.pointerType}),onPointerMove:_t(h.onPointerMove,T=>{var R;A.current=T.pointerType,c?(R=v.onItemLeave)==null||R.call(v):A.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_t(h.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=v.onItemLeave)==null||R.call(v))}),onKeyDown:_t(h.onKeyDown,T=>{var _;c||T.target!==T.currentTarget||((_=v.searchRef)==null?void 0:_.current)!==""&&T.key===" "||(N_.includes(T.key)&&E(),T.key===" "&&T.preventDefault())})})})})},"SelectItem")),Yd="SelectItemText",W_=j.forwardRef($t(function(n,i){const{__scopeSelect:o,className:l,style:c,...u}=n,h=Uo(Yd,o),f=rf(Yd,o),v=v5(Yd,o),y=M_(Yd,o),[p,w]=j.useState(null),b=Jn(E=>{var T;return(T=f.itemTextRefCallback)==null?void 0:T.call(f,E,v.value,v.disabled)}),k=qt(i,w,v.onItemTextChange,b),S=p==null?void 0:p.textContent,N=j.useMemo(()=>r.jsx("option",{value:v.value,disabled:v.disabled,children:S},v.value),[v.disabled,v.value,S]),{onNativeOptionAdd:C,onNativeOptionRemove:A}=y;return ea(()=>(C(N),()=>A(N)),[C,A,N]),r.jsxs(r.Fragment,{children:[r.jsx(hn.span,{id:v.textId,...u,ref:k}),v.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!vu(h.value)?Po.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),J_="SelectItemIndicator",eR=j.forwardRef($t(function(n,i){const{__scopeSelect:o,...l}=n;return v5(J_,o).isSelected?r.jsx(hn.span,{"aria-hidden":!0,...l,ref:i}):null},"SelectItemIndicator")),tR="SelectBubbleInput",nR=j.forwardRef($t(function({__scopeSelect:n,...i},o){const l=Uo(tR,n),{value:c,onValueChange:u,required:h,disabled:f,name:v,autoComplete:y,form:p}=l,{nativeOptions:w,nativeSelectKey:b}=l,k=j.useRef(null),S=qt(o,k),N=c??"",C=n5(N),A=Array.from(w).some(E=>(E.props.value??"")==="");return j.useEffect(()=>{const E=k.current;if(!E)return;const T=window.HTMLSelectElement.prototype,_=Object.getOwnPropertyDescriptor(T,"value").set;if(C!==N&&_){const L=new Event("change",{bubbles:!0});_.call(E,N),E.dispatchEvent(L)}},[C,N]),r.jsxs(hn.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:v,autoComplete:y,disabled:f,form:p,onChange:E=>u(E.target.value),...i,style:{...GE,...i.style},ref:S,defaultValue:N,children:[vu(c)&&!A?r.jsx("option",{value:""}):null,Array.from(w)]},b)},"SelectBubbleInput"));function g5(e){return typeof e=="function"}$t(g5,"isFunction");function vu(e){return e===""||e===void 0}$t(vu,"shouldShowPlaceholder");function dg(e){const n=Jn(e),i=j.useRef(""),o=j.useRef(0),l=j.useCallback(u=>{const h=i.current+u;n(h),$t((function f(v){i.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(h)},[n]),c=j.useCallback(()=>{i.current="",window.clearTimeout(o.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(o.current),[]),[i,l,c]}$t(dg,"useTypeaheadSearch");function hg(e,n,i){const l=n.length>1&&Array.from(n).every(v=>v===n[0])?n[0]:n,c=i?e.indexOf(i):-1;let u=y5(e,Math.max(c,0));l.length===1&&(u=u.filter(v=>v!==i));const f=u.find(v=>v.textValue.toLowerCase().startsWith(l.toLowerCase()));return f!==i?f:void 0}$t(hg,"findNextItem");function y5(e,n){return e.map((i,o)=>e[(n+o)%e.length])}$t(y5,"wrapArray");const aR=Bv("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 ke({className:e,variant:n="default",size:i="default",asChild:o=!1,...l}){const c=o?BE:"button";return r.jsx(c,{"data-slot":"button","data-variant":n,"data-size":i,className:Ln(aR({variant:n,size:i,className:e})),...l})}const x5=100;function iR(e){const n=e.trim(),i=n.startsWith("<")&&n.endsWith(">")?oR(n):null;if(!(i!=null&&i.length))return null;const o=b5(i,0,0)[0];for(;o.length&&!o[0].text.trim();)o.shift();for(;o.length&&!o.at(-1).text.trim();)o.pop();return o.length?o:null}function b5(e,n,i){const o=[];let l=n;for(;l<e.length;){const c=e[l];if(c.kind==="close")return[o,l+1];if(c.kind==="text"){o.push(...rR(c.text,i)),l++;continue}if(c.kind==="self"){o.push(...Ob(c,i)),l++;continue}const u=e[l+1],h=e[l+2],f=j5(c.attrs);if((u==null?void 0:u.kind)==="close"&&u.name===c.name){o.push({depth:i,text:`<${c.name}${f} />`}),l+=2;continue}if((u==null?void 0:u.kind)==="text"&&(h==null?void 0:h.kind)==="close"&&h.name===c.name&&!u.text.includes(`
600
+ `)){const p=`<${c.name}${f}>${u.text.trim()}</${c.name}>`;if(p.length<=x5){o.push({depth:i,text:p}),l+=3;continue}}o.push(...Ob(c,i));const[v,y]=b5(e,l+1,i+1);o.push(...v,{depth:i,text:`</${c.name}>`}),l=y}return[o,l]}function rR(e,n){const i=e.split(`
601
+ `);for(;i.length&&!i[0].trim();)i.shift();for(;i.length&&!i.at(-1).trim();)i.pop();return i.map(o=>({depth:n,text:o.trimEnd()}))}function j5(e){return e.map(n=>` ${n}`).join("")}function Ob(e,n){const i=j5(e.attrs),o=e.kind==="self"?" />":">",l=`<${e.name}${i}${o}`;if(l.length<=x5||!e.attrs.length)return[{depth:n,text:l}];const c=e.attrs.map(u=>` ${u}`);return c[c.length-1]=`${c[c.length-1]}${o}`,[{depth:n,text:`<${e.name}`},...c.map(u=>({depth:n,text:u}))]}function oR(e){const n=[],i=[];let o=0;for(;o<e.length;){const l=e.indexOf("<",o);if(l<0){n.push({kind:"text",text:e.slice(o)});break}l>o&&n.push({kind:"text",text:e.slice(o,l)});let c=l+1,u=null;for(;c<e.length;c++){const p=e[c];if(u)p===u&&(u=null);else if(p==='"'||p==="'")u=p;else if(p===">")break}if(c>=e.length)return null;const h=e.slice(l+1,c).trim(),f=h.startsWith("/"),v=h.endsWith("/"),y=(f?h.slice(1):v?h.slice(0,-1):h).trim().split(/[\s/]/,1)[0]??"";if(!/^[A-Za-z][\w.:-]*$/.test(y))return null;if(f){if(i.pop()!==y)return null;n.push({kind:"close",name:y,attrs:[]})}else v||i.push(y),n.push({kind:v?"self":"open",name:y,attrs:sR(h.slice(y.length))});o=c+1}return i.length?null:n}function sR(e){const n=[],i=/([\w.:-]+)\s*=\s*("(?:[^"]*)"|'(?:[^']*)')|([\w.:-]+)/g;for(const o of e.matchAll(i))n.push(o[0].replace(/\s*=\s*/,"="));return n}const lR=5*6e4,Ms=e=>new Date(e).toDateString(),fg=(e,n)=>n===void 0||Ms(e)!==Ms(n),w5=(e,n,i=n==null?void 0:n.createdAt)=>fg(e.createdAt,i)||(n==null?void 0:n.senderId)!==e.senderId||e.createdAt-n.createdAt>=lR;function cR(e){const n=new Date,i=new Date(e),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()-1);if(Ms(e)===Ms(n.getTime()))return m("chat.today");if(Ms(e)===o.toDateString())return m("chat.yesterday");const l=sr()==="zh"?"long":"short";return i.getFullYear()===n.getFullYear()?ta(e,{weekday:"short",month:l,day:"numeric"}):ta(e,{year:"numeric",month:l,day:"numeric"})}const uR=e=>ta(e,{year:"numeric",month:sr()==="zh"?"long":"short",day:"numeric",hour:sr()==="zh"?"2-digit":"numeric",minute:"2-digit"}),mg=e=>Ms(e)===Ms(Date.now())?Oo(e):`${qh(e)} ${Oo(e)}`;function k5({time:e}){return r.jsx("div",{className:"jv-day",role:"separator",children:r.jsx("span",{children:cR(e)})})}function av({time:e,className:n}){return r.jsx("time",{className:n,dateTime:new Date(e).toISOString(),title:uR(e),children:Oo(e)})}function dR(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const hR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mR={};function Db(e,n){return(mR.jsx?fR:hR).test(e)}const pR=/[ \t\n\f\r]/g;function vR(e){return typeof e=="object"?e.type==="text"?zb(e.value):!1:zb(e)}function zb(e){return e.replace(pR,"")===""}class gu{constructor(n,i,o){this.normal=i,this.property=n,o&&(this.space=o)}}gu.prototype.normal={};gu.prototype.property={};gu.prototype.space=void 0;function S5(e,n){const i={},o={};for(const l of e)Object.assign(i,l.property),Object.assign(o,l.normal);return new gu(i,o,n)}function iv(e){return e.toLowerCase()}class La{constructor(n,i){this.attribute=i,this.property=n}}La.prototype.attribute="";La.prototype.booleanish=!1;La.prototype.boolean=!1;La.prototype.commaOrSpaceSeparated=!1;La.prototype.commaSeparated=!1;La.prototype.defined=!1;La.prototype.mustUseProperty=!1;La.prototype.number=!1;La.prototype.overloadedBoolean=!1;La.prototype.property="";La.prototype.spaceSeparated=!1;La.prototype.space=void 0;let gR=0;const ut=Hs(),Rn=Hs(),rv=Hs(),Ae=Hs(),Zt=Hs(),_s=Hs(),ei=Hs();function Hs(){return 2**++gR}const ov=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Rn,commaOrSpaceSeparated:ei,commaSeparated:_s,number:Ae,overloadedBoolean:rv,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Zp=Object.keys(ov);class pg extends La{constructor(n,i,o,l){let c=-1;if(super(n,i),Lb(this,"space",l),typeof o=="number")for(;++c<Zp.length;){const u=Zp[c];Lb(this,Zp[c],(o&ov[u])===ov[u])}}}pg.prototype.defined=!0;function Lb(e,n,i){i&&(e[n]=i)}function Gl(e){const n={},i={};for(const[o,l]of Object.entries(e.properties)){const c=new pg(o,e.transform(e.attributes||{},o),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(c.mustUseProperty=!0),n[o]=c,i[iv(o)]=o,i[iv(c.attribute)]=o}return new gu(n,i,e.space)}const C5=Gl({properties:{ariaActiveDescendant:null,ariaAtomic:Rn,ariaAutoComplete:null,ariaBusy:Rn,ariaChecked:Rn,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:Rn,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:Rn,ariaFlowTo:Zt,ariaGrabbed:Rn,ariaHasPopup:null,ariaHidden:Rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:Ae,ariaLive:null,ariaModal:Rn,ariaMultiLine:Rn,ariaMultiSelectable:Rn,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:Rn,ariaReadOnly:Rn,ariaRelevant:null,ariaRequired:Rn,ariaRoleDescription:Zt,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:Rn,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function N5(e,n){return n in e?e[n]:n}function E5(e,n){return N5(e,n.toLowerCase())}const yR=Gl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alpha:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:Zt,autoFocus:ut,autoPlay:ut,blocking:Zt,capture:null,charSet:null,checked:ut,cite:null,className:Zt,closedBy:null,colorSpace:null,cols:Ae,colSpan:Ae,command:null,commandFor:null,content:null,contentEditable:Rn,controls:ut,controlsList:Zt,coords:Ae|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:rv,draggable:Rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:Zt,height:Ae,hidden:rv,high:Ae,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:ut,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:Ae,pattern:null,ping:Zt,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:Zt,required:ut,reversed:ut,rows:Ae,rowSpan:Ae,sandbox:Zt,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootClonable:ut,shadowRootCustomElementRegistry:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shadowRootSerializable:ut,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:Rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:Rn,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:Rn,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ut,disablePictureInPicture:ut,disableRemotePlayback:ut,exportParts:_s,part:Zt,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:E5}),xR=Gl({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:ei,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:Zt,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:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,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:Ae,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:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ei,rev:ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ei,requiredFeatures:ei,requiredFonts:ei,requiredFormats:ei,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:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ei,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N5}),T5=Gl({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()}}),A5=Gl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:E5}),M5=Gl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),bR={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"},jR=/[A-Z]/g,Bb=/-[a-z]/g,wR=/^data[-\w.:]+$/i;function kR(e,n){const i=iv(n);let o=n,l=La;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&wR.test(n)){if(n.charAt(4)==="-"){const c=n.slice(5).replace(Bb,CR);o="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=n.slice(4);if(!Bb.test(c)){let u=c.replace(jR,SR);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}l=pg}return new l(o,n)}function SR(e){return"-"+e.toLowerCase()}function CR(e){return e.charAt(1).toUpperCase()}const NR=S5([C5,yR,T5,A5,M5],"html"),vg=S5([C5,xR,T5,A5,M5],"svg");function ER(e){return e.join(" ").trim()}var Tl={},Wp,Ib;function TR(){if(Ib)return Wp;Ib=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,h=/^\s+|\s+$/g,f=`
602
+ `,v="/",y="*",p="",w="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 A=1,E=1;function T(K){var q=K.match(n);q&&(A+=q.length);var Q=K.lastIndexOf(f);E=~Q?K.length-Q:E+K.length}function R(){var K={line:A,column:E};return function(q){return q.position=new _(K),H(),q}}function _(K){this.start=K,this.end={line:A,column:E},this.source=C.source}_.prototype.content=N;function L(K){var q=new Error(C.source+":"+A+":"+E+": "+K);if(q.reason=K,q.filename=C.source,q.line=A,q.column=E,q.source=N,!C.silent)throw q}function I(K){var q=K.exec(N);if(q){var Q=q[0];return T(Q),N=N.slice(Q.length),q}}function H(){I(i)}function O(K){var q;for(K=K||[];q=P();)q!==!1&&K.push(q);return K}function P(){var K=R();if(!(v!=N.charAt(0)||y!=N.charAt(1))){for(var q=2;p!=N.charAt(q)&&(y!=N.charAt(q)||v!=N.charAt(q+1));)++q;if(q+=2,p===N.charAt(q-1))return L("End of comment missing");var Q=N.slice(2,q-2);return E+=2,T(Q),N=N.slice(q),E+=2,K({type:w,comment:Q})}}function U(){var K=R(),q=I(o);if(q){if(P(),!I(l))return L("property missing ':'");var Q=I(c),V=K({type:b,property:S(q[0].replace(e,p)),value:Q?S(Q[0].replace(e,p)):p});return I(u),V}}function Y(){var K=[];O(K);for(var q;q=U();)q!==!1&&(K.push(q),O(K));return K}return H(),Y()}function S(N){return N?N.replace(h,p):p}return Wp=k,Wp}var Pb;function AR(){if(Pb)return Tl;Pb=1;var e=Tl&&Tl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.default=i;const n=e(TR());function i(o,l){let c=null;if(!o||typeof o!="string")return c;const u=(0,n.default)(o),h=typeof l=="function";return u.forEach(f=>{if(f.type!=="declaration")return;const{property:v,value:y}=f;h?l(v,y,f):y&&(c=c||{},c[v]=y)}),c}return Tl}var Ic={},qb;function MR(){if(qb)return Ic;qb=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(v){return!v||i.test(v)||e.test(v)},u=function(v,y){return y.toUpperCase()},h=function(v,y){return"".concat(y,"-")},f=function(v,y){return y===void 0&&(y={}),c(v)?v:(v=v.toLowerCase(),y.reactCompat?v=v.replace(l,h):v=v.replace(o,h),v.replace(n,u))};return Ic.camelCase=f,Ic}var Pc,Fb;function _R(){if(Fb)return Pc;Fb=1;var e=Pc&&Pc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(AR()),i=MR();function o(l,c){var u={};return!l||typeof l!="string"||(0,n.default)(l,function(h,f){h&&f&&(u[(0,i.camelCase)(h,c)]=f)}),u}return o.default=o,Pc=o,Pc}var RR=_R();const OR=Nv(RR),_5=R5("end"),gg=R5("start");function R5(e){return n;function n(i){const o=i&&i.position&&i.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function DR(e){const n=gg(e),i=_5(e);if(n&&i)return{start:n,end:i}}function Xc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hb(e.position):"start"in e||"end"in e?Hb(e):"line"in e||"column"in e?sv(e):""}function sv(e){return Ub(e&&e.line)+":"+Ub(e&&e.column)}function Hb(e){return sv(e&&e.start)+"-"+sv(e&&e.end)}function Ub(e){return e&&typeof e=="number"?e:1}class ca extends Error{constructor(n,i,o){super(),typeof i=="string"&&(o=i,i=void 0);let l="",c={},u=!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&&(u=!0,l=n.message,c.cause=n),!c.ruleId&&!c.source&&typeof o=="string"){const f=o.indexOf(":");f===-1?c.ruleId=o:(c.source=o.slice(0,f),c.ruleId=o.slice(f+1))}if(!c.place&&c.ancestors&&c.ancestors){const f=c.ancestors[c.ancestors.length-1];f&&(c.place=f.position)}const h=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=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=h?h.line:void 0,this.name=Xc(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=u&&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}}ca.prototype.file="";ca.prototype.name="";ca.prototype.reason="";ca.prototype.message="";ca.prototype.stack="";ca.prototype.column=void 0;ca.prototype.line=void 0;ca.prototype.ancestors=void 0;ca.prototype.cause=void 0;ca.prototype.fatal=void 0;ca.prototype.place=void 0;ca.prototype.ruleId=void 0;ca.prototype.source=void 0;const yg={}.hasOwnProperty,zR=new Map,LR=/[A-Z]/g,BR=new Set(["table","tbody","thead","tfoot","tr"]),IR=new Set(["td","th"]),O5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PR(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let o;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=YR(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");o=GR(i,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:o,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"?vg:NR,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 qR(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return FR(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return UR(e,n,i);if(n.type==="mdxjsEsm")return HR(e,n);if(n.type==="root")return $R(e,n,i);if(n.type==="text")return VR(e,n)}function qR(e,n,i){const o=e.schema;let l=o;n.tagName.toLowerCase()==="svg"&&o.space==="html"&&(l=vg,e.schema=l),e.ancestors.push(n);const c=L5(e,n.tagName,!1),u=KR(e,n);let h=bg(e,n);return BR.has(n.tagName)&&(h=h.filter(function(f){return typeof f=="string"?!vR(f):!0})),z5(e,u,c,n),xg(u,h),e.ancestors.pop(),e.schema=o,e.create(n,c,u,i)}function FR(e,n){if(n.data&&n.data.estree&&e.evaluater){const o=n.data.estree.body[0];return o.type,e.evaluater.evaluateExpression(o.expression)}ou(e,n.position)}function HR(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ou(e,n.position)}function UR(e,n,i){const o=e.schema;let l=o;n.name==="svg"&&o.space==="html"&&(l=vg,e.schema=l),e.ancestors.push(n);const c=n.name===null?e.Fragment:L5(e,n.name,!0),u=XR(e,n),h=bg(e,n);return z5(e,u,c,n),xg(u,h),e.ancestors.pop(),e.schema=o,e.create(n,c,u,i)}function $R(e,n,i){const o={};return xg(o,bg(e,n)),e.create(n,e.Fragment,o,i)}function VR(e,n){return n.value}function z5(e,n,i,o){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=o)}function xg(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function GR(e,n,i){return o;function o(l,c,u,h){const v=Array.isArray(u.children)?i:n;return h?v(c,u,h):v(c,u)}}function YR(e,n){return i;function i(o,l,c,u){const h=Array.isArray(c.children),f=gg(o);return n(l,c,u,h,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function KR(e,n){const i={};let o,l;for(l in n.properties)if(l!=="children"&&yg.call(n.properties,l)){const c=QR(e,l,n.properties[l]);if(c){const[u,h]=c;e.tableCellAlignToStyle&&u==="align"&&typeof h=="string"&&IR.has(n.tagName)?o=h:i[u]=h}}if(o){const c=i.style||(i.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return i}function XR(e,n){const i={};for(const o of n.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){const c=o.data.estree.body[0];c.type;const u=c.expression;u.type;const h=u.properties[0];h.type,Object.assign(i,e.evaluater.evaluateExpression(h.argument))}else ou(e,n.position);else{const l=o.name;let c;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&e.evaluater){const h=o.value.data.estree.body[0];h.type,c=e.evaluater.evaluateExpression(h.expression)}else ou(e,n.position);else c=o.value===null?!0:o.value;i[l]=c}return i}function bg(e,n){const i=[];let o=-1;const l=e.passKeys?new Map:zR;for(;++o<n.children.length;){const c=n.children[o];let u;if(e.passKeys){const f=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(f){const v=l.get(f)||0;u=f+"-"+v,l.set(f,v+1)}}const h=D5(e,c,u);h!==void 0&&i.push(h)}return i}function QR(e,n,i){const o=kR(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=o.commaSeparated?dR(i):ER(i)),o.property==="style"){let l=typeof i=="object"?i:ZR(e,String(i));return e.stylePropertyNameCase==="css"&&(l=WR(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&o.space?bR[o.property]||o.property:o.attribute,i]}}function ZR(e,n){try{return OR(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const o=i,l=new ca("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=O5+"#cannot-parse-style-attribute",l}}function L5(e,n,i){let o;if(!i)o={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let c=-1,u;for(;++c<l.length;){const h=Db(l[c])?{type:"Identifier",name:l[c]}:{type:"Literal",value:l[c]};u=u?{type:"MemberExpression",object:u,property:h,computed:!!(c&&h.type==="Literal"),optional:!1}:h}o=u}else o=Db(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(o.type==="Literal"){const l=o.value;return yg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(o);ou(e)}function ou(e,n){const i=new ca("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=O5+"#cannot-handle-mdx-estrees-without-createevaluater",i}function WR(e){const n={};let i;for(i in e)yg.call(e,i)&&(n[JR(i)]=e[i]);return n}function JR(e){let n=e.replace(LR,eO);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function eO(e){return"-"+e.toLowerCase()}const Jp={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"]},tO={};function jg(e,n){const i=tO,o=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,l=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return B5(e,o,l)}function B5(e,n,i){if(nO(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 $b(e.children,n,i)}return Array.isArray(e)?$b(e,n,i):""}function $b(e,n,i){const o=[];let l=-1;for(;++l<e.length;)o[l]=B5(e[l],n,i);return o.join("")}function nO(e){return!!(e&&typeof e=="object")}const Vb=document.createElement("i");function wg(e){const n="&"+e+";";Vb.innerHTML=n;const i=Vb.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function ni(e,n,i,o){const l=e.length;let c=0,u;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,i=i>0?i:0,o.length<1e4)u=Array.from(o),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);c<o.length;)u=o.slice(c,c+1e4),u.unshift(n,0),e.splice(...u),c+=1e4,n+=1e4}function mi(e,n){return e.length>0?(ni(e,e.length,0,n),e):n}const Gb={}.hasOwnProperty;function I5(e){const n={};let i=-1;for(;++i<e.length;)aO(n,e[i]);return n}function aO(e,n){let i;for(i in n){const l=(Gb.call(e,i)?e[i]:void 0)||(e[i]={}),c=n[i];let u;if(c)for(u in c){Gb.call(l,u)||(l[u]=[]);const h=c[u];iO(l[u],Array.isArray(h)?h:h?[h]:[])}}}function iO(e,n){let i=-1;const o=[];for(;++i<n.length;)(n[i].add==="after"?e:o).push(n[i]);ni(e,0,0,o)}function P5(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 _i(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ja=$o(/[A-Za-z]/),sa=$o(/[\dA-Za-z]/),rO=$o(/[#-'*+\--9=?A-Z^-~]/);function Ah(e){return e!==null&&(e<32||e===127)}const lv=$o(/\d/),oO=$o(/[\dA-Fa-f]/),sO=$o(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Wt(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const of=$o(new RegExp("\\p{P}|\\p{S}","u")),Is=$o(/\s/);function $o(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function Yl(e){const n=[];let i=-1,o=0,l=0;for(;++i<e.length;){const c=e.charCodeAt(i);let u="";if(c===37&&sa(e.charCodeAt(i+1))&&sa(e.charCodeAt(i+2)))l=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const h=e.charCodeAt(i+1);c<56320&&h>56319&&h<57344?(u=String.fromCharCode(c,h),l=1):u="�"}else u=String.fromCharCode(c);u&&(n.push(e.slice(o,i),encodeURIComponent(u)),o=i+l+1,u=""),l&&(i+=l,l=0)}return n.join("")+e.slice(o)}function Mt(e,n,i,o){const l=o?o-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(f){return jt(f)?(e.enter(i),h(f)):n(f)}function h(f){return jt(f)&&c++<l?(e.consume(f),h):(e.exit(i),n(f))}}const lO={tokenize:cO};function cO(e){const n=e.attempt(this.parser.constructs.contentInitial,o,l);let i;return n;function o(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Mt(e,n,"linePrefix")}function l(h){return e.enter("paragraph"),c(h)}function c(h){const f=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=f),i=f,u(h)}function u(h){if(h===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(h);return}return et(h)?(e.consume(h),e.exit("chunkText"),c):(e.consume(h),u)}}const uO={tokenize:dO},Yb={tokenize:hO};function dO(e){const n=this,i=[];let o=0,l,c,u;return h;function h(E){if(o<i.length){const T=i[o];return n.containerState=T[1],e.attempt(T[0].continuation,f,v)(E)}return v(E)}function f(E){if(o++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&A();const T=n.events.length;let R=T,_;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){_=n.events[R][1].end;break}C(o);let L=T;for(;L<n.events.length;)n.events[L][1].end={..._},L++;return ni(n.events,R+1,0,n.events.slice(T)),n.events.length=L,v(E)}return h(E)}function v(E){if(o===i.length){if(!l)return w(E);if(l.currentConstruct&&l.currentConstruct.concrete)return k(E);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Yb,y,p)(E)}function y(E){return l&&A(),C(o),w(E)}function p(E){return n.parser.lazy[n.now().line]=o!==i.length,u=n.now().offset,k(E)}function w(E){return n.containerState={},e.attempt(Yb,b,k)(E)}function b(E){return o++,i.push([n.currentConstruct,n.containerState]),w(E)}function k(E){if(E===null){l&&A(),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 et(E)?(e.consume(E),N(e.exit("chunkFlow")),o=0,n.interrupt=void 0,h):(e.consume(E),S)}function N(E,T){const R=n.sliceStream(E);if(T&&R.push(null),E.previous=c,c&&(c.next=E),c=E,l.defineSkip(E.start),l.write(R),n.parser.lazy[E.start.line]){let _=l.events.length;for(;_--;)if(l.events[_][1].start.offset<u&&(!l.events[_][1].end||l.events[_][1].end.offset>u))return;const L=n.events.length;let I=L,H,O;for(;I--;)if(n.events[I][0]==="exit"&&n.events[I][1].type==="chunkFlow"){if(H){O=n.events[I][1].end;break}H=!0}for(C(o),_=L;_<n.events.length;)n.events[_][1].end={...O},_++;ni(n.events,I+1,0,n.events.slice(L)),n.events.length=_}}function C(E){let T=i.length;for(;T-- >E;){const R=i[T];n.containerState=R[1],R[0].exit.call(n,e)}i.length=E}function A(){l.write([null]),c=void 0,l=void 0,n.containerState._closeFlow=void 0}}function hO(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 Pl(e){if(e===null||Wt(e)||Is(e))return 1;if(of(e))return 2}function sf(e,n,i){const o=[];let l=-1;for(;++l<e.length;){const c=e[l].resolveAll;c&&!o.includes(c)&&(n=c(n,i),o.push(c))}return n}const cv={name:"attention",resolveAll:fO,tokenize:mO};function fO(e,n){let i=-1,o,l,c,u,h,f,v,y;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(o=i;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&n.sliceSerialize(e[o][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[o][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;f=e[o][1].end.offset-e[o][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const p={...e[o][1].end},w={...e[i][1].start};Kb(p,-f),Kb(w,f),u={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[o][1].end}},h={type:f>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:w},c={type:f>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[i][1].start}},l={type:f>1?"strong":"emphasis",start:{...u.start},end:{...h.end}},e[o][1].end={...u.start},e[i][1].start={...h.end},v=[],e[o][1].end.offset-e[o][1].start.offset&&(v=mi(v,[["enter",e[o][1],n],["exit",e[o][1],n]])),v=mi(v,[["enter",l,n],["enter",u,n],["exit",u,n],["enter",c,n]]),v=mi(v,sf(n.parser.constructs.insideSpan.null,e.slice(o+1,i),n)),v=mi(v,[["exit",c,n],["enter",h,n],["exit",h,n],["exit",l,n]]),e[i][1].end.offset-e[i][1].start.offset?(y=2,v=mi(v,[["enter",e[i][1],n],["exit",e[i][1],n]])):y=0,ni(e,o-1,i-o+3,v),i=o+v.length-y-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function mO(e,n){const i=this.parser.constructs.attentionMarkers.null,o=this.previous,l=Pl(o);let c;return u;function u(f){return c=f,e.enter("attentionSequence"),h(f)}function h(f){if(f===c)return e.consume(f),h;const v=e.exit("attentionSequence"),y=Pl(f),p=!y||y===2&&l||i.includes(f),w=!l||l===2&&y||i.includes(o);return v._open=!!(c===42?p:p&&(l||!w)),v._close=!!(c===42?w:w&&(y||!p)),n(f)}}function Kb(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const pO={name:"autolink",tokenize:vO};function vO(e,n,i){let o=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 ja(b)?(e.consume(b),u):b===64?i(b):v(b)}function u(b){return b===43||b===45||b===46||sa(b)?(o=1,h(b)):v(b)}function h(b){return b===58?(e.consume(b),o=0,f):(b===43||b===45||b===46||sa(b))&&o++<32?(e.consume(b),h):(o=0,v(b))}function f(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||Ah(b)?i(b):(e.consume(b),f)}function v(b){return b===64?(e.consume(b),y):rO(b)?(e.consume(b),v):i(b)}function y(b){return sa(b)?p(b):i(b)}function p(b){return b===46?(e.consume(b),o=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):w(b)}function w(b){if((b===45||sa(b))&&o++<63){const k=b===45?w:p;return e.consume(b),k}return i(b)}}const yu={partial:!0,tokenize:gO};function gO(e,n,i){return o;function o(c){return jt(c)?Mt(e,l,"linePrefix")(c):l(c)}function l(c){return c===null||et(c)?n(c):i(c)}}const q5={continuation:{tokenize:xO},exit:bO,name:"blockQuote",tokenize:yO};function yO(e,n,i){const o=this;return l;function l(u){if(u===62){const h=o.containerState;return h.open||(e.enter("blockQuote",{_container:!0}),h.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return i(u)}function c(u){return jt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function xO(e,n,i){const o=this;return l;function l(u){return jt(u)?Mt(e,c,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(q5,n,i)(u)}}function bO(e){e.exit("blockQuote")}const F5={name:"characterEscape",tokenize:jO};function jO(e,n,i){return o;function o(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),l}function l(c){return sO(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(c)}}const H5={name:"characterReference",tokenize:wO};function wO(e,n,i){const o=this;let l=0,c,u;return h;function h(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),v):(e.enter("characterReferenceValue"),c=31,u=sa,y(p))}function v(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=oO,y):(e.enter("characterReferenceValue"),c=7,u=lv,y(p))}function y(p){if(p===59&&l){const w=e.exit("characterReferenceValue");return u===sa&&!wg(o.sliceSerialize(w))?i(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(p)&&l++<c?(e.consume(p),y):i(p)}}const Xb={partial:!0,tokenize:SO},Qb={concrete:!0,name:"codeFenced",tokenize:kO};function kO(e,n,i){const o=this,l={partial:!0,tokenize:R};let c=0,u=0,h;return f;function f(_){return v(_)}function v(_){const L=o.events[o.events.length-1];return c=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,h=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(_)}function y(_){return _===h?(u++,e.consume(_),y):u<3?i(_):(e.exit("codeFencedFenceSequence"),jt(_)?Mt(e,p,"whitespace")(_):p(_))}function p(_){return _===null||et(_)?(e.exit("codeFencedFence"),o.interrupt?n(_):e.check(Xb,S,T)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===null||et(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(_)):jt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,b,"whitespace")(_)):_===96&&_===h?i(_):(e.consume(_),w)}function b(_){return _===null||et(_)?p(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(_))}function k(_){return _===null||et(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(_)):_===96&&_===h?i(_):(e.consume(_),k)}function S(_){return e.attempt(l,T,N)(_)}function N(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),C}function C(_){return c>0&&jt(_)?Mt(e,A,"linePrefix",c+1)(_):A(_)}function A(_){return _===null||et(_)?e.check(Xb,S,T)(_):(e.enter("codeFlowValue"),E(_))}function E(_){return _===null||et(_)?(e.exit("codeFlowValue"),A(_)):(e.consume(_),E)}function T(_){return e.exit("codeFenced"),n(_)}function R(_,L,I){let H=0;return O;function O(q){return _.enter("lineEnding"),_.consume(q),_.exit("lineEnding"),P}function P(q){return _.enter("codeFencedFence"),jt(q)?Mt(_,U,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):U(q)}function U(q){return q===h?(_.enter("codeFencedFenceSequence"),Y(q)):I(q)}function Y(q){return q===h?(H++,_.consume(q),Y):H>=u?(_.exit("codeFencedFenceSequence"),jt(q)?Mt(_,K,"whitespace")(q):K(q)):I(q)}function K(q){return q===null||et(q)?(_.exit("codeFencedFence"),L(q)):I(q)}}}function SO(e,n,i){const o=this;return l;function l(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c)}function c(u){return o.parser.lazy[o.now().line]?i(u):n(u)}}const e0={name:"codeIndented",tokenize:NO},CO={partial:!0,tokenize:EO};function NO(e,n,i){const o=this;return l;function l(v){return e.enter("codeIndented"),Mt(e,c,"linePrefix",5)(v)}function c(v){const y=o.events[o.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(v):i(v)}function u(v){return v===null?f(v):et(v)?e.attempt(CO,u,f)(v):(e.enter("codeFlowValue"),h(v))}function h(v){return v===null||et(v)?(e.exit("codeFlowValue"),u(v)):(e.consume(v),h)}function f(v){return e.exit("codeIndented"),n(v)}}function EO(e,n,i){const o=this;return l;function l(u){return o.parser.lazy[o.now().line]?i(u):et(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):Mt(e,c,"linePrefix",5)(u)}function c(u){const h=o.events[o.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?n(u):et(u)?l(u):i(u)}}const TO={name:"codeText",previous:MO,resolve:AO,tokenize:_O};function AO(e){let n=e.length-4,i=3,o,l;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(o=i;++o<n;)if(e[o][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(o=i-1,n++;++o<=n;)l===void 0?o!==n&&e[o][1].type!=="lineEnding"&&(l=o):(o===n||e[o][1].type==="lineEnding")&&(e[l][1].type="codeTextData",o!==l+2&&(e[l][1].end=e[o-1][1].end,e.splice(l+2,o-l-2),n-=o-l-2,o=l+2),l=void 0);return e}function MO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _O(e,n,i){let o=0,l,c;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),h(p)}function h(p){return p===96?(e.consume(p),o++,h):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?i(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(c=e.enter("codeTextSequence"),l=0,y(p)):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),v(p))}function v(p){return p===null||p===32||p===96||et(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),v)}function y(p){return p===96?(e.consume(p),l++,y):l===o?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(c.type="codeTextData",v(p))}}class RO{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 o=i??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(n,o):n>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(n,i,o){const l=i||0;this.setCursor(Math.trunc(n));const c=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return o&&qc(this.left,o),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),qc(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),qc(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);qc(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);qc(this.left,i.reverse())}}}function qc(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 U5(e){const n={};let i=-1,o,l,c,u,h,f,v;const y=new RO(e);for(;++i<y.length;){for(;i in n;)i=n[i];if(o=y.get(i),i&&o[1].type==="chunkFlow"&&y.get(i-1)[1].type==="listItemPrefix"&&(f=o[1]._tokenizer.events,c=0,c<f.length&&f[c][1].type==="lineEndingBlank"&&(c+=2),c<f.length&&f[c][1].type==="content"))for(;++c<f.length&&f[c][1].type!=="content";)f[c][1].type==="chunkText"&&(f[c][1]._isInFirstContentOfListItem=!0,c++);if(o[0]==="enter")o[1].contentType&&(Object.assign(n,OO(y,i)),i=n[i],v=!0);else if(o[1]._container){for(c=i,l=void 0;c--;)if(u=y.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(o[1].end={...y.get(l)[1].start},h=y.slice(l,i),h.unshift(o),y.splice(l,i-l+1,h))}}return ni(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!v}function OO(e,n){const i=e.get(n)[1],o=e.get(n)[2];let l=n-1;const c=[];let u=i._tokenizer;u||(u=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const h=u.events,f=[],v={};let y,p,w=-1,b=i,k=0,S=0;const N=[S];for(;b;){for(;e.get(++l)[1]!==b;);c.push(l),b._tokenizer||(y=o.sliceStream(b),b.next||y.push(null),p&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=i;++w<h.length;)h[w][0]==="exit"&&h[w-1][0]==="enter"&&h[w][1].type===h[w-1][1].type&&h[w][1].start.line!==h[w][1].end.line&&(S=w+1,N.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),w=N.length;w--;){const C=h.slice(N[w],N[w+1]),A=c.pop();f.push([A,A+C.length-1]),e.splice(A,2,C)}for(f.reverse(),w=-1;++w<f.length;)v[k+f[w][0]]=k+f[w][1],k+=f[w][1]-f[w][0]-1;return v}const DO={resolve:LO,tokenize:BO},zO={partial:!0,tokenize:IO};function LO(e){return U5(e),e}function BO(e,n){let i;return o;function o(h){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),l(h)}function l(h){return h===null?c(h):et(h)?e.check(zO,u,c)(h):(e.consume(h),l)}function c(h){return e.exit("chunkContent"),e.exit("content"),n(h)}function u(h){return e.consume(h),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}}function IO(e,n,i){const o=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Mt(e,c,"linePrefix")}function c(u){if(u===null||et(u))return i(u);const h=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?n(u):e.interrupt(o.parser.constructs.flow,i,n)(u)}}function $5(e,n,i,o,l,c,u,h,f){const v=f||Number.POSITIVE_INFINITY;let y=0;return p;function p(C){return C===60?(e.enter(o),e.enter(l),e.enter(c),e.consume(C),e.exit(c),w):C===null||C===32||C===41||Ah(C)?i(C):(e.enter(o),e.enter(u),e.enter(h),e.enter("chunkString",{contentType:"string"}),S(C))}function w(C){return C===62?(e.enter(c),e.consume(C),e.exit(c),e.exit(l),e.exit(o),n):(e.enter(h),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===62?(e.exit("chunkString"),e.exit(h),w(C)):C===null||C===60||et(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||Wt(C))?(e.exit("chunkString"),e.exit(h),e.exit(u),e.exit(o),n(C)):y<v&&C===40?(e.consume(C),y++,S):C===41?(e.consume(C),y--,S):C===null||C===32||C===40||Ah(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 V5(e,n,i,o,l,c){const u=this;let h=0,f;return v;function v(b){return e.enter(o),e.enter(l),e.consume(b),e.exit(l),e.enter(c),y}function y(b){return h>999||b===null||b===91||b===93&&!f||b===94&&!h&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(c),e.enter(l),e.consume(b),e.exit(l),e.exit(o),n):et(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||et(b)||h++>999?(e.exit("chunkString"),y(b)):(e.consume(b),f||(f=!jt(b)),b===92?w:p)}function w(b){return b===91||b===92||b===93?(e.consume(b),h++,p):p(b)}}function G5(e,n,i,o,l,c){let u;return h;function h(w){return w===34||w===39||w===40?(e.enter(o),e.enter(l),e.consume(w),e.exit(l),u=w===40?41:w,f):i(w)}function f(w){return w===u?(e.enter(l),e.consume(w),e.exit(l),e.exit(o),n):(e.enter(c),v(w))}function v(w){return w===u?(e.exit(c),f(u)):w===null?i(w):et(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),Mt(e,v,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===u||w===null||et(w)?(e.exit("chunkString"),v(w)):(e.consume(w),w===92?p:y)}function p(w){return w===u||w===92?(e.consume(w),y):y(w)}}function Qc(e,n){let i;return o;function o(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i=!0,o):jt(l)?Mt(e,o,i?"linePrefix":"lineSuffix")(l):n(l)}}const PO={name:"definition",tokenize:FO},qO={partial:!0,tokenize:HO};function FO(e,n,i){const o=this;let l;return c;function c(b){return e.enter("definition"),u(b)}function u(b){return V5.call(o,e,h,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function h(b){return l=_i(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):i(b)}function f(b){return Wt(b)?Qc(e,v)(b):v(b)}function v(b){return $5(e,y,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(qO,p,p)(b)}function p(b){return jt(b)?Mt(e,w,"whitespace")(b):w(b)}function w(b){return b===null||et(b)?(e.exit("definition"),o.parser.defined.push(l),n(b)):i(b)}}function HO(e,n,i){return o;function o(h){return Wt(h)?Qc(e,l)(h):i(h)}function l(h){return G5(e,c,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return jt(h)?Mt(e,u,"whitespace")(h):u(h)}function u(h){return h===null||et(h)?n(h):i(h)}}const UO={name:"hardBreakEscape",tokenize:$O};function $O(e,n,i){return o;function o(c){return e.enter("hardBreakEscape"),e.consume(c),l}function l(c){return et(c)?(e.exit("hardBreakEscape"),n(c)):i(c)}}const VO={name:"headingAtx",resolve:GO,tokenize:YO};function GO(e,n){let i=e.length-2,o=3,l,c;return e[o][1].type==="whitespace"&&(o+=2),i-2>o&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(o===i-1||i-4>o&&e[i-2][1].type==="whitespace")&&(i-=o+1===i?2:4),i>o&&(l={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},c={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},ni(e,o,i-o+1,[["enter",l,n],["enter",c,n],["exit",c,n],["exit",l,n]])),e}function YO(e,n,i){let o=0;return l;function l(y){return e.enter("atxHeading"),c(y)}function c(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&o++<6?(e.consume(y),u):y===null||Wt(y)?(e.exit("atxHeadingSequence"),h(y)):i(y)}function h(y){return y===35?(e.enter("atxHeadingSequence"),f(y)):y===null||et(y)?(e.exit("atxHeading"),n(y)):jt(y)?Mt(e,h,"whitespace")(y):(e.enter("atxHeadingText"),v(y))}function f(y){return y===35?(e.consume(y),f):(e.exit("atxHeadingSequence"),h(y))}function v(y){return y===null||y===35||Wt(y)?(e.exit("atxHeadingText"),h(y)):(e.consume(y),v)}}const KO=["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"],Zb=["pre","script","style","textarea"],XO={concrete:!0,name:"htmlFlow",resolveTo:WO,tokenize:JO},QO={partial:!0,tokenize:tD},ZO={partial:!0,tokenize:eD};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 JO(e,n,i){const o=this;let l,c,u,h,f;return v;function v(D){return y(D)}function y(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),w):D===47?(e.consume(D),c=!0,S):D===63?(e.consume(D),l=3,o.interrupt?n:z):ja(D)?(e.consume(D),u=String.fromCharCode(D),N):i(D)}function w(D){return D===45?(e.consume(D),l=2,b):D===91?(e.consume(D),l=5,h=0,k):ja(D)?(e.consume(D),l=4,o.interrupt?n:z):i(D)}function b(D){return D===45?(e.consume(D),o.interrupt?n:z):i(D)}function k(D){const F="CDATA[";return D===F.charCodeAt(h++)?(e.consume(D),h===F.length?o.interrupt?n:U:k):i(D)}function S(D){return ja(D)?(e.consume(D),u=String.fromCharCode(D),N):i(D)}function N(D){if(D===null||D===47||D===62||Wt(D)){const F=D===47,ie=u.toLowerCase();return!F&&!c&&Zb.includes(ie)?(l=1,o.interrupt?n(D):U(D)):KO.includes(u.toLowerCase())?(l=6,F?(e.consume(D),C):o.interrupt?n(D):U(D)):(l=7,o.interrupt&&!o.parser.lazy[o.now().line]?i(D):c?A(D):E(D))}return D===45||sa(D)?(e.consume(D),u+=String.fromCharCode(D),N):i(D)}function C(D){return D===62?(e.consume(D),o.interrupt?n:U):i(D)}function A(D){return jt(D)?(e.consume(D),A):O(D)}function E(D){return D===47?(e.consume(D),O):D===58||D===95||ja(D)?(e.consume(D),T):jt(D)?(e.consume(D),E):O(D)}function T(D){return D===45||D===46||D===58||D===95||sa(D)?(e.consume(D),T):R(D)}function R(D){return D===61?(e.consume(D),_):jt(D)?(e.consume(D),R):E(D)}function _(D){return D===null||D===60||D===61||D===62||D===96?i(D):D===34||D===39?(e.consume(D),f=D,L):jt(D)?(e.consume(D),_):I(D)}function L(D){return D===f?(e.consume(D),f=null,H):D===null||et(D)?i(D):(e.consume(D),L)}function I(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Wt(D)?R(D):(e.consume(D),I)}function H(D){return D===47||D===62||jt(D)?E(D):i(D)}function O(D){return D===62?(e.consume(D),P):i(D)}function P(D){return D===null||et(D)?U(D):jt(D)?(e.consume(D),P):i(D)}function U(D){return D===45&&l===2?(e.consume(D),Q):D===60&&l===1?(e.consume(D),V):D===62&&l===4?(e.consume(D),he):D===63&&l===3?(e.consume(D),z):D===93&&l===5?(e.consume(D),ue):et(D)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(QO,oe,Y)(D)):D===null||et(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),U)}function Y(D){return e.check(ZO,K,oe)(D)}function K(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return D===null||et(D)?Y(D):(e.enter("htmlFlowData"),U(D))}function Q(D){return D===45?(e.consume(D),z):U(D)}function V(D){return D===47?(e.consume(D),u="",Z):U(D)}function Z(D){if(D===62){const F=u.toLowerCase();return Zb.includes(F)?(e.consume(D),he):U(D)}return ja(D)&&u.length<8?(e.consume(D),u+=String.fromCharCode(D),Z):U(D)}function ue(D){return D===93?(e.consume(D),z):U(D)}function z(D){return D===62?(e.consume(D),he):D===45&&l===2?(e.consume(D),z):U(D)}function he(D){return D===null||et(D)?(e.exit("htmlFlowData"),oe(D)):(e.consume(D),he)}function oe(D){return e.exit("htmlFlow"),n(D)}}function eD(e,n,i){const o=this;return l;function l(u){return et(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):i(u)}function c(u){return o.parser.lazy[o.now().line]?i(u):n(u)}}function tD(e,n,i){return o;function o(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(yu,n,i)}}const nD={name:"htmlText",tokenize:aD};function aD(e,n,i){const o=this;let l,c,u;return h;function h(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),v):z===47?(e.consume(z),R):z===63?(e.consume(z),E):ja(z)?(e.consume(z),I):i(z)}function v(z){return z===45?(e.consume(z),y):z===91?(e.consume(z),c=0,k):ja(z)?(e.consume(z),A):i(z)}function y(z){return z===45?(e.consume(z),b):i(z)}function p(z){return z===null?i(z):z===45?(e.consume(z),w):et(z)?(u=p,V(z)):(e.consume(z),p)}function w(z){return z===45?(e.consume(z),b):p(z)}function b(z){return z===62?Q(z):z===45?w(z):p(z)}function k(z){const he="CDATA[";return z===he.charCodeAt(c++)?(e.consume(z),c===he.length?S:k):i(z)}function S(z){return z===null?i(z):z===93?(e.consume(z),N):et(z)?(u=S,V(z)):(e.consume(z),S)}function N(z){return z===93?(e.consume(z),C):S(z)}function C(z){return z===62?Q(z):z===93?(e.consume(z),C):S(z)}function A(z){return z===null||z===62?Q(z):et(z)?(u=A,V(z)):(e.consume(z),A)}function E(z){return z===null?i(z):z===63?(e.consume(z),T):et(z)?(u=E,V(z)):(e.consume(z),E)}function T(z){return z===62?Q(z):E(z)}function R(z){return ja(z)?(e.consume(z),_):i(z)}function _(z){return z===45||sa(z)?(e.consume(z),_):L(z)}function L(z){return et(z)?(u=L,V(z)):jt(z)?(e.consume(z),L):Q(z)}function I(z){return z===45||sa(z)?(e.consume(z),I):z===47||z===62||Wt(z)?H(z):i(z)}function H(z){return z===47?(e.consume(z),Q):z===58||z===95||ja(z)?(e.consume(z),O):et(z)?(u=H,V(z)):jt(z)?(e.consume(z),H):Q(z)}function O(z){return z===45||z===46||z===58||z===95||sa(z)?(e.consume(z),O):P(z)}function P(z){return z===61?(e.consume(z),U):et(z)?(u=P,V(z)):jt(z)?(e.consume(z),P):H(z)}function U(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),l=z,Y):et(z)?(u=U,V(z)):jt(z)?(e.consume(z),U):(e.consume(z),K)}function Y(z){return z===l?(e.consume(z),l=void 0,q):z===null?i(z):et(z)?(u=Y,V(z)):(e.consume(z),Y)}function K(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||Wt(z)?H(z):(e.consume(z),K)}function q(z){return z===47||z===62||Wt(z)?H(z):i(z)}function Q(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function V(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Z}function Z(z){return jt(z)?Mt(e,ue,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):ue(z)}function ue(z){return e.enter("htmlTextData"),u(z)}}const kg={name:"labelEnd",resolveAll:sD,resolveTo:lD,tokenize:cD},iD={tokenize:uD},rD={tokenize:dD},oD={tokenize:hD};function sD(e){let n=-1;const i=[];for(;++n<e.length;){const o=e[n][1];if(i.push(e[n]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const l=o.type==="labelImage"?4:2;o.type="data",n+=l}}return e.length!==i.length&&ni(e,0,e.length,i),e}function lD(e,n){let i=e.length,o=0,l,c,u,h;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(u){if(e[i][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(c=i,l.type!=="labelLink")){o=2;break}}else l.type==="labelEnd"&&(u=i);const f={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},v={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[c+o+2][1].end},end:{...e[u-2][1].start}};return h=[["enter",f,n],["enter",v,n]],h=mi(h,e.slice(c+1,c+o+3)),h=mi(h,[["enter",y,n]]),h=mi(h,sf(n.parser.constructs.insideSpan.null,e.slice(c+o+4,u-3),n)),h=mi(h,[["exit",y,n],e[u-2],e[u-1],["exit",v,n]]),h=mi(h,e.slice(u+1)),h=mi(h,[["exit",f,n]]),ni(e,c,e.length,h),e}function cD(e,n,i){const o=this;let l=o.events.length,c,u;for(;l--;)if((o.events[l][1].type==="labelImage"||o.events[l][1].type==="labelLink")&&!o.events[l][1]._balanced){c=o.events[l][1];break}return h;function h(w){return c?c._inactive?p(w):(u=o.parser.defined.includes(_i(o.sliceSerialize({start:c.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),f):i(w)}function f(w){return w===40?e.attempt(iD,y,u?y:p)(w):w===91?e.attempt(rD,y,u?v:p)(w):u?y(w):p(w)}function v(w){return e.attempt(oD,y,p)(w)}function y(w){return n(w)}function p(w){return c._balanced=!0,i(w)}}function uD(e,n,i){return o;function o(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),l}function l(p){return Wt(p)?Qc(e,c)(p):c(p)}function c(p){return p===41?y(p):$5(e,u,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return Wt(p)?Qc(e,f)(p):y(p)}function h(p){return i(p)}function f(p){return p===34||p===39||p===40?G5(e,v,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):y(p)}function v(p){return Wt(p)?Qc(e,y)(p):y(p)}function y(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):i(p)}}function dD(e,n,i){const o=this;return l;function l(h){return V5.call(o,e,c,u,"reference","referenceMarker","referenceString")(h)}function c(h){return o.parser.defined.includes(_i(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?n(h):i(h)}function u(h){return i(h)}}function hD(e,n,i){return o;function o(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 fD={name:"labelStartImage",resolveAll:kg.resolveAll,tokenize:mD};function mD(e,n,i){const o=this;return l;function l(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),c}function c(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelImage"),u):i(h)}function u(h){return h===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(h):n(h)}}const pD={name:"labelStartLink",resolveAll:kg.resolveAll,tokenize:vD};function vD(e,n,i){const o=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in o.parser.constructs?i(u):n(u)}}const t0={name:"lineEnding",tokenize:gD};function gD(e,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Mt(e,n,"linePrefix")}}const ph={name:"thematicBreak",tokenize:yD};function yD(e,n,i){let o=0,l;return c;function c(v){return e.enter("thematicBreak"),u(v)}function u(v){return l=v,h(v)}function h(v){return v===l?(e.enter("thematicBreakSequence"),f(v)):o>=3&&(v===null||et(v))?(e.exit("thematicBreak"),n(v)):i(v)}function f(v){return v===l?(e.consume(v),o++,f):(e.exit("thematicBreakSequence"),jt(v)?Mt(e,h,"whitespace")(v):h(v))}}const Oa={continuation:{tokenize:wD},exit:SD,name:"list",tokenize:jD},xD={partial:!0,tokenize:CD},bD={partial:!0,tokenize:kD};function jD(e,n,i){const o=this,l=o.events[o.events.length-1];let c=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return h;function h(b){const k=o.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!o.containerState.marker||b===o.containerState.marker:lv(b)){if(o.containerState.type||(o.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(ph,i,v)(b):v(b);if(!o.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return i(b)}function f(b){return lv(b)&&++u<10?(e.consume(b),f):(!o.interrupt||u<2)&&(o.containerState.marker?b===o.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),v(b)):i(b)}function v(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||b,e.check(yu,o.interrupt?i:y,e.attempt(xD,w,p))}function y(b){return o.containerState.initialBlankLine=!0,c++,w(b)}function p(b){return jt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),w):i(b)}function w(b){return o.containerState.size=c+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function wD(e,n,i){const o=this;return o.containerState._closeFlow=void 0,e.check(yu,l,c);function l(h){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Mt(e,n,"listItemIndent",o.containerState.size+1)(h)}function c(h){return o.containerState.furtherBlankLines||!jt(h)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,u(h)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(bD,n,u)(h))}function u(h){return o.containerState._closeFlow=!0,o.interrupt=void 0,Mt(e,e.attempt(Oa,n,i),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function kD(e,n,i){const o=this;return Mt(e,l,"listItemIndent",o.containerState.size+1);function l(c){const u=o.events[o.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===o.containerState.size?n(c):i(c)}}function SD(e){e.exit(this.containerState.type)}function CD(e,n,i){const o=this;return Mt(e,l,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(c){const u=o.events[o.events.length-1];return!jt(c)&&u&&u[1].type==="listItemPrefixWhitespace"?n(c):i(c)}}const Wb={name:"setextUnderline",resolveTo:ND,tokenize:ED};function ND(e,n){let i=e.length,o,l,c;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){o=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 u={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",c?(e.splice(l,0,["enter",u,n]),e.splice(c+1,0,["exit",e[o][1],n]),e[o][1].end={...e[c][1].end}):e[o][1]=u,e.push(["exit",u,n]),e}function ED(e,n,i){const o=this;let l;return c;function c(v){let y=o.events.length,p;for(;y--;)if(o.events[y][1].type!=="lineEnding"&&o.events[y][1].type!=="linePrefix"&&o.events[y][1].type!=="content"){p=o.events[y][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||p)?(e.enter("setextHeadingLine"),l=v,u(v)):i(v)}function u(v){return e.enter("setextHeadingLineSequence"),h(v)}function h(v){return v===l?(e.consume(v),h):(e.exit("setextHeadingLineSequence"),jt(v)?Mt(e,f,"lineSuffix")(v):f(v))}function f(v){return v===null||et(v)?(e.exit("setextHeadingLine"),n(v)):i(v)}}const TD={tokenize:AD};function AD(e){const n=this,i=e.attempt(yu,o,e.attempt(this.parser.constructs.flowInitial,l,Mt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(DO,l)),"linePrefix")));return i;function o(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 MD={resolveAll:K5()},_D=Y5("string"),RD=Y5("text");function Y5(e){return{resolveAll:K5(e==="text"?OD:void 0),tokenize:n};function n(i){const o=this,l=this.parser.constructs[e],c=i.attempt(l,u,h);return u;function u(y){return v(y)?c(y):h(y)}function h(y){if(y===null){i.consume(y);return}return i.enter("data"),i.consume(y),f}function f(y){return v(y)?(i.exit("data"),c(y)):(i.consume(y),f)}function v(y){if(y===null)return!0;const p=l[y];let w=-1;if(p)for(;++w<p.length;){const b=p[w];if(!b.previous||b.previous.call(o,o.previous))return!0}return!1}}}function K5(e){return n;function n(i,o){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,o):i}}function OD(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 o=e[i-1][1],l=n.sliceStream(o);let c=l.length,u=-1,h=0,f;for(;c--;){const v=l[c];if(typeof v=="string"){for(u=v.length;v.charCodeAt(u-1)===32;)h++,u--;if(u)break;u=-1}else if(v===-2)f=!0,h++;else if(v!==-1){c++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(h=0),h){const v={type:i===e.length||f||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:o.start._bufferIndex+u,_index:o.start._index+c,line:o.end.line,column:o.end.column-h,offset:o.end.offset-h},end:{...o.end}};o.end={...v.start},o.start.offset===o.end.offset?Object.assign(o,v):(e.splice(i,0,["enter",v,n],["exit",v,n]),i+=2)}i++}return e}const DD={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:q5},zD={91:PO},LD={[-2]:e0,[-1]:e0,32:e0},BD={35:VO,42:ph,45:[Wb,ph],60:XO,61:Wb,95:ph,96:Qb,126:Qb},ID={38:H5,92:F5},PD={[-5]:t0,[-4]:t0,[-3]:t0,33:fD,38:H5,42:cv,60:[pO,nD],91:pD,92:[UO,F5],93:kg,95:cv,96:TO},qD={null:[cv,MD]},FD={null:[42,95]},HD={null:[]},UD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FD,contentInitial:zD,disable:HD,document:DD,flow:BD,flowInitial:LD,insideSpan:qD,string:ID,text:PD},Symbol.toStringTag,{value:"Module"}));function $D(e,n,i){let o={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const l={},c=[];let u=[],h=[];const f={attempt:L(R),check:L(_),consume:A,enter:E,exit:T,interrupt:L(_,{interrupt:!0})},v={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:e,previous:null,sliceSerialize:w,sliceStream:b,write:p};let y=n.tokenize.call(v,f);return n.resolveAll&&c.push(n),v;function p(P){return u=mi(u,P),N(),u[u.length-1]!==null?[]:(I(n,0),v.events=sf(c,v.events,v),v.events)}function w(P,U){return GD(b(P),U)}function b(P){return VD(u,P)}function k(){const{_bufferIndex:P,_index:U,line:Y,column:K,offset:q}=o;return{_bufferIndex:P,_index:U,line:Y,column:K,offset:q}}function S(P){l[P.line]=P.column,O()}function N(){let P;for(;o._index<u.length;){const U=u[o._index];if(typeof U=="string")for(P=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===P&&o._bufferIndex<U.length;)C(U.charCodeAt(o._bufferIndex));else C(U)}}function C(P){y=y(P)}function A(P){et(P)?(o.line++,o.column=1,o.offset+=P===-3?2:1,O()):P!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===u[o._index].length&&(o._bufferIndex=-1,o._index++)),v.previous=P}function E(P,U){const Y=U||{};return Y.type=P,Y.start=k(),v.events.push(["enter",Y,v]),h.push(Y),Y}function T(P){const U=h.pop();return U.end=k(),v.events.push(["exit",U,v]),U}function R(P,U){I(P,U.from)}function _(P,U){U.restore()}function L(P,U){return Y;function Y(K,q,Q){let V,Z,ue,z;return Array.isArray(K)?oe(K):"tokenize"in K?oe([K]):he(K);function he($){return X;function X(ee){const me=ee!==null&&$[ee],te=ee!==null&&$.null,ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(te)?te:te?[te]:[]];return oe(ce)(ee)}}function oe($){return V=$,Z=0,$.length===0?Q:D($[Z])}function D($){return X;function X(ee){return z=H(),ue=$,$.partial||(v.currentConstruct=$),$.name&&v.parser.constructs.disable.null.includes($.name)?ie():$.tokenize.call(U?Object.assign(Object.create(v),U):v,f,F,ie)(ee)}}function F($){return P(ue,z),q}function ie($){return z.restore(),++Z<V.length?D(V[Z]):Q}}}function I(P,U){P.resolveAll&&!c.includes(P)&&c.push(P),P.resolve&&ni(v.events,U,v.events.length-U,P.resolve(v.events.slice(U),v)),P.resolveTo&&(v.events=P.resolveTo(v.events,v))}function H(){const P=k(),U=v.previous,Y=v.currentConstruct,K=v.events.length,q=Array.from(h);return{from:K,restore:Q};function Q(){o=P,v.previous=U,v.currentConstruct=Y,v.events.length=K,h=q,O()}}function O(){o.line in l&&o.column<2&&(o.column=l[o.line],o.offset+=l[o.line]-1)}}function VD(e,n){const i=n.start._index,o=n.start._bufferIndex,l=n.end._index,c=n.end._bufferIndex;let u;if(i===l)u=[e[i].slice(o,c)];else{if(u=e.slice(i,l),o>-1){const h=u[0];typeof h=="string"?u[0]=h.slice(o):u.shift()}c>0&&u.push(e[l].slice(0,c))}return u}function GD(e,n){let i=-1;const o=[];let l;for(;++i<e.length;){const c=e[i];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
603
+ `;break}case-3:{u=`\r
604
+ `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&l)continue;u=" ";break}default:u=String.fromCharCode(c)}l=c===-2,o.push(u)}return o.join("")}function YD(e){const o={constructs:I5([UD,...(e||{}).extensions||[]]),content:l(lO),defined:[],document:l(uO),flow:l(TD),lazy:{},string:l(_D),text:l(RD)};return o;function l(c){return u;function u(h){return $D(o,c,h)}}}function KD(e){for(;!U5(e););return e}const Jb=/[\0\t\n\r]/g;function XD(){let e=1,n="",i=!0,o;return l;function l(c,u,h){const f=[];let v,y,p,w,b;for(c=n+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),p=0,n="",i&&(c.charCodeAt(0)===65279&&p++,i=void 0);p<c.length;){if(Jb.lastIndex=p,v=Jb.exec(c),w=v&&v.index!==void 0?v.index:c.length,b=c.charCodeAt(w),!v){n=c.slice(p);break}if(b===10&&p===w&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),p<w&&(f.push(c.slice(p,w)),e+=w-p),b){case 0:{f.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,f.push(-2);e++<y;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:o=!0,e=1}p=w+1}return h&&(o&&f.push(-5),n&&f.push(n),f.push(null)),f}}const QD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZD(e){return e.replace(QD,WD)}function WD(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const l=i.charCodeAt(1),c=l===120||l===88;return P5(i.slice(c?2:1),c?16:10)}return wg(i)||e}const X5={}.hasOwnProperty;function JD(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),ez(i)(KD(YD(i).document().write(XD()(e,n,!0))))}function ez(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(at),autolinkProtocol:H,autolinkEmail:H,atxHeading:c(De),blockQuote:c(te),characterEscape:H,characterReference:H,codeFenced:c(ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(ce,u),codeText:c(J,u),codeTextData:H,data:H,codeFlowValue:H,definition:c(je),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(Re),hardBreakEscape:c(Pe),hardBreakTrailing:c(Pe),htmlFlow:c(Le,u),htmlFlowData:H,htmlText:c(Le,u),htmlTextData:H,image:c(He),label:u,link:c(at),listItem:c(Gt),listItemValue:w,listOrdered:c(Lt,p),listUnordered:c(Lt),paragraph:c(ft),reference:D,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(De),strong:c(Cn),thematicBreak:c(fn)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:me,autolinkProtocol:ee,blockQuote:f(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:$,characterReference:X,codeFenced:f(N),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:O,codeIndented:f(C),codeText:f(q),codeTextData:O,data:O,definition:f(),definitionDestinationString:T,definitionLabelString:A,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(U),hardBreakTrailing:f(U),htmlFlow:f(Y),htmlFlowData:O,htmlText:f(K),htmlTextData:O,image:f(V),label:ue,labelText:Z,lineEnding:P,link:f(Q),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:F,resourceDestinationString:z,resourceTitleString:he,resource:oe,setextHeading:f(I),setextHeadingLineSequence:L,setextHeadingText:_,strong:f(),thematicBreak:f()}};Q5(n,(e||{}).mdastExtensions||[]);const i={};return o;function o(ye){let _e={type:"root",children:[]};const We={stack:[_e],tokenStack:[],config:n,enter:h,exit:v,buffer:u,resume:y,data:i},tt=[];let ct=-1;for(;++ct<ye.length;)if(ye[ct][1].type==="listOrdered"||ye[ct][1].type==="listUnordered")if(ye[ct][0]==="enter")tt.push(ct);else{const on=tt.pop();ct=l(ye,on,ct)}for(ct=-1;++ct<ye.length;){const on=n[ye[ct][0]];X5.call(on,ye[ct][1].type)&&on[ye[ct][1].type].call(Object.assign({sliceSerialize:ye[ct][2].sliceSerialize},We),ye[ct][1])}if(We.tokenStack.length>0){const on=We.tokenStack[We.tokenStack.length-1];(on[1]||ej).call(We,void 0,on[0])}for(_e.position={start:Mo(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:Mo(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},ct=-1;++ct<n.transforms.length;)_e=n.transforms[ct](_e)||_e;return _e}function l(ye,_e,We){let tt=_e-1,ct=-1,on=!1,On,yn,Bn,ge;for(;++tt<=We;){const Ee=ye[tt];switch(Ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ee[0]==="enter"?ct++:ct--,ge=void 0;break}case"lineEndingBlank":{Ee[0]==="enter"&&(On&&!ge&&!ct&&!Bn&&(Bn=tt),ge=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ge=void 0}if(!ct&&Ee[0]==="enter"&&Ee[1].type==="listItemPrefix"||ct===-1&&Ee[0]==="exit"&&(Ee[1].type==="listUnordered"||Ee[1].type==="listOrdered")){if(On){let Oe=tt;for(yn=void 0;Oe--;){const qe=ye[Oe];if(qe[1].type==="lineEnding"||qe[1].type==="lineEndingBlank"){if(qe[0]==="exit")continue;yn&&(ye[yn][1].type="lineEndingBlank",on=!0),qe[1].type="lineEnding",yn=Oe}else if(!(qe[1].type==="linePrefix"||qe[1].type==="blockQuotePrefix"||qe[1].type==="blockQuotePrefixWhitespace"||qe[1].type==="blockQuoteMarker"||qe[1].type==="listItemIndent"))break}Bn&&(!yn||Bn<yn)&&(On._spread=!0),On.end=Object.assign({},yn?ye[yn][1].start:Ee[1].end),ye.splice(yn||tt,0,["exit",On,Ee[2]]),tt++,We++}if(Ee[1].type==="listItemPrefix"){const Oe={type:"listItem",_spread:!1,start:Object.assign({},Ee[1].start),end:void 0};On=Oe,ye.splice(tt,0,["enter",Oe,Ee[2]]),tt++,We++,Bn=void 0,ge=!0}}}return ye[_e][1]._spread=on,We}function c(ye,_e){return We;function We(tt){h.call(this,ye(tt),tt),_e&&_e.call(this,tt)}}function u(){this.stack.push({type:"fragment",children:[]})}function h(ye,_e,We){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([_e,We||void 0]),ye.position={start:Mo(_e.start),end:void 0}}function f(ye){return _e;function _e(We){ye&&ye.call(this,We),v.call(this,We)}}function v(ye,_e){const We=this.stack.pop(),tt=this.tokenStack.pop();if(tt)tt[0].type!==ye.type&&(_e?_e.call(this,ye,tt[0]):(tt[1]||ej).call(this,ye,tt[0]));else throw new Error("Cannot close `"+ye.type+"` ("+Xc({start:ye.start,end:ye.end})+"): it’s not open");We.position.end=Mo(ye.end)}function y(){return jg(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function w(ye){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=ye}function k(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=ye}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ye.replace(/(\r?\n|\r)$/g,"")}function A(ye){const _e=this.resume(),We=this.stack[this.stack.length-1];We.label=_e,We.identifier=_i(this.sliceSerialize(ye)).toLowerCase()}function E(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ye}function T(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ye}function R(ye){const _e=this.stack[this.stack.length-1];if(!_e.depth){const We=this.sliceSerialize(ye).length;_e.depth=We}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function L(ye){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function H(ye){const We=this.stack[this.stack.length-1].children;let tt=We[We.length-1];(!tt||tt.type!=="text")&&(tt=wn(),tt.position={start:Mo(ye.start),end:void 0},We.push(tt)),this.stack.push(tt)}function O(ye){const _e=this.stack.pop();_e.value+=this.sliceSerialize(ye),_e.position.end=Mo(ye.end)}function P(ye){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const We=_e.children[_e.children.length-1];We.position.end=Mo(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(_e.type)&&(H.call(this,ye),O.call(this,ye))}function U(){this.data.atHardBreak=!0}function Y(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ye}function K(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ye}function q(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ye}function Q(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=_e,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function V(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=_e,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function Z(ye){const _e=this.sliceSerialize(ye),We=this.stack[this.stack.length-2];We.label=ZD(_e),We.identifier=_i(_e).toLowerCase()}function ue(){const ye=this.stack[this.stack.length-1],_e=this.resume(),We=this.stack[this.stack.length-1];if(this.data.inReference=!0,We.type==="link"){const tt=ye.children;We.children=tt}else We.alt=_e}function z(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ye}function he(){const ye=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ye}function oe(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function F(ye){const _e=this.resume(),We=this.stack[this.stack.length-1];We.label=_e,We.identifier=_i(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function ie(ye){this.data.characterReferenceType=ye.type}function $(ye){const _e=this.sliceSerialize(ye),We=this.data.characterReferenceType;let tt;We?(tt=P5(_e,We==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):tt=wg(_e);const ct=this.stack[this.stack.length-1];ct.value+=tt}function X(ye){const _e=this.stack.pop();_e.position.end=Mo(ye.end)}function ee(ye){O.call(this,ye);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(ye)}function me(ye){O.call(this,ye);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(ye)}function te(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function J(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function De(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function Le(){return{type:"html",value:""}}function He(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function Lt(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function Gt(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function Cn(){return{type:"strong",children:[]}}function wn(){return{type:"text",value:""}}function fn(){return{type:"thematicBreak"}}}function Mo(e){return{line:e.line,column:e.column,offset:e.offset}}function Q5(e,n){let i=-1;for(;++i<n.length;){const o=n[i];Array.isArray(o)?Q5(e,o):tz(e,o)}}function tz(e,n){let i;for(i in n)if(X5.call(n,i))switch(i){case"canContainEols":{const o=n[i];o&&e[i].push(...o);break}case"transforms":{const o=n[i];o&&e[i].push(...o);break}case"enter":case"exit":{const o=n[i];o&&Object.assign(e[i],o);break}}}function ej(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Xc({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Xc({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Xc({start:n.start,end:n.end})+") is still open")}function nz(e){const n=this;n.parser=i;function i(o){return JD(o,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function az(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 iz(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
605
+ `}]}function rz(e,n){const i=n.value?n.value+`
606
+ `:"",o={},l=n.lang?n.lang.split(/\s+/):[];l.length>0&&(o.className=["language-"+l[0]]);let c={type:"element",tagName:"code",properties:o,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 oz(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function sz(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function lz(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",o=String(n.identifier).toUpperCase(),l=Yl(o.toLowerCase()),c=e.footnoteOrder.indexOf(o);let u,h=e.footnoteCounts.get(o);h===void 0?(h=0,e.footnoteOrder.push(o),u=e.footnoteOrder.length):u=c+1,h+=1,e.footnoteCounts.set(o,h);const f={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+l,id:i+"fnref-"+l+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,f);const v={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(n,v),e.applyData(n,v)}function cz(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 uz(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function Z5(e,n){const i=n.referenceType;let o="]";if(i==="collapsed"?o+="[]":i==="full"&&(o+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+o}];const l=e.all(n),c=l[0];c&&c.type==="text"?c.value="["+c.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=o:l.push({type:"text",value:o}),l}function dz(e,n){const i=String(n.identifier).toUpperCase(),o=e.definitionById.get(i);if(!o)return Z5(e,n);const l={src:Yl(o.url||""),alt:n.alt};o.title!==null&&o.title!==void 0&&(l.title=o.title);const c={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,c),e.applyData(n,c)}function hz(e,n){const i={src:Yl(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 o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function fz(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const o={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,o),e.applyData(n,o)}function mz(e,n){const i=String(n.identifier).toUpperCase(),o=e.definitionById.get(i);if(!o)return Z5(e,n);const l={href:Yl(o.url||"")};o.title!==null&&o.title!==void 0&&(l.title=o.title);const c={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,c),e.applyData(n,c)}function pz(e,n){const i={href:Yl(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function vz(e,n,i){const o=e.all(n),l=i?gz(i):W5(n),c={},u=[];if(typeof n.checked=="boolean"){const y=o[0];let p;y&&y.type==="element"&&y.tagName==="p"?p=y:(p={type:"element",tagName:"p",properties:{},children:[]},o.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h<o.length;){const y=o[h];(l||h!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
607
+ `}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const f=o[o.length-1];f&&(l||f.type!=="element"||f.tagName!=="p")&&u.push({type:"text",value:`
608
+ `});const v={type:"element",tagName:"li",properties:c,children:u};return e.patch(n,v),e.applyData(n,v)}function gz(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let o=-1;for(;!n&&++o<i.length;)n=W5(i[o])}return n}function W5(e){const n=e.spread;return n??e.children.length>1}function yz(e,n){const i={},o=e.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++l<o.length;){const u=o[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.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(o,!0)};return e.patch(n,c),e.applyData(n,c)}function xz(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function bz(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function jz(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function wz(e,n){const i=e.all(n),o=i.shift(),l=[];if(o){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([o],!0)};e.patch(n.children[0],u),l.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},h=gg(n.children[1]),f=_5(n.children[n.children.length-1]);h&&f&&(u.position={start:h,end:f}),l.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,c),e.applyData(n,c)}function kz(e,n,i){const o=i?i.children:void 0,c=(o?o.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,h=u?u.length:n.children.length;let f=-1;const v=[];for(;++f<h;){const p=n.children[f],w={},b=u?u[f]:void 0;b&&(w.align=b);let k={type:"element",tagName:c,properties:w,children:[]};p&&(k.children=e.all(p),e.patch(p,k),k=e.applyData(p,k)),v.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(v,!0)};return e.patch(n,y),e.applyData(n,y)}function Sz(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const tj=9,nj=32;function Cz(e){const n=String(e),i=/\r?\n|\r/g;let o=i.exec(n),l=0;const c=[];for(;o;)c.push(aj(n.slice(l,o.index),l>0,!0),o[0]),l=o.index+o[0].length,o=i.exec(n);return c.push(aj(n.slice(l),l>0,!1)),c.join("")}function aj(e,n,i){let o=0,l=e.length;if(n){let c=e.codePointAt(o);for(;c===tj||c===nj;)o++,c=e.codePointAt(o)}if(i){let c=e.codePointAt(l-1);for(;c===tj||c===nj;)l--,c=e.codePointAt(l-1)}return l>o?e.slice(o,l):""}function Nz(e,n){const i={type:"text",value:Cz(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function Ez(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const Tz={blockquote:az,break:iz,code:rz,delete:oz,emphasis:sz,footnoteReference:lz,heading:cz,html:uz,imageReference:dz,image:hz,inlineCode:fz,linkReference:mz,link:pz,listItem:vz,list:yz,paragraph:xz,root:bz,strong:jz,table:wz,tableCell:Sz,tableRow:kz,text:Nz,thematicBreak:Ez,toml:Kd,yaml:Kd,definition:Kd,footnoteDefinition:Kd};function Kd(){}const J5=-1,lf=0,Zc=1,Mh=2,Sg=3,Cg=4,Ng=5,Eg=6,eS=7,tS=8,{defineProperty:Az}=Object,nS=typeof self=="object"?self:globalThis,ij=(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 nS[e](n)},Mz=(e,n)=>{const i=(l,c)=>(e.set(c,l),l),o=l=>{if(e.has(l))return e.get(l);const[c,u]=n[l];switch(c){case lf:case J5:return i(u,l);case Zc:{const h=i([],l);for(const f of u)h.push(o(f));return h}case Mh:{const h=i({},l);for(const[f,v]of u){const y=o(f),p=o(v);y==="__proto__"?Az(h,y,{value:p,configurable:!0,enumerable:!0,writable:!0}):h[y]=p}return h}case Sg:return i(new Date(u),l);case Cg:{const{source:h,flags:f}=u;return i(new RegExp(h,f),l)}case Ng:{const h=i(new Map,l);for(const[f,v]of u)h.set(o(f),o(v));return h}case Eg:{const h=i(new Set,l);for(const f of u)h.add(o(f));return h}case eS:{const{name:h,message:f}=u;return i(typeof nS[h]=="function"?ij(h,f):new Error(f),l)}case tS:return i(BigInt(u),l);case"BigInt":return i(Object(BigInt(u)),l);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:h}=new Uint8Array(u);return i(new DataView(h),u)}case"-0":return-0}return i(ij(c,u),l)};return o},rj=e=>Mz(new Map,e)(0),Ns="",{toString:_z}={},{keys:Rz,is:Oz}=Object,Fc=e=>{const n=typeof e;if(n!=="object"||!e)return[lf,n];const i=_z.call(e).slice(8,-1);switch(i){case"Array":return[Zc,Ns];case"Object":return[Mh,Ns];case"Date":return[Sg,Ns];case"RegExp":return[Cg,Ns];case"Map":return[Ng,Ns];case"Set":return[Eg,Ns];case"DataView":return[Zc,i]}return i.includes("Array")?[Zc,i]:e instanceof Error?[eS,e.name||"Error"]:[Mh,i]},Xd=([e,n])=>e===lf&&(n==="function"||n==="symbol"),Dz=(e,n,i,o)=>{const l=(u,h)=>{const f=o.push(u)-1;return i.set(h,f),f},c=u=>{if(i.has(u))return i.get(u);let[h,f]=Fc(u);switch(h){case lf:{let y=u;switch(f){case"bigint":h=tS,y=u.toString();break;case"number":if(!u&&Oz(u,-0))return o.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);y=null;break;case"undefined":return l([J5],u)}return l([h,y],u)}case Zc:{if(f){let w=u;return f==="DataView"?w=new Uint8Array(u.buffer):f==="ArrayBuffer"&&(w=new Uint8Array(u)),l([f,[...w]],u)}const y=[],p=l([h,y],u);for(const w of u)y.push(c(w));return p}case Mh:{if(f)switch(f){case"BigInt":return l([f,u.toString()],u);case"Boolean":case"Number":case"String":return l([f,u.valueOf()],u)}if(n&&"toJSON"in u)return c(u.toJSON());const y=[],p=l([h,y],u);for(const w of Rz(u))(e||!Xd(Fc(u[w])))&&y.push([c(w),c(u[w])]);return p}case Sg:return l([h,isNaN(u.getTime())?Ns:u.toISOString()],u);case Cg:{const{source:y,flags:p}=u;return l([h,{source:y,flags:p}],u)}case Ng:{const y=[],p=l([h,y],u);for(const[w,b]of u)(e||!(Xd(Fc(w))||Xd(Fc(b))))&&y.push([c(w),c(b)]);return p}case Eg:{const y=[],p=l([h,y],u);for(const w of u)(e||!Xd(Fc(w)))&&y.push(c(w));return p}}const{message:v}=u;return l([h,{name:f,message:v}],u)};return c},oj=(e,{json:n,lossy:i}={})=>{const o=[];return Dz(!(n||i),!!n,new Map,o)(e),o},_h=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?rj(oj(e,n)):structuredClone(e):(e,n)=>rj(oj(e,n));function zz(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 Lz(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Bz(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||zz,o=e.options.footnoteBackLabel||Lz,l=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let f=-1;for(;++f<e.footnoteOrder.length;){const v=e.footnoteById.get(e.footnoteOrder[f]);if(!v)continue;const y=e.all(v),p=String(v.identifier).toUpperCase(),w=Yl(p.toLowerCase());let b=0;const k=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++b<=S;){k.length>0&&k.push({type:"text",value:" "});let A=typeof i=="string"?i:i(f,b);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+w+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(f,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const A=N.children[N.children.length-1];A&&A.type==="text"?A.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-"+w},children:e.wrap(y,!0)};e.patch(v,C),h.push(C)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{..._h(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
609
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(h,!0)},{type:"text",value:`
610
+ `}]}}const cf=(function(e){if(e==null)return Fz;if(typeof e=="function")return uf(e);if(typeof e=="object")return Array.isArray(e)?Iz(e):Pz(e);if(typeof e=="string")return qz(e);throw new Error("Expected function, string, or object as test")});function Iz(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=cf(e[i]);return uf(o);function o(...l){let c=-1;for(;++c<n.length;)if(n[c].apply(this,l))return!0;return!1}}function Pz(e){const n=e;return uf(i);function i(o){const l=o;let c;for(c in e)if(l[c]!==n[c])return!1;return!0}}function qz(e){return uf(n);function n(i){return i&&i.type===e}}function uf(e){return n;function n(i,o,l){return!!(Hz(i)&&e.call(this,i,typeof o=="number"?o:void 0,l||void 0))}}function Fz(){return!0}function Hz(e){return e!==null&&typeof e=="object"&&"type"in e}const aS=[],Uz=!0,uv=!1,$z="skip";function iS(e,n,i,o){let l;typeof n=="function"&&typeof i!="function"?(o=i,i=n):l=n;const c=cf(l),u=o?-1:1;h(e,void 0,[])();function h(f,v,y){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return w;function w(){let b=aS,k,S,N;if((!n||c(f,v,y[y.length-1]||void 0))&&(b=Vz(i(f,y)),b[0]===uv))return b;if("children"in f&&f.children){const C=f;if(C.children&&b[0]!==$z)for(S=(o?C.children.length:-1)+u,N=y.concat(C);S>-1&&S<C.children.length;){const A=C.children[S];if(k=h(A,S,N)(),k[0]===uv)return k;S=typeof k[1]=="number"?k[1]:S+u}}return b}}}function Vz(e){return Array.isArray(e)?e:typeof e=="number"?[Uz,e]:e==null?aS:[e]}function Tg(e,n,i,o){let l,c,u;typeof n=="function"&&typeof i!="function"?(c=void 0,u=n,l=i):(c=n,u=i,l=o),iS(e,c,h,l);function h(f,v){const y=v[v.length-1],p=y?y.children.indexOf(f):void 0;return u(f,p,y)}}const dv={}.hasOwnProperty,Gz={};function Yz(e,n){const i=n||Gz,o=new Map,l=new Map,c=new Map,u={...Tz,...i.handlers},h={all:v,applyData:Xz,definitionById:o,footnoteById:l,footnoteCounts:c,footnoteOrder:[],handlers:u,one:f,options:i,patch:Kz,wrap:Zz};return Tg(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const p=y.type==="definition"?o:l,w=String(y.identifier).toUpperCase();p.has(w)||p.set(w,y)}}),h;function f(y,p){const w=y.type,b=h.handlers[w];if(dv.call(h.handlers,w)&&b)return b(h,y,p);if(h.options.passThrough&&h.options.passThrough.includes(w)){if("children"in y){const{children:S,...N}=y,C=_h(N);return C.children=h.all(y),C}return _h(y)}return(h.options.unknownHandler||Qz)(h,y,p)}function v(y){const p=[];if("children"in y){const w=y.children;let b=-1;for(;++b<w.length;){const k=h.one(w[b],y);if(k){if(b&&w[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=sj(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=sj(S.value))}Array.isArray(k)?p.push(...k):p.push(k)}}}return p}}function Kz(e,n){e.position&&(n.position=DR(e))}function Xz(e,n){let i=n;if(e&&e.data){const o=e.data.hName,l=e.data.hChildren,c=e.data.hProperties;if(typeof o=="string")if(i.type==="element")i.tagName=o;else{const u="children"in i?i.children:[i];i={type:"element",tagName:o,properties:{},children:u}}i.type==="element"&&c&&Object.assign(i.properties,_h(c)),"children"in i&&i.children&&l!==null&&l!==void 0&&(i.children=l)}return i}function Qz(e,n){const i=n.data||{},o="value"in n&&!(dv.call(i,"hProperties")||dv.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function Zz(e,n){const i=[];let o=-1;for(n&&i.push({type:"text",value:`
611
+ `});++o<e.length;)o&&i.push({type:"text",value:`
612
+ `}),i.push(e[o]);return n&&e.length>0&&i.push({type:"text",value:`
613
+ `}),i}function sj(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function lj(e,n){const i=Yz(e,n),o=i.one(e,void 0),l=Bz(i),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return l&&c.children.push({type:"text",value:`
614
+ `},l),c}function Wz(e,n){return e&&"run"in e?async function(i,o){const l=lj(i,{file:o,...n});await e.run(l,o)}:function(i,o){return lj(i,{file:o,...e||n})}}function cj(e){if(e)throw e}var n0,uj;function Jz(){if(uj)return n0;uj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(v){return typeof Array.isArray=="function"?Array.isArray(v):n.call(v)==="[object Array]"},c=function(v){if(!v||n.call(v)!=="[object Object]")return!1;var y=e.call(v,"constructor"),p=v.constructor&&v.constructor.prototype&&e.call(v.constructor.prototype,"isPrototypeOf");if(v.constructor&&!y&&!p)return!1;var w;for(w in v);return typeof w>"u"||e.call(v,w)},u=function(v,y){i&&y.name==="__proto__"?i(v,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):v[y.name]=y.newValue},h=function(v,y){if(y==="__proto__")if(e.call(v,y)){if(o)return o(v,y).value}else return;return v[y]};return n0=function f(){var v,y,p,w,b,k,S=arguments[0],N=1,C=arguments.length,A=!1;for(typeof S=="boolean"&&(A=S,S=arguments[1]||{},N=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});N<C;++N)if(v=arguments[N],v!=null)for(y in v)p=h(S,y),w=h(v,y),S!==w&&(A&&w&&(c(w)||(b=l(w)))?(b?(b=!1,k=p&&l(p)?p:[]):k=p&&c(p)?p:{},u(S,{name:y,newValue:f(A,k,w)})):typeof w<"u"&&u(S,{name:y,newValue:w}));return S},n0}var eL=Jz();const a0=Nv(eL);function hv(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 tL(){const e=[],n={run:i,use:o};return n;function i(...l){let c=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);h(null,...l);function h(f,...v){const y=e[++c];let p=-1;if(f){u(f);return}for(;++p<l.length;)(v[p]===null||v[p]===void 0)&&(v[p]=l[p]);l=v,y?nL(y,h)(...v):u(null,...v)}}function o(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function nL(e,n){let i;return o;function o(...u){const h=e.length>u.length;let f;h&&u.push(l);try{f=e.apply(this,u)}catch(v){const y=v;if(h&&i)throw y;return l(y)}h||(f&&f.then&&typeof f.then=="function"?f.then(c,l):f instanceof Error?l(f):c(f))}function l(u,...h){i||(i=!0,n(u,...h))}function c(u){l(null,u)}}const nr={basename:aL,dirname:iL,extname:rL,join:oL,sep:"/"};function aL(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');xu(e);let i=0,o=-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 o<0&&(c=!0,o=l+1);return o<0?"":e.slice(i,o)}if(n===e)return"";let u=-1,h=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(c){i=l+1;break}}else u<0&&(c=!0,u=l+1),h>-1&&(e.codePointAt(l)===n.codePointAt(h--)?h<0&&(o=l):(h=-1,o=u));return i===o?o=u:o<0&&(o=e.length),e.slice(i,o)}function iL(e){if(xu(e),e.length===0)return".";let n=-1,i=e.length,o;for(;--i;)if(e.codePointAt(i)===47){if(o){n=i;break}}else o||(o=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function rL(e){xu(e);let n=e.length,i=-1,o=0,l=-1,c=0,u;for(;n--;){const h=e.codePointAt(n);if(h===47){if(u){o=n+1;break}continue}i<0&&(u=!0,i=n+1),h===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===o+1?"":e.slice(l,i)}function oL(...e){let n=-1,i;for(;++n<e.length;)xu(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":sL(i)}function sL(e){xu(e);const n=e.codePointAt(0)===47;let i=lL(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function lL(e,n){let i="",o=0,l=-1,c=0,u=-1,h,f;for(;++u<=e.length;){if(u<e.length)h=e.codePointAt(u);else{if(h===47)break;h=47}if(h===47){if(!(l===u-1||c===1))if(l!==u-1&&c===2){if(i.length<2||o!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(f=i.lastIndexOf("/"),f!==i.length-1){f<0?(i="",o=0):(i=i.slice(0,f),o=i.length-1-i.lastIndexOf("/")),l=u,c=0;continue}}else if(i.length>0){i="",o=0,l=u,c=0;continue}}n&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(l+1,u):i=e.slice(l+1,u),o=u-l-1;l=u,c=0}else h===46&&c>-1?c++:c=-1}return i}function xu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cL={cwd:uL};function uL(){return"/"}function fv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dL(e){if(typeof e=="string")e=new URL(e);else if(!fv(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 hL(e)}function hL(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const o=n.codePointAt(i+2);if(o===70||o===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 i0=["history","path","basename","stem","extname","dirname"];class rS{constructor(n){let i;n?fv(n)?i={path:n}:typeof n=="string"||fL(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":cL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<i0.length;){const c=i0[o];c in i&&i[c]!==void 0&&i[c]!==null&&(this[c]=c==="history"?[...i[c]]:i[c])}let l;for(l in i)i0.includes(l)||(this[l]=i[l])}get basename(){return typeof this.path=="string"?nr.basename(this.path):void 0}set basename(n){o0(n,"basename"),r0(n,"basename"),this.path=nr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?nr.dirname(this.path):void 0}set dirname(n){dj(this.basename,"dirname"),this.path=nr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?nr.extname(this.path):void 0}set extname(n){if(r0(n,"extname"),dj(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=nr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){fv(n)&&(n=dL(n)),o0(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?nr.basename(this.path,this.extname):void 0}set stem(n){o0(n,"stem"),r0(n,"stem"),this.path=nr.join(this.dirname||"",n+(this.extname||""))}fail(n,i,o){const l=this.message(n,i,o);throw l.fatal=!0,l}info(n,i,o){const l=this.message(n,i,o);return l.fatal=void 0,l}message(n,i,o){const l=new ca(n,i,o);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 r0(e,n){if(e&&e.includes(nr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+nr.sep+"`")}function o0(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function dj(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function fL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mL=(function(e){const o=this.constructor.prototype,l=o[e],c=function(){return l.apply(c,arguments)};return Object.setPrototypeOf(c,o),c}),pL={}.hasOwnProperty;class Ag extends mL{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=tL()}copy(){const n=new Ag;let i=-1;for(;++i<this.attachers.length;){const o=this.attachers[i];n.use(...o)}return n.data(a0(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(c0("data",this.frozen),this.namespace[n]=i,this):pL.call(this.namespace,n)&&this.namespace[n]||void 0:n?(c0("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,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const l=i.call(n,...o);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=Qd(n),o=this.parser||this.Parser;return s0("parse",o),o(String(i),i)}process(n,i){const o=this;return this.freeze(),s0("process",this.parser||this.Parser),l0("process",this.compiler||this.Compiler),i?l(void 0,i):new Promise(l);function l(c,u){const h=Qd(n),f=o.parse(h);o.run(f,h,function(y,p,w){if(y||!p||!w)return v(y);const b=p,k=o.stringify(b,w);yL(k)?w.value=k:w.result=k,v(y,w)});function v(y,p){y||!p?u(y):c?c(p):i(void 0,p)}}}processSync(n){let i=!1,o;return this.freeze(),s0("processSync",this.parser||this.Parser),l0("processSync",this.compiler||this.Compiler),this.process(n,l),fj("processSync","process",i),o;function l(c,u){i=!0,cj(c),o=u}}run(n,i,o){hj(n),this.freeze();const l=this.transformers;return!o&&typeof i=="function"&&(o=i,i=void 0),o?c(void 0,o):new Promise(c);function c(u,h){const f=Qd(i);l.run(n,f,v);function v(y,p,w){const b=p||n;y?h(y):u?u(b):o(void 0,b,w)}}}runSync(n,i){let o=!1,l;return this.run(n,i,c),fj("runSync","run",o),l;function c(u,h){cj(u),l=h,o=!0}}stringify(n,i){this.freeze();const o=Qd(i),l=this.compiler||this.Compiler;return l0("stringify",l),hj(n),l(n,o)}use(n,...i){const o=this.attachers,l=this.namespace;if(c0("use",this.frozen),n!=null)if(typeof n=="function")f(n,i);else if(typeof n=="object")Array.isArray(n)?h(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function c(v){if(typeof v=="function")f(v,[]);else if(typeof v=="object")if(Array.isArray(v)){const[y,...p]=v;f(y,p)}else u(v);else throw new TypeError("Expected usable value, not `"+v+"`")}function u(v){if(!("plugins"in v)&&!("settings"in v))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");h(v.plugins),v.settings&&(l.settings=a0(!0,l.settings,v.settings))}function h(v){let y=-1;if(v!=null)if(Array.isArray(v))for(;++y<v.length;){const p=v[y];c(p)}else throw new TypeError("Expected a list of plugins, not `"+v+"`")}function f(v,y){let p=-1,w=-1;for(;++p<o.length;)if(o[p][0]===v){w=p;break}if(w===-1)o.push([v,...y]);else if(y.length>0){let[b,...k]=y;const S=o[w][1];hv(S)&&hv(b)&&(b=a0(!0,S,b)),o[w]=[v,b,...k]}}}}const vL=new Ag().freeze();function s0(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function l0(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function c0(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 hj(e){if(!hv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fj(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Qd(e){return gL(e)?e:new rS(e)}function gL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yL(e){return typeof e=="string"||xL(e)}function xL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mj=[],pj={allowDangerousHtml:!0},jL=/^(https?|ircs?|mailto|xmpp)$/i,wL=[{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 kL(e){const n=SL(e),i=CL(e);return NL(n.runSync(n.parse(i),i),e)}function SL(e){const n=e.rehypePlugins||mj,i=e.remarkPlugins||mj,o=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pj}:pj;return vL().use(nz).use(i).use(Wz,o).use(n)}function CL(e){const n=e.children||"",i=new rS;return typeof n=="string"&&(i.value=n),i}function NL(e,n){const i=n.allowedElements,o=n.allowElement,l=n.components,c=n.disallowedElements,u=n.skipHtml,h=n.unwrapDisallowed,f=n.urlTransform||EL;for(const y of wL)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+bL+y.id,void 0);return Tg(e,v),PR(e,{Fragment:r.Fragment,components:l,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function v(y,p,w){if(y.type==="raw"&&w&&typeof p=="number")return u?w.children.splice(p,1):w.children[p]={type:"text",value:y.value},p;if(y.type==="element"){let b;for(b in Jp)if(Object.hasOwn(Jp,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],S=Jp[b];(S===null||S.includes(y.tagName))&&(y.properties[b]=f(String(k||""),b,y))}}if(y.type==="element"){let b=i?!i.includes(y.tagName):c?c.includes(y.tagName):!1;if(!b&&o&&typeof p=="number"&&(b=!o(y,p,w)),b&&w&&typeof p=="number")return h&&y.children?w.children.splice(p,1,...y.children):w.children.splice(p,1),p}}}function EL(e){const n=e.indexOf(":"),i=e.indexOf("?"),o=e.indexOf("#"),l=e.indexOf("/");return n===-1||l!==-1&&n>l||i!==-1&&n>i||o!==-1&&n>o||jL.test(e.slice(0,n))?e:""}function TL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function oS(e,n,i){const l=cf((i||{}).ignore||[]),c=AL(n);let u=-1;for(;++u<c.length;)iS(e,"text",h);function h(v,y){let p=-1,w;for(;++p<y.length;){const b=y[p],k=w?w.children:void 0;if(l(b,k?k.indexOf(b):void 0,w))return;w=b}if(w)return f(v,y)}function f(v,y){const p=y[y.length-1],w=c[u][0],b=c[u][1];let k=0;const N=p.children.indexOf(v);let C=!1,A=[];w.lastIndex=0;let E=w.exec(v.value);for(;E;){const T=E.index,R={index:E.index,input:E.input,stack:[...y,v]};let _=b(...E,R);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?w.lastIndex=T+1:(k!==T&&A.push({type:"text",value:v.value.slice(k,T)}),Array.isArray(_)?A.push(..._):_&&A.push(_),k=T+E[0].length,C=!0),!w.global)break;E=w.exec(v.value)}return C?(k<v.value.length&&A.push({type:"text",value:v.value.slice(k)}),p.children.splice(N,1,...A)):A=[v],N+A.length}}function AL(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 o=-1;for(;++o<i.length;){const l=i[o];n.push([ML(l[0]),_L(l[1])])}return n}function ML(e){return typeof e=="string"?new RegExp(TL(e),"g"):e}function _L(e){return typeof e=="function"?e:function(){return e}}function RL(e){oS(e,[/\r?\n|\r/g,OL])}function OL(){return{type:"break"}}function DL(){return function(e){RL(e)}}const zL=/[\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]/,LL=/https?:\/\/[^\s<\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]+/g;function BL(e){var o;const n=((o=e.children)==null?void 0:o.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 sS(e,n){return{type:"link",url:e,children:[{type:"text",value:n}]}}function IL(e){const n=[];let i=0;for(const o of e.matchAll(LL))o.index>i&&n.push({type:"text",value:e.slice(i,o.index)}),n.push(sS(o[0],o[0])),i=o.index+o[0].length;return i<e.length&&n.push({type:"text",value:e.slice(i)}),n}function lS(e){const n=e.children;if(n)for(let i=0;i<n.length;i++){const o=n[i];if(o.type!=="link"){lS(o);continue}const l=BL(o),c=l===void 0?-1:l.search(zL);if(l===void 0||c<=0)continue;const u=l.slice(0,c),h=o.url.slice(0,o.url.length-l.length),f=IL(l.slice(c));n.splice(i,1,sS(h+u,u),...f),i+=f.length}}function PL(){return e=>lS(e)}const qL=new RegExp("(?<![A-Za-z0-9_/#.@-])m\\d{1,9}(?![A-Za-z0-9_-]|\\.[A-Za-z0-9])","g");function FL(e){const n=[];let i=0;for(const o of e.matchAll(qL))o.index>i&&n.push({type:"text",value:e.slice(i,o.index)}),n.push({type:"link",url:`#ref-${o[0]}`,children:[{type:"text",value:o[0]}]}),i=o.index+o[0].length;return n.length?(i<e.length&&n.push({type:"text",value:e.slice(i)}),n):null}function cS(e){const n=e.children;if(!(!n||e.type==="link"||e.type==="linkReference"))for(let i=0;i<n.length;i++){const o=n[i];if(o.type!=="text"){cS(o);continue}const l=o.value?FL(o.value):null;l&&(n.splice(i,1,...l),i+=l.length-1)}}function HL(){return e=>cS(e)}function vj(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let o=0,l=i.indexOf(n);for(;l!==-1;)o++,l=i.indexOf(n,l+n.length);return o}const u0="phrasing",d0=["autolink","link","image","label"];function UL(){return{transforms:[QL],enter:{literalAutolink:VL,literalAutolinkEmail:h0,literalAutolinkHttp:h0,literalAutolinkWww:h0},exit:{literalAutolink:XL,literalAutolinkEmail:KL,literalAutolinkHttp:GL,literalAutolinkWww:YL}}}function $L(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:u0,notInConstruct:d0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:u0,notInConstruct:d0},{character:":",before:"[ps]",after:"\\/",inConstruct:u0,notInConstruct:d0}]}}function VL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function h0(e){this.config.enter.autolinkProtocol.call(this,e)}function GL(e){this.config.exit.autolinkProtocol.call(this,e)}function YL(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 KL(e){this.config.exit.autolinkEmail.call(this,e)}function XL(e){this.exit(e)}function QL(e){oS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ZL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),WL]],{ignore:["link","linkReference"]})}function ZL(e,n,i,o,l){let c="";if(!uS(l)||(/^w/i.test(n)&&(i=n+i,n="",c="http://"),!JL(i)))return!1;const u=eB(i+o);if(!u[0])return!1;const h={type:"link",title:null,url:c+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[h,{type:"text",value:u[1]}]:h}function WL(e,n,i,o){return!uS(o,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function JL(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 eB(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],o=i.indexOf(")");const l=vj(e,"(");let c=vj(e,")");for(;o!==-1&&l>c;)e+=i.slice(0,o+1),i=i.slice(o+1),o=i.indexOf(")"),c++;return[e,i]}function uS(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Is(i)||of(i))&&(!n||i!==47)}dS.peek=cB;function tB(){this.buffer()}function nB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aB(){this.buffer()}function iB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rB(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=_i(this.sliceSerialize(e)).toLowerCase(),i.label=n}function oB(e){this.exit(e)}function sB(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=_i(this.sliceSerialize(e)).toLowerCase(),i.label=n}function lB(e){this.exit(e)}function cB(){return"["}function dS(e,n,i,o){const l=i.createTracker(o);let c=l.move("[^");const u=i.enter("footnoteReference"),h=i.enter("reference");return c+=l.move(i.safe(i.associationId(e),{after:"]",before:c})),h(),u(),c+=l.move("]"),c}function uB(){return{enter:{gfmFootnoteCallString:tB,gfmFootnoteCall:nB,gfmFootnoteDefinitionLabelString:aB,gfmFootnoteDefinition:iB},exit:{gfmFootnoteCallString:rB,gfmFootnoteCall:oB,gfmFootnoteDefinitionLabelString:sB,gfmFootnoteDefinition:lB}}}function dB(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:dS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(o,l,c,u){const h=c.createTracker(u);let f=h.move("[^");const v=c.enter("footnoteDefinition"),y=c.enter("label");return f+=h.move(c.safe(c.associationId(o),{before:f,after:"]"})),y(),f+=h.move("]:"),o.children&&o.children.length>0&&(h.shift(4),f+=h.move((n?`
615
+ `:" ")+c.indentLines(c.containerFlow(o,h.current()),n?hS:hB))),v(),f}}function hB(e,n,i){return n===0?e:hS(e,n,i)}function hS(e,n,i){return(i?"":" ")+e}const fB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fS.peek=yB;function mB(){return{canContainEols:["delete"],enter:{strikethrough:vB},exit:{strikethrough:gB}}}function pB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fB}],handlers:{delete:fS}}}function vB(e){this.enter({type:"delete",children:[]},e)}function gB(e){this.exit(e)}function fS(e,n,i,o){const l=i.createTracker(o),c=i.enter("strikethrough");let u=l.move("~~");return u+=i.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),c(),u}function yB(){return"~"}function xB(e){return e.length}function bB(e,n){const i=n||{},o=(i.align||[]).concat(),l=i.stringLength||xB,c=[],u=[],h=[],f=[];let v=0,y=-1;for(;++y<e.length;){const S=[],N=[];let C=-1;for(e[y].length>v&&(v=e[y].length);++C<e[y].length;){const A=jB(e[y][C]);if(i.alignDelimiters!==!1){const E=l(A);N[C]=E,(f[C]===void 0||E>f[C])&&(f[C]=E)}S.push(A)}u[y]=S,h[y]=N}let p=-1;if(typeof o=="object"&&"length"in o)for(;++p<v;)c[p]=gj(o[p]);else{const S=gj(o);for(;++p<v;)c[p]=S}p=-1;const w=[],b=[];for(;++p<v;){const S=c[p];let N="",C="";S===99?(N=":",C=":"):S===108?N=":":S===114&&(C=":");let A=i.alignDelimiters===!1?1:Math.max(1,f[p]-N.length-C.length);const E=N+"-".repeat(A)+C;i.alignDelimiters!==!1&&(A=N.length+A+C.length,A>f[p]&&(f[p]=A),b[p]=A),w[p]=E}u.splice(1,0,w),h.splice(1,0,b),y=-1;const k=[];for(;++y<u.length;){const S=u[y],N=h[y];p=-1;const C=[];for(;++p<v;){const A=S[p]||"";let E="",T="";if(i.alignDelimiters!==!1){const R=f[p]-(N[p]||0),_=c[p];_===114?E=" ".repeat(R):_===99?R%2?(E=" ".repeat(R/2+.5),T=" ".repeat(R/2-.5)):(E=" ".repeat(R/2),T=E):T=" ".repeat(R)}i.delimiterStart!==!1&&!p&&C.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&A==="")&&(i.delimiterStart!==!1||p)&&C.push(" "),i.alignDelimiters!==!1&&C.push(E),C.push(A),i.alignDelimiters!==!1&&C.push(T),i.padding!==!1&&C.push(" "),(i.delimiterEnd!==!1||p!==v-1)&&C.push("|")}k.push(i.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
616
+ `)}function jB(e){return e==null?"":String(e)}function gj(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 wB(e,n,i,o){const l=i.enter("blockquote"),c=i.createTracker(o);c.move("> "),c.shift(2);const u=i.indentLines(i.containerFlow(e,c.current()),kB);return l(),u}function kB(e,n,i){return">"+(i?"":" ")+e}function SB(e,n){return yj(e,n.inConstruct,!0)&&!yj(e,n.notInConstruct,!1)}function yj(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let o=-1;for(;++o<n.length;)if(e.includes(n[o]))return!0;return!1}function xj(e,n,i,o){let l=-1;for(;++l<i.unsafe.length;)if(i.unsafe[l].character===`
617
+ `&&SB(i.stack,i.unsafe[l]))return/[ \t]/.test(o.before)?"":" ";return`\\
618
+ `}function CB(e,n){const i=String(e);let o=i.indexOf(n),l=o,c=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===l?++c>u&&(u=c):c=1,l=o+n.length,o=i.indexOf(n,l);return u}function NB(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 EB(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 TB(e,n,i,o){const l=EB(i),c=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(NB(e,i)){const p=i.enter("codeIndented"),w=i.indentLines(c,AB);return p(),w}const h=i.createTracker(o),f=l.repeat(Math.max(CB(c,l)+1,3)),v=i.enter("codeFenced");let y=h.move(f);if(e.lang){const p=i.enter(`codeFencedLang${u}`);y+=h.move(i.safe(e.lang,{before:y,after:" ",encode:["`"],...h.current()})),p()}if(e.lang&&e.meta){const p=i.enter(`codeFencedMeta${u}`);y+=h.move(" "),y+=h.move(i.safe(e.meta,{before:y,after:`
619
+ `,encode:["`"],...h.current()})),p()}return y+=h.move(`
620
+ `),c&&(y+=h.move(c+`
621
+ `)),y+=h.move(f),v(),y}function AB(e,n,i){return(i?"":" ")+e}function Mg(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 MB(e,n,i,o){const l=Mg(i),c=l==='"'?"Quote":"Apostrophe",u=i.enter("definition");let h=i.enter("label");const f=i.createTracker(o);let v=f.move("[");return v+=f.move(i.safe(i.associationId(e),{before:v,after:"]",...f.current()})),v+=f.move("]: "),h(),!e.url||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),v+=f.move("<"),v+=f.move(i.safe(e.url,{before:v,after:">",...f.current()})),v+=f.move(">")):(h=i.enter("destinationRaw"),v+=f.move(i.safe(e.url,{before:v,after:e.title?" ":`
622
+ `,...f.current()}))),h(),e.title&&(h=i.enter(`title${c}`),v+=f.move(" "+l),v+=f.move(i.safe(e.title,{before:v,after:l,...f.current()})),v+=f.move(l),h()),u(),v}function _B(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 su(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rh(e,n,i){const o=Pl(e),l=Pl(n);return o===void 0?l===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===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}}mS.peek=RB;function mS(e,n,i,o){const l=_B(i),c=i.enter("emphasis"),u=i.createTracker(o),h=u.move(l);let f=u.move(i.containerPhrasing(e,{after:l,before:h,...u.current()}));const v=f.charCodeAt(0),y=Rh(o.before.charCodeAt(o.before.length-1),v,l);y.inside&&(f=su(v)+f.slice(1));const p=f.charCodeAt(f.length-1),w=Rh(o.after.charCodeAt(0),p,l);w.inside&&(f=f.slice(0,-1)+su(p));const b=u.move(l);return c(),i.attentionEncodeSurroundingInfo={after:w.outside,before:y.outside},h+f+b}function RB(e,n,i){return i.options.emphasis||"*"}function OB(e,n){let i=!1;return Tg(e,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return i=!0,uv}),!!((!e.depth||e.depth<3)&&jg(e)&&(n.options.setext||i))}function DB(e,n,i,o){const l=Math.max(Math.min(6,e.depth||1),1),c=i.createTracker(o);if(OB(e,i)){const y=i.enter("headingSetext"),p=i.enter("phrasing"),w=i.containerPhrasing(e,{...c.current(),before:`
623
+ `,after:`
624
+ `});return p(),y(),w+`
625
+ `+(l===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
626
+ `))+1))}const u="#".repeat(l),h=i.enter("headingAtx"),f=i.enter("phrasing");c.move(u+" ");let v=i.containerPhrasing(e,{before:"# ",after:`
627
+ `,...c.current()});return/^[\t ]/.test(v)&&(v=su(v.charCodeAt(0))+v.slice(1)),v=v?u+" "+v:u,i.options.closeAtx&&(v+=" "+u),f(),h(),v}pS.peek=zB;function pS(e){return e.value||""}function zB(){return"<"}vS.peek=LB;function vS(e,n,i,o){const l=Mg(i),c=l==='"'?"Quote":"Apostrophe",u=i.enter("image");let h=i.enter("label");const f=i.createTracker(o);let v=f.move("![");return v+=f.move(i.safe(e.alt,{before:v,after:"]",...f.current()})),v+=f.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),v+=f.move("<"),v+=f.move(i.safe(e.url,{before:v,after:">",...f.current()})),v+=f.move(">")):(h=i.enter("destinationRaw"),v+=f.move(i.safe(e.url,{before:v,after:e.title?" ":")",...f.current()}))),h(),e.title&&(h=i.enter(`title${c}`),v+=f.move(" "+l),v+=f.move(i.safe(e.title,{before:v,after:l,...f.current()})),v+=f.move(l),h()),v+=f.move(")"),u(),v}function LB(){return"!"}gS.peek=BB;function gS(e,n,i,o){const l=e.referenceType,c=i.enter("imageReference");let u=i.enter("label");const h=i.createTracker(o);let f=h.move("![");const v=i.safe(e.alt,{before:f,after:"]",...h.current()});f+=h.move(v+"]["),u();const y=i.stack;i.stack=[],u=i.enter("reference");const p=i.safe(i.associationId(e),{before:f,after:"]",...h.current()});return u(),i.stack=y,c(),l==="full"||!v||v!==p?f+=h.move(p+"]"):l==="shortcut"?f=f.slice(0,-1):f+=h.move("]"),f}function BB(){return"!"}yS.peek=IB;function yS(e,n,i){let o=e.value||"",l="`",c=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(o);)l+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++c<i.unsafe.length;){const u=i.unsafe[c],h=i.compilePattern(u);let f;if(u.atBreak)for(;f=h.exec(o);){let v=f.index;o.charCodeAt(v)===10&&o.charCodeAt(v-1)===13&&v--,o=o.slice(0,v)+" "+o.slice(f.index+1)}}return l+o+l}function IB(){return"`"}function xS(e,n){const i=jg(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))}bS.peek=PB;function bS(e,n,i,o){const l=Mg(i),c=l==='"'?"Quote":"Apostrophe",u=i.createTracker(o);let h,f;if(xS(e,i)){const y=i.stack;i.stack=[],h=i.enter("autolink");let p=u.move("<");return p+=u.move(i.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),h(),i.stack=y,p}h=i.enter("link"),f=i.enter("label");let v=u.move("[");return v+=u.move(i.containerPhrasing(e,{before:v,after:"](",...u.current()})),v+=u.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),v+=u.move("<"),v+=u.move(i.safe(e.url,{before:v,after:">",...u.current()})),v+=u.move(">")):(f=i.enter("destinationRaw"),v+=u.move(i.safe(e.url,{before:v,after:e.title?" ":")",...u.current()}))),f(),e.title&&(f=i.enter(`title${c}`),v+=u.move(" "+l),v+=u.move(i.safe(e.title,{before:v,after:l,...u.current()})),v+=u.move(l),f()),v+=u.move(")"),h(),v}function PB(e,n,i){return xS(e,i)?"<":"["}jS.peek=qB;function jS(e,n,i,o){const l=e.referenceType,c=i.enter("linkReference");let u=i.enter("label");const h=i.createTracker(o);let f=h.move("[");const v=i.containerPhrasing(e,{before:f,after:"]",...h.current()});f+=h.move(v+"]["),u();const y=i.stack;i.stack=[],u=i.enter("reference");const p=i.safe(i.associationId(e),{before:f,after:"]",...h.current()});return u(),i.stack=y,c(),l==="full"||!v||v!==p?f+=h.move(p+"]"):l==="shortcut"?f=f.slice(0,-1):f+=h.move("]"),f}function qB(){return"["}function _g(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 FB(e){const n=_g(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 HB(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 wS(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 UB(e,n,i,o){const l=i.enter("list"),c=i.bulletCurrent;let u=e.ordered?HB(i):_g(i);const h=e.ordered?u==="."?")":".":FB(i);let f=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&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&&(f=!0),wS(i)===u&&y){let p=-1;for(;++p<e.children.length;){const w=e.children[p];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(u=h),i.bulletCurrent=u;const v=i.containerFlow(e,o);return i.bulletLastUsed=u,i.bulletCurrent=c,l(),v}function $B(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 VB(e,n,i,o){const l=$B(i);let c=i.bulletCurrent||_g(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 u=c.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const h=i.createTracker(o);h.move(c+" ".repeat(u-c.length)),h.shift(u);const f=i.enter("listItem"),v=i.indentLines(i.containerFlow(e,h.current()),y);return f(),v;function y(p,w,b){return w?(b?"":" ".repeat(u))+p:(b?c:c+" ".repeat(u-c.length))+p}}function GB(e,n,i,o){const l=i.enter("paragraph"),c=i.enter("phrasing"),u=i.containerPhrasing(e,o);return c(),l(),u}const YB=cf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KB(e,n,i,o){return(e.children.some(function(u){return YB(u)})?i.containerPhrasing:i.containerFlow).call(i,e,o)}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}kS.peek=QB;function kS(e,n,i,o){const l=XB(i),c=i.enter("strong"),u=i.createTracker(o),h=u.move(l+l);let f=u.move(i.containerPhrasing(e,{after:l,before:h,...u.current()}));const v=f.charCodeAt(0),y=Rh(o.before.charCodeAt(o.before.length-1),v,l);y.inside&&(f=su(v)+f.slice(1));const p=f.charCodeAt(f.length-1),w=Rh(o.after.charCodeAt(0),p,l);w.inside&&(f=f.slice(0,-1)+su(p));const b=u.move(l+l);return c(),i.attentionEncodeSurroundingInfo={after:w.outside,before:y.outside},h+f+b}function QB(e,n,i){return i.options.strong||"*"}function ZB(e,n,i,o){return i.safe(e.value,o)}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 JB(e,n,i){const o=(wS(i)+(i.options.ruleSpaces?" ":"")).repeat(WB(i));return i.options.ruleSpaces?o.slice(0,-1):o}const SS={blockquote:wB,break:xj,code:TB,definition:MB,emphasis:mS,hardBreak:xj,heading:DB,html:pS,image:vS,imageReference:gS,inlineCode:yS,link:bS,linkReference:jS,list:UB,listItem:VB,paragraph:GB,root:KB,strong:kS,text:ZB,thematicBreak:JB};function eI(){return{enter:{table:tI,tableData:bj,tableHeader:bj,tableRow:aI},exit:{codeText:iI,table:nI,tableData:f0,tableHeader:f0,tableRow:f0}}}function tI(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 nI(e){this.exit(e),this.data.inTable=void 0}function aI(e){this.enter({type:"tableRow",children:[]},e)}function f0(e){this.exit(e)}function bj(e){this.enter({type:"tableCell",children:[]},e)}function iI(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,rI));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function rI(e,n){return n==="|"?n:e}function oI(e){const n=e||{},i=n.tableCellPadding,o=n.tablePipeAlign,l=n.stringLength,c=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
628
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:u,tableCell:f,tableRow:h}};function u(b,k,S,N){return v(y(b,S,N),b.align)}function h(b,k,S,N){const C=p(b,S,N),A=v([C]);return A.slice(0,A.indexOf(`
629
+ `))}function f(b,k,S,N){const C=S.enter("tableCell"),A=S.enter("phrasing"),E=S.containerPhrasing(b,{...N,before:c,after:c});return A(),C(),E}function v(b,k){return bB(b,{align:k,alignDelimiters:o,padding:i,stringLength:l})}function y(b,k,S){const N=b.children;let C=-1;const A=[],E=k.enter("table");for(;++C<N.length;)A[C]=p(N[C],k,S);return E(),A}function p(b,k,S){const N=b.children;let C=-1;const A=[],E=k.enter("tableRow");for(;++C<N.length;)A[C]=f(N[C],b,k,S);return E(),A}function w(b,k,S){let N=SS.inlineCode(b,k,S);return S.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function sI(){return{exit:{taskListCheckValueChecked:jj,taskListCheckValueUnchecked:jj,paragraph:cI}}}function lI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:uI}}}function jj(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function cI(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 o=i.children[0];if(o&&o.type==="text"){const l=n.children;let c=-1,u;for(;++c<l.length;){const h=l[c];if(h.type==="paragraph"){u=h;break}}u===i&&(o.value=o.value.slice(1),o.value.length===0?i.children.shift():i.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,i.position.start=Object.assign({},o.position.start)))}}this.exit(e)}function uI(e,n,i,o){const l=e.children[0],c=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",h=i.createTracker(o);c&&h.move(u);let f=SS.listItem(e,n,i,{...o,...h.current()});return c&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,v)),f;function v(y){return y+u}}function dI(){return[UL(),uB(),mB(),eI(),sI()]}function hI(e){return{extensions:[$L(),dB(e),pB(),oI(e),lI()]}}const fI={tokenize:xI,partial:!0},CS={tokenize:bI,partial:!0},NS={tokenize:jI,partial:!0},ES={tokenize:wI,partial:!0},mI={tokenize:kI,partial:!0},TS={name:"wwwAutolink",tokenize:gI,previous:MS},AS={name:"protocolAutolink",tokenize:yI,previous:_S},Wr={name:"emailAutolink",tokenize:vI,previous:RS},pr={};function pI(){return{text:pr}}let ws=48;for(;ws<123;)pr[ws]=Wr,ws++,ws===58?ws=65:ws===91&&(ws=97);pr[43]=Wr;pr[45]=Wr;pr[46]=Wr;pr[95]=Wr;pr[72]=[Wr,AS];pr[104]=[Wr,AS];pr[87]=[Wr,TS];pr[119]=[Wr,TS];function vI(e,n,i){const o=this;let l,c;return u;function u(p){return!mv(p)||!RS.call(o,o.previous)||Rg(o.events)?i(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),h(p))}function h(p){return mv(p)?(e.consume(p),h):p===64?(e.consume(p),f):i(p)}function f(p){return p===46?e.check(mI,y,v)(p):p===45||p===95||sa(p)?(c=!0,e.consume(p),f):y(p)}function v(p){return e.consume(p),l=!0,f}function y(p){return c&&l&&ja(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(p)):i(p)}}function gI(e,n,i){const o=this;return l;function l(u){return u!==87&&u!==119||!MS.call(o,o.previous)||Rg(o.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fI,e.attempt(CS,e.attempt(NS,c),i),i)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function yI(e,n,i){const o=this;let l="",c=!1;return u;function u(p){return(p===72||p===104)&&_S.call(o,o.previous)&&!Rg(o.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(p),e.consume(p),h):i(p)}function h(p){if(ja(p)&&l.length<5)return l+=String.fromCodePoint(p),e.consume(p),h;if(p===58){const w=l.toLowerCase();if(w==="http"||w==="https")return e.consume(p),f}return i(p)}function f(p){return p===47?(e.consume(p),c?v:(c=!0,f)):i(p)}function v(p){return p===null||Ah(p)||Wt(p)||Is(p)||of(p)?i(p):e.attempt(CS,e.attempt(NS,y),i)(p)}function y(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(p)}}function xI(e,n,i){let o=0;return l;function l(u){return(u===87||u===119)&&o<3?(o++,e.consume(u),l):u===46&&o===3?(e.consume(u),c):i(u)}function c(u){return u===null?i(u):n(u)}}function bI(e,n,i){let o,l,c;return u;function u(v){return v===46||v===95?e.check(ES,f,h)(v):v===null||Wt(v)||Is(v)||v!==45&&of(v)?f(v):(c=!0,e.consume(v),u)}function h(v){return v===95?o=!0:(l=o,o=void 0),e.consume(v),u}function f(v){return l||o||!c?i(v):n(v)}}function jI(e,n){let i=0,o=0;return l;function l(u){return u===40?(i++,e.consume(u),l):u===41&&o<i?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(ES,n,c)(u):u===null||Wt(u)||Is(u)?n(u):(e.consume(u),l)}function c(u){return u===41&&o++,e.consume(u),l}}function wI(e,n,i){return o;function o(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(e.consume(h),o):h===38?(e.consume(h),c):h===93?(e.consume(h),l):h===60||h===null||Wt(h)||Is(h)?n(h):i(h)}function l(h){return h===null||h===40||h===91||Wt(h)||Is(h)?n(h):o(h)}function c(h){return ja(h)?u(h):i(h)}function u(h){return h===59?(e.consume(h),o):ja(h)?(e.consume(h),u):i(h)}}function kI(e,n,i){return o;function o(c){return e.consume(c),l}function l(c){return sa(c)?i(c):n(c)}}function MS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Wt(e)}function _S(e){return!ja(e)}function RS(e){return!(e===47||mv(e))}function mv(e){return e===43||e===45||e===46||e===95||sa(e)}function Rg(e){let n=e.length,i=!1;for(;n--;){const o=e[n][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){i=!0;break}if(o._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const SI={tokenize:RI,partial:!0};function CI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:AI,continuation:{tokenize:MI},exit:_I}},text:{91:{name:"gfmFootnoteCall",tokenize:TI},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NI,resolveTo:EI}}}}function NI(e,n,i){const o=this;let l=o.events.length;const c=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let u;for(;l--;){const f=o.events[l][1];if(f.type==="labelImage"){u=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return h;function h(f){if(!u||!u._balanced)return i(f);const v=_i(o.sliceSerialize({start:u.end,end:o.now()}));return v.codePointAt(0)!==94||!c.includes(v.slice(1))?i(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),n(f))}}function EI(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 o={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)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},h=[e[i+1],e[i+2],["enter",o,n],e[i+3],e[i+4],["enter",l,n],["exit",l,n],["enter",c,n],["enter",u,n],["exit",u,n],["exit",c,n],e[e.length-2],e[e.length-1],["exit",o,n]];return e.splice(i,e.length-i+1,...h),e}function TI(e,n,i){const o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let c=0,u;return h;function h(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?i(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",v)}function v(p){if(c>999||p===93&&!u||p===null||p===91||Wt(p))return i(p);if(p===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return l.includes(_i(o.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(p)}return Wt(p)||(u=!0),c++,e.consume(p),p===92?y:v}function y(p){return p===91||p===92||p===93?(e.consume(p),c++,v):v(p)}}function AI(e,n,i){const o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let c,u=0,h;return f;function f(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),v}function v(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(u>999||k===93&&!h||k===null||k===91||Wt(k))return i(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=_i(o.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return Wt(k)||(h=!0),u++,e.consume(k),k===92?p:y}function p(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function w(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 MI(e,n,i){return e.check(yu,n,e.attempt(SI,n,i))}function _I(e){e.exit("gfmFootnoteDefinition")}function RI(e,n,i){const o=this;return Mt(e,l,"gfmFootnoteDefinitionIndent",5);function l(c){const u=o.events[o.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(c):i(c)}}function OI(e){let i=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:c,resolveAll:l};return i==null&&(i=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function l(u,h){let f=-1;for(;++f<u.length;)if(u[f][0]==="enter"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._close){let v=f;for(;v--;)if(u[v][0]==="exit"&&u[v][1].type==="strikethroughSequenceTemporary"&&u[v][1]._open&&u[f][1].end.offset-u[f][1].start.offset===u[v][1].end.offset-u[v][1].start.offset){u[f][1].type="strikethroughSequence",u[v][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[v][1].start),end:Object.assign({},u[f][1].end)},p={type:"strikethroughText",start:Object.assign({},u[v][1].end),end:Object.assign({},u[f][1].start)},w=[["enter",y,h],["enter",u[v][1],h],["exit",u[v][1],h],["enter",p,h]],b=h.parser.constructs.insideSpan.null;b&&ni(w,w.length,0,sf(b,u.slice(v+1,f),h)),ni(w,w.length,0,[["exit",p,h],["enter",u[f][1],h],["exit",u[f][1],h],["exit",y,h]]),ni(u,v-1,f-v+3,w),f=v+w.length-2;break}}for(f=-1;++f<u.length;)u[f][1].type==="strikethroughSequenceTemporary"&&(u[f][1].type="data");return u}function c(u,h,f){const v=this.previous,y=this.events;let p=0;return w;function w(k){return v===126&&y[y.length-1][1].type!=="characterEscape"?f(k):(u.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const S=Pl(v);if(k===126)return p>1?f(k):(u.consume(k),p++,b);if(p<2&&!i)return f(k);const N=u.exit("strikethroughSequenceTemporary"),C=Pl(k);return N._open=!C||C===2&&!!S,N._close=!S||S===2&&!!C,h(k)}}}class DI{constructor(){this.map=[],this.index=new Map}add(n,i,o){zI(this,n,i,o)}consume(n){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const o=[];for(;i>0;)i-=1,o.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];o.push(n.slice()),n.length=0;let l=o.pop();for(;l;){for(const c of l)n.push(c);l=o.pop()}this.map.length=0,this.index.clear()}}function zI(e,n,i,o){if(i===0&&o.length===0)return;const l=e.index.get(n);if(l){l[1]+=i,l[2].push(...o);return}const c=[n,i,o];e.map.push(c),e.index.set(n,c)}function LI(e,n){let i=!1;const o=[];for(;n<e.length;){const l=e[n];if(i){if(l[0]==="enter")l[1].type==="tableContent"&&o.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const c=o.length-1;o[c]=o[c]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return o}function BI(){return{flow:{null:{name:"table",tokenize:II,resolveAll:PI}}}}function II(e,n,i){const o=this;let l=0,c=0,u;return h;function h(O){let P=o.events.length-1;for(;P>-1;){const{type:K}=o.events[P][1];if(K==="lineEnding"||K==="linePrefix")P--;else break}const U=P>-1?o.events[P][1].type:null,Y=U==="tableHead"||U==="tableRow"?_:f;return Y===_&&o.parser.lazy[o.now().line]?i(O):Y(O)}function f(O){return e.enter("tableHead"),e.enter("tableRow"),v(O)}function v(O){return O===124||(u=!0,c+=1),y(O)}function y(O){return O===null?i(O):et(O)?c>1?(c=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),b):i(O):jt(O)?Mt(e,y,"whitespace")(O):(c+=1,u&&(u=!1,l+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),p(O)))}function p(O){return O===null||O===124||Wt(O)?(e.exit("data"),y(O)):(e.consume(O),O===92?w:p)}function w(O){return O===92||O===124?(e.consume(O),p):p(O)}function b(O){return o.interrupt=!1,o.parser.lazy[o.now().line]?i(O):(e.enter("tableDelimiterRow"),u=!1,jt(O)?Mt(e,k,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):k(O))}function k(O){return O===45||O===58?N(O):O===124?(u=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):R(O)}function S(O){return jt(O)?Mt(e,N,"whitespace")(O):N(O)}function N(O){return O===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),C):O===45?(c+=1,C(O)):O===null||et(O)?T(O):R(O)}function C(O){return O===45?(e.enter("tableDelimiterFiller"),A(O)):R(O)}function A(O){return O===45?(e.consume(O),A):O===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(O))}function E(O){return jt(O)?Mt(e,T,"whitespace")(O):T(O)}function T(O){return O===124?k(O):O===null||et(O)?!u||l!==c?R(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):R(O)}function R(O){return i(O)}function _(O){return e.enter("tableRow"),L(O)}function L(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),L):O===null||et(O)?(e.exit("tableRow"),n(O)):jt(O)?Mt(e,L,"whitespace")(O):(e.enter("data"),I(O))}function I(O){return O===null||O===124||Wt(O)?(e.exit("data"),L(O)):(e.consume(O),O===92?H:I)}function H(O){return O===92||O===124?(e.consume(O),I):I(O)}}function PI(e,n){let i=-1,o=!0,l=0,c=[0,0,0,0],u=[0,0,0,0],h=!1,f=0,v,y,p;const w=new DI;for(;++i<e.length;){const b=e[i],k=b[1];b[0]==="enter"?k.type==="tableHead"?(h=!1,f!==0&&(wj(w,n,f,v,y),y=void 0,f=0),v={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},w.add(i,0,[["enter",v,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(o=!0,p=void 0,c=[0,0,0,0],u=[0,i+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},w.add(i,0,[["enter",y,n]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(o=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],p=Zd(w,n,c,l,void 0,p),c=[0,0,0,0]),u[2]=i)):k.type==="tableCellDivider"&&(o?o=!1:(c[1]!==0&&(u[0]=u[1],p=Zd(w,n,c,l,void 0,p)),c=u,u=[c[1],i,0,0])):k.type==="tableHead"?(h=!0,f=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(f=i,c[1]!==0?(u[0]=u[1],p=Zd(w,n,c,l,i,p)):u[1]!==0&&(p=Zd(w,n,u,l,i,p)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=i)}for(f!==0&&wj(w,n,f,v,y),w.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=LI(n.events,i))}return e}function Zd(e,n,i,o,l,c){const u=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",h="tableContent";i[0]!==0&&(c.end=Object.assign({},Rl(n.events,i[0])),e.add(i[0],0,[["exit",c,n]]));const f=Rl(n.events,i[1]);if(c={type:u,start:Object.assign({},f),end:Object.assign({},f)},e.add(i[1],0,[["enter",c,n]]),i[2]!==0){const v=Rl(n.events,i[2]),y=Rl(n.events,i[3]),p={type:h,start:Object.assign({},v),end:Object.assign({},y)};if(e.add(i[2],0,[["enter",p,n]]),o!==2){const w=n.events[i[2]],b=n.events[i[3]];if(w[1].end=Object.assign({},b[1].end),w[1].type="chunkText",w[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",p,n]])}return l!==void 0&&(c.end=Object.assign({},Rl(n.events,l)),e.add(l,0,[["exit",c,n]]),c=void 0),c}function wj(e,n,i,o,l){const c=[],u=Rl(n.events,i);l&&(l.end=Object.assign({},u),c.push(["exit",l,n])),o.end=Object.assign({},u),c.push(["exit",o,n]),e.add(i+1,0,c)}function Rl(e,n){const i=e[n],o=i[0]==="enter"?"start":"end";return i[1][o]}const qI={name:"tasklistCheck",tokenize:HI};function FI(){return{text:{91:qI}}}function HI(e,n,i){const o=this;return l;function l(f){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?i(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),c)}function c(f){return Wt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),u):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),u):i(f)}function u(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),h):i(f)}function h(f){return et(f)?n(f):jt(f)?e.check({tokenize:UI},n,i)(f):i(f)}}function UI(e,n,i){return Mt(e,o,"whitespace");function o(l){return l===null?i(l):n(l)}}function $I(e){return I5([pI(),CI(),OI(e),BI(),FI()])}const VI={};function GI(e){const n=this,i=e||VI,o=n.data(),l=o.micromarkExtensions||(o.micromarkExtensions=[]),c=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),u=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);l.push($I(i)),c.push(dI()),u.push(hI(i))}const bu=()=>window.jarvyDesktop;function YI(e,n,i,o){var v;const l=bu();if(!l||e.senderId===i||document.hasFocus()||n.type!=="dm"&&!e.mentions.includes(i))return;const c=((v=o.find(y=>y.id===e.senderId))==null?void 0:v.name)??m("desktop.someone"),u=n.title.length>32?`${n.title.slice(0,32)}…`:n.title,h=n.type==="dm"?c:`${c} · ${u}`,f=e.content.replace(/\[\[q\d+\]\]/g,"").replace(/\s+/g," ").trim().slice(0,200)||m("desktop.attachment");l.notify({title:h,body:f,chatId:e.chatId})}function KI(){var o;if(!((o=bu())!=null&&o.frameless))return;document.documentElement.dataset.desktop="";let e=!1;const n=()=>{e=!1;const l=window.innerWidth-2;for(const c of document.querySelectorAll(XI)){const u=c.getBoundingClientRect(),h=u.width>0&&u.top<4&&u.right>=l;h!==c.hasAttribute("data-under-controls")&&c.toggleAttribute("data-under-controls",h)}},i=()=>{e||(e=!0,requestAnimationFrame(n))};new MutationObserver(i).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","hidden","data-pane","data-view","data-open"]}),window.addEventListener("resize",i),i()}const XI=".ui-column-header";function QI(e){const n=bu();if(!(n!=null&&n.setTheme))return;const i=getComputedStyle(document.documentElement),o=(parseFloat(i.getPropertyValue("--jv-titlebar"))||52)-1;n.setTheme(e,{background:kj(i.getPropertyValue("--ui-bg-base")),symbol:kj(i.getPropertyValue("--ui-text-secondary")),height:o})}function kj(e){const n=document.createElement("canvas");n.width=n.height=1;const i=n.getContext("2d");if(!i)return"#808080";i.fillStyle=e.trim()||"#808080",i.fillRect(0,0,1,1);const[o=128,l=128,c=128]=i.getImageData(0,0,1,1).data;return`#${[o,l,c].map(u=>u.toString(16).padStart(2,"0")).join("")}`}function Oh(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e,localStorage.setItem("jarvy-theme",e),QI(e)}const ZI={add:Mi,"chat-bubble":zv,window:t9,close:Fl,"chevron-left":Mv,"chevron-right":Ti,"chevron-down":Di,gear:G9,"person-add":tE,"arrow-bracket-to-left":O9,"arrow-up":i9,copy:Os,check:na,"cloud-download":_v,bell:o9,"bell-slash":r9,image:M9,paperclip:Fh,"smiley-plus":g9,info:Dv,people:nE,pencil:H9,file:w9,"file-video":b9,"file-audio":x9,folder:C9,"layout-sidebar-left":q9,sun:W9,moon:P9,"arrows-expand":v9,"arrows-contract":X9,"arrow-u-up-right":V9,"list-bullets":R9,eye:Ov,"eye-slash":Rv,pin:B0,megaphone:D9,trash:wh,search:Io,quote:$9,fold:S9,unfold:eE,more:p9};function Fe({name:e}){const n=ZI[e]??Dv;return r.jsx(n,{className:"ui-icon","aria-hidden":"true",focusable:"false"})}function kt({icon:e,label:n,className:i="",...o}){return r.jsx("button",{type:"button",className:`ui-iconbtn ${i}`,"aria-label":n,title:n,...o,children:r.jsx(Fe,{name:e})})}function ql({title:e,onClose:n,children:i,className:o=""}){const l=j.useRef(null),c=j.useId();return j.useEffect(()=>{const u=l.current,h=document.activeElement;return u.showModal(),()=>{u.close(),h==null||h.focus({preventScroll:!0})}},[]),Po.createPortal(r.jsxs("dialog",{ref:l,className:`ui-small-dialog ${o}`,"aria-labelledby":c,onCancel:u=>{u.preventDefault(),n()},children:[r.jsx(kt,{icon:"close",label:m("ui.closeNamed",{name:e}),className:"ui-dialog-close",onClick:n}),r.jsxs("div",{className:"ui-dialog-body",children:[r.jsx("h1",{id:c,children:e}),i]})]}),document.body)}async function Kl(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 WI({children:e}){const n=j.useRef(null),[i,o]=j.useState("idle");j.useEffect(()=>{if(i==="idle")return;const c=setTimeout(()=>o("idle"),1500);return()=>clearTimeout(c)},[i]);const l=async()=>{var c;return o(await Kl((((c=n.current)==null?void 0:c.textContent)??"").replace(/\n$/,""))?"copied":"failed")};return r.jsxs("figure",{className:"ui-code-figure",children:[r.jsx("pre",{ref:n,children:e}),r.jsx(kt,{icon:i==="copied"?"check":"copy",label:m(i==="copied"?"ui.copied":i==="failed"?"ui.copyFailed":"ui.copyCode"),onClick:()=>void l()})]})}const JI=[GI,PL,HL,DL],OS=j.createContext({});function eP({href:e,children:n}){var o;const i=j.useContext(OS);return e==="#mention"||e==="#mention-me"?r.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-")?((o=i.ref)==null?void 0:o.call(i,e.slice(5)))??r.jsx(r.Fragment,{children:n}):r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const tP={a:eP,img:({alt:e})=>r.jsx("span",{children:m("ui.image",{alt:e||m("ui.imageHidden")})}),pre:({children:e})=>r.jsx(WI,{children:e})},Bo=j.memo(function({text:n,renderQuote:i,renderRef:o}){return $w(),r.jsx(OS.Provider,{value:{quote:i,ref:o},children:r.jsx(kL,{remarkPlugins:JI,skipHtml:!0,components:tP,children:n})})}),Ir=(e,n)=>{var i;return((i=e.people.find(o=>o.id===n))==null?void 0:i.name)??m("inputs.someone")},Rs=(e,n)=>{var i;return((i=e.chats.find(o=>o.id===n))==null?void 0:i.title)??m("inputs.aChat")},Sj={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=>Sj[e]?m(Sj[e]):e,Cj={done:"inputs.jobStatus.done",failed:"inputs.jobStatus.failed",stopped:"inputs.jobStatus.stopped",timed_out:"inputs.jobStatus.timed_out"},nP=e=>Cj[e]?m(Cj[e]):e;function Yc(e,n){switch(e.kind){case"message":return m("inputs.message",{person:Ir(n,e.from),chat:Rs(n,e.chat),text:e.text||m("activity.attachments",{count:e.files.length})});case"task":return m("inputs.task",{name:e.name,text:e.text});case"reaction":return m("inputs.reaction",{person:Ir(n,e.by),emoji:e.emoji,text:e.text});case"update":return m(e.what==="summary"?"inputs.summary":"inputs.notice",{person:Ir(n,e.by),chat:Rs(n,e.chat),version:e.version});case"change":return m("inputs.change",{person:Ir(n,e.by),what:DS(e.what)});case"onboard":return m("inputs.onboard",{person:Ir(n,e.by)});case"followed":return m("inputs.followed",{count:e.total});case"instructions":return m("inputs.instructions",{parts:e.parts.join(", ")});case"job":return m("inputs.job",{id:e.id,status:nP(e.status),command:e.command});case"handoff_continue":return m("inputs.handoffContinue");case"other":return e.text}}function aP(e){return Yc(e.first,{chats:e.chat?[e.chat]:[],people:e.person?[e.person]:[]}).replace(/\s+/g," ").trim()}function Hc({at:e}){return e===void 0?null:r.jsx("time",{dateTime:new Date(e).toISOString(),children:mg(e)})}function iP({item:e,names:n}){return e.kind==="message"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsxs("h4",{children:[r.jsx("strong",{children:Ir(n,e.from)}),r.jsx("span",{children:Rs(n,e.chat)}),r.jsx(Hc,{at:e.at})]}),e.replyTo&&r.jsxs("blockquote",{className:"jv-input-quote",children:[r.jsx("span",{children:m("inputs.replyTo",{person:Ir(n,e.replyTo.from)})}),e.replyTo.text]}),e.text&&r.jsx("div",{className:"jv-input-body",children:r.jsx(Bo,{text:e.text})}),e.files.length>0&&r.jsx("ul",{className:"jv-input-files",children:e.files.map((i,o)=>r.jsxs("li",{children:[r.jsx(Fh,{}),i.name,i.size&&r.jsx("small",{children:i.size})]},o))})]}):e.kind==="task"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsxs("h4",{children:[r.jsx("strong",{children:m("inputs.taskTitle",{name:e.name})}),r.jsx("span",{children:e.schedule}),e.due!==void 0&&r.jsx("span",{children:m("inputs.due",{time:mg(e.due)})})]}),r.jsx("p",{className:"jv-input-text",children:e.text})]}):e.kind==="reaction"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsxs("h4",{children:[r.jsx("strong",{children:m("inputs.reacted",{person:Ir(n,e.by),emoji:e.emoji})}),r.jsx("span",{children:Rs(n,e.chat)}),r.jsx(Hc,{at:e.at})]}),r.jsx("blockquote",{className:"jv-input-quote",children:e.text})]}):e.kind==="change"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsxs("h4",{children:[r.jsx("strong",{children:m("inputs.change",{person:Ir(n,e.by),what:DS(e.what)})}),r.jsx(Hc,{at:e.at})]}),e.value!==null&&r.jsx("p",{className:"jv-input-text",children:e.value})]}):e.kind==="followed"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsx("h4",{children:r.jsx("strong",{children:Yc(e,n)})}),r.jsx("ul",{className:"jv-input-threads",children:e.threads.map(i=>r.jsxs("li",{children:[r.jsx("span",{children:Rs(n,i.chat)}),i.unread>0&&r.jsx("small",{children:m("inputs.unreadThreads",{count:i.unread})})]},i.chat))})]}):e.kind==="job"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsxs("h4",{children:[r.jsx("strong",{children:Yc(e,n)}),e.duration&&r.jsx("span",{children:e.duration}),e.exitCode!==void 0&&r.jsx("span",{children:m("inputs.jobExit",{code:e.exitCode})}),r.jsx(Hc,{at:e.at})]}),(e.error||e.output)&&r.jsx("pre",{className:"jv-input-code",children:[e.error,e.output].filter(Boolean).join(`
630
+ `)})]}):e.kind==="instructions"||e.kind==="other"?r.jsxs("section",{className:"jv-input-item","data-kind":e.kind,children:[r.jsx("h4",{children:r.jsx("strong",{children:e.kind==="other"?`<${e.name}>`:Yc(e,n)})}),r.jsx("pre",{className:"jv-input-code",children:e.text})]}):r.jsx("section",{className:"jv-input-item","data-kind":e.kind,children:r.jsxs("h4",{children:[r.jsx("strong",{children:Yc(e,n)}),r.jsx(Hc,{at:e.at})]})})}function rP({input:e}){const{unread:n,unreadNotes:i,place:o,runningJobs:l,context:c}=e;return r.jsxs("div",{className:"jv-input",children:[e.items.map((u,h)=>r.jsx(iP,{item:u,names:e},h)),(n||i||o||c||l&&l.length>0)&&r.jsxs("footer",{className:"jv-input-tail",children:[n&&r.jsx("p",{children:m("inputs.unread",{count:n.total,list:n.chats.map(u=>`${u.title??Rs(e,u.id)} ${u.count}`).join(" · ")})}),i&&r.jsx("p",{children:m("inputs.unreadNotes",{list:i.map(u=>m("inputs.version",{title:u.title??Rs(e,u.id),version:u.version})).join(" · ")})}),l&&l.length>0&&r.jsx("p",{children:m("inputs.runningJobs",{count:l.length,list:l.map(u=>`${u.id} ${u.command}`).join(" · ")})}),c&&r.jsx("p",{children:m("inputs.context",{used:la(c.tokens),window:la(c.window)})}),o&&r.jsx("p",{children:m("inputs.place",{name:o.kind==="sandbox"?m("inputs.sandbox"):o.name,directory:o.directory})}),(o==null?void 0:o.unavailable)&&r.jsx("p",{className:"jv-input-problem",children:m("inputs.unavailable")})]})]})}const Og=e=>ta(e,{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Ts({value:e}){return r.jsx("pre",{className:"jv-history-json",children:JSON.stringify(e,null,2)})}function zS({blocks:e,links:n,onSelect:i}){return r.jsx(r.Fragment,{children:e.map((o,l)=>{if(o.type==="text"||o.type==="reasoning")return r.jsxs("section",{className:"jv-history-block",children:[r.jsx("h4",{children:m(o.type==="reasoning"?"history.reasoning":"history.text")}),r.jsx(oP,{text:o.text})]},l);if(o.type==="image")return r.jsxs("section",{className:"jv-history-block",children:[r.jsxs("h4",{children:[m("files.kindImage")," · ",o.mime_type]}),r.jsx("img",{className:"jv-history-image",src:`data:${o.mime_type};base64,${o.data}`,alt:m("history.image")})]},l);if(o.type==="tool_call"||o.type==="tool_result"){const c=n.filter(u=>u.tool_call_id===o.tool_call_id);return r.jsxs("section",{className:"jv-history-block",children:[r.jsxs("h4",{children:[m(o.type==="tool_call"?"history.toolCall":"history.toolResult")," · ",r.jsx("strong",{children:o.name}),o.type==="tool_result"&&o.is_error&&r.jsx("span",{className:"jv-history-error-tag",children:m("history.error")})]}),r.jsxs("div",{className:"jv-history-call",children:[r.jsx("code",{children:o.tool_call_id}),c.map(u=>r.jsxs("button",{type:"button",onClick:()=>i(u.id),"aria-label":m("history.related",{id:u.id}),children:[m(u.role==="tool"?"history.result":"history.call")," #",u.id]},u.id))]}),o.type==="tool_call"?r.jsx(Ts,{value:o.arguments}):r.jsxs(r.Fragment,{children:[r.jsx(zS,{blocks:o.result.content,links:[],onSelect:i}),o.result.details!==void 0&&r.jsxs("details",{children:[r.jsx("summary",{children:m("history.details")}),r.jsx(Ts,{value:o.result.details})]})]})]},l)}})})}function oP({text:e}){const n=iR(e);return n?r.jsx("div",{className:"jv-history-text jv-history-markup",children:n.map((i,o)=>r.jsx("div",{style:{paddingLeft:`${i.depth*2}ch`},children:i.text||" "},o))}):r.jsx("pre",{className:"jv-history-text",children:e||m("history.empty")})}const sP={content:"history.content",raw:"inputs.raw",json:"history.json"};function lP({detail:e,onSelect:n}){const[i,o]=j.useState("content"),{record:l,links:c,input:u}=e,h=u?["content","raw","json"]:["content","json"];return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-history-detail-head",children:[r.jsxs("div",{children:[r.jsxs("h3",{children:["#",l.id," ",r.jsx("span",{children:l.role})]}),r.jsx("p",{children:Og(l.timestamp)})]}),r.jsx("div",{role:"tablist","aria-label":m("history.view"),children:h.map(f=>r.jsx(ke,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":i===f,onClick:()=>o(f),children:m(sP[f])},f))})]}),r.jsx("div",{className:"jv-history-detail-scroll",role:"tabpanel","aria-label":m(i==="json"?"history.json":i==="raw"?"inputs.raw":"history.contentLabel"),children:i==="json"?r.jsx(Ts,{value:l}):u&&i==="content"?r.jsx(rP,{input:u}):r.jsxs(r.Fragment,{children:[l.model&&r.jsxs("div",{className:"jv-history-model",children:[r.jsx("span",{children:m("usage.model")}),r.jsx("strong",{children:l.model.id}),r.jsx("small",{children:l.model.provider})]}),r.jsx(zS,{blocks:l.message.content,links:c,onSelect:n}),l.message.tools&&r.jsxs("details",{className:"jv-history-fold",children:[r.jsxs("summary",{children:[m("history.tools")," · ",l.message.tools.length]}),r.jsx(Ts,{value:l.message.tools})]}),l.message.tools_removed!==void 0&&r.jsxs("details",{className:"jv-history-fold",children:[r.jsx("summary",{children:m("history.toolsRemoved")}),r.jsx(Ts,{value:l.message.tools_removed})]}),l.message.stop_reason&&r.jsxs("p",{className:"jv-history-note",children:[m("history.stopReason")," · ",l.message.stop_reason]}),l.message.error&&r.jsx("pre",{className:"jv-history-failure",children:l.message.error}),r.jsxs("details",{className:"jv-history-fold",children:[r.jsx("summary",{children:"Usage"}),r.jsx(Ts,{value:l.usage})]}),r.jsxs("details",{className:"jv-history-fold",children:[r.jsx("summary",{children:"Extra"}),r.jsx(Ts,{value:l.extra})]})]})})]})}const Nj={system:"activity.roleSystem",user:"activity.roleUser",assistant:"activity.roleAssistant",tool:"history.toolResult"},cP=new Set(["user","system"]),Ej=e=>ta(e,{year:"numeric",month:"long",day:"numeric"}),uP=e=>[e.preview,...e.tools.map(n=>m(n.kind==="call"?"activity.toolCall":n.error?"activity.toolFailed":"activity.toolResult",{name:n.name})),e.images?m("activity.images",{count:e.images}):""].filter(Boolean).join(" "),dP=e=>ta(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function hP({items:e,onSelect:n}){return r.jsx("ol",{className:"jv-activity-timeline","aria-label":m("activity.timeline"),children:e.map((i,o)=>{const{record:l}=i,c=Ej(l.timestamp);return r.jsxs(j.Fragment,{children:[(o===0||Ej(e[o-1].record.timestamp)!==c)&&r.jsx("li",{className:"jv-activity-day",children:r.jsx("span",{children:c})}),r.jsxs("li",{className:`jv-activity-row is-${i.kind}`,"data-kind":i.kind,children:[r.jsxs("div",{className:"jv-activity-time",children:[r.jsx("time",{dateTime:new Date(l.timestamp).toISOString(),title:`${Og(l.timestamp)}.${String(l.timestamp%1e3).padStart(3,"0")}`,children:dP(l.timestamp)}),r.jsx("span",{className:"jv-activity-dot"})]}),i.kind==="chat"?r.jsxs("article",{className:"jv-activity-card jv-activity-chat","aria-label":m("activity.chatMessage",{id:i.record.id}),children:[r.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>n({kind:"chat",id:i.record.id}),"aria-label":m("activity.viewMessage",{sequence:i.record.sequence,chat:i.record.chatTitle}),children:[r.jsxs("span",{className:"jv-activity-card-head",children:[r.jsx(L9,{}),r.jsx("strong",{title:i.record.chatTitle,children:i.record.chatTitle}),r.jsxs("span",{children:["#",i.record.sequence]})]}),r.jsx("span",{className:"jv-activity-preview",children:i.record.preview||m("activity.attachmentOnly")}),i.record.attachmentCount>0&&r.jsxs("span",{className:"jv-activity-attachment",children:[r.jsx(Fh,{}),m("activity.attachments",{count:i.record.attachmentCount})]})]}),i.record.source&&r.jsxs("button",{type:"button",className:"jv-activity-source",onClick:()=>n({kind:"history",id:i.record.source.historyId}),"aria-label":m("activity.viewSentBy",{id:i.record.source.historyId}),children:[m("activity.sentBy",{id:i.record.source.historyId}),r.jsx(Jc,{})]})]}):r.jsx("article",{className:"jv-activity-card jv-activity-history","data-input":cP.has(i.record.role)||void 0,"aria-label":m("activity.historyRecord",{id:i.record.id}),children:r.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>n({kind:"history",id:i.record.id}),"aria-label":m("activity.viewHistory",{id:i.record.id,role:i.record.role}),children:[r.jsxs("span",{className:"jv-activity-card-head",children:[r.jsx("strong",{children:Nj[i.record.role]?m(Nj[i.record.role]):i.record.role}),i.record.input&&i.record.input.count>1&&r.jsx("em",{className:"jv-activity-more",children:m("inputs.more",{count:i.record.input.count})}),r.jsxs("span",{children:["#",i.record.id]})]}),r.jsx("span",{className:"jv-activity-preview",children:(i.record.input?aP(i.record.input):uP(i.record))||m("activity.emptyMessage")})]})})]})]},`${i.kind}:${l.id}`)})})}const fP={read:(e,n)=>xe(`/bots/${e}/history/${n}`)},Tj={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",connector_auth_required:"error.connectorAuthRequired",connector_client_missing:"error.connectorClientMissing",connector_headers_invalid:"error.connectorHeadersInvalid",connector_missing:"error.connectorMissing",connector_oauth_failed:"error.connectorOAuthFailed",connector_slug_invalid:"error.connectorSlugInvalid",connector_unreachable:"error.connectorUnreachable",connector_url_invalid:"error.connectorUrlInvalid",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",device_missing:"error.deviceMissing",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"},LS=(e,n)=>{const i=e&&Object.hasOwn(Tj,e)?Tj[e]:void 0;return i?m(i,n):null};function Vt(e,n="common.failed"){return e instanceof lr?LS(e.code,e.params)??(e.status<500?e.message:m(n)):e instanceof Error&&e.message?e.message:m(n)}const BS=e=>LS(e.errorCode,e.errorParams)??e.error??"";function mP({botId:e,selected:n,onSelect:i,onOpenChat:o}){const[l,c]=j.useState(null),[u,h]=j.useState(!0),[f,v]=j.useState(""),[y,p]=j.useState(0);if(j.useEffect(()=>{let k=!0;return h(!0),v(""),c(null),(n.kind==="history"?fP.read(e,n.id).then(N=>({kind:"history",data:N})):P3.message(e,n.id).then(N=>({kind:"chat",data:N}))).then(N=>{k&&c(N)}).catch(N=>{k&&v(Vt(N,"activity.detailFailed"))}).finally(()=>{k&&h(!1)}),()=>{k=!1}},[e,n.kind,n.id,y]),u)return r.jsx("p",{className:"jv-activity-state",role:"status",children:m("activity.detailLoading")});if(f)return r.jsxs("div",{className:"jv-activity-state",children:[r.jsx("p",{role:"alert",children:f}),r.jsx(ke,{variant:"outline",size:"sm",onClick:()=>p(k=>k+1),children:m("common.retry")})]});if(!l)return null;if(l.kind==="history")return r.jsx(lP,{detail:l.data,onSelect:k=>i({kind:"history",id:k})},l.data.record.id);const{chat:w,message:b}=l.data;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-activity-message-head",children:[r.jsxs("div",{children:[r.jsx("h3",{children:w.title}),r.jsx("p",{children:Og(b.createdAt)})]}),r.jsxs(ke,{variant:"ghost",size:"sm",onClick:()=>o(w.id),children:[m("activity.openChat"),r.jsx(Jc,{})]})]}),r.jsxs("div",{className:"jv-activity-message-body",children:[b.content&&r.jsx(Bo,{text:b.content}),b.attachments.length>0&&r.jsx("div",{className:"jv-activity-message-files",children:b.attachments.map(k=>r.jsxs("a",{href:`/api/attachments/${k.id}`,download:k.name,children:[r.jsx(Fh,{}),k.name]},k.id))}),b.source&&r.jsxs(ke,{className:"jv-activity-message-source",variant:"outline",size:"sm",onClick:()=>i({kind:"history",id:b.source.historyId}),children:[m("activity.sentBy",{id:b.source.historyId}),r.jsx(Jc,{})]})]})]})}function pP({botId:e,onOpenChat:n}){const[i,o]=j.useState([void 0]),l=i.at(-1),[c,u]=j.useState({items:[],nextBefore:null}),[h,f]=j.useState(!0),[v,y]=j.useState(""),[p,w]=j.useState(0),[b,k]=j.useState(null),S=j.useRef(null),N=j.useRef(0),C=j.useRef(null);j.useEffect(()=>{let T=!0;return f(!0),y(""),u({items:[],nextBefore:null}),S.current&&(S.current.scrollTop=0),P3.list(e,l).then(R=>{T&&u(R)}).catch(R=>{T&&y(Vt(R,"activity.loadFailed"))}).finally(()=>{T&&f(!1)}),()=>{T=!1}},[e,l,p]);const A=T=>{var R;b||(N.current=((R=S.current)==null?void 0:R.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 r.jsxs("div",{className:"jv-activity",children:[r.jsxs("div",{className:"jv-activity-list",hidden:b!==null,children:[r.jsxs("div",{className:"jv-activity-toolbar",children:[r.jsx("span",{children:m("activity.newestFirst")}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>{o([void 0]),w(T=>T+1)},"aria-label":m("activity.refresh"),children:[r.jsx(du,{}),m(h?"activity.reading":"usage.refresh")]})]}),r.jsxs("div",{className:"jv-activity-columns","aria-hidden":"true",children:[r.jsx("span",{children:m("activity.columnChat")}),r.jsx("span",{children:m("activity.columnTime")}),r.jsx("span",{children:"History"})]}),r.jsx("div",{className:"jv-activity-scroll",ref:S,children:h?r.jsx("p",{className:"jv-activity-state",role:"status",children:m("activity.loading")}):v?r.jsxs("div",{className:"jv-activity-state",children:[r.jsx("p",{role:"alert",children:v}),r.jsx(ke,{variant:"outline",size:"sm",onClick:()=>w(T=>T+1),children:m("common.retry")})]}):c.items.length?r.jsx(hP,{items:c.items,onSelect:A}):r.jsx("div",{className:"jv-activity-state jv-activity-empty",children:r.jsx("p",{children:m("activity.empty")})})}),r.jsxs("div",{className:"jv-activity-pagination",children:[r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:h||i.length===1,onClick:()=>o(T=>T.slice(0,-1)),children:[r.jsx(Mv,{}),m("activity.newer")]}),r.jsx("span",{children:m("activity.page",{page:i.length})}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:h||c.nextBefore===null,onClick:()=>o(T=>[...T,c.nextBefore]),children:[m("activity.older"),r.jsx(Ti,{})]})]})]}),b&&r.jsxs("section",{className:"jv-activity-detail","aria-label":m(b.kind==="history"?"activity.historyDetail":"activity.chatDetail"),children:[r.jsx("div",{className:"jv-activity-toolbar",children:r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",onClick:E,children:[r.jsx(Av,{}),m("activity.backToTimeline")]})}),r.jsx(mP,{botId:e,selected:b,onSelect:A,onOpenChat:n})]})]})}const IS={list:(e,n)=>xe(`/bots/${e}/usage?since=${n}`),overview:e=>xe(`/usage?since=${e}`)},vP=["today","7d","30d","all"],gP=e=>e==="today"?m("usage.today"):e==="all"?m("usage.all"):m("usage.days",{count:e==="7d"?7:30}),Wd=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"],["cacheRead","usage.cacheRead"],["cacheWrite","usage.cacheWrite"]];function yP(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 pv=e=>la(e,e<1e4?void 0:{notation:"compact",maximumFractionDigits:1}),xP=e=>e>0&&e<.01?"< $0.01":`$${e.toFixed(2)}`,vv=e=>r.jsx("td",{"data-label":m("usage.cost"),className:e===null?"jv-usage-unpriced":void 0,title:e===null?void 0:`$${e.toFixed(4)}`,children:e===null?m("usage.unpriced"):xP(e)});function PS(e,n){const[i,o]=j.useState("today"),[l,c]=j.useState(null),[u,h]=j.useState(""),[f,v]=j.useState(0);return j.useEffect(()=>{let y=!0;return c(null),h(""),e(yP(i)).then(p=>{y&&c(p)}).catch(p=>{y&&h(Vt(p,"usage.loadFailed"))}),()=>{y=!1}},[n,i,f]),{range:i,setRange:o,data:l,error:u,reload:()=>v(y=>y+1)}}function qS({range:e,setRange:n,busy:i,reload:o}){return r.jsxs("div",{className:"jv-usage-toolbar",children:[r.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":m("usage.range"),children:vP.map(l=>r.jsx("button",{type:"button",role:"tab","aria-selected":e===l,onClick:()=>n(l),children:gP(l)},l))}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:o,"aria-label":m("usage.refreshLabel"),children:[r.jsx(du,{}),m("usage.refresh")]})]})}function FS({loading:e,error:n,empty:i,reload:o}){return n?r.jsxs("div",{className:"jv-usage-state",children:[r.jsx("p",{role:"alert",children:n}),r.jsx(ke,{variant:"outline",size:"sm",onClick:o,children:m("usage.retry")})]}):e?r.jsx("p",{className:"jv-usage-state",role:"status",children:m("usage.loading")}):i?r.jsx("div",{className:"jv-usage-state jv-usage-empty",children:r.jsx("p",{children:m("usage.empty")})}):null}function HS({models:e,note:n=!0}){const i=e.filter(l=>l.cost!==null),o=Object.fromEntries(Wd.map(([l])=>[l,e.reduce((c,u)=>c+u[l],0)]));return r.jsxs(r.Fragment,{children:[r.jsxs("table",{className:"jv-usage-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:m("usage.model")}),Wd.map(([l,c])=>r.jsx("th",{scope:"col",children:m(c)},l)),r.jsx("th",{scope:"col",children:m("usage.cost")})]})}),r.jsx("tbody",{children:e.map(l=>r.jsxs("tr",{children:[r.jsx("th",{scope:"row",children:r.jsxs("span",{className:"jv-usage-model",children:[r.jsx("strong",{children:l.model}),r.jsx("span",{children:l.provider})]})}),Wd.map(([c,u])=>r.jsx("td",{"data-label":m(u),title:la(l[c]),children:pv(l[c])},c)),vv(l.cost)]},`${l.provider}/${l.model}`))}),e.length>1&&r.jsx("tfoot",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"row",children:r.jsx("strong",{children:m("usage.total")})}),Wd.map(([l,c])=>r.jsx("td",{"data-label":m(c),title:la(o[l]),children:pv(o[l])},l)),vv(i.length?i.reduce((l,c)=>l+c.cost,0):null)]})})]}),n&&i.length>0&&i.length<e.length&&r.jsx("p",{className:"jv-usage-note",children:m("usage.notePartial")})]})}function bP({botId:e}){const{range:n,setRange:i,data:o,error:l,reload:c}=PS(u=>IS.list(e,u).then(h=>h.models),e);return r.jsxs("div",{className:"jv-usage",children:[r.jsx(qS,{range:n,setRange:i,busy:!o&&!l,reload:c}),r.jsxs("div",{className:"jv-usage-scroll",children:[r.jsx(FS,{loading:!o,error:l,empty:!(o!=null&&o.length),reload:c}),o&&o.length>0&&!l&&r.jsx(HS,{models:o})]})]})}const Ri={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"}},US=e=>{var n;return`#${(((n=Ri[e])==null?void 0:n.hex)??Ri.gray.hex).toString(16).padStart(6,"0")}`},jP={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},wP={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},Aj={lit:.55,rim:.5},kP="attribute vec2 p; void main(){ gl_Position = vec4(p, 0., 1.); }",SP=`
631
+ precision highp float;
632
+ uniform vec2 uRes, uLook;
633
+ uniform vec3 uColor, uInk;
634
+ uniform float uSquash, uEarL, uEarR, uOpen, uHappy, uTilt, uLift, uZoom, uShadow, uYaw, uSpin;
635
+ uniform float uEars, uEarSize, uBody, uEyeGap, uEyeSize, uWaist, uEarX, uEarY, uEarW, uEarH, uEarBlend;
636
+ uniform float uKind, uEyeScale, uLid, uLidTilt, uSmile, uBlush, uMouth, uMouthOpen, uEarThick;
637
+ uniform float uLit, uRim;
638
+
639
+ 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; }
640
+ float sdEllipsoid(vec3 p, vec3 r){ float k0 = length(p / r), k1 = length(p / (r * r)); return k0 * (k0 - 1.) / k1; }
641
+ float sdTri(vec2 p, vec2 q){
642
+ p.x = abs(p.x);
643
+ vec2 a = p - q * clamp(dot(p, q) / dot(q, q), 0., 1.);
644
+ vec2 b = p - q * vec2(clamp(p.x / q.x, 0., 1.), 1.);
645
+ float s = -sign(q.y);
646
+ 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)));
647
+ return -sqrt(d.x) * sign(d.y);
648
+ }
649
+ float sdPill(vec2 q, float a, float r){ return length(vec2(q.x, q.y - clamp(q.y, -a, a))) - r; }
650
+ 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); }
651
+ float sdStar5(vec2 p, float r, float rf){
652
+ const vec2 k1 = vec2(.809016994375, -.587785252292);
653
+ const vec2 k2 = vec2(-k1.x, k1.y);
654
+ p.x = abs(p.x);
655
+ p -= 2. * max(dot(k1, p), 0.) * k1; p -= 2. * max(dot(k2, p), 0.) * k2;
656
+ p.x = abs(p.x); p.y -= r;
657
+ vec2 ba = rf * vec2(-k1.y, k1.x) - vec2(0., 1.);
658
+ float h = clamp(dot(p, ba) / dot(ba, ba), 0., r);
659
+ return length(p - ba * h) * sign(p.y * ba.x - p.x * ba.y);
660
+ }
661
+ mat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
662
+ float fill(float d){ return 1. - smoothstep(-.0035, .0035, d); }
663
+
664
+ // An ear: a fin standing on the head, thick down the middle and thin at both edges, thinner toward the tip — so from the
665
+ // 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.
666
+ float sdEar(vec3 q, float ang){
667
+ q.xy = rot(ang) * q.xy;
668
+ float h = uEarH * uEarSize, w = uEarW * uEarSize, round_ = .030 * uEarSize;
669
+ float d2 = sdTri(q.xy - vec2(0., h), vec2(w, -h));
670
+ float up = clamp((q.y + h * .05) / (h * 1.45), 0., 1.), across = clamp(abs(q.x) / w, 0., 1.);
671
+ float half_ = uEarThick * uEarSize * (1. - .45 * up) * (1. - .55 * across * across);
672
+ vec2 e = vec2(d2, abs(q.z) - half_);
673
+ return min(max(e.x, e.y), 0.) + length(max(e, 0.)) - round_;
674
+ }
675
+
676
+ // Down to body space: lifted, tilted about the bottom edge, then squashed at a constant volume, so a squat ball widens.
677
+ vec3 toBody(vec3 p){
678
+ p.y -= uLift;
679
+ p.xz = rot(uYaw + uSpin) * p.xz;
680
+ float floorY = -.58 * uBody;
681
+ p.y -= floorY; p.xy = rot(uTilt) * p.xy; p.y += floorY;
682
+ float widen = 1. / sqrt(max(uSquash, .55));
683
+ p.x *= widen; p.z *= widen; p.y = (p.y - floorY) * uSquash + floorY;
684
+ return p;
685
+ }
686
+ float map(vec3 p){
687
+ vec3 b = toBody(p);
688
+ vec3 bp = b;
689
+ bp.x /= (1. + uWaist * clamp(-b.y, 0., 1.));
690
+ float d = sdEllipsoid(bp, vec3(.58, .58 * uBody, .55));
691
+ if (uEars > .5){
692
+ float el = sdEar(bp - vec3(-uEarX, uEarY, -.01), uEarL);
693
+ float er = sdEar(bp - vec3(uEarX, uEarY, -.01), -uEarR);
694
+ d = smin(d, min(el, er), uEarBlend);
695
+ }
696
+ return d;
697
+ }
698
+ 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))); }
699
+ 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.); }
700
+
701
+ // One eye. 0 pill (with lids, or a smile arc), 1 squeezed chevron, 2 star, 3 spiral, 4 closed in content.
702
+ float eye(vec2 q, float side){
703
+ q /= uEyeScale;
704
+ float open = max(uOpen, .10), H = .105 * open, d;
705
+ if (uKind < .5){
706
+ float dPill = sdPill(vec2(q.x, q.y / open), .055, .05) * min(open, 1.);
707
+ // Lids: the top cut slants (inner corner low = cross, high = worried); the bottom cut is a curve (a smiling eye).
708
+ dPill = max(dPill, q.y - (H - 2. * H * uLid + uLidTilt * side * q.x));
709
+ vec2 c = vec2(0., -H - .10 + uSmile * .14);
710
+ dPill = max(dPill, -(length(q - c) - .10));
711
+ vec2 qa = q - vec2(0., -.04);
712
+ float dArc = max(abs(length(qa) - .062 * uEyeSize) - .019, -qa.y + .004);
713
+ d = mix(dPill * uEyeSize, dArc, uHappy);
714
+ } else if (uKind < 1.5){
715
+ vec2 tip = vec2(-side * .045, 0.);
716
+ d = min(sdSeg(q, tip, vec2(side * .04, .062)), sdSeg(q, tip, vec2(side * .04, -.062))) - .02;
717
+ } else if (uKind < 2.5){
718
+ d = sdStar5(q * rot(side * .12), .092, .48) - .012;
719
+ } else if (uKind < 3.5){
720
+ float r = length(q), a = atan(q.y, q.x) * side, k = .036;
721
+ d = max(abs(fract(r / k - a / 6.2831853) - .5) * k - .0095, r - .088);
722
+ } else {
723
+ vec2 qa = q - vec2(0., .035);
724
+ d = max(abs(length(qa) - .062 * uEyeSize) - .019, qa.y + .004);
725
+ }
726
+ return d * uEyeScale;
727
+ }
728
+
729
+ // Every mouth is a white line, the same pen as the eyes: no filled cavity, no tongue.
730
+ // 1 cat ω, 2 a smile, 3 an O (a yawn), 4 a short line, 5 wavy (a wry face), 6 a frown
731
+ float mouth(vec2 q){
732
+ if (uMouth < .5) return 0.;
733
+ float w = .0145, d = 1.;
734
+ if (uMouth < 1.5){
735
+ float r = .034;
736
+ float a = max(abs(length(q - vec2(-r, .012)) - r) - w, q.y - .012);
737
+ float b = max(abs(length(q - vec2(r, .012)) - r) - w, q.y - .012);
738
+ d = min(a, b);
739
+ } else if (uMouth < 2.5){
740
+ vec2 c = vec2(0., .048 * uMouthOpen);
741
+ float R = .062 * uMouthOpen;
742
+ d = max(abs(length(q - c) - R) - w, max(q.y - c.y + .004, abs(q.x) - R * .92));
743
+ } else if (uMouth < 3.5){
744
+ d = abs(length(q / vec2(.060, .080 * uMouthOpen)) - 1.) * .060 - .018;
745
+ } else if (uMouth < 4.5){
746
+ d = sdSeg(q, vec2(-.032, 0.), vec2(.032, 0.)) - w;
747
+ } else if (uMouth < 5.5){
748
+ d = max(abs(q.y - .011 * sin(q.x * 95.)) - .0125, abs(q.x) - .05);
749
+ } else {
750
+ d = max(abs(length(q - vec2(0., -.05)) - .05) - w, -(q.y + .022));
751
+ }
752
+ return fill(d);
753
+ }
754
+
755
+ // The face is painted on the ball's surface, so it sits on the curve rather than floating in front of it.
756
+ vec3 paintFace(vec3 b, vec3 base){
757
+ if (b.z < 0.) return base;
758
+ float ink = 0., blush = 0.;
759
+ for (int i = 0; i < 2; i++){
760
+ float side = i == 0 ? -1. : 1.;
761
+ vec2 q = b.xy - (vec2(side * uEyeGap, .01) + uLook);
762
+ ink = max(ink, fill(eye(q, side)));
763
+ vec2 qb = (b.xy - vec2(side * (uEyeGap + .092), .01 - .142) - uLook * .4) / vec2(.080, .050);
764
+ blush = max(blush, 1. - smoothstep(.75, 1.02, length(qb)));
765
+ }
766
+ base = mix(base, mix(uColor, vec3(1., .56, .72), .86), blush * uBlush);
767
+ base = mix(base, uInk, max(ink, mouth(b.xy - vec2(uLook.x * .7, .01 - .215 + uLook.y * .5))));
768
+ return base;
769
+ }
770
+
771
+ void main(){
772
+ vec2 uv = (gl_FragCoord.xy - .5 * uRes) / uRes.y;
773
+ vec3 ro = vec3(0., .30, 3.4), ta = vec3(0., -.02, 0.);
774
+ vec3 ww = normalize(ta - ro), uu = normalize(cross(ww, vec3(0., 1., 0.))), vv = cross(uu, ww);
775
+ vec3 rd = normalize(uv.x * uu + uv.y * vv + 2.45 * uZoom * ww);
776
+ float t = 0., near = 9.; bool hit = false;
777
+ for (int i = 0; i < 110; i++){
778
+ float d = map(ro + rd * t);
779
+ near = min(near, d);
780
+ if (d < .0008){ hit = true; break; }
781
+ t += d * .8; if (t > 6.) break;
782
+ }
783
+ vec4 col = vec4(0.);
784
+ float tf = (-.585 - ro.y) / rd.y;
785
+ if (tf > 0. && uShadow > 0.){
786
+ vec3 g = ro + rd * tf;
787
+ // Off the ground, the shadow tightens and fades, so a hop reads as a hop rather than as floating.
788
+ float up = clamp(uLift / .35, 0., 1.), wide = 1. - .38 * up;
789
+ float s = exp(-pow(length(vec2(g.x / (.95 * wide), g.z / (.8 * wide))) / (.58 * wide), 2.) * 2.0);
790
+ col = vec4(0., 0., 0., .20 * s * uShadow * (1. - .55 * up));
791
+ }
792
+ if (hit){
793
+ vec3 p = ro + rd * t, n = normal(p);
794
+ vec3 L = normalize(vec3(-.5, .8, .75));
795
+ // One solid colour, deepened toward the bottom edge and in the hollows, then a soft light from the upper left and a
796
+ // rim that catches the far edge — with the outline, that is what makes a flat colour read as a round body.
797
+ vec3 base = uColor * mix(.94, 1., smoothstep(-.62, .30, p.y)) * mix(.90, 1., ao(p, n));
798
+ float lam = clamp((dot(n, L) + .45) / 1.45, 0., 1.);
799
+ vec3 soft = uColor * mix(vec3(.80, .83, .93), vec3(1.), smoothstep(.08, .86, lam)) * mix(.88, 1., ao(p, n));
800
+ base = mix(base, soft, uLit);
801
+ base += uColor * uRim * pow(1. - max(dot(n, -rd), 0.), 3.2) * .55;
802
+ base = paintFace(toBody(p), base);
803
+ // The crease where the ears meet the head turns edge-on when the head turns, and takes the outline with it.
804
+ base = mix(base, uColor * vec3(.55, .57, .65), (1. - smoothstep(.10, .17, max(dot(n, -rd), 0.))) * .85);
805
+ col = vec4(base, 1.);
806
+ }
807
+ if (!hit && near < 9.){
808
+ // The outline is a band of even width just outside the silhouette, so it does not vanish where the surface turns away
809
+ // fast; a near miss inside the band paints the line over the shadow. Its width is a fixed share of the picture, so
810
+ // the DM figure gets a clear edge and a 22 px avatar a hairline, as in the design study.
811
+ float w = .003 * t;
812
+ float edge = 1. - smoothstep(w * .55, w, near);
813
+ if (edge > 0.) col = vec4(mix(col.rgb, uColor * vec3(.55, .57, .65), edge), max(col.a, edge));
814
+ }
815
+ gl_FragColor = vec4(col.rgb * col.a, col.a);
816
+ }`;function $S(e,n){const i=2.45*n/3.4,o=.92,l=o/e.squash;return{x:.5-l*Math.sin(e.tilt)*i,y:.5-.39*n/.92-(l*Math.cos(e.tilt)+e.lift-o)*i,scale:n/.92,angle:-e.tilt}}const Mj=e=>[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255],CP=256,NP=/swiftshader|llvmpipe|softpipe|software|basic render/i;function EP(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 VS({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&&NP.test(EP(i))){(y=i.getExtension("WEBGL_lose_context"))==null||y.loseContext();return}const o=(p,w)=>{const b=i.createShader(p);if(i.shaderSource(b,w),i.compileShader(b),!i.getShaderParameter(b,i.COMPILE_STATUS))throw new Error(i.getShaderInfoLog(b)??"shader");return b},l=i.createProgram();i.attachShader(l,o(i.VERTEX_SHADER,kP)),i.attachShader(l,o(i.FRAGMENT_SHADER,SP)),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 u=p=>i.getUniformLocation(l,p),h=Mj(16777215),f=[document.createElement("canvas"),document.createElement("canvas")],v=(p,w,b,k,S)=>{n.width!==p&&(n.width=n.height=p),i.viewport(0,0,p,p),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.uniform2f(u("uRes"),p,p),i.uniform3fv(u("uColor"),Mj(w)),i.uniform3fv(u("uInk"),h),i.uniform2fv(u("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(u(N),C);for(const[N,C]of Object.entries(wP))i.uniform1f(u("u"+N[0].toUpperCase()+N.slice(1)),C);i.uniform1f(u("uZoom"),S),i.uniform1f(u("uShadow"),k?1:0),i.uniform1f(u("uLit"),Aj.lit),i.uniform1f(u("uRim"),Aj.rim),i.drawArrays(i.TRIANGLES,0,3)};return{paint(p,w,b,k,{shadow:S=!0,zoom:N=.9}={}){let C=w*2;for(;C<CP;)C*=2;v(C,b,k,S,N);let A=n;for(let E=0;C>w*2;C/=2,E^=1){const T=f[E],R=T.getContext("2d");T.width!==C/2?T.width=T.height=C/2:R.clearRect(0,0,C/2,C/2),R.drawImage(A,0,0,C,C,0,0,C/2,C/2),A=T}p.drawImage(A,0,0,C,C,0,0,w,w)},dispose(){var p;(p=i.getExtension("WEBGL_lose_context"))==null||p.loseContext()}}}const TP={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}},gv=e=>({...jP,...TP[e]}),AP={sleep:"zz",busy:"sweat",ask:"ask",stretch:"sparkle"},GS={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}},MP=GS.sleep??{},_j={rest:.2,turn:.02,ask:.08,read:.12},Rj=Math.PI*2,Uc=(e,n,i)=>e+(n-e)*i;let _P=class{constructor(){$e(this,"x",0);$e(this,"v",0);$e(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 o=9.5;return this.v+=(-180*this.x-o*this.v)*i,this.x+=this.v*i,this.x}};class RP{constructor(){$e(this,"squash",new _P);$e(this,"start",0);$e(this,"motion",null);$e(this,"motionAt",0);$e(this,"lookX",0);$e(this,"lookY",0);$e(this,"yaw",0);$e(this,"lift",0);$e(this,"tilt",0)}frame(n,i){const o=i.motion,l=!!i.reduced,c=o==="sleep",u=i.faceX??0,h=(o==="turn"||o==="ask"||o==="read"?_j[o]:_j.rest)*u;this.start||(this.start=n,this.yaw=h),o!==this.motion&&(this.motion&&!l&&this.squash.kick(c?-.4:.6),this.motion=o,this.motionAt=n);const f=(n-this.start)/1e3,v=(n-this.motionAt)/1e3,y={...gv(i.mood),...GS[o]},p=(A,E)=>l?0:Math.sin(f*A)*E,w=!c&&i.mood==="dizzy",b=o==="idle"?1:c?.25:.45;this.lookX=Uc(this.lookX,(w?0:i.lookX*b)*.055,.18),this.lookY=Uc(this.lookY,(w?0:i.lookY*b)*.045,.15),this.yaw=Uc(this.yaw,h,.07);let k=(c?1.05:1)+(l?0:Math.sin(Rj*f/(c?4.4:3.4))*(c?.014:.008)),S=0,N=y.tilt,C=y.look;if(o==="think")C=[p(.9,.045)+.03,.04],N+=.06+p(1.3,.03);else if(o==="work"||o==="busy"){const A=o==="busy"||i.fast,E=l?0:Math.abs(Math.sin(Rj*f*(A?1.9:1.5)));k+=.032*(1-E),S=.013*E,C=A?[p(6.5,.012)+p(2.3,.005),-.03]:[p(1.9,.02),-.03],o==="busy"&&(N+=p(1.6,.02))}else if(o==="read")C=[l?0:v*.55%1*.09-.045,-.045],N+=p(.7,.02);else if(o==="ask")C=[0,.03],N+=.14+p(1.1,.03);else if(o==="yawn"){const A=l?0:Math.sin(Math.PI*Math.min(1,v%3.2/1.8));k+=.05*A,S=.02*A}else if(o==="stretch"){const A=l?0:Math.sin(Math.PI*Math.min(1,v%3.6/1.8));k-=.04*A,S=.03*A}else o==="groom"&&(N-=.1,C=[.04,-.03]);return this.lift=Uc(this.lift,S,.2),this.tilt=Uc(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 OP=40,DP=30,zP=.05,m0=new Map;let Jd;function YS(e,n,i){const o=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*o,e.lineJoin="round",e.beginPath(),e.moveTo(-13*o,6*o),e.lineTo(-13*o,-2*o),e.lineTo(-6*o,3*o),e.lineTo(0,-7*o),e.lineTo(6*o,3*o),e.lineTo(13*o,-2*o),e.lineTo(13*o,6*o),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*o,c*o,2.2*o,0,Math.PI*2),e.fill();e.restore()}function LP(e,n,i,o,l,c){var p;if(Jd===void 0){const w=VS();Jd=w?{figure:w,out:document.createElement("canvas")}:null}if(!Jd)return"";const{figure:u,out:h}=Jd,f=c?{...gv(n),...MP}:gv(n),v=o?.92:.9;h.width=h.height=i;const y=h.getContext("2d");return y?(o||y.translate(0,zP*i),u.paint(y,i,((p=Ri[e])==null?void 0:p.hex)??Ri.gray.hex,f,{shadow:o,zoom:v}),l&&YS(y,i,$S(f,v)),h.toDataURL("image/png")):""}function BP(e,n,i,o,l=!1,c=!1){const u=Math.round(i*Math.min(3,Math.max(1,o))),h=i>=OP,f=l&&i>=DP,v=`${e}:${n}:${u}:${f}:${c}`;let y=m0.get(v);return y||(y=Promise.resolve().then(()=>LP(e,n,u,h,f,c)),m0.set(v,y),y.catch(()=>m0.delete(v))),y}function IP(e){let n;const i=()=>{e(),o()},o=()=>{n=matchMedia(`(resolution: ${devicePixelRatio}dppx)`),n.addEventListener("change",i,{once:!0})};return o(),()=>n==null?void 0:n.removeEventListener("change",i)}function Ii({color:e,mood:n="normal",size:i=36,badge:o,crown:l=!1,asleep:c=!1}){const[u,h]=j.useState(),f=j.useSyncExternalStore(IP,()=>devicePixelRatio||1);return j.useEffect(()=>{let v=!0;return BP(e,n,i,f,l,c).then(y=>{v&&h(y)}).catch(()=>{}),()=>{v=!1}},[e,n,i,f,l,c]),r.jsxs("span",{className:"jv-bot-avatar",style:{"--jv-avatar-size":`${i}px`,"--jv-avatar-color":US(e)},"aria-hidden":"true",children:[u?r.jsx("img",{src:u,alt:""}):r.jsx("span",{className:"jv-bot-avatar-tile"}),o==="working"&&r.jsxs("span",{className:"jv-typing",title:m("avatar.working"),children:[r.jsx("i",{}),r.jsx("i",{}),r.jsx("i",{})]}),o==="asking"&&r.jsx("span",{className:"jv-typing jv-asking",title:m("activity.asking"),children:"?"})]})}const KS=uA;function XS({className:e,children:n,showCloseButton:i=!0,...o}){return r.jsxs(hA,{children:[r.jsx(fA,{"data-slot":"dialog-overlay",className:"fixed inset-0 z-[80] bg-black/50"}),r.jsxs(vA,{"data-slot":"dialog-content",className:Ln("fixed top-1/2 left-1/2 z-[81] flex max-h-[calc(var(--jv-vh,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),...o,children:[n,i&&r.jsx(wA,{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":m("common.close"),children:r.jsx(Fl,{className:"size-4"})})]})]})}function QS({className:e,...n}){return r.jsx(bA,{"data-slot":"dialog-title",className:Ln("text-lg font-semibold",e),...n})}const PP={running:"activity.running",idle:"activity.idle",stop:"activity.stopped"};function qP({bot:e,status:n,onSaved:i}){const[o,l]=j.useState(null),[c,u]=j.useState(!1),[h,f]=j.useState(""),v=(n==null?void 0:n.status)??"stop";async function y(w){l(w),f("");try{await ae.controlBot(e.id,w)}catch(b){f(Vt(b,"common.failed"))}finally{l(null)}}async function p(w){if(w!==e.color){u(!0),f("");try{i(await ae.setBotColor(e.id,w))}catch(b){f(Vt(b,"bot.changeFailed"))}finally{u(!1)}}}return r.jsxs("header",{className:"jv-bot-head",children:[r.jsx(Ii,{color:e.color,mood:e.mood,size:56,crown:e.agent}),r.jsxs("div",{className:"jv-bot-identity",children:[r.jsx(QS,{children:e.name}),e.description&&r.jsx("span",{children:e.description}),r.jsx("div",{className:"jv-bot-colors",role:"radiogroup","aria-label":m("bot.color"),children:Object.keys(Ri).map(w=>r.jsx("button",{type:"button",role:"radio","aria-checked":e.color===w,"aria-label":m(Ri[w].label),title:m(Ri[w].label),disabled:c,style:{background:US(w)},onClick:()=>void p(w)},w))})]}),r.jsxs("div",{className:"jv-bot-run",children:[r.jsx("span",{className:"jv-status","data-ok":v!=="stop"||void 0,"data-busy":v==="running"||void 0,children:m(PP[v])}),v==="running"&&r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:!!o,onClick:()=>void y("abort"),children:m(o==="abort"?"bot.aborting":"bot.abort")}),r.jsx(ke,{type:"button",variant:"outline",size:"sm",disabled:!!o||!e.connectionId,onClick:()=>void y(v==="stop"?"start":"stop"),children:m(o==="start"?"bot.starting":o==="stop"?"bot.stopping":v==="stop"?"bot.start":"bot.stop")})]}),h&&r.jsx("p",{className:"jv-note-error jv-bot-head-error",role:"alert",children:h})]})}const Vr=__,Gr=z_;function Yr({className:e,children:n,...i}){return r.jsxs(O_,{"data-slot":"select-trigger",className:Ln("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,r.jsx(L_,{asChild:!0,children:r.jsx(Di,{className:"size-4 opacity-50"})})]})}function Kr({className:e,children:n,container:i,...o}){return r.jsx(q_,{container:i??void 0,children:r.jsx(F_,{"data-slot":"select-content",position:"popper",sideOffset:5,className:Ln("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),...o,children:r.jsx(K_,{children:n})})})}function Da({className:e,children:n,...i}){return r.jsxs(Z_,{"data-slot":"select-item",className:Ln("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:[r.jsx(W_,{children:n}),r.jsx(eR,{"data-slot":"select-indicator",className:"absolute right-2",children:r.jsx(na,{className:"size-4"})})]})}function rn(){const[e,n]=j.useState(null),[i,o]=j.useState(""),l=j.useCallback(async(c,u,h)=>{n(c),o("");try{return await u(),!0}catch(f){return o(Vt(f,h)),!1}finally{n(null)}},[]);return{busy:e!==null,doing:e,error:i,setError:o,run:l}}const Oj={auto:"botModel.auto",off:"botModel.off",minimal:"botModel.minimal",low:"botModel.low",medium:"botModel.medium",high:"botModel.high",xhigh:"botModel.xhigh",max:"botModel.max"},FP=(e,n)=>JSON.stringify([e,n]);function ZS({bot:e,connections:n,onSaved:i,onManage:o}){const[l,c]=j.useState([]),[u,h]=j.useState(!0),[f,v]=j.useState(""),[y,p]=j.useState(0),{busy:w,error:b,run:k}=rn(),[S,N]=j.useState(!1),[C,A]=j.useState(""),[E,T]=j.useState(-1),R=j.useRef(null),_=j.useRef(null),[L,I]=j.useState(null),H=j.useId();j.useEffect(()=>{let oe=!0;return h(!0),v(""),ae.modelOptions().then(D=>{oe&&c(D.connections)}).catch(D=>{oe&&v(Vt(D,"botModel.loadFailed"))}).finally(()=>{oe&&h(!1)}),()=>{oe=!1}},[n,y]);const O=l.flatMap(oe=>oe.models.map(D=>({...D,connectionId:oe.id,connectionName:oe.name,key:FP(oe.id,D.id)}))).sort((oe,D)=>oe.name.localeCompare(D.name,void 0,{numeric:!0})),P=O.find(oe=>oe.connectionId===e.connectionId&&oe.id===e.modelId),U=n.find(oe=>oe.id===e.connectionId),Y=U==null?void 0:U.models.find(oe=>oe.id===e.modelId),K=O.filter(oe=>`${oe.name} ${oe.id} ${oe.connectionName}`.toLocaleLowerCase().includes(C.trim().toLocaleLowerCase())),q=l.map(oe=>({...oe,models:K.filter(D=>D.connectionId===oe.id)})).filter(oe=>oe.models.length),Q=q.flatMap(oe=>oe.models),V=O.length>8,Z=e.thinkingLevel==="auto"?`auto${e.effectiveThinkingLevel?` · ${e.effectiveThinkingLevel}`:""}`:e.effectiveThinkingLevel??e.thinkingLevel;function ue(oe){N(oe),A(""),T(-1)}async function z(oe,D,F){ue(!1),await k("choose",async()=>i(await ae.selectBotModel(e.id,oe,D,F,sr())),"botModel.switchFailed")}function he(oe){var D;if(oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const F=oe.key==="ArrowDown"?Math.min(E+1,Q.length-1):Math.max(E-1,0);T(F),(D=document.getElementById(`${H}-${F}`))==null||D.scrollIntoView({block:"nearest"})}else if(oe.key==="Enter"&&Q[E]){oe.preventDefault();const F=Q[E];z(F.connectionId,F.id,e.thinkingLevel)}}return r.jsxs("div",{className:"jv-bot-model jv-ui","aria-busy":w||u,ref:oe=>I((oe==null?void 0:oe.closest("[data-slot=dialog-content]"))??null),children:[r.jsxs("div",{className:"jv-bot-model-fields",children:[r.jsxs("div",{className:"jv-bot-model-field",children:[r.jsx("span",{className:"jv-field-label",children:m("usage.model")}),r.jsxs(Jh,{open:S,onOpenChange:ue,children:[r.jsxs(ef,{className:"jv-model-trigger","aria-label":m("botModel.pick"),"aria-haspopup":"listbox",disabled:w||u||!!f,children:[r.jsx("span",{children:(P==null?void 0:P.name)??(Y==null?void 0:Y.name)??m(e.connectionId?"botModel.broken":"botModel.choose")}),w?r.jsx(H4,{className:"animate-spin"}):r.jsx(Di,{})]}),r.jsx(tf,{container:L,children:r.jsxs(nf,{className:"jv-model-menu jv-ui",align:"start",sideOffset:6,collisionPadding:12,collisionBoundary:L,onOpenAutoFocus:oe=>{var D;oe.preventDefault(),(D=V?R.current:_.current)==null||D.focus()},onKeyDown:he,children:[V&&r.jsxs("div",{className:"jv-model-search",children:[r.jsx(Io,{}),r.jsx("input",{ref:R,role:"combobox","aria-label":m("botModel.filter"),"aria-expanded":"true","aria-controls":H,"aria-activedescendant":E>=0?`${H}-${E}`:void 0,placeholder:m("botModel.filterPlaceholder"),value:C,onChange:oe=>{A(oe.target.value),T(-1)},autoComplete:"off",spellCheck:!1})]}),r.jsxs("div",{ref:_,id:H,role:"listbox","aria-label":m("botModel.list"),tabIndex:-1,"aria-activedescendant":E>=0?`${H}-${E}`:void 0,className:"jv-model-options",children:[q.map(oe=>r.jsxs("div",{role:"group","aria-label":oe.name,children:[r.jsx("div",{className:"jv-model-group-label",children:oe.name}),oe.models.map(D=>{const F=Q.indexOf(D),ie=D.connectionId===e.connectionId&&D.id===e.modelId;return r.jsxs("button",{type:"button",role:"option",tabIndex:-1,id:`${H}-${F}`,"aria-selected":ie,"data-active":F===E||void 0,title:D.id,onClick:()=>void z(D.connectionId,D.id,e.thinkingLevel),children:[r.jsx("span",{className:"jv-option-check",children:ie&&r.jsx(na,{})}),r.jsx("span",{children:D.name})]},D.key)})]},oe.id)),!Q.length&&r.jsx("p",{className:"jv-menu-empty",children:m(O.length?"botModel.noMatch":"botModel.none")})]}),r.jsx("button",{type:"button",className:"jv-menu-manage",onClick:()=>{ue(!1),o()},children:m("botModel.manage")})]})})]}),(P||U)&&r.jsx("span",{className:"jv-field-note",children:(P==null?void 0:P.connectionName)??(U==null?void 0:U.displayName)})]}),r.jsxs("div",{className:"jv-bot-model-field",children:[r.jsx("span",{className:"jv-field-label",children:m("botModel.thinking")}),r.jsxs(Vr,{value:e.thinkingLevel==="auto"?"auto":e.effectiveThinkingLevel??e.thinkingLevel,disabled:w||u||!P||!!f,onValueChange:oe=>{e.connectionId&&z(e.connectionId,e.modelId,oe)},children:[r.jsx(Yr,{className:"jv-thinking-trigger","aria-label":m("botModel.pickThinking"),children:r.jsx(Gr,{children:Z})}),r.jsx(Kr,{className:"jv-select-menu jv-thinking-menu",align:"end",children:["auto",...(P==null?void 0:P.thinking.levels)??[]].map(oe=>{const D=P==null?void 0:P.thinkingLevelMap[oe],F=D&&D!==oe?D:oe;return r.jsx(Da,{value:oe,children:r.jsxs("span",{className:"jv-thinking-option",children:[r.jsxs("span",{children:[F,D&&D!==oe&&r.jsxs("small",{children:[" (",oe,")"]})]}),r.jsx("small",{children:Oj[oe]&&m(Oj[oe])})]})},oe)})})]})]})]}),u&&r.jsx("p",{className:"jv-field-note",role:"status",children:m("botModel.loading")}),w&&r.jsx("p",{className:"jv-field-note",role:"status",children:m("botModel.switching")}),f&&r.jsxs("p",{className:"jv-model-error",role:"alert",children:[f," ",r.jsx("button",{type:"button",onClick:()=>p(oe=>oe+1),children:m("common.retry")})]}),b&&r.jsx("p",{className:"jv-model-error",role:"alert",children:b})]})}function HP(){const[e,n]=j.useState(!1),i=o=>l=>{l.pointerType==="mouse"&&n(o)};return r.jsxs(Jh,{open:e,onOpenChange:n,children:[r.jsx(ef,{className:"jv-context-stale",title:"","aria-label":m("bot.contextStale"),onPointerEnter:i(!0),onPointerLeave:i(!1),children:r.jsx(Hh,{"aria-hidden":"true"})}),r.jsx(tf,{children:r.jsx(nf,{className:"jv-context-tip jv-ui",side:"top",align:"end",sideOffset:6,collisionPadding:12,onOpenAutoFocus:o=>o.preventDefault(),children:m("bot.contextStale")})})]})}function UP({bot:e,status:n,connections:i,chats:o,onSaved:l,onManageModels:c,onOpenSubscription:u}){const[h,f]=j.useState(!1),[v,y]=j.useState(null);j.useEffect(()=>{let w=!0;return ae.botSubscriptions(e.id).then(b=>{w&&y(b.chats)}).catch(()=>{}),()=>{w=!1}},[e.id]),j.useEffect(()=>{if(!h)return;const w=setTimeout(()=>f(!1),1500);return()=>clearTimeout(w)},[h]);const p=n==null?void 0:n.context;return r.jsxs(r.Fragment,{children:[e.agent&&r.jsxs("section",{className:"jv-section","aria-label":m("agent.title"),children:[r.jsx("h3",{className:"jv-section-title",children:m("agent.title")}),r.jsxs("div",{className:"jv-panel jv-agent-about",children:[r.jsx("p",{children:m("agent.intro",{name:e.name})}),r.jsx("ul",{children:["agent.create","agent.model","agent.run","agent.delete","agent.oversee"].map(w=>r.jsx("li",{children:m(w)},w))})]})]}),r.jsxs("section",{className:"jv-section","aria-label":m("usage.model"),children:[r.jsx("h3",{className:"jv-section-title",children:m("usage.model")}),r.jsxs("div",{className:"jv-panel",children:[r.jsx(ZS,{bot:e,connections:i,onSaved:l,onManage:c}),p&&r.jsxs("div",{className:"jv-context",title:m("bot.contextHint"),children:[r.jsxs("div",{className:"jv-context-label",children:[r.jsx("span",{children:m("bot.context")}),r.jsxs("span",{"data-stale":p.stale&&p.tokens!==null||void 0,children:[p.stale&&p.tokens!==null&&r.jsx(HP,{}),p.tokens===null?m("bot.unknown"):m("bot.tokens",{used:la(p.tokens),window:la(p.contextWindow)})]})]}),p.tokens!==null&&r.jsx("div",{className:"jv-context-bar",children:r.jsx("span",{style:{width:`${Math.min(100,Math.max(1,p.tokens/p.contextWindow*100))}%`}})})]})]})]}),r.jsxs("section",{className:"jv-section","aria-label":m("bot.workspace"),children:[r.jsx("h3",{className:"jv-section-title",children:m("bot.workspace")}),r.jsx("div",{className:"jv-list",children:r.jsxs("div",{className:"jv-list-row jv-static-row",children:[r.jsx("span",{className:"jv-row-text",children:r.jsx("code",{title:e.workspacePath,children:e.workspacePath})}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m(h?"ui.copied":"bot.copyWorkspace"),onClick:()=>void Kl(e.workspacePath).then(w=>f(w)),children:h?r.jsx(na,{}):r.jsx(Os,{})})]})})]}),v&&r.jsxs("section",{className:"jv-section","aria-label":m("bot.subscriptions"),children:[r.jsx("h3",{className:"jv-section-title",children:m("bot.subscriptions")}),r.jsx("div",{className:"jv-list",children:v.length===0?r.jsx("div",{className:"jv-list-row jv-static-row",children:r.jsx("span",{className:"jv-row-text",children:r.jsx("span",{children:m("bot.noSubscriptions")})})}):v.map(w=>{var b;return r.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>u(w),children:[r.jsx("span",{className:"jv-row-icon",children:w.type==="thread"?r.jsx(W4,{}):r.jsx(T9,{})}),r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:w.title}),r.jsx("span",{children:w.type==="thread"?m("bot.threadIn",{channel:((b=o.find(k=>k.id===w.parentId))==null?void 0:b.title)??""}):m("info.menu")})]}),r.jsx(Ti,{className:"jv-row-chevron"})]},w.id)})})]})]})}function Xe({className:e,type:n,...i}){return r.jsx("input",{type:n,"data-slot":"input",className:Ln("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 Ps({className:e,...n}){return r.jsx("textarea",{"data-slot":"textarea",className:Ln("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 $P({bot:e,onSaved:n}){const[i,o]=j.useState(e.name),[l,c]=j.useState(e.description),[u,h]=j.useState(e.systemPrompt),[f,v]=j.useState(!1),[y,p]=j.useState(null),w=i!==e.name||l!==e.description||u!==e.systemPrompt;async function b(S){S.preventDefault(),v(!0),p(null);try{n(await ae.saveBot(e.id,{name:i,description:l,systemPrompt:u})),p({kind:"ok",text:m("bot.saved")})}catch(N){p({kind:"error",text:Vt(N,"common.saveFailed")})}finally{v(!1)}}const k=(y==null?void 0:y.kind)==="error"||!w?y:null;return r.jsxs("form",{className:"jv-bot-profile",onSubmit:S=>void b(S),children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("info.name")}),r.jsx(Xe,{id:"jarvy-bot-name",required:!0,maxLength:80,value:i,onChange:S=>o(S.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("bot.description")}),r.jsx(Ps,{id:"jarvy-bot-description",maxLength:1e3,rows:2,value:l,onChange:S=>c(S.target.value),placeholder:m("bot.descriptionPlaceholder")})]}),r.jsxs("label",{className:"jv-field jv-bot-persona",children:[r.jsx("span",{children:"Persona"}),r.jsx(Ps,{id:"jarvy-bot-persona",maxLength:16e3,value:u,onChange:S=>h(S.target.value),placeholder:m("bot.personaPlaceholder")}),r.jsx("small",{className:"jv-hint",children:m("bot.personaHint")})]}),r.jsxs("div",{className:"jv-form-footer",children:[k?r.jsx("p",{className:k.kind==="error"?"jv-note-error":"jv-note-ok",role:k.kind==="error"?"alert":"status",children:k.text}):w?r.jsx("p",{className:"jv-hint",children:m("bot.unsaved")}):r.jsx("span",{}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:f||!w,children:m(f?"bot.saving":"common.save")})]})]})}const Pr=2**30,VP=2**20,Hr=(e,n=2)=>String(Number(e.toFixed(n))),Dh=e=>e<Pr?`${Math.round(e/VP)} MB`:`${Hr(e/Pr,1)} GB`,WS=e=>e===1?m("environment.limits.oneCore"):m("environment.limits.cores",{count:Hr(e)});function GP({usage:e,limits:n,capacity:i}){var u,h;const o=n.memory??(i==null?void 0:i.memory)??null,l=n.cpus??(i==null?void 0:i.cpus)??null,c=(f,v,y)=>v===null?f:y?m("environment.usage.machine",{used:f,whole:v}):`${f} / ${v}`;return r.jsxs(r.Fragment,{children:[r.jsx(p0,{label:m("environment.usage.memory"),share:o&&e.memory/o,host:(u=e.host)==null?void 0:u.memory,text:c(Dh(e.memory),o===null?null:`${Hr(o/Pr,n.memory===null?1:2)} GB`,n.memory===null)}),r.jsx(p0,{label:m("environment.usage.cpu"),share:l&&e.cpu/100/l,text:c(Hr(e.cpu/100),l===null?null:WS(l),n.cpus===null)}),e.disk&&r.jsx(p0,{label:m("environment.usage.disk"),share:e.disk.used/e.disk.size,host:(h=e.host)==null?void 0:h.disk,text:c(Dh(e.disk.used),`${Hr(e.disk.size/Pr)} GB`,!1)})]})}function p0({label:e,text:n,share:i,host:o}){const[l,c]=j.useState(!1),u=r.jsxs(r.Fragment,{children:[r.jsx("span",{children:e}),r.jsx("span",{className:"jv-env-value",children:n}),i!==null&&r.jsx("span",{className:"jv-env-bar","aria-hidden":"true",children:r.jsx("span",{style:{width:`${Math.min(100,Math.max(1,i*100))}%`},"data-high":i>.9||void 0})})]});if(o==null)return r.jsx("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-meter",children:u});const h=f=>v=>{v.pointerType==="mouse"&&c(f)};return r.jsxs(Jh,{open:l,onOpenChange:c,children:[r.jsx(ef,{className:"jv-list-row jv-env-fact jv-env-meter",onPointerEnter:h(!0),onPointerLeave:h(!1),children:u}),r.jsx(tf,{children:r.jsx(nf,{className:"jv-env-tip jv-ui",side:"top",align:"end",sideOffset:4,collisionPadding:12,onOpenAutoFocus:f=>f.preventDefault(),children:m("environment.usage.host",{value:Dh(o)})})})]})}function YP({memory:e,cpus:n}){if(e===null&&n===null)return m("environment.limits.none");const i=m("environment.limits.unlimited");return`${m("environment.limits.memory",{value:e===null?i:`${Hr(e/Pr)} GB`})} · ${m("environment.limits.cpu",{value:n===null?i:WS(n)})}`}function KP({bot:e,onSaved:n}){const i=e.environment.computer,o=i.state==="running",l=i.type==="vm",c=l?{memory:1,cpus:1}:{memory:.25,cpus:.1},u=H=>l?H==="memory"?"4":"2":m("environment.limits.unlimited"),[h,f]=j.useState(null),[v,y]=j.useState(!1),[p,w]=j.useState(""),[b,k]=j.useState(""),{busy:S,error:N,setError:C,run:A}=rn();j.useEffect(()=>{let H=!0;const O=()=>void ae.computerResources(e.id).then(U=>{H&&f(U)}).catch(()=>{});O();const P=o?setInterval(O,1e4):void 0;return()=>{H=!1,clearInterval(P)}},[e.id,o]);const E=o?(h==null?void 0:h.usage)??null:null,T=(h==null?void 0:h.capacity)??null;function R(){w(i.limits.memory===null?"":Hr(i.limits.memory/Pr)),k(i.limits.cpus===null?"":Hr(i.limits.cpus)),C(""),y(!0)}const _={memory:p.trim()?Math.round(Number(p)*Pr):null,cpus:b.trim()?Number(b):null},L=!l&&E&&_.memory!==null&&_.memory<E.memory,I=H=>{H.preventDefault(),A("save",async()=>{n(await ae.setComputerLimits(e.id,_)),y(!1)},"environment.limits.failed")};return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"jv-list-row jv-env-fact jv-env-limits","aria-expanded":v,onClick:()=>v?y(!1):R(),children:[r.jsx("span",{children:m(l?"environment.limits.vm":"environment.limits")}),r.jsx("span",{className:"jv-env-value",children:YP(i.limits)}),r.jsx(Ti,{className:"jv-row-chevron"})]}),E&&r.jsx(GP,{usage:E,limits:i.limits,capacity:T}),v&&r.jsx("div",{className:"jv-list-row jv-static-row jv-env-details",children:r.jsxs("form",{className:"jv-env-limits-form","aria-label":m(l?"environment.limits.vmEdit":"environment.limits.edit"),onSubmit:I,children:[r.jsxs("div",{className:"jv-env-limit-fields",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("environment.limits.memoryField")}),r.jsx(Xe,{type:"number",inputMode:"decimal",min:c.memory,max:T?Number((T.memory/Pr).toFixed(2)):void 0,step:"any",placeholder:u("memory"),value:p,onChange:H=>{w(H.target.value),C("")}})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("environment.limits.cpuField")}),r.jsx(Xe,{type:"number",inputMode:"decimal",min:c.cpus,max:T==null?void 0:T.cpus,step:"any",placeholder:u("cpus"),value:b,onChange:H=>{k(H.target.value),C("")}})]})]}),T&&r.jsx("small",{className:"jv-hint",children:m("environment.limits.machine",{cpus:T.cpus,memory:Hr(T.memory/Pr,1)})}),l&&r.jsx("small",{className:"jv-hint",children:m("environment.limits.vmDefault")}),l&&o&&r.jsx("small",{className:"jv-hint",children:m("environment.limits.vmLater")}),L&&r.jsx("p",{className:"jv-env-warn",role:"status",children:m("environment.limits.below",{usage:Dh(E.memory)})}),N&&r.jsx("p",{className:"jv-note-error",role:"alert",children:N}),r.jsxs("div",{className:"jv-env-confirm-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!1),children:m("common.cancel")}),r.jsx(ke,{type:"submit",className:"jv-primary",size:"sm",disabled:S,children:m("common.save")})]})]})})]})}const XP=["container","vm"];function QP({bot:e,disabled:n,onSaved:i}){const o=e.environment.computer,[l,c]=j.useState(null),[u,h]=j.useState(null),{doing:f,error:v,run:y}=rn();j.useEffect(()=>{let S=!0;const N=A=>void A().then(E=>{S&&c(E)}).catch(()=>{});l||N(ae.vmSupport);const C=(l==null?void 0:l.state)==="checking"||(l==null?void 0:l.state)==="unknown"?setTimeout(()=>N(ae.vmSupport),2e3):void 0;return()=>{S=!1,clearTimeout(C)}},[l]);const p=o.type==="vm"||(l==null?void 0:l.state)==="available",w=o.type==="container"||e.environment.docker,b=(l==null?void 0:l.state)==="checking"||(l==null?void 0:l.state)==="unknown"?m("environment.type.checking"):(l==null?void 0:l.state)==="unavailable"&&o.type!=="vm"?m("environment.type.unavailable",{why:m(`environment.type.why.${l.reason??"failed"}`)}):null,k=S=>void y("switch",async()=>{i(await ae.setComputerType(e.id,S)),h(null)},"common.failed");return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-type",children:[r.jsx("span",{children:m("environment.type")}),r.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":m("environment.type"),children:XP.map(S=>r.jsx("button",{type:"button",role:"radio","aria-checked":o.type===S,disabled:n||!!f||S==="vm"&&!p||S==="container"&&!w,onClick:()=>{S!==o.type&&h(S)},children:m(`environment.type.${S}`)},S))})]}),(b||u||v)&&r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[b&&!u&&r.jsxs("p",{className:"jv-env-type-note",children:[b,(l==null?void 0:l.state)==="unavailable"&&r.jsx(ke,{type:"button",variant:"link",size:"sm",disabled:!!f,onClick:()=>void y("check",async()=>c(await ae.checkVmSupport())),children:m("environment.type.recheck")})]}),u&&r.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":m(`environment.type.${u}Title`,{name:e.name}),children:[r.jsx("strong",{children:m(`environment.type.${u}Title`,{name:e.name})}),r.jsx("p",{children:m(`environment.type.${u}Body`)}),r.jsxs("div",{className:"jv-env-confirm-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(null),children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:!!f,onClick:()=>k(u),children:m(f==="switch"?"environment.type.switching":"environment.type.confirm")})]})]}),v&&r.jsx("p",{className:"jv-note-error",role:"alert",children:v})]})]})}const yv={preparing:"environment.state.preparing",running:"environment.state.running",stopped:"environment.state.stopped",failed:"environment.state.failed",unavailable:"environment.state.unavailable"},ZP=e=>e==="missing"||e==="stopped"||e==="denied"?e:"failed",WP=e=>e==="no_libvirt"||e==="stopped"||e==="denied"||e==="no_tools"||e==="no_kvm"||e==="busy"?e:"failed";function JS({bot:e,onSaved:n,heading:i=!0}){const{doing:o,error:l,run:c}=rn(),[u,h]=j.useState(null),{computer:f,current:v,currentName:y}=e.environment,p=(C,A,E)=>c(C,async()=>n(await A()),E),w=C=>void p(C,()=>ae.computer(e.id,C),"common.failed"),b=f==null?void 0:f.state,k=(f==null?void 0:f.type)==="vm",S=b?yv[b]:null,N=m(k?`environment.type.why.${WP(f==null?void 0:f.error)}`:`environment.unavailable.${ZP(f==null?void 0:f.error)}`);return r.jsxs("section",{className:"jv-section","aria-label":m("environment.title"),children:[i&&r.jsx("h3",{className:"jv-section-title",children:m("environment.title")}),f&&b&&S&&r.jsxs("div",{className:"jv-list jv-env-sandbox",children:[r.jsxs("div",{className:"jv-list-row jv-static-row",children:[r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:m(k?"environment.ownVm":"environment.own")}),v!=="computer"&&y&&r.jsx("span",{className:"jv-env-away",children:m("environment.awayMachine",{name:y??""})})]}),r.jsx("span",{className:"jv-status","data-ok":b==="running"||void 0,"data-busy":b==="preparing"||void 0,children:m(S)})]}),r.jsx(QP,{bot:e,disabled:!!o||b==="preparing",onSaved:n}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m(k?"environment.vm":"environment.container")}),r.jsx("code",{children:f.container})]}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m("environment.image")}),r.jsx("code",{children:f.image})]}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m("environment.mount")}),r.jsx("code",{children:f.mount})]}),b!=="unavailable"&&r.jsx(KP,{bot:e,onSaved:n}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[f.restartNeeded&&b==="running"&&!u&&r.jsx("p",{children:m("environment.restartNote")}),b==="unavailable"?r.jsx("p",{children:m("environment.unavailable",{why:N})}):!u&&r.jsxs("div",{className:"jv-env-actions",children:[f.restartNeeded&&b==="running"&&r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:!!o,onClick:()=>h("restart"),children:m("environment.restart")}),r.jsx(ke,{type:"button",variant:"outline",size:"sm",disabled:!!o||b==="preparing",onClick:()=>b==="running"?h("stop"):w("start"),children:m(o==="start"?"environment.starting":o==="stop"?"environment.stopping":b==="running"?"environment.stop":"environment.start")}),r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:!!o||b==="preparing",onClick:()=>h("reset"),children:m("environment.reset")})]}),u&&r.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":m(`environment.${u}Title`,{name:e.name}),children:[r.jsx("strong",{children:m(`environment.${u}Title`,{name:e.name})}),r.jsx("p",{children:m(u==="reset"&&k?"environment.resetBodyVm":`environment.${u}Body`)}),r.jsxs("div",{className:"jv-env-confirm-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(null),children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{const C=u;h(null),w(C)},children:m(`environment.${u}Confirm`)})]})]})]})]}),l&&r.jsx("p",{className:"jv-note-error",role:"alert",children:l})]})}function Kc({items:e,grantedIds:n,texts:i,rows:o,onGrant:l}){const[c,u]=j.useState(!1),[h,f]=j.useState(""),[v,y]=j.useState([]),p=j.useRef(null),{busy:w,error:b,run:k}=rn();j.useEffect(()=>{var I;c&&((I=p.current)==null||I.scrollIntoView({block:"nearest"}))},[c]);const S=n.map(I=>e.find(H=>H.id===I)).filter(I=>!!I),N=e.filter(I=>!n.includes(I.id)),C=h.trim().toLowerCase(),A=N.filter(I=>{var H;return I.name.toLowerCase().includes(C)||!!((H=I.detail)!=null&&H.toLowerCase().includes(C))}),E=()=>{u(!1),f(""),y([])},T=I=>y(H=>H.includes(I)?H.filter(O=>O!==I):[...H,I]),R=I=>k("grant",I),_=()=>R(async()=>{await l(v,!0),E()}),L=I=>o?r.jsxs("span",{className:"jv-grant-text",children:[r.jsx("strong",{className:I.mono?"jv-mono":void 0,children:I.name}),I.detail&&r.jsx("span",{children:I.detail})]}):r.jsx("span",{className:"jv-secret-bot-name",children:I.name});return r.jsxs("section",{className:"jv-secret-grants","aria-label":i.heading,children:[r.jsxs("div",{className:"jv-secret-grants-head",children:[r.jsxs("h4",{className:"jv-secret-heading",children:[i.heading,S.length>0&&r.jsxs("span",{children:[" · ",S.length]})]}),!c&&r.jsxs(ke,{type:"button",variant:"outline",size:"sm",disabled:w,onClick:()=>u(!0),children:[r.jsx(Mi,{}),i.add]})]}),S.length>0?r.jsx("ul",{className:"jv-secret-granted","data-rows":o||void 0,children:S.map(I=>r.jsxs("li",{children:[I.icon,L(I),I.once&&r.jsx("span",{className:"jv-secret-once",children:m("secrets.onceTag")}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-secret-revoke",disabled:w,"aria-label":m("secrets.revoke",{name:I.name}),onClick:()=>void R(()=>l([I.id],!1)),children:r.jsx(Fl,{})})]},I.id))}):!c&&r.jsx("p",{className:"jv-hint",children:i.none}),c&&r.jsxs("div",{ref:p,className:"jv-secret-picker",children:[e.length>0&&r.jsxs("label",{className:"jv-search",children:[r.jsx(Io,{"aria-hidden":"true"}),r.jsx("input",{type:"search",autoFocus:!0,value:h,placeholder:i.search,"aria-label":i.search,onChange:I=>f(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.nativeEvent.isComposing&&(I.preventDefault(),A.length===1&&T(A[0].id))}})]}),r.jsxs("div",{className:"jv-secret-options",role:"listbox","aria-multiselectable":"true","aria-label":i.add,"data-rows":o||void 0,children:[A.map(I=>r.jsxs("button",{type:"button",role:"option","aria-selected":v.includes(I.id),className:"jv-secret-option",onClick:()=>T(I.id),children:[I.icon,L(I),v.includes(I.id)&&r.jsx(na,{"aria-hidden":"true"})]},I.id)),A.length===0&&(e.length?r.jsx("p",{className:"jv-hint",children:N.length?i.noMatch:i.all}):r.jsx("div",{className:"jv-hint jv-grant-nothing",children:i.nothing}))]}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:E,children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:w||!v.length,onClick:()=>void _(),children:v.length?m("dialogs.addCount",{count:v.length}):m("common.add")})]})]}),b&&r.jsx("p",{className:"jv-note-error",role:"alert",children:b})]})}function JP({secret:e,bots:n,onChanged:i}){return r.jsx(df,{grantedIds:e.grants.map(o=>o.botId),onceIds:new Set(e.grants.filter(o=>o.scope==="once").map(o=>o.botId)),bots:n,onGrant:async(o,l)=>{let c=e;for(const u of o)c=await ae.grantSecret(e.id,u,l);i(c)}})}function df({grantedIds:e,onceIds:n,bots:i,onGrant:o}){const l=n??new Set;return r.jsx(Kc,{grantedIds:e,onGrant:o,items:i.map(c=>({id:c.id,name:c.name,once:l.has(c.id),icon:r.jsx(Ii,{color:c.color,mood:c.mood,size:20,crown:c.agent})})),texts:{heading:m("secrets.grants"),add:m("secrets.addBots"),search:m("secrets.searchBots"),none:m("secrets.noGrants"),nothing:m("secrets.noBots"),noMatch:m("secrets.noMatch"),all:m("secrets.allGranted")}})}function hf({value:e,visible:n,onChange:i,onVisible:o,placeholder:l,required:c,warnShort:u=!0}){return r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"jv-secret-input",children:[r.jsx(Xe,{type:n?"text":"password",autoComplete:"new-password",spellCheck:!1,required:c,className:"jv-mono",placeholder:l,value:e,onChange:h=>i(h.target.value)}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m(n?"secrets.hideValue":"secrets.showValue"),onClick:()=>o(!n),children:n?r.jsx(Rv,{}):r.jsx(Ov,{})})]}),u&&e.length>0&&e.length<8&&r.jsx("span",{className:"jv-field-hint jv-secret-short",children:m("secrets.shortValue")})]})}function lu({publicKey:e}){const[n,i]=j.useState(!1);return j.useEffect(()=>{if(!n)return;const o=setTimeout(()=>i(!1),1500);return()=>clearTimeout(o)},[n]),r.jsxs("div",{className:"jv-machine-key",children:[r.jsx("code",{children:e}),r.jsxs("button",{type:"button",className:"ui-button jv-machine-copy","aria-label":m("machines.copy"),onClick:()=>void Kl(e).then(i),children:[n?r.jsx(na,{"aria-hidden":"true"}):r.jsx(Os,{"aria-hidden":"true"}),r.jsx("span",{children:m(n?"machines.copied":"machines.copy")})]})]})}function e6(e){const[n,i]=j.useState(null),[o,l]=j.useState(null);return j.useEffect(()=>{if(!e||n)return;let c=!0;return ae.prepareMachineKey().then(u=>{c&&i(u)}).catch(u=>{c&&l(Vt(u))}),()=>{c=!1}},[e,n]),{key:n,error:o,renew:()=>{i(null),l(null)}}}const vh=e=>`${e.user}@${e.host}${e.port===22?"":`:${e.port}`}`;function eq({machine:e,bots:n,onChanged:i,onDeleted:o}){const[l,c]=j.useState(e.name),[u,h]=j.useState(e.directory),[f,v]=j.useState(e.description),[y,p]=j.useState(null),[w,b]=j.useState(null),{busy:k,doing:S,error:N,setError:C,run:A}=rn(),[E,T]=j.useState(""),[R,_]=j.useState(!1),[L,I]=j.useState(null),H=Y=>{Y.preventDefault(),A("save",async()=>{const K=await ae.updateMachine(e.id,{name:l.trim(),directory:u.trim(),description:f.trim()});i(K),c(K.name),h(K.directory),v(K.description)})},O=Y=>void A("delete",async()=>{try{await ae.deleteMachine(e.id,Y),o()}catch(K){throw!Y&&K instanceof lr&&K.code!=="machine_missing"&&b("force"),K}}),P=l.trim()!==e.name||u.trim()!==e.directory||f.trim()!==e.description,U=w==="force";return r.jsx("div",{className:"jv-list jv-machine-detail",children:r.jsxs("div",{className:"jv-list-row jv-static-row jv-secret-details",children:[r.jsxs("form",{className:"jv-secret-edit jv-machine-edit",onSubmit:H,"aria-label":e.name,children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.name")}),r.jsx(Xe,{required:!0,maxLength:40,value:l,onChange:Y=>c(Y.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.directory")}),r.jsx(Xe,{className:"jv-mono",required:!0,maxLength:1e3,spellCheck:!1,value:u,onChange:Y=>h(Y.target.value)})]}),r.jsxs("label",{className:"jv-field jv-machine-description",children:[r.jsx("span",{children:m("machines.description")}),r.jsx(Ps,{maxLength:2e3,rows:3,placeholder:m("machines.descriptionPlaceholder"),value:f,onChange:Y=>v(Y.target.value)})]}),r.jsx("div",{className:"jv-secret-actions",children:r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:k||!P||!l.trim(),children:m("common.save")})})]}),r.jsxs("div",{className:"jv-machine-part",children:[r.jsxs("section",{className:"jv-secret-grants","aria-label":m("machines.fingerprint"),children:[r.jsx("h4",{className:"jv-secret-heading",children:m("machines.fingerprint")}),r.jsxs("div",{className:"jv-machine-key jv-machine-fingerprint",children:[r.jsx("div",{className:"jv-machine-codes",children:(y!=null&&y.changed?y.hostKeys.fingerprints:e.fingerprints).map(Y=>r.jsx("code",{"data-new":(y==null?void 0:y.changed)||void 0,children:Y},Y))}),y!=null&&y.changed?r.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:k,onClick:()=>void A("trust",async()=>{i(await ae.trustMachine(e.id,y.hostKeys.fingerprints)),p(null)}),children:m("machines.trust")}):r.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:k,onClick:()=>void A("check",async()=>{const Y=await ae.checkMachine(e.id);p(Y),i(Y.machine)}),children:m(S==="check"?"machines.checking":"machines.check")})]}),y&&r.jsx("p",{className:"jv-hint","data-warn":y.changed||void 0,children:m(y.changed?"machines.changed":"machines.unchanged")})]}),r.jsxs("section",{className:"jv-secret-grants","aria-label":m("machines.login"),children:[r.jsxs("div",{className:"jv-secret-grants-head",children:[r.jsx("h4",{className:"jv-secret-heading",children:m("machines.login")}),r.jsx("span",{className:"jv-row-meta",children:m(e.login==="password"?"machines.loginPassword":"machines.loginKey")})]}),e.publicKey&&r.jsx(lu,{publicKey:e.publicKey}),e.login==="password"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"jv-hint",children:m("machines.passwordLogin")}),r.jsxs("form",{className:"jv-machine-password",autoComplete:"off","aria-label":m("machines.updatePassword"),onSubmit:Y=>{Y.preventDefault(),A("password",async()=>{i(await ae.setMachinePassword(e.id,E)),T(""),I(m("machines.passwordUpdated"))})},children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.newPassword")}),r.jsx(hf,{value:E,visible:R,onChange:T,onVisible:_,required:!0,warnShort:!1})]}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:()=>void A("key",async()=>{const Y=await ae.checkMachine(e.id);p(Y),i(Y.machine),I(m(Y.machine.login==="key"?"machines.usingKey":"machines.stillPassword"))}),children:m("machines.useKey")}),r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:k||!E,children:m("machines.updatePassword")})]})]})]}),L&&r.jsx("p",{className:"jv-hint",children:L})]})]}),r.jsx("div",{className:"jv-machine-part",children:r.jsx(df,{grantedIds:e.botIds,bots:n,onGrant:async(Y,K)=>{let q=e;for(const Q of Y)q=await ae.grantMachine(e.id,Q,K);i(q)}})}),w?r.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":m(U?"machines.forceTitle":"machines.deleteTitle",{name:e.name}),children:[r.jsx("strong",{children:m(U?"machines.forceTitle":"machines.deleteTitle",{name:e.name})}),r.jsx("p",{children:U?m("machines.forceBody",{comment:`jarvy-${e.id}`}):m("machines.deleteBody")}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>{b(null),C("")},children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:k,onClick:()=>O(U),children:m(U?"machines.forceConfirm":"machines.deleteConfirm")})]})]}):r.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>b("delete"),children:m("machines.delete")})}),N&&r.jsx("p",{className:"jv-note-error",role:"alert",children:N})]})})}function qs({provider:e,badge:n=!1,className:i}){const o=e==="github"?r.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:i,"aria-hidden":"true",children:r.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12Z"})}):e==="gmail"?r.jsxs("svg",{viewBox:"0 0 24 24",className:i,"aria-hidden":"true",children:[r.jsx("path",{fill:"#4285F4",d:"M2 6.5V18a2 2 0 0 0 2 2h2V9.8L2 6.8V6.5Z"}),r.jsx("path",{fill:"#34A853",d:"M18 20h2a2 2 0 0 0 2-2V6.5v.3l-4 3V20Z"}),r.jsx("path",{fill:"#FBBC04",d:"M18 4.5v5.3l4-3V6a2 2 0 0 0-3.2-1.6L18 4.5Z"}),r.jsx("path",{fill:"#EA4335",d:"M6 9.8V4.5l6 4.5 6-4.5v5.3l-6 4.5-6-4.5Z"}),r.jsx("path",{fill:"#C5221F",d:"M2 6a2 2 0 0 1 3.2-1.6L6 4.5v5.3l-4-3V6Z"})]}):e==="linear"?r.jsx("svg",{viewBox:"0 0 24 24",className:i,"aria-hidden":"true",children:r.jsx("path",{fill:"#5E6AD2",d:"M.356 14.886a12.01 12.01 0 0 0 8.758 8.758L.356 14.886ZM.006 11.535 12.465 23.994c.666-.026 1.323-.107 1.964-.24L.246 9.571A12.04 12.04 0 0 0 .006 11.535Zm.842-3.972 15.589 15.589c.524-.216 1.03-.47 1.514-.76L1.608 6.049c-.29.484-.544.99-.76 1.514Zm2.168-3.373 16.794 16.794a12 12 0 1 0-16.794-16.794Z"})}):r.jsx(u3,{className:i,"aria-hidden":"true"});return n?r.jsx("span",{className:"jv-provider-mark","data-logo":e!=="custom_mcp"?"":void 0,"aria-hidden":"true",children:o}):o}function tq({bot:e,onSaved:n,onManageSecrets:i,onManageConnectors:o,onAddMachine:l}){const[c,u]=j.useState(null),[h,f]=j.useState(null),[v,y]=j.useState(null),[p,w]=j.useState(!1);if(j.useEffect(()=>{let k=!0;return Promise.all([ae.secrets(),ae.machines(),ae.connectors()]).then(([S,N,C])=>{k&&(u(S.secrets.filter(A=>A.kind==="value")),f(N.machines),y(C.connectors))}).catch(()=>{k&&w(!0)}),()=>{k=!1}},[e.id]),p)return r.jsx("p",{className:"jv-note-error",role:"alert",children:m("access.loadFailed")});if(!c||!h||!v)return null;const b=k=>k.grants.find(S=>S.botId===e.id);return r.jsxs("section",{className:"jv-section jv-access","aria-label":m("bot.tab.access"),children:[r.jsx(Kc,{rows:!0,grantedIds:c.filter(b).map(k=>k.id),items:c.map(k=>{var S;return{id:k.id,name:k.name,mono:!0,...k.description?{detail:k.description}:{},once:((S=b(k))==null?void 0:S.scope)==="once",icon:r.jsx(jh,{className:"jv-grant-icon","aria-hidden":"true"})}}),texts:{heading:m("access.secrets"),add:m("common.add"),search:m("access.searchSecrets"),none:m("access.noSecrets"),noMatch:m("access.noMatch"),all:m("access.allSecrets"),nothing:r.jsxs(r.Fragment,{children:[r.jsx("span",{children:m("access.noSecretsYet")}),r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:i,children:[r.jsx(Mi,{}),m("access.newSecret")]})]})},onGrant:async(k,S)=>{const N=new Map;for(const C of k)N.set(C,await ae.grantSecret(C,e.id,S));u(C=>C&&C.map(A=>N.get(A.id)??A))}}),r.jsx(Kc,{rows:!0,grantedIds:v.filter(k=>k.grants.some(S=>S.botId===e.id)).map(k=>k.id),items:v.map(k=>{const S=k.grants.find(C=>C.botId===e.id),N=k.statusDetail&&!k.name.includes(k.statusDetail)?k.statusDetail:m("connectors.toolCount",{count:k.tools.length});return{id:k.id,name:k.name,detail:N,once:(S==null?void 0:S.scope)==="once",icon:r.jsx(qs,{provider:k.provider,className:"jv-grant-icon"})}}),texts:{heading:m("access.connectors"),add:m("common.add"),search:m("access.searchConnectors"),none:m("access.noConnectors"),noMatch:m("access.noMatch"),all:m("access.allConnectors"),nothing:r.jsxs(r.Fragment,{children:[r.jsx("span",{children:m("access.noConnectorsYet")}),r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:o,children:[r.jsx(Mi,{}),m("access.manageConnectors")]})]})},onGrant:async(k,S)=>{const N=new Map;for(const C of k)N.set(C,await ae.grantConnector(C,e.id,S));y(C=>C&&C.map(A=>N.get(A.id)??A))}}),r.jsx(Kc,{rows:!0,grantedIds:[...e.environment.devices.filter(k=>k.granted).map(k=>k.id),...h.filter(k=>k.botIds.includes(e.id)).map(k=>k.id)],items:[...e.environment.devices.map(k=>({id:k.id,name:k.name,detail:m("devices.kindDevice"),once:k.once===!0,icon:r.jsx(I4,{className:"jv-grant-icon","aria-hidden":"true"})})),...h.map(k=>{var S;return{id:k.id,name:k.name,detail:vh(k),once:((S=e.environment.machines.find(N=>N.id===k.id))==null?void 0:S.once)===!0,icon:r.jsx(Bl,{className:"jv-grant-icon","aria-hidden":"true"})}})],texts:{heading:m("environment.external"),add:m("common.add"),search:m("access.searchMachines"),none:m("access.noMachines"),noMatch:m("access.noMatch"),all:m("access.allMachines"),nothing:r.jsxs(r.Fragment,{children:[r.jsx("span",{children:m("access.noMachinesYet")}),r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:l,children:[r.jsx(Mi,{}),m("machines.add")]})]})},onGrant:async(k,S)=>{for(const N of k)n(await ae.grantBotMachine(e.id,N,S));f(N=>N&&N.map(C=>k.includes(C.id)?{...C,botIds:S?[...new Set([...C.botIds,e.id])]:C.botIds.filter(A=>A!==e.id)}:C))}}),e.environment.sandboxes&&r.jsx(Kc,{rows:!0,grantedIds:e.environment.sandboxes.filter(k=>k.granted).map(k=>k.id),items:e.environment.sandboxes.map(k=>({id:k.id,name:m("access.sandboxOf",{name:k.name}),once:k.once===!0,icon:r.jsx(L0,{className:"jv-grant-icon","aria-hidden":"true"})})),texts:{heading:m("access.sandboxes"),add:m("common.add"),search:m("access.searchSandboxes"),none:m("access.noSandboxes"),noMatch:m("access.noMatch"),all:m("access.allSandboxes"),nothing:r.jsx("span",{children:m("access.noOtherBots")})},onGrant:async(k,S)=>{for(const N of k)n(await ae.grantBotSandbox(e.id,N,S))}})]})}const Dj=(e,n)=>Oo(new Date(2e3,0,1,e,n)),t6=e=>ta(new Date(2023,0,1+e),{weekday:"long"}),Dg=e=>`${qh(e)} ${Oo(e)}`;function nq(e){switch(e.kind){case"once":return m("tasks.schedule.once",{time:Dg(e.at)});case"every":return e.minutes%60===0?m("tasks.schedule.hours",{count:e.minutes/60}):m("tasks.schedule.minutes",{count:e.minutes});case"daily":return m("tasks.schedule.daily",{time:Dj(e.hour,e.minute)});case"weekly":return m("tasks.schedule.weekly",{day:t6(e.weekday),time:Dj(e.hour,e.minute)})}}const Ol=e=>String(e).padStart(2,"0"),zj=e=>{const n=new Date(e);return`${n.getFullYear()}-${Ol(n.getMonth()+1)}-${Ol(n.getDate())}T${Ol(n.getHours())}:${Ol(n.getMinutes())}`},aq=(e,n)=>`${Ol(e)}:${Ol(n)}`,Lj={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"},iq=["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"],rq=e=>iq.includes(e)?m(`agentLog.tool.${e}`):e;function oq({bot:e,runs:n}){const[i,o]=j.useState(null),[l,c]=j.useState(null),[u,h]=j.useState(!1),[f,v]=j.useState("");j.useEffect(()=>{let p=!0;return v(""),ae.agentActions(e.id).then(w=>{p&&(o(w.items),c(w.nextBefore))}).catch(w=>{p&&v(Vt(w,"agentLog.loadFailed"))}),()=>{p=!1}},[e.id,n]);const y=()=>{u||l===null||(h(!0),v(""),ae.agentActions(e.id,l).then(p=>{o(w=>[...w??[],...p.items]),c(p.nextBefore)}).catch(p=>v(Vt(p,"agentLog.loadFailed"))).finally(()=>h(!1)))};return r.jsxs("section",{className:"jv-section jv-agent-log","aria-label":m("agentLog.title"),children:[r.jsx("h3",{className:"jv-section-title",children:m("agentLog.title")}),f&&r.jsx("p",{className:"jv-note-error",role:"alert",children:f}),i&&r.jsx("div",{className:"jv-list",children:i.length===0?r.jsx("div",{className:"jv-list-row jv-static-row",children:r.jsx("span",{className:"jv-row-text",children:r.jsx("span",{children:m("agentLog.empty")})})}):i.map(p=>r.jsxs("div",{className:"jv-list-row jv-static-row jv-agent-log-row","data-outcome":p.outcome,children:[r.jsxs("span",{className:"jv-row-text",children:[r.jsxs("strong",{children:[rq(p.tool),p.target&&r.jsxs("span",{className:"jv-agent-log-target",children:[" · ",p.target]})]}),r.jsx("span",{children:[Dg(p.at),p.detail].filter(Boolean).join(" · ")})]}),r.jsx("span",{className:"jv-agent-log-outcome",children:Lj[p.outcome]?m(Lj[p.outcome]):p.outcome})]},p.id))}),l!==null&&r.jsx(ke,{type:"button",variant:"ghost",size:"sm",className:"jv-agent-log-more",disabled:u,onClick:y,children:m("agentLog.more")})]})}const sq=["once","every","daily","weekly"],n6=5;function lq(e){const n=Date.now()+36e5,i={at:zj(n-n%(300*1e3)),count:"30",unit:"minutes",time:"09:00",weekday:"1"};return e&&(e.kind==="once"&&(i.at=zj(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=aq(e.hour,e.minute)),e.kind==="weekly"&&(i.weekday=String(e.weekday))),i}function cq(e,n){const[i,o]=n.time.split(":").map(Number),l=Number.isInteger(i)&&Number.isInteger(o)?{hour:i,minute:o}: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>=n6?{kind:e,minutes:c}:null}return l?e==="daily"?{kind:e,...l}:{kind:e,weekday:Number(n.weekday),...l}:null}function uq({task:e,busy:n,error:i,onSave:o,onDelete:l,onCancel:c}){const[u,h]=j.useState((e==null?void 0:e.name)??""),[f,v]=j.useState((e==null?void 0:e.instruction)??""),[y,p]=j.useState((e==null?void 0:e.schedule.kind)??"daily"),[w,b]=j.useState(()=>lq(e==null?void 0:e.schedule)),[k,S]=j.useState(!1),N=cq(y,w),C=E=>b(T=>({...T,...E}));function A(E){E.preventDefault(),N&&u.trim()&&f.trim()&&o({name:u.trim(),instruction:f.trim(),schedule:N})}return r.jsxs("form",{className:"jv-panel jv-task-editor",onSubmit:A,"aria-label":m(e?"tasks.editTitle":"tasks.newTitle"),children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("tasks.name")}),r.jsx(Xe,{required:!0,maxLength:80,value:u,placeholder:m("tasks.namePlaceholder"),onChange:E=>h(E.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("tasks.instruction")}),r.jsx(Ps,{required:!0,maxLength:8e3,rows:4,value:f,placeholder:m("tasks.instructionPlaceholder"),onChange:E=>v(E.target.value)})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("tasks.when")}),r.jsx("div",{className:"jv-seg jv-task-kinds",role:"radiogroup","aria-label":m("tasks.when"),children:sq.map(E=>r.jsx("button",{type:"button",role:"radio","aria-checked":y===E,onClick:()=>p(E),children:m(`tasks.kind.${E}`)},E))}),r.jsxs("div",{className:"jv-task-when","data-kind":y,children:[y==="once"&&r.jsx(Xe,{type:"datetime-local","aria-label":m("tasks.at"),value:w.at,onChange:E=>C({at:E.target.value})}),y==="every"&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"jv-task-label",children:m("tasks.everyCount")}),r.jsx(Xe,{type:"number",min:w.unit==="hours"?1:n6,step:1,"aria-label":m("tasks.everyCount"),value:w.count,onChange:E=>C({count:E.target.value})}),r.jsxs(Vr,{value:w.unit,onValueChange:E=>C({unit:E}),children:[r.jsx(Yr,{"aria-label":m("tasks.everyCount"),children:r.jsx(Gr,{})}),r.jsx(Kr,{className:"jv-select-menu",children:["minutes","hours"].map(E=>r.jsx(Da,{value:E,children:m(`tasks.unit.${E}`)},E))})]})]}),y==="weekly"&&r.jsxs(Vr,{value:w.weekday,onValueChange:E=>C({weekday:E}),children:[r.jsx(Yr,{"aria-label":m("tasks.weekday"),children:r.jsx(Gr,{})}),r.jsx(Kr,{className:"jv-select-menu",children:[1,2,3,4,5,6,0].map(E=>r.jsx(Da,{value:String(E),children:t6(E)},E))})]}),(y==="daily"||y==="weekly")&&r.jsx(Xe,{type:"time","aria-label":m("tasks.time"),value:w.time,onChange:E=>C({time:E.target.value})})]}),y==="every"&&!N&&r.jsx("small",{className:"jv-hint",children:m("tasks.minimum")})]}),i&&r.jsx("p",{className:"jv-note-error",role:"alert",children:i}),k&&l&&r.jsxs("div",{className:"jv-env-confirm jv-task-confirm",role:"group","aria-label":m("tasks.deleteTitle",{name:u||(e==null?void 0:e.name)||""}),children:[r.jsx("strong",{children:m("tasks.deleteTitle",{name:u||(e==null?void 0:e.name)||""})}),r.jsx("p",{children:m("tasks.deleteBody")}),r.jsxs("div",{className:"jv-env-confirm-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(!1),children:m("common.cancel")}),r.jsx(ke,{type:"button",variant:"ghost",className:"jv-task-delete",size:"sm",disabled:n,onClick:l,children:m("tasks.delete")})]})]}),r.jsxs("div",{className:"jv-form-footer",children:[r.jsx("div",{className:"jv-task-editor-actions",children:l&&r.jsx(ke,{type:"button",variant:"ghost",className:"jv-task-delete",disabled:n,onClick:()=>S(!0),children:m("tasks.delete")})}),r.jsxs("div",{className:"jv-task-editor-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",onClick:c,children:m("common.cancel")}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:n||!N||!u.trim()||!f.trim(),children:m("common.save")})]})]})]})}function dq({bot:e,runs:n}){const[i,o]=j.useState(null),[l,c]=j.useState(null),{busy:u,error:h,setError:f,run:v}=rn(),y=rn(),p=u||y.busy,w=y.error;j.useEffect(()=>{let R=!0;return ae.tasks(e.id).then(_=>{R&&o(_.tasks)}).catch(_=>{R&&f(Vt(_,"tasks.loadFailed"))}),()=>{R=!1}},[e.id,n]);const b=R=>o(_=>(_??[]).some(L=>L.id===R.id)?_.map(L=>L.id===R.id?R:L):[..._??[],R]);function k(R){f(""),y.setError(""),c(R)}async function S(R){await y.run("save",async()=>{b(l==="new"||!l?await ae.createTask(e.id,R):await ae.updateTask(e.id,l.id,R)),c(null)},"tasks.saveFailed")}const N=R=>v("change",R,"tasks.changeFailed"),C=R=>N(async()=>b(await ae.setTaskOn(e.id,R.id,R.state!=="active"))),A=R=>N(async()=>{await ae.deleteTask(e.id,R.id),o(_=>(_==null?void 0:_.filter(L=>L.id!==R.id))??null),c(null)}),E=R=>R.state==="active"?R.schedule.kind==="once"||!R.nextRunAt?"":m("tasks.next",{time:Dg(R.nextRunAt)}):m(R.state==="done"?"tasks.done":"tasks.paused"),T=R=>[nq(R.schedule),E(R)].filter(Boolean).join(" · ");return r.jsxs("section",{className:"jv-section","aria-label":m("tasks.title"),children:[r.jsxs("div",{className:"jv-task-head",children:[r.jsx("h3",{className:"jv-section-title",children:m("tasks.title")}),!l&&r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:p||i===null,onClick:()=>k("new"),children:[r.jsx(Mi,{}),m("tasks.add")]})]}),l?r.jsx(uq,{task:l==="new"?void 0:l,busy:p,error:w,onSave:R=>void S(R),onCancel:()=>c(null),...l==="new"?{}:{onDelete:()=>void A(l)}}):i&&r.jsx("div",{className:"jv-list",children:i.length===0?r.jsx("div",{className:"jv-list-row jv-static-row",children:r.jsx("span",{className:"jv-row-text",children:r.jsx("span",{children:m("tasks.empty")})})}):i.map(R=>r.jsxs("div",{className:"jv-task-row","data-state":R.state,children:[r.jsx("button",{type:"button",className:"jv-list-row jv-task-open","aria-label":R.name,onClick:()=>k(R),children:r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:R.name}),r.jsx("span",{children:T(R)})]})}),R.state!=="done"&&r.jsx("button",{type:"button",role:"switch","aria-checked":R.state==="active","aria-label":m("tasks.toggle",{name:R.name}),disabled:p,className:"jv-env-access jv-task-switch",onClick:()=>void C(R),children:r.jsx("span",{className:"jv-env-switch","aria-hidden":"true"})})]},R.id))}),h&&r.jsx("p",{className:"jv-note-error",role:"alert",children:h})]})}function a6({id:e,open:n,onToggle:i,text:o,meta:l,extra:c,busy:u,error:h,remove:f,confirming:v,onAskRemove:y,onCancel:p,onConfirm:w,children:b}){const k=r.jsxs("button",{type:"button",className:"jv-list-row jv-secret-row","aria-expanded":n,"aria-controls":e,onClick:i,children:[r.jsx("span",{className:"jv-row-text",children:o}),l,c&&r.jsx("span",{className:"jv-secret-room","aria-hidden":"true"}),r.jsx(Di,{className:"jv-row-chevron","aria-hidden":"true"})]});return r.jsxs(r.Fragment,{children:[c?r.jsxs("div",{className:"jv-secret-head",children:[k,r.jsx("span",{className:"jv-secret-extra",children:c})]}):k,n&&r.jsxs("div",{id:e,className:"jv-list-row jv-static-row jv-secret-details",children:[b,v?r.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":v.title,children:[r.jsx("strong",{children:v.title}),r.jsx("p",{children:v.body}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:p,children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:u,onClick:w,children:v.confirm})]})]}):r.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:u,onClick:y,children:f})}),h&&r.jsx("p",{className:"jv-note-error",role:"alert",children:h})]})]})}const Bj={local:"ports.hint.local",idle:"ports.hint.idle",stopped:"ports.hint.stopped"};function hq(e){const n=`${location.protocol}//${location.hostname.includes(":")?`[${location.hostname}]`:location.hostname}:${e.hostPort}`;return[n,...e.urls.filter(i=>i!==n)]}function i6({bot:e,runs:n}){const[i,o]=j.useState(null),[l,c]=j.useState(null),[u,h]=j.useState(!1),[f,v]=j.useState(null),{busy:y,error:p,setError:w,run:b}=rn();j.useEffect(()=>{let C=!0;return ae.ports(e.id).then(A=>{C&&o(A.ports)}).catch(A=>{C&&w(Vt(A,"ports.loadFailed"))}),()=>{C=!1}},[e.id,n]);function k(C){w(""),h(!1),c(A=>A===C?null:C)}const S=C=>b("unpublish",async()=>{await ae.unpublishPort(e.id,C.port),o(A=>(A==null?void 0:A.filter(E=>E.port!==C.port))??null),c(null),h(!1)},"ports.changeFailed"),N=l!==null&&!!(i!=null&&i.some(C=>C.port===l));return r.jsxs("section",{className:"jv-section","aria-label":m("ports.title"),children:[r.jsx("h3",{className:"jv-section-title",children:m("ports.title")}),i&&r.jsx("div",{className:"jv-list",children:i.length===0?r.jsx("div",{className:"jv-list-row jv-static-row",children:r.jsx("span",{className:"jv-row-text",children:r.jsx("span",{children:m("ports.empty")})})}):i.map(C=>{const A=hq(C),E=l===C.port;return r.jsxs(a6,{id:`port-${e.id}-${C.port}`,open:E,onToggle:()=>k(C.port),busy:y,error:E?p:"",text:r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:C.name}),r.jsxs("span",{className:"jv-port-line",children:[m("ports.port",{port:C.hostPort})," · ",r.jsx("span",{className:"jv-port-state","data-state":C.state,children:m(`ports.state.${C.state}`)})]})]}),meta:null,extra:r.jsx(ke,{asChild:!0,variant:"ghost",size:"icon-sm",children:r.jsx("a",{href:A[0],target:"_blank",rel:"noopener noreferrer","aria-label":m("ports.open",{name:C.name}),children:r.jsx(Ll,{})})}),remove:m("ports.stop"),confirming:E&&u?{title:m("ports.stopTitle",{name:C.name}),body:m("ports.stopBody"),confirm:m("ports.stop")}:null,onAskRemove:()=>h(!0),onCancel:()=>h(!1),onConfirm:()=>void S(C),children:[C.description&&r.jsx("p",{className:"jv-port-about",children:C.description}),Bj[C.state]&&r.jsx("p",{className:"jv-port-hint",role:"note",children:m(Bj[C.state])}),r.jsx("div",{className:"jv-port-links",children:A.map((T,R)=>r.jsxs("div",{className:"jv-port-link",children:[r.jsx("span",{children:m(R?"ports.linkOther":"ports.link")}),r.jsx("code",{title:T,children:T}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m(f===T?"ui.copied":"ports.copy"),onClick:()=>void Kl(T).then(_=>v(_?T:null)),children:f===T?r.jsx(na,{}):r.jsx(Os,{})}),r.jsx(ke,{asChild:!0,variant:"ghost",size:"icon-sm",children:r.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer","aria-label":m("ports.open",{name:C.name}),children:r.jsx(Ll,{})})})]},T))}),r.jsx("p",{className:"jv-port-from",children:m("ports.from",{port:C.port})})]},C.port)})}),p&&!N&&r.jsx("p",{className:"jv-note-error",role:"alert",children:p})]})}const r6=[["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"]],fq=[...r6,["log","bot.tab.log"]];function mq({bot:e,status:n,connections:i,chats:o,onSaved:l,onManageModels:c,onManageSecrets:u,onManageConnectors:h,onAddMachine:f,onClose:v,onOpenChat:y,onOpenSubscription:p}){const[w,b]=j.useState("overview"),[k,S]=j.useState(()=>new Set(["overview"])),N=j.useRef(null);j.useEffect(()=>{var _;(_=N.current)==null||_.scrollIntoView({block:"nearest",inline:"nearest"})},[w]);const C=_=>{b(_),S(L=>L.has(_)?L:new Set(L).add(_))},A=e.agent?fq:r6,E=_=>{const L=A.findIndex(([H])=>H===w),I={ArrowRight:L+1,ArrowLeft:L-1,Home:0,End:A.length-1}[_.key];I!==void 0&&(_.preventDefault(),C(A[(I+A.length)%A.length][0]),requestAnimationFrame(()=>{var H;return(H=N.current)==null?void 0:H.focus()}))},T=`${(n==null?void 0:n.status)??"stop"}:${(n==null?void 0:n.runId)??""}`,R=(_,L,I=!1)=>k.has(_)&&r.jsx("div",{id:`jv-bot-panel-${_}`,role:"tabpanel","aria-labelledby":`jv-bot-tab-${_}`,hidden:w!==_,className:I?"jv-bot-fill":"jv-bot-scroll",children:L},_);return r.jsx(KS,{open:!0,onOpenChange:_=>{_||v()},children:r.jsxs(XS,{className:"jv-bot-info jv-ui","aria-describedby":void 0,children:[r.jsx(qP,{bot:e,status:n,onSaved:l}),r.jsx("div",{className:"jv-bot-tabs",role:"tablist","aria-label":m("entry.botInfo"),onKeyDown:E,children:A.map(([_,L])=>r.jsx("button",{id:`jv-bot-tab-${_}`,ref:w===_?N:void 0,type:"button",role:"tab","aria-selected":w===_,"aria-controls":`jv-bot-panel-${_}`,tabIndex:w===_?0:-1,onClick:()=>C(_),children:m(L)},_))}),R("overview",r.jsx(UP,{bot:e,status:n,connections:i,chats:o,onSaved:l,onManageModels:c,onOpenSubscription:p})),R("profile",r.jsx($P,{bot:e,onSaved:l})),R("environment",r.jsxs(r.Fragment,{children:[r.jsx(JS,{bot:e,onSaved:l}),r.jsx(i6,{bot:e,runs:T})]})),R("access",r.jsx(tq,{bot:e,onSaved:l,onManageSecrets:u,onManageConnectors:h,onAddMachine:f})),R("tasks",r.jsx(dq,{bot:e,runs:T})),R("activity",r.jsx(pP,{botId:e.id,onOpenChat:y}),!0),R("usage",r.jsx(bP,{botId:e.id}),!0),e.agent&&R("log",r.jsx(oq,{bot:e,runs:T}))]})})}function o6({id:e,value:n,sections:i,onChange:o}){const[l,c]=j.useState(null);return r.jsxs(Vr,{value:n??"none",onValueChange:u=>o(u==="none"?null:u),children:[r.jsx(Yr,{id:e,ref:u=>c((u==null?void 0:u.closest("dialog"))??null),className:"jv-select jv-section-select",children:r.jsx(Gr,{})}),r.jsxs(Kr,{className:"jv-select-menu",position:"popper",sideOffset:4,container:l,children:[r.jsx(Da,{value:"none",children:m("info.noSection")}),i.map(u=>r.jsx(Da,{value:u.id,children:u.name},u.id))]})]})}const pq=1024*1024,vq=e=>e==="text"||e==="markdown"||e==="html"||e==="svg",gq=["txt","json","jsonl","yaml","yml","ts","tsx","js","jsx","mjs","cjs","css","log","csv","py","sh","sql","toml","xml","ini","env","diff","patch"],Ai=e=>`/api/attachments/${e.id}`,yq=e=>zg(e)==="gif"||e.mimeType==="image/gif"?Ai(e):`${Ai(e)}/thumb`,zg=e=>e.name.includes(".")?e.name.split(".").pop().toLowerCase():"";function ju(e){const n=zg(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/")||gq.includes(n)?"text":"download"}const Wc=e=>e==="image"||e==="svg",s6=e=>e==="video"||e==="audio",l6={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 c6(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 u6(e,n){const i=await fetch(Ai(e),{signal:n,credentials:"same-origin"});if(!i.ok)throw new Error(i.status===404?m("files.gone"):m("files.readFailed",{status:i.status}));return i.text()}async function d6(e,n){return ju(e)==="svg"?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await u6(e,n))}`:Ai(e)}const Ij=e=>`/api/attachments/${e.id}/run`;function xq(e){const n=new DOMParser().parseFromString(e,"text/html");let i=n.querySelectorAll("script").length;const o=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 u=new URL(c.value);(u.protocol==="http:"||u.protocol==="https:")&&o.add(u.host)}catch{}}),i?{count:i,hosts:[...o]}:null}function bq(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 o of[...i.attributes])(o.name.startsWith("on")||["href","xlink:href","srcset","action","formaction","target","autofocus","contenteditable"].includes(o.name)||o.name==="src"&&!o.value.startsWith("data:image/"))&&i.removeAttribute(o.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 Pj=new Map;function jq({file:e,onSize:n}){const i=ju(e)==="svg",[o,l]=j.useState(()=>i?void 0:yq(e)),[c,u]=j.useState(!1);j.useEffect(()=>{if(!i)return;const f=new AbortController;return u(!1),d6(e,f.signal).then(l).catch(()=>{f.signal.aborted||u(!0)}),()=>f.abort()},[e.id]);const h=()=>{!i&&o!==Ai(e)?l(Ai(e)):u(!0)};return c?r.jsx("span",{className:"ui-broken-image",children:r.jsx(Fe,{name:"image"})}):o?r.jsx("img",{src:o,alt:e.name,loading:"lazy",onError:h,onLoad:f=>{const{naturalWidth:v,naturalHeight:y}=f.currentTarget;v&&y&&n({width:v,height:y})}}):r.jsx(Fe,{name:"image"})}function wq({file:e,onOpen:n}){const[i,o]=j.useState(()=>Pj.get(e.id)),l=ju(e),c=Wc(l),u=s6(l),h=zg(e).toUpperCase(),f=c&&i?{"--image-w":`${i.width}px`,"--image-ratio":`${i.width/i.height}`}:void 0;return r.jsxs("div",{className:`ui-message-file ${c?"ui-message-image":""}`,"data-sized":f?"":void 0,style:f,children:[r.jsxs("button",{type:"button",className:"ui-message-open",onClick:n,"aria-label":m("files.preview",{name:e.name}),children:[c?r.jsx("span",{className:"ui-image-frame",children:r.jsx(jq,{file:e,onSize:v=>{Pj.set(e.id,v),o(v)}})}):r.jsx("span",{className:"ui-file-icon","data-kind":u?l:void 0,children:r.jsx(Fe,{name:u?`file-${l}`:"file"})}),r.jsxs("span",{className:"ui-file-copy",children:[r.jsx("strong",{title:e.name,children:e.name}),r.jsxs("small",{children:[u?`${m(l6[l])} · `:"",h?`${h} · `:"",c6(e.size)]})]})]}),r.jsx("a",{className:"ui-iconbtn",href:Ai(e),download:e.name,"aria-label":m("files.download",{name:e.name}),title:m("files.download",{name:e.name}),children:r.jsx(Fe,{name:"cloud-download"})})]})}function h6({files:e,onOpen:n}){const i=e.some(o=>Wc(ju(o)));return r.jsx("div",{className:`ui-message-files ${i?"ui-has-images":""}`,children:e.map((o,l)=>r.jsx(wq,{file:o,onOpen:()=>n(l)},o.id))})}function Lg({icon:e,title:n,titleClass:i,purpose:o,label:l,busy:c,error:u,ready:h,decline:f,confirm:v,onDecline:y,onConfirm:p,once:w,children:b}){const k=j.Children.toArray(b).length>0||!!u,S=N=>{N.preventDefault(),h&&p()};return r.jsxs("form",{className:"jv-question jv-secret-request",autoComplete:"off","aria-label":l,"aria-busy":c||void 0,onSubmit:S,children:[r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:e}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{className:i?`jv-question-title ${i}`:"jv-question-title",children:n}),r.jsx("p",{className:"jv-question-detail",children:o})]})]}),k&&r.jsxs("div",{className:"jv-question-body",children:[b,u&&r.jsx("p",{className:"jv-question-error",role:"alert",children:u})]}),r.jsxs("div",{className:"jv-question-foot",children:[r.jsx("button",{type:"button",className:"ui-button",disabled:c,onClick:y,children:f}),w&&r.jsx("button",{type:"button",className:"ui-button",disabled:c||!h,onClick:w.onClick,children:w.label}),r.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:c||!h,children:v})]})]})}function Bg({icon:e,title:n,state:i,text:o,purpose:l}){return r.jsx("div",{className:"jv-question jv-question-settled","data-state":i,children:r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:e}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{className:"jv-question-title",children:n}),r.jsx("p",{className:"jv-question-detail",children:l})]}),r.jsxs("span",{className:"jv-question-outcome",children:[i==="answered"?r.jsx(na,{"aria-hidden":"true"}):r.jsx(Lv,{"aria-hidden":"true"}),o]})]})})}function f6({label:e,value:n,visible:i,disabled:o,autoFocus:l,placeholder:c,hint:u,short:h,onChange:f,onVisible:v}){return r.jsxs("label",{className:"ui-field jv-secret-request-value",children:[r.jsx("span",{children:e}),r.jsxs("span",{className:"jv-secret-request-field",children:[r.jsx("input",{type:i?"text":"password",autoComplete:"new-password",spellCheck:!1,autoFocus:l,placeholder:c,value:n,disabled:o,onChange:y=>f(y.target.value)}),r.jsx("button",{type:"button","aria-label":m(i?"secrets.hideValue":"secrets.showValue"),onClick:()=>v(!i),children:i?r.jsx(Rv,{}):r.jsx(Ov,{})})]}),r.jsx("small",{"data-short":h||void 0,children:u})]})}function kq({message:e,onSettled:n}){var C;const i=e.question,o=i.secret,[l,c]=j.useState(""),[u,h]=j.useState(!1),[f,v]=j.useState(!1),{busy:y,error:p,run:w}=rn();if(i.state!=="pending"){const A=i.state!=="answered"?m(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):m(((C=i.answer)==null?void 0:C.selected[0])===1?"request.outcome.once":"request.outcome.allowed");return r.jsx(Bg,{icon:r.jsx(jh,{"aria-hidden":"true"}),title:o.name,state:i.state,text:A,purpose:o.purpose})}const b=o.needsValue||f,k=l.length>0&&l.length<8,S=A=>{y||w("answer",async()=>n(await A()),"question.failed")},N=A=>S(()=>ae.fulfilSecret(e.chatId,e.id,{scope:A,...b?{value:l}:{}}));return r.jsxs(Lg,{icon:r.jsx(jh,{"aria-hidden":"true"}),title:o.name,titleClass:"jv-secret-request-name",purpose:o.purpose,label:m("secretCard.title",{name:o.name}),busy:y,error:p,ready:!b||!!l,decline:m("secretCard.decline"),confirm:m("secretCard.always"),onDecline:()=>S(()=>ae.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>N("always"),once:{label:m("secretCard.once"),onClick:()=>N("once")},children:[!window.isSecureContext&&r.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[r.jsx(Hh,{"aria-hidden":"true"}),m("secretCard.insecure")]}),o.exists&&!o.needsValue&&r.jsxs("p",{className:"jv-secret-request-note",children:[m("secretCard.exists"),r.jsx("button",{type:"button",className:"jv-secret-request-link",onClick:()=>{v(!f),c("")},children:m(f?"secretCard.keepValue":"secretCard.replace")})]}),o.exists&&o.needsValue&&r.jsx("p",{className:"jv-secret-request-note",children:m("secretCard.unreadable")}),b&&r.jsx(f6,{label:m("secretCard.value"),value:l,visible:u,disabled:y,autoFocus:!0,placeholder:m("secretCard.valuePlaceholder"),hint:m(k?"secrets.shortValue":"secretCard.valueHint"),short:k,onChange:c,onVisible:h})]})}function Sq({message:e,onSettled:n}){const i=e.question,o=i.machine,[l,c]=j.useState(""),[u,h]=j.useState(!1),{busy:f,error:v,setError:y,run:p}=rn(),[w,b]=j.useState("password"),k=e6(i.state==="pending"&&!o.existing&&w==="key"),S=`${o.user}@${o.host}${o.port===22?"":`:${o.port}`}`;if(i.state!=="pending"){const E=i.state!=="answered"?m(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):m(o.existing?"request.outcome.allowed":"request.outcome.added");return r.jsx(Bg,{icon:r.jsx(Bl,{"aria-hidden":"true"}),title:o.name,state:i.state,text:E,purpose:o.purpose})}const N=E=>{f||p("answer",async()=>{try{n(await E())}catch(T){throw T instanceof lr&&T.code==="ssh_key_expired"&&k.renew(),T}},"question.failed")},C=!o.existing,A=!C||(w==="key"?!!k.key:!!l);return r.jsxs(Lg,{icon:r.jsx(Bl,{"aria-hidden":"true"}),title:o.name,purpose:o.purpose,label:m("machineCard.title",{name:o.name}),busy:f,error:v,ready:A,decline:m("machineCard.decline"),confirm:m(C?w==="key"?f?"machines.verifying":"machines.verify":f?"machines.connecting":"machineCard.add":"machineCard.allow"),onDecline:()=>N(()=>ae.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>N(()=>ae.fulfilMachine(e.chatId,e.id,w==="key"&&k.key?{keyId:k.key.keyId}:{password:l})),children:[r.jsxs("p",{className:"jv-machine-where",children:[r.jsx("code",{children:S}),o.directory&&r.jsx("code",{children:o.directory})]}),o.existing?r.jsx("p",{className:"jv-secret-request-note",children:m("machineCard.existing")}):r.jsxs(r.Fragment,{children:[!window.isSecureContext&&r.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[r.jsx(Hh,{"aria-hidden":"true"}),m("secretCard.insecure")]}),r.jsxs("div",{className:"jv-machine-card-field",children:[r.jsx("span",{children:m("machines.fingerprint")}),r.jsx("div",{className:"jv-machine-prints",children:o.hostKeys.fingerprints.map(E=>r.jsx("code",{children:E},E))}),r.jsx("small",{children:m("machines.fingerprintHint")})]}),r.jsx("div",{className:"jv-secret-request-seg",role:"radiogroup","aria-label":m("machines.login"),children:["password","key"].map(E=>r.jsx("button",{type:"button",role:"radio","aria-checked":w===E,disabled:f,onClick:()=>{b(E),y("")},children:m(E==="password"?"machines.byPassword":"machines.byKey")},E))}),w==="password"?r.jsx(f6,{label:m("machines.password"),value:l,visible:u,disabled:f,hint:m("machines.passwordHint"),onChange:c,onVisible:h}):r.jsxs("div",{className:"jv-machine-card-field",children:[r.jsx("span",{children:m("machines.publicKey")}),k.key?r.jsx(lu,{publicKey:k.key.publicKey}):k.error?r.jsx("p",{className:"jv-question-error",role:"alert",children:k.error}):r.jsx("small",{children:"…"}),r.jsx("small",{children:m("machines.keyHint",{user:o.user})})]})]})]})}function Cq({message:e,onSettled:n}){var y;const i=e.question,o=i.enter,l=o.kind==="sandbox"?m("envs.sandboxOf",{name:o.name}):o.name,{busy:c,error:u,run:h}=rn();if(i.state!=="pending"){const p=i.state!=="answered"?m(i.state==="dismissed"?"request.outcome.declined":"request.outcome.ignored"):m(((y=i.answer)==null?void 0:y.selected[0])===1?"request.outcome.once":"request.outcome.allowed");return r.jsx(Bg,{icon:o.kind==="sandbox"?r.jsx(L0,{"aria-hidden":"true"}):r.jsx(Bl,{"aria-hidden":"true"}),title:l,state:i.state,text:p,purpose:o.purpose})}const f=p=>{c||h("answer",async()=>n(await p()),"question.failed")},v=p=>f(()=>ae.answerQuestion(e.chatId,e.id,{action:"answer",selected:[p]}));return r.jsx(Lg,{icon:o.kind==="sandbox"?r.jsx(L0,{"aria-hidden":"true"}):r.jsx(Bl,{"aria-hidden":"true"}),title:l,purpose:o.purpose,label:m("enterCard.title",{name:l}),busy:c,error:u,ready:!0,decline:m("secretCard.decline"),confirm:m("secretCard.always"),onDecline:()=>f(()=>ae.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>v(0),once:{label:m("secretCard.once"),onClick:()=>v(1)},children:o.address&&r.jsx("p",{className:"jv-machine-where",children:r.jsx("code",{children:o.address})})})}function Nq({message:e,onSettled:n}){var y;const i=e.question,o=i.connectorAuth,{busy:l,error:c,run:u}=rn(),h=o.account&&!o.name.includes(o.account)?`${o.name} (${o.account})`:o.name,f=p=>void u(`fulfil:${p}`,async()=>{n(await ae.fulfilConnectorAuth(e.chatId,e.id,p))}),v=()=>void u("decline",async()=>{n(await ae.answerQuestion(e.chatId,e.id,{action:"dismiss"}))});if(i.state!=="pending"){const p=i.state==="answered",w=p?m(((y=i.answer)==null?void 0:y.selected[0])===1?"request.outcome.once":"request.outcome.allowed"):i.state==="dismissed"?m("request.outcome.declined"):i.expiredReason==="connector_disconnected"?m("connectorCard.disconnected"):i.expiredReason==="connector_revoked"?m("connectorCard.revoked"):m("request.outcome.ignored");return r.jsx("div",{className:"jv-question jv-question-settled","data-state":i.state,children:r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:r.jsx(qs,{provider:o.provider})}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{className:"jv-question-title",children:h}),r.jsx("p",{className:"jv-question-detail",children:o.purpose})]}),r.jsxs("span",{className:"jv-question-outcome",children:[p?r.jsx(na,{"aria-hidden":"true"}):r.jsx(Lv,{"aria-hidden":"true"}),r.jsx("span",{children:w})]})]})})}return r.jsxs("div",{className:"jv-question",role:"group","aria-busy":l||void 0,children:[r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:r.jsx(qs,{provider:o.provider})}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{className:"jv-question-title",children:m("connectorCard.grantTitle",{name:h})}),r.jsx("p",{className:"jv-question-detail",children:o.purpose})]})]}),c&&r.jsx("div",{className:"jv-question-body",children:r.jsx("p",{className:"jv-question-error",role:"alert",children:c})}),r.jsxs("div",{className:"jv-question-foot",children:[r.jsx("button",{type:"button",className:"ui-button",disabled:l,onClick:v,children:m("secretCard.decline")}),r.jsx("button",{type:"button",className:"ui-button",disabled:l,onClick:()=>f("once"),children:m("secretCard.once")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:l,onClick:()=>f("always"),children:m("secretCard.always")})]})]})}const Eq={create_issue:"connectorAction.create_issue",update_issue:"connectorAction.update_issue",create_comment:"connectorAction.create_comment",send_email:"connectorAction.send_email",create_draft:"connectorAction.create_draft"},Tq={title:"connectorField.title",name:"connectorField.name",subject:"connectorField.subject",team:"connectorField.team",project:"connectorField.project",description:"connectorField.description",body:"connectorField.body",content:"connectorField.content",message:"connectorField.message",text:"connectorField.text",comment:"connectorField.comment",from:"connectorField.from",to:"connectorField.to",cc:"connectorField.cc",bcc:"connectorField.bcc",priority:"connectorField.priority",status:"connectorField.status",state:"connectorField.status",assignee:"connectorField.assignee",labels:"connectorField.labels",parent:"connectorField.parent",url:"connectorField.url",owner:"connectorField.owner",repo:"connectorField.repo",repository:"connectorField.repo",number:"connectorField.number",issue_number:"connectorField.number"},v0=new Set(["subject","title","name"]),g0=new Set(["body","description","content","message","text","comment"]),Aq=92,qj=200,Mq=560,Es=e=>e.editable!==!1;function _q(e){let n=(e==null?void 0:e.parentElement)??null;for(;n;){const i=getComputedStyle(n).overflowY;if((i==="auto"||i==="scroll")&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}function Rq(e,n){var l;const i={};if(n)try{const c=JSON.parse(n);if(c&&typeof c=="object"&&!Array.isArray(c))for(const[u,h]of Object.entries(c))typeof h=="string"&&(i[u]=h)}catch{}const o=e.fields.map(c=>({...c,value:Es(c)&&i[c.key]!==void 0?i[c.key]:c.value}));return(l=i.cc)!=null&&l.trim()&&!o.some(c=>c.key==="cc")&&o.push({key:"cc",label:"Cc",value:i.cc.trim(),editable:!0}),o}function Oq({message:e,onSettled:n}){var he,oe,D,F,ie,$;const i=e.question,o=i.connectorWrite,l=o.toolName.toLowerCase(),c=l==="send_email"||l==="create_draft"||o.provider==="gmail",u=Eq[l],h=u?m(u):o.actionLabel,f=c?m("connectorCard.emailKind"):o.name,[v,y]=j.useState(()=>Object.fromEntries(o.fields.filter(Es).map(X=>[X.key,X.value]))),[p,w]=j.useState(!1),[b,k]=j.useState(!1),[S,N]=j.useState({}),[C,A]=j.useState(!1),[E,T]=j.useState(!1),R=j.useRef(null),{busy:_,error:L,run:I}=rn(),H=o.fields.find(X=>v0.has(X.key.toLowerCase())),O=o.fields.find(X=>g0.has(X.key.toLowerCase())),P=o.fields.filter(X=>X!==H&&X!==O),U=!!(O&&Es(O)),Y=O?U?v[O.key]??"":O.value:"",K=new Map;for(const X of o.fields){const ee=X.key.toLowerCase();K.set(ee,(K.get(ee)??0)+1)}j.useLayoutEffect(()=>{const X=R.current;if(!X||i.state!=="pending"||!U)return;const ee=_q(X),me=(ee==null?void 0:ee.scrollTop)??0,te=ee?ee.scrollHeight-ee.scrollTop-ee.clientHeight<48:!1;X.style.height="0px";const ce=X.scrollHeight;A(ce>qj+8);const J=p?Mq:qj;X.style.height=`${Math.max(Aq,Math.min(ce,J))}px`,ee&&(ee.scrollTop=te?ee.scrollHeight-ee.clientHeight:me)},[Y,U,p,i.state]);const q=(X,ee)=>{const me=X.toLowerCase();if((K.get(me)??0)>1)return ee;const te=Tq[me];return te?m(te):ee};if(i.state!=="pending"){const X=Rq(o,(he=i.answer)==null?void 0:he.custom),ee=(oe=i.answer)==null?void 0:oe.selected[0],te=i.state==="answered"&&ee===0?m(c?"connectorCard.sent":"connectorCard.confirmed"):i.state==="ignored"?m(i.expiredReason==="connector_disconnected"?"connectorCard.disconnected":i.expiredReason==="connector_revoked"?"connectorCard.revoked":"connectorCard.expired"):m("connectorCard.discarded"),ce=X.find(Le=>["to","repo","repository","team"].includes(Le.key.toLowerCase())),J=X.find(Le=>v0.has(Le.key.toLowerCase()))??X[0],je=(F=(D=(ce==null?void 0:ce.preview)??(ce==null?void 0:ce.value))==null?void 0:D.split(`
817
+ `)[0])==null?void 0:F.slice(0,60),Re=($=(ie=(J==null?void 0:J.preview)??(J==null?void 0:J.value))==null?void 0:ie.split(`
818
+ `)[0])==null?void 0:$.slice(0,60),De=!c&&o.account&&!f.includes(o.account)?o.account:null,Pe=[te,De,je,Re&&Re!==je?Re:null].filter(Boolean);return r.jsxs("div",{className:"jv-write-settled","data-state":i.state,children:[r.jsxs("button",{type:"button",className:"jv-write-pill","aria-expanded":E,"aria-label":m("connectorCard.toggleDetails"),onClick:()=>T(Le=>!Le),children:[r.jsx("span",{className:"jv-write-pill-icon",children:c?r.jsx(ab,{"aria-hidden":"true"}):r.jsx(qs,{provider:o.provider})}),r.jsx("span",{className:"jv-write-pill-kind",children:f}),r.jsx("span",{className:"jv-write-pill-summary",children:Pe.join(" · ")}),r.jsx(u9,{className:"jv-write-pill-chevron","aria-hidden":"true"})]}),E&&(()=>{const Le=X.find(ft=>v0.has(ft.key.toLowerCase())),He=X.filter(ft=>g0.has(ft.key.toLowerCase())),at=X.filter(ft=>ft!==Le&&!g0.has(ft.key.toLowerCase())),Lt=!!o.account||at.length>0,Gt=!!Le||He.length>0;return r.jsxs("div",{className:"jv-write-settled-body",children:[Lt&&r.jsx("div",{className:"jv-write-settled-meta",children:r.jsxs("div",{className:"jv-write-meta",children:[o.account&&r.jsxs("div",{className:"jv-write-meta-row",children:[r.jsx("span",{className:"jv-write-meta-label",children:m(c?"connectorCard.from":"connectorCard.account")}),r.jsx("span",{className:"jv-write-meta-static",children:o.account})]}),at.map(ft=>r.jsxs("div",{className:"jv-write-meta-row",children:[r.jsx("span",{className:"jv-write-meta-label",title:q(ft.key,ft.label),children:q(ft.key,ft.label)}),r.jsx("span",{className:"jv-write-meta-static",children:ft.value})]},ft.key))]})}),Gt&&r.jsxs("div",{className:"jv-write-settled-content",children:[Le&&r.jsx("h4",{className:"jv-write-settled-title",children:Le.value}),He.map(ft=>r.jsx("div",{className:"jv-write-body-static",children:r.jsx(Bo,{text:ft.value})},ft.key))]})]})})()]})}const Q=()=>{var ee;const X={};for(const me of o.fields){if(!Es(me))continue;const te=v[me.key];te!==void 0&&te!==me.value&&(X[me.key]=te)}return c&&((ee=v.cc)!=null&&ee.trim())&&!o.fields.some(me=>me.key==="cc")&&(X.cc=v.cc.trim()),Object.keys(X).length?JSON.stringify(X):void 0},V=()=>{const X=Q();I("confirm",async()=>{n(await ae.answerQuestion(e.chatId,e.id,{action:"answer",selected:[0],...X?{custom:X}:{}}))})},Z=()=>void I("discard",async()=>{n(await ae.answerQuestion(e.chatId,e.id,{action:"answer",selected:[1]}))}),ue=c&&l==="send_email"?m("connectorCard.send"):h,z=c?null:o.account&&!f.includes(o.account)?`${h} · ${o.account}`:h;return r.jsxs("div",{className:"jv-question jv-write-card",role:"group","aria-busy":_||void 0,children:[r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:c?r.jsx(ab,{"aria-hidden":"true"}):r.jsx(qs,{provider:o.provider})}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{className:"jv-question-title",children:f}),z&&r.jsx("p",{className:"jv-question-detail",children:z})]})]}),r.jsxs("div",{className:"jv-question-body",children:[H&&(Es(H)?r.jsx("input",{className:"jv-write-subject",value:v[H.key]??"",placeholder:m("connectorCard.subjectPlaceholder"),onChange:X=>y(ee=>({...ee,[H.key]:X.target.value}))}):r.jsx("p",{className:"jv-write-subject-static",children:H.value})),(c||P.length>0)&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-write-meta",children:[c&&o.account&&r.jsxs("div",{className:"jv-write-meta-row",children:[r.jsx("span",{className:"jv-write-meta-label",children:m("connectorCard.from")}),r.jsx("span",{className:"jv-write-meta-static",children:o.account})]}),(b?P:P.slice(0,6)).map(X=>{const ee=!Es(X)&&(X.value.length>160||X.value.includes(`
819
+ `)),me=!!S[X.key];return r.jsxs("div",{className:"jv-write-meta-row","data-multiline":ee||void 0,children:[r.jsx("span",{className:"jv-write-meta-label",title:q(X.key,X.label),children:q(X.key,X.label)}),Es(X)?r.jsx("input",{className:"jv-write-meta-input",value:v[X.key]??"",onChange:te=>y(ce=>({...ce,[X.key]:te.target.value}))}):ee?r.jsxs("div",{className:"jv-write-readonly-wrap",children:[r.jsx("pre",{className:"jv-write-readonly-block","data-expanded":me||void 0,children:X.value}),r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:()=>N(te=>({...te,[X.key]:!me})),children:m(me?"connectorCard.showLess":"connectorCard.showMore")})]}):r.jsx("span",{className:"jv-write-meta-static",title:X.value,children:X.value})]},X.key)}),c&&!o.fields.some(X=>X.key==="cc")&&r.jsxs("div",{className:"jv-write-meta-row",children:[r.jsx("span",{className:"jv-write-meta-label",children:m("connectorCard.cc")}),r.jsx("input",{className:"jv-write-meta-input",value:v.cc??"",placeholder:m("connectorCard.ccPlaceholder"),onChange:X=>y(ee=>({...ee,cc:X.target.value}))})]})]}),P.length>6&&r.jsx("div",{className:"jv-write-body-toggle",children:r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:()=>k(X=>!X),children:b?m("connectorCard.showFewerFields"):m("connectorCard.showAllFields",{count:P.length})})})]}),O&&(U?r.jsxs("div",{className:"jv-write-body-wrap",children:[r.jsx("textarea",{ref:R,className:"jv-write-body-input",value:Y,placeholder:m("connectorCard.bodyPlaceholder"),onChange:X=>y(ee=>({...ee,[O.key]:X.target.value}))}),(C||p)&&r.jsx("div",{className:"jv-write-body-toggle",children:r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:()=>w(X=>!X),children:m(p?"connectorCard.showLess":"connectorCard.showMore")})})]}):r.jsxs("div",{className:"jv-write-body-wrap",children:[r.jsx("div",{className:"jv-write-body-static jv-write-readonly-body","data-expanded":p||void 0,children:r.jsx(Bo,{text:O.value})}),(O.value.length>360||O.value.split(`
820
+ `).length>8)&&r.jsx("div",{className:"jv-write-body-toggle",children:r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:()=>w(X=>!X),children:m(p?"connectorCard.showLess":"connectorCard.showMore")})})]})),L&&r.jsx("p",{className:"jv-question-error",role:"alert",children:L})]}),r.jsxs("div",{className:"jv-question-foot",children:[r.jsx("button",{type:"button",className:"ui-button",disabled:_,onClick:Z,children:m("connectorCard.discard")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:_,onClick:V,children:ue})]})]})}const Fj=e=>String.fromCharCode(65+e),Hj=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable;function m6(e){const{message:n}=e,{secret:i,machine:o,enter:l,connectorAuth:c,connectorWrite:u}=n.question;return i?r.jsx(kq,{message:{...n,question:{...n.question,secret:i}},onSettled:e.onSettled}):o?r.jsx(Sq,{message:{...n,question:{...n.question,machine:o}},onSettled:e.onSettled}):l?r.jsx(Cq,{message:{...n,question:{...n.question,enter:l}},onSettled:e.onSettled}):c?r.jsx(Nq,{message:{...n,question:{...n.question,connectorAuth:c}},onSettled:e.onSettled}):u?r.jsx(Oq,{message:{...n,question:{...n.question,connectorWrite:u}},onSettled:e.onSettled}):r.jsx(Dq,{...e})}function Dq({message:e,keyboard:n,onSettled:i}){var C,A;const o=e.question,l=o.state==="pending",c=j.useId(),[u,h]=j.useState([]),[f,v]=j.useState(""),{busy:y,error:p,run:w}=rn();async function b(E){y||!l||await w("settle",async()=>i(await ae.answerQuestion(e.chatId,e.id,E)),"question.failed")}const k=E=>{if(!o.multiple){b({action:"answer",selected:[E]});return}h(T=>T.includes(E)?T.filter(R=>R!==E):[...T,E])},S=()=>void b({action:"answer",selected:u,...f.trim()?{custom:f.trim()}:{}}),N=()=>{f.trim()&&(o.multiple?S():b({action:"answer",selected:[],custom:f.trim()}))};if(j.useEffect(()=>{if(!n||!l)return;const E=T=>{if(T.defaultPrevented||T.metaKey||T.ctrlKey||T.altKey||T.key.length!==1||Hj(T.target)||Hj(document.activeElement)||document.querySelector("dialog[open], [role=dialog]"))return;const R=T.key.toUpperCase().charCodeAt(0)-65;R<0||R>=o.options.length||(T.preventDefault(),k(R))};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)}),!l){const E=o.state==="answered"?[...(((C=o.answer)==null?void 0:C.selected)??[]).map(T=>{var R;return((R=o.options[T])==null?void 0:R.label)??""}),...(A=o.answer)!=null&&A.custom?[o.answer.custom]:[]].filter(Boolean).join(m("common.listSeparator")):null;return r.jsxs("p",{className:"jv-question-done","data-state":o.state,title:`${o.question}
821
+ ${E===null?m("question.dismissed"):m("question.chose",{answer:E})}`,children:[E===null?r.jsx(Lv,{"aria-hidden":"true"}):r.jsx(na,{"aria-hidden":"true"}),r.jsx("span",{className:"jv-question-answer",children:E===null?m("question.dismissed"):Tv("question.chose",{answer:r.jsx("strong",{children:E})})}),r.jsx("span",{className:"jv-question-asked",children:o.question})]})}return r.jsxs("div",{className:"jv-question",role:"group","aria-labelledby":c,"aria-busy":y||void 0,children:[r.jsxs("div",{className:"jv-question-head",children:[r.jsx("span",{className:"jv-question-icon",children:r.jsx(Y4,{"aria-hidden":"true"})}),r.jsxs("div",{className:"jv-question-heading",children:[r.jsx("p",{id:c,className:"jv-question-title",children:o.question}),o.detail&&r.jsx("p",{className:"jv-question-detail",children:o.detail})]}),r.jsx("button",{type:"button",className:"jv-question-dismiss","aria-label":m("question.dismissLabel"),title:m("question.dismiss"),disabled:y,onClick:()=>void b({action:"dismiss"}),children:r.jsx(Fl,{"aria-hidden":"true"})})]}),r.jsxs("div",{className:"jv-question-body",children:[r.jsx("div",{className:"jv-question-options",role:o.multiple?"group":void 0,"aria-label":o.multiple?m("question.multiple"):void 0,children:o.options.map((E,T)=>{const R=u.includes(T);return r.jsxs("button",{type:"button",className:"jv-question-option","data-style":E.style,"data-on":R||void 0,"aria-pressed":o.multiple?R:void 0,"aria-keyshortcuts":n?Fj(T).toLowerCase():void 0,disabled:y,onClick:()=>k(T),children:[r.jsx("span",{className:"jv-question-key","aria-hidden":"true",children:R?r.jsx(na,{}):Fj(T)}),r.jsxs("span",{className:"jv-question-copy",children:[r.jsx("strong",{children:E.label}),E.description&&r.jsx("small",{children:E.description})]})]},E.label)})}),p&&r.jsx("p",{className:"jv-question-error",role:"alert",children:p})]}),(o.allowCustom||o.multiple)&&r.jsxs("div",{className:"jv-question-foot",children:[o.allowCustom&&r.jsx("input",{className:"jv-question-custom",value:f,maxLength:2e3,placeholder:m(o.multiple?"question.note":"question.own"),"aria-label":m("question.ownLabel"),disabled:y,onChange:E=>v(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.nativeEvent.isComposing&&(E.preventDefault(),N())}}),o.multiple?r.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!u.length&&!f.trim(),onClick:S,children:u.length?m("question.confirmCount",{count:u.length}):m("question.confirm")}):r.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!f.trim(),onClick:N,children:m("question.send")})]})]})}function hr({place:e,as:n="strong",title:i,sub:o,leading:l,actions:c,className:u="",titleProps:h}){const f=n==="button"?r.jsx("button",{type:"button",className:"ui-column-title",...h,children:i}):r.jsx(n,{className:"ui-column-title",children:i});return r.jsxs("header",{className:`ui-column-header ${u}`,"data-place":e,children:[l,i!==void 0&&f,o&&r.jsx("span",{className:"ui-column-sub",children:o}),r.jsx("span",{className:"ui-spacer"}),c||null]})}function zi(e){return e?e.deleted?m("member.deleted",{name:e.name}):e.name:m("member.unknown")}const zq={reasoning:"activity.reasoning",texting:"activity.texting",tool_calling:"activity.toolCalling",asking:"activity.asking"},p6=e=>m(zq[e??""]??"activity.running");function v6(e,n){return e!=null&&e.connectionId?n!=null&&n.error?{label:m("activity.error"),tone:"error"}:(n==null?void 0:n.status)==="running"?{label:p6(n.activity),tone:"busy"}:{label:m((n==null?void 0:n.status)==="idle"?"activity.idle":"activity.stopped")}:{label:m("activity.noModel")}}const Lq=e=>e.environment.current!=="computer"?m("botCard.onMachine",{name:e.environment.currentName??""}):m("botCard.sandbox"),Oi=e=>e.filter(n=>!n.deleted);function Bq(e){const n=new Set(e.map(o=>o.toLowerCase()));let i=m("bot.newName");for(let o=2;n.has(i.toLowerCase());o++)i=m("bot.newNameN",{n:o});return i}const y0=/[\p{Script=Latin}\p{Nd}_]/u;function Ig(e,n){const i=e.replace(/```[\s\S]*?```|`[^`\n]*`/g,u=>" ".repeat(u.length)),o=i.toLowerCase(),l=[...n].sort((u,h)=>h.name.length-u.name.length),c=[];for(let u=o.indexOf("@");u>=0;u=o.indexOf("@",u+1)){if(u>0&&y0.test(i[u-1]))continue;const h=l.find(f=>{const v=f.name.toLowerCase();if(!v||!o.startsWith(v,u+1))return!1;const y=i[u+1+v.length];return!(y&&y0.test(y)&&y0.test(v.at(-1)))});h&&(c.push({member:h,at:u,length:h.name.length+1}),u+=h.name.length)}return c}function Iq(e,n,i){let o="",l=0;for(const c of Ig(e,n))o+=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 o+e.slice(l)}function Pq(e){return e.type==="dm"?m("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[o,l]=j.useState(!1),c=j.useRef(""),u=j.useRef(void 0),h=j.useRef(!1);j.useEffect(()=>()=>window.clearTimeout(u.current),[]);const f=zi(n.find(b=>b.id===e.senderId)),v=Us(e),y=(b,k)=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(b),k)},p=b=>k=>{k.pointerType==="mouse"&&y(b,b?350:150)},w=()=>{window.clearTimeout(u.current),h.current=!0,l(!1),i==null||i()};return r.jsxs(Jh,{open:o,onOpenChange:l,children:[r.jsxs(ef,{className:"jv-ref-tag",title:"","aria-label":m("ref.label",{name:f,text:v}),onPointerDown:b=>{c.current=b.pointerType},onPointerEnter:p(!0),onPointerLeave:p(!1),onClick:b=>{const k=c.current==="touch"||c.current==="pen";c.current="",!k&&i&&(b.preventDefault(),w())},children:[r.jsx(Fe,{name:"chat-bubble"}),r.jsx("span",{className:"jv-quote-name",children:m("quote.by",{name:f})}),r.jsx("span",{className:"jv-quote-text",children:v})]}),r.jsx(tf,{children:r.jsxs(nf,{className:"jv-ref-card jv-ui",side:"top",align:"start",sideOffset:6,collisionPadding:12,onOpenAutoFocus:b=>b.preventDefault(),onPointerEnter:p(!0),onPointerLeave:p(!1),onCloseAutoFocus:b=>{h.current&&b.preventDefault(),h.current=!1},children:[r.jsxs("div",{className:"jv-ref-place",children:[r.jsx("span",{children:Pq(e.chat)}),r.jsxs("span",{children:[qh(e.createdAt)," ",Oo(e.createdAt)]})]}),r.jsx("div",{className:"jv-ref-name",children:f}),r.jsx("p",{className:"jv-ref-text",children:v}),i&&r.jsx("button",{type:"button",className:"jv-ref-open",onClick:w,children:m("ref.open")})]})})]})}const g6=/\[\[q(\d+)\]\]/g,xv=(e,n=40)=>{const i=e.replace(/\s+/g," ").trim();return i.length>n?`${i.slice(0,n)}…`:i};function Pg(e){return e.content.replace(g6,(n,i)=>{const o=e.quotes[Number(i)-1];return o?m("quote.inline",{text:o.text}):n})}function Us(e){return Pg(e).replace(/[*`~#>]/g,"").replace(/\s+/g," ").trim()||m("common.attachment")}function y6({message:e,members:n,me:i,onJump:o}){const l=Iq(e.content,n.filter(h=>e.mentions.includes(h.id)),i).replace(g6,(h,f)=>e.quotes[Number(f)-1]?`[q${f}](#quote-${f})`:h),c=h=>{const f=e.quotes[h-1];if(!f)return null;const v=zi(n.find(y=>y.id===f.senderId));return r.jsxs("button",{type:"button",className:"jv-quote-tag",title:m("sidebar.said",{name:v,text:f.text}),"data-gone":f.messageId?void 0:"",onClick:()=>o==null?void 0:o(f.messageId,f.text),children:[r.jsx(Fe,{name:"quote"}),r.jsx("span",{className:"jv-quote-name",children:m("quote.by",{name:v})}),r.jsx("span",{className:"jv-quote-text",children:xv(f.text,80)})]})},u=h=>{const f=e.refs.find(v=>v.id===h);return f?r.jsx(qq,{target:f,members:n,onJump:o&&(()=>o(h))}):null};return r.jsx(Bo,{text:l,renderQuote:c,renderRef:u})}function x6(e,n){var p;const i=n.replace(/\s+/g,"");if(!i||typeof CSS>"u"||!("highlights"in CSS))return!1;const o=e.querySelector(".ui-bubble")??e,l=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),c=[];for(let w=l.nextNode();w;w=l.nextNode())if(!((p=w.parentElement)!=null&&p.closest(".jv-quote-tag, button")))for(let b=0;b<w.data.length;b++)/\s/.test(w.data[b])||c.push({node:w,offset:b});const u=c.map(w=>w.node.data[w.offset]).join(""),h=u.indexOf(i);if(h<0)return!1;const f=c[h],v=c[h+i.length-1],y=new Range;return y.setStart(f.node,f.offset),y.setEnd(v.node,v.offset+1),CSS.highlights.set("jv-passage",new Highlight(y)),setTimeout(()=>CSS.highlights.delete("jv-passage"),2400),!0}function zh(e,n){var i;(i=e.querySelector(".jv-long-toggle[aria-expanded='false']"))==null||i.click(),e.scrollIntoView({block:"center",behavior:"smooth"}),!(n&&x6(e,n))&&(e.classList.add("jv-jump"),setTimeout(()=>e.classList.remove("jv-jump"),1200))}function Fq({quotes:e,onRemove:n}){return e.length?r.jsx("div",{className:"jv-compose-quotes",children:e.map((i,o)=>r.jsxs("span",{className:"jv-quote-tag",title:m("sidebar.said",{name:i.name,text:i.text}),children:[r.jsx(Fe,{name:"quote"}),r.jsx("span",{className:"jv-quote-name",children:m("quote.by",{name:i.name})}),r.jsx("span",{className:"jv-quote-text",children:xv(i.text)}),r.jsx("button",{type:"button","aria-label":m("quote.remove",{text:xv(i.text,20)}),onClick:()=>n(o),children:"×"})]},o))}):null}function qg({container:e,drafts:n,chatId:i,source:o,members:l,onNotice:c}){const u=(y,p)=>{const w=o(y);w&&!Hq(n,i,w,l,p)&&c(m("quote.tooMany",{count:10}))},[h,f]=j.useState(null);if(j.useEffect(()=>{const y=e.current;if(!y||!matchMedia("(hover: hover) and (pointer: fine)").matches)return;const p=C=>{var A;return(A=C instanceof Element?C:C==null?void 0:C.parentElement)==null?void 0:A.closest(".ui-bubble")},w=()=>{var _,L;const C=getSelection(),A=(C==null?void 0:C.toString())??"";if(!C||C.isCollapsed||!A.trim()){f(null);return}const E=p(C.anchorNode),T=E==null?void 0:E.closest("[data-message]");if(!E||!T||!y.contains(E)||p(C.focusNode)!==E||(L=(_=C.anchorNode)==null?void 0:_.parentElement)!=null&&L.closest(".jv-quote-tag, button")){f(null);return}const R=C.getRangeAt(0).getBoundingClientRect();f({x:Math.min(Math.max(R.left+R.width/2,90),innerWidth-90),y:Math.max(R.top-8,48),messageId:T.getAttribute("data-message"),text:A.trim()})},b=()=>requestAnimationFrame(w),k=()=>f(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]),!h)return null;const v=()=>{var y;f(null),(y=getSelection())==null||y.removeAllRanges()};return r.jsxs("div",{className:"ui-popover jv-selection-menu",role:"menu","aria-label":m("quote.selection"),style:{left:h.x,top:h.y},onMouseDown:y=>y.preventDefault(),children:[r.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{Kl(h.text),v()},children:[r.jsx(Fe,{name:"copy"}),r.jsx("span",{className:"ui-menu-copy",children:m("quote.copy")})]}),r.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{u(h.messageId,h.text),v()},children:[r.jsx(Fe,{name:"quote"}),r.jsx("span",{className:"ui-menu-copy",children:m("quote.quote")})]})]})}function Hq(e,n,i,o,l){if(e.get(n).passages.length>=10)return!1;const c={messageId:i.id,name:zi(o.find(u=>u.id===i.senderId)),text:l};return e.update(n,u=>({passages:[...u.passages,c]})),!0}const Uq="modulepreload",$q=function(e){return"/"+e},Uj={},Vq=function(n,i,o){let l=Promise.resolve();if(i&&i.length>0){let u=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),f=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));l=u(i.map(v=>{if(v=$q(v),v in Uj)return;Uj[v]=!0;const y=v.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${p}`))return;const w=document.createElement("link");if(w.rel=y?"stylesheet":Uq,y||(w.as="script"),w.crossOrigin="",w.href=v,f&&w.setAttribute("nonce",f),document.head.appendChild(w),y)return new Promise((b,k)=>{w.addEventListener("load",b),w.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return l.then(u=>{for(const h of u||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};let $j;function Gq(){return $j??($j=Vq(()=>import("./data-uMIXh-O1.js"),[]).then(e=>e.default.groups)),$j}const Yq=["👍","👎","👌","✅","❌","👀","🙏","🤔"],b6=9,j6="jarvy-emoji-recent",Kq={"Smileys & Emotion":y9,"People & Body":E9,"Animals & Nature":l9,"Food & Drink":aE,"Travel & Places":U9,Activities:J9,Objects:_9,Symbols:A9,Flags:k9};function Xq(){try{const e=JSON.parse(localStorage.getItem(j6)??"[]");return Array.isArray(e)?e.filter(n=>typeof n=="string").slice(0,b6):[]}catch{return[]}}function Qq(e,n){const[,i,o,l,c]=e,u=n.toLowerCase(),h=i.toLowerCase().split(/[\s:]+/),f=o.toLowerCase().split(" "),v=c.split(" "),y=h.includes(u)||l.split(/:\s*/).includes(n)?5:f.includes(u)||v.includes(n)?4:h.some(p=>p.startsWith(u))||l.startsWith(n)?3:f.some(p=>p.startsWith(u))||v.some(p=>p.startsWith(n))?2:u.length>3&&f.some(p=>p.includes(u))||l.includes(n)||c.includes(n)?1:0;return y&&y*1e3-Math.min(f.length+v.length,999)}function Zq({onPick:e}){const[n,i]=j.useState(""),[o,l]=j.useState(Xq),[c,u]=j.useState(0),[h,f]=j.useState([]);j.useEffect(()=>{let A=!0;return Gq().then(E=>{A&&f(E)}),()=>{A=!1}},[]);const v=j.useRef(null),y=j.useRef(null),p=j.useRef([]),w=j.useMemo(()=>{if(!h.length)return[];const A=new Map(h.flatMap(T=>T.emoji.map(R=>[R[0],R]))),E=h.map(({name:T,emoji:R})=>({key:T,label:m(`actions.emoji.${T}`),Icon:Kq[T],emoji:R}));return o.length?[{key:"recent",label:m("actions.recent"),Icon:d9,emoji:o.map(T=>A.get(T)??[T,"","","",""])},...E]:E},[h,o]),b=j.useMemo(()=>{const A=n.trim();return!A||!h.length?null:h.flatMap(E=>E.emoji).map(E=>[E,Qq(E,A)]).filter(([,E])=>E>0).sort((E,T)=>T[1]-E[1]).map(([E])=>E)},[n,h]),k=A=>{const E=[A,...o.filter(T=>T!==A)].slice(0,b6);l(E);try{localStorage.setItem(j6,JSON.stringify(E))}catch{}e(A)};j.useEffect(()=>{const A=y.current;if(!A||b)return;const E=()=>{const T=A.getBoundingClientRect().top;let R=0;p.current.forEach((_,L)=>{_&&_.getBoundingClientRect().top-T<40&&(R=L)}),u(R)};return A.addEventListener("scroll",E,{passive:!0}),()=>A.removeEventListener("scroll",E)},[b]);const S=A=>{const E=p.current[A];!E||!y.current||(y.current.scrollTop+=E.getBoundingClientRect().top-y.current.getBoundingClientRect().top,u(A))},N=A=>r.jsx("button",{type:"button",className:"jv-emoji-cell",title:sr()==="zh"?A[3]:A[1],onClick:()=>k(A[0]),children:A[0]},A[0]),C=A=>{var L;const E=[...((L=v.current)==null?void 0:L.querySelectorAll(".jv-emoji-grid button"))??[]],T=E.indexOf(document.activeElement),R={ArrowRight:1,ArrowLeft:-1,ArrowDown:9,ArrowUp:-9,Home:0,End:0}[A.key];if(T<0||R===void 0)return;const _=E[A.key==="Home"?T-T%9:A.key==="End"?T-T%9+8:Math.max(0,Math.min(E.length-1,T+R))];_&&(A.preventDefault(),_.focus())};return r.jsxs("div",{className:"jv-emoji-panel",ref:v,onKeyDown:C,children:[r.jsx("div",{className:"jv-emoji-quick",children:Yq.map(A=>r.jsx("button",{type:"button",onClick:()=>k(A),children:A},A))}),r.jsxs("label",{className:"jv-emoji-search",children:[r.jsx(Io,{"aria-hidden":"true"}),r.jsx("input",{value:n,onChange:A=>i(A.target.value),placeholder:m("actions.searchEmoji"),"aria-label":m("actions.searchEmoji"),autoFocus:matchMedia("(hover: hover)").matches,onKeyDown:A=>{A.key==="Escape"&&n&&(A.stopPropagation(),i("")),A.key==="Enter"&&!A.nativeEvent.isComposing&&(b!=null&&b[0])&&(A.preventDefault(),k(b[0][0]))}})]}),r.jsx("div",{className:"jv-emoji-groups",role:"tablist","data-hidden":!w.length||void 0,children:w.map(({key:A,label:E,Icon:T},R)=>r.jsx("button",{type:"button",role:"tab","aria-selected":!b&&R===c,title:E,onKeyDown:_=>{var I,H;if(_.key!=="ArrowLeft"&&_.key!=="ArrowRight")return;_.preventDefault();const L=(R+(_.key==="ArrowRight"?1:-1)+w.length)%w.length;S(L),(H=(I=v.current)==null?void 0:I.querySelectorAll(".jv-emoji-groups button")[L])==null||H.focus()},onClick:()=>{b?(i(""),requestAnimationFrame(()=>S(R))):S(R)},children:r.jsx(T,{"aria-hidden":"true"})},A))}),r.jsx("div",{className:"jv-emoji-scroll",ref:y,role:b?void 0:"tabpanel",children:b?b.length?r.jsx("div",{className:"jv-emoji-grid",children:b.map(N)}):r.jsx("p",{className:"jv-emoji-empty",children:m("actions.noEmoji")}):w.map(({key:A,label:E,emoji:T},R)=>r.jsxs("section",{className:"jv-emoji-section",ref:_=>{p.current[R]=_},children:[r.jsx("h2",{children:E}),r.jsx("div",{className:"jv-emoji-grid",children:T.map(N)})]},A))})]})}const Al=380,eh=310;function w6({message:e,members:n,onJump:i}){if(!e.replyTo)return null;const o=n.find(l=>l.id===e.replyTo.senderId);return r.jsxs("button",{type:"button",className:"jv-reply-quote",onClick:()=>i(e.replyTo.id),children:[r.jsx("span",{className:"jv-reply-author",children:zi(o)}),r.jsx("span",{className:"jv-reply-text",children:Us(e.replyTo)})]})}const Vj=3;function k6({message:e,me:n,members:i,onReact:o,onError:l}){return e.reactions.length?r.jsx("div",{className:"jv-reactions",children:e.reactions.map(c=>{const u=c.memberIds.includes(n),h=m("common.listSeparator"),f=c.memberIds.map(y=>zi(i.find(p=>p.id===y))),v=f.length-Vj;return r.jsxs("button",{type:"button",className:"jv-reaction","data-mine":u||void 0,title:f.join(h),onClick:()=>{try{o(e,c.emoji,!u)}catch(y){l(y)}},children:[r.jsx("span",{className:"jv-reaction-emoji",children:c.emoji}),r.jsx("span",{className:"jv-reaction-names",children:f.slice(0,Vj).join(h)}),v>0&&r.jsx("span",{className:"jv-reaction-more",children:m("reactions.more",{count:v})})]},c.emoji)})}):null}function S6({message:e,me:n,onReply:i,onReact:o,onError:l}){const[c,u]=j.useState(!1),[h,f]=j.useState(!1),[v,y]=j.useState(!1),p=j.useRef(null),[w,b]=j.useState(null);j.useEffect(()=>{if(!c)return;const N=C=>{var A;(A=p.current)!=null&&A.contains(C.target)||u(!1)};return document.addEventListener("pointerdown",N),()=>document.removeEventListener("pointerdown",N)},[c]);const k=N=>{var A;const C=!((A=e.reactions.find(E=>E.emoji===N))!=null&&A.memberIds.includes(n));try{o(e,N,C)}catch(E){l(E)}u(!1)},S=()=>{var A,E,T,R;const N=(A=p.current)==null?void 0:A.getBoundingClientRect(),C=(T=(E=p.current)==null?void 0:E.closest(".ui-transcript, .ui-pane-body"))==null?void 0:T.getBoundingClientRect();if(N){const _=((C==null?void 0:C.right)??window.innerWidth)-N.left,L=N.right-((C==null?void 0:C.left)??0),I=!!((R=p.current)!=null&&R.closest(".ui-user")),H=((C==null?void 0:C.bottom)??window.innerHeight)-N.bottom,O=N.top-((C==null?void 0:C.top)??0),P=I?_>=eh||_>L:L<eh&&_>L;f(H<Al),y(P),b(H<Al&&O<Al&&!matchMedia("(max-width: 640px)").matches?{top:N.top>Al+8?N.top-Al-4:Math.min(N.bottom+4,window.innerHeight-Al-8),left:Math.max(8,Math.min(P?N.left:N.right-eh,window.innerWidth-eh-8))}:null)}u(!c)};return r.jsxs("div",{className:"jv-message-actions",ref:p,children:[i&&r.jsx(kt,{icon:"arrow-u-up-right",label:m("actions.reply"),onClick:()=>i(e)}),r.jsx(kt,{icon:"smiley-plus",label:m("actions.react"),"aria-expanded":c,onClick:S}),c&&r.jsx("div",{className:"jv-emoji-menu",role:"dialog","aria-label":m("actions.pickEmoji"),"data-up":h||void 0,"data-right":v||void 0,style:w?{position:"fixed",top:w.top,left:w.left,right:"auto",bottom:"auto"}:void 0,onKeyDown:N=>{N.key==="Escape"&&u(!1)},children:r.jsx(Zq,{onPick:k})})]})}const Wq=12;function C6({children:e,whole:n=!1}){const i=j.useRef(null),[o,l]=j.useState(null),[c,u]=j.useState(n);j.useLayoutEffect(()=>{const f=i.current;if(!f)return;const v=()=>{const p=parseFloat(getComputedStyle(f).lineHeight)||24,w=Math.round(Wq*p);l(f.scrollHeight>w+2*p?w:null)};v();const y=new ResizeObserver(v);return y.observe(f),()=>y.disconnect()},[]);const h=o!==null&&!c;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:i,className:"jv-long","data-cut":h||void 0,style:h?{maxHeight:o}:void 0,children:e}),o!==null&&r.jsx("button",{type:"button",className:"jv-long-toggle","aria-expanded":c,onClick:()=>u(!c),children:m(c?"fold.less":"fold.more")})]})}function N6(){const[e,n]=j.useState(new Set);return{has:i=>e.has(i),add:i=>n(o=>new Set(o).add(i))}}function E6({message:e}){return r.jsxs("div",{className:"jv-folded",children:[r.jsx("span",{className:"jv-folded-text",children:Us(e)}),r.jsxs("span",{className:"jv-folded-tag",children:[r.jsx(Fe,{name:"fold"}),m("fold.folded")]})]})}const T6="jarvy-notice-closed",Jq=()=>{try{return JSON.parse(localStorage.getItem(T6)??"[]")}catch{return[]}};function vr({member:e,bots:n,size:i,working:o=!1,onBot:l}){const c=(e==null?void 0:e.kind)==="bot"?n.find(h=>h.id===e.id):void 0,u=c?r.jsx(Ii,{color:c.color,mood:c.mood,size:i,badge:o?"working":void 0,crown:c.agent}):null;return c&&l?r.jsx("button",{type:"button",className:"jv-avatar-button","aria-label":m("botCard.open",{name:c.name}),"aria-haspopup":"dialog",onClick:h=>l(c,h.currentTarget.getBoundingClientRect()),children:u}):u||r.jsx("span",{className:"ui-user-avatar jv-user-avatar",style:{width:i,height:i,fontSize:Math.round(i*.38)},children:r.jsx("span",{children:((e==null?void 0:e.name)??"?").slice(0,2).toUpperCase()})})}function eF({chat:e,members:n,bots:i,infoOpen:o,membersOpen:l,threadsOpen:c,searchOpen:u,onNav:h,onInfo:f,onMembers:v,onThreads:y,onSearch:p}){const w=n.filter(b=>e.memberIds.includes(b.id));return r.jsx(hr,{place:"content",as:"button",className:"jv-channel-header",leading:r.jsx(kt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:m("common.openNav"),onClick:h}),title:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"jv-hash",children:"#"}),e.title,r.jsx(Fe,{name:"chevron-down"})]}),titleProps:{"aria-label":m("channel.infoFor",{name:e.title}),"aria-pressed":o,onClick:f},sub:e.topic,actions:r.jsxs("div",{className:"ui-column-actions",children:[r.jsxs("button",{type:"button",className:"jv-members-button","aria-label":m("channel.membersCount",{count:w.length}),"aria-pressed":l,title:m("channel.members"),onClick:v,children:[r.jsx("span",{className:"jv-stack",children:w.slice(0,3).map(b=>r.jsx("span",{className:"jv-stack-item",children:r.jsx(vr,{member:b,bots:i,size:22})},b.id))}),r.jsx("span",{className:"jv-members-count",children:w.length})]}),r.jsx(kt,{icon:"search",label:m("channel.search"),"aria-pressed":u,className:"jv-threads-button",onClick:p}),r.jsx(kt,{icon:"chat-bubble",label:m("channel.threads"),"aria-pressed":c,className:"jv-threads-button",onClick:y})]})})}function tF({chat:e,onSave:n}){var b;const[i,o]=j.useState(Jq),[l,c]=j.useState(null),[u,h]=j.useState(!1);j.useEffect(()=>c(null),[e.id]);const f=!i.includes(e.id),v=e.note,y=()=>o(k=>{const S=f?[...k,e.id]:k.filter(N=>N!==e.id);return localStorage.setItem(T6,JSON.stringify(S)),S}),p=async()=>{if(l!=null&&l.trim()){h(!0);try{await n(l.trim()),c(null)}finally{h(!1)}}};if(l!==null)return r.jsxs("div",{className:"jv-notice","data-editing":!0,children:[r.jsxs("div",{className:"jv-notice-head",children:[r.jsx(Fe,{name:"megaphone"}),r.jsx("strong",{children:m("notice.edit")})]}),r.jsx("textarea",{className:"jv-notice-input",value:l,autoFocus:!0,"aria-label":m("notice.content"),onChange:k=>c(k.target.value)}),r.jsxs("div",{className:"jv-notice-actions",children:[r.jsx("button",{type:"button",className:"ui-button",onClick:()=>c(null),children:m("common.cancel")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:u||!l.trim(),onClick:()=>void p(),children:m("common.save")})]})]});if(!v)return r.jsxs("div",{className:"jv-notice","data-empty":!0,children:[r.jsx(Fe,{name:"megaphone"}),r.jsx("span",{className:"jv-muted",children:m("notice.none")}),r.jsx(kt,{icon:"pencil",label:m("notice.edit"),onClick:()=>c("")})]});const w=((b=v.text.split(`
822
+ `).find(k=>k.trim()&&!k.startsWith("#")))==null?void 0:b.replace(/[*`|>-]/g,"").trim())??"";return r.jsxs("div",{className:"jv-notice","data-open":f||void 0,children:[r.jsxs("div",{className:"jv-notice-head",children:[r.jsxs("button",{type:"button",className:"jv-notice-toggle","aria-expanded":f,onClick:y,children:[r.jsx(Fe,{name:"megaphone"}),r.jsx("strong",{children:m("notice.title")}),!f&&r.jsx("span",{className:"jv-notice-first",children:w}),r.jsx(Fe,{name:f?"chevron-down":"chevron-right"})]}),r.jsxs("span",{className:"jv-muted jv-notice-meta",children:[v.updatedBy.name," · ",ta(v.updatedAt,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})," · ",m("notice.version",{version:v.version})]}),r.jsx(kt,{icon:"pencil",label:m("notice.edit"),onClick:()=>c(v.text)})]}),f&&r.jsx("div",{className:"jv-notice-body ui-bubble jv-flat",children:r.jsx(Bo,{text:v.text})})]})}function Lh({messages:e,members:n,bots:i,me:o,divider:l,before:c,activeQuestion:u,onSettled:h,onPreview:f,onReply:v,onOpenThread:y,onQuote:p,onReact:w,onFold:b,onJump:k,onBotCard:S,onError:N}){var E;const C=(E=e.find(T=>T.sequence>l&&T.senderId!==o))==null?void 0:E.id,A=N6();return r.jsx(r.Fragment,{children:e.map((T,R)=>{const _=e[R-1],L=n.find(P=>P.id===T.senderId),I=(_==null?void 0:_.createdAt)??c,H=!w5(T,_,I)&&T.id!==C,O=T.folded;return r.jsxs("div",{children:[fg(T.createdAt,I)&&r.jsx(k5,{time:T.createdAt}),T.id===C&&r.jsx("div",{className:"jv-divider",role:"separator",children:r.jsx("span",{children:m("chat.newBelow")})}),r.jsxs("div",{className:"jv-row",tabIndex:-1,"data-message":T.id,"data-folded":H||void 0,"data-mention":T.mentions.includes(o)||void 0,"data-shut":O||void 0,children:[r.jsx("div",{className:"jv-row-gutter",children:H?r.jsx(av,{time:T.createdAt,className:"jv-row-time"}):r.jsx(vr,{member:L,bots:i,size:32,onBot:S})}),r.jsxs("div",{className:"jv-row-body",children:[!H&&r.jsxs("div",{className:"jv-row-head",children:[r.jsx("strong",{children:zi(L)}),(L==null?void 0:L.kind)==="bot"&&r.jsx("span",{className:"jv-role",children:"Bot"}),r.jsx(av,{time:T.createdAt})]}),O?r.jsx(E6,{message:T}):r.jsxs(r.Fragment,{children:[T.echoOf&&r.jsx("button",{type:"button",className:"jv-echo",onClick:()=>y==null?void 0:y(T.echoOf.id),children:m("channel.echo",{title:T.echoOf.title})}),T.replyTo&&r.jsx(w6,{message:T,members:n,onJump:P=>k==null?void 0:k(P)}),T.question?r.jsx(m6,{message:{...T,question:T.question},keyboard:T.id===u,onSettled:h}):r.jsxs("div",{className:"ui-bubble jv-flat",children:[T.content&&r.jsx(C6,{whole:A.has(T.id),children:r.jsx(y6,{message:T,members:n,me:o,onJump:k})}),T.attachments.length>0&&r.jsx(h6,{files:T.attachments,onOpen:P=>f(T.attachments,P)})]}),w&&r.jsx(k6,{message:T,me:o,members:n,onReact:w,onError:N??(()=>{})})]}),T.thread&&T.thread.replies>0&&r.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:[m("channel.replies",{count:T.thread.replies}),T.thread.status==="done"&&` · ${m("channel.threadDone")}`,T.thread.lastReplyAt&&r.jsx("span",{className:"jv-muted",children:m("channel.lastReply",{time:mg(T.thread.lastReplyAt)})})]})]}),r.jsxs("div",{className:"jv-row-actions",children:[v&&!T.echoOf&&r.jsx(kt,{icon:"chat-bubble",label:m("channel.replyInThread"),onClick:()=>v(T)}),w&&r.jsx(S6,{message:T,me:o,onReply:p,onReact:w,onError:N??(()=>{})}),b&&r.jsx(kt,{icon:T.folded?"unfold":"fold",label:m(T.folded?"actions.unfold":"actions.fold"),onClick:()=>{T.folded&&A.add(T.id),b(T,!T.folded)}})]})]})]},T.id)})})}function A6({candidates:e,bots:n,busy:i,onCancel:o,onConfirm:l}){const[c,u]=j.useState(""),[h,f]=j.useState([]),v=e.filter(p=>p.name.toLowerCase().includes(c.trim().toLowerCase())),y=p=>f(w=>w.includes(p)?w.filter(b=>b!==p):[...w,p]);return r.jsxs("div",{className:"jv-picker",children:[r.jsx("div",{className:"ui-field",children:r.jsx("input",{type:"search",value:c,autoFocus:!0,placeholder:m("common.searchMembers"),"aria-label":m("common.searchMembers"),onChange:p=>u(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.nativeEvent.isComposing&&(p.preventDefault(),v.length===1&&y(v[0].id))}})}),r.jsxs("div",{className:"jv-picker-list",role:"listbox","aria-multiselectable":"true","aria-label":m("dialogs.candidates"),children:[v.map(p=>r.jsxs("button",{type:"button",role:"option","aria-selected":h.includes(p.id),className:"jv-member-option",onClick:()=>y(p.id),children:[r.jsx(vr,{member:p,bots:n,size:24}),r.jsx("span",{className:"jv-member-name",children:p.name}),r.jsx("span",{className:"jv-muted",children:p.kind==="bot"?"Bot":m("common.member")}),r.jsx("span",{className:"jv-check",children:h.includes(p.id)&&r.jsx(Fe,{name:"check"})})]},p.id)),v.length===0&&r.jsx("p",{className:"jv-picker-empty",children:m(e.length?"common.noMatch":"dialogs.allInside")})]}),r.jsxs("div",{className:"ui-dialog-actions",children:[r.jsx("span",{className:"ui-spacer"}),r.jsx("button",{type:"button",className:"ui-button",onClick:o,children:m("common.cancel")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:i||h.length===0,onClick:()=>l(h),children:h.length?m("dialogs.addCount",{count:h.length}):m("common.add")})]})]})}function nF({chat:e,members:n,bots:i,onClose:o,onChanged:l}){const{busy:c,error:u,run:h}=rn();async function f(v){await h("add",async()=>{let y=e;for(const p of v)y=await ae.addMember(e.id,p);l(y),o()},"dialogs.addFailed")}return r.jsxs(ql,{title:m("info.addMembers"),onClose:o,className:"jv-channel-dialog",children:[r.jsx(A6,{candidates:n.filter(v=>!e.memberIds.includes(v.id)),bots:i,busy:c,onCancel:o,onConfirm:v=>void f(v)}),u&&r.jsx("p",{className:"jv-form-error",role:"alert",children:u})]})}function aF({sections:e,members:n,bots:i,me:o,onClose:l,onSaved:c}){const u=j.useId(),[h,f]=j.useState(""),[v,y]=j.useState(""),[p,w]=j.useState(null),[b,k]=j.useState([o]),[S,N]=j.useState(!1),{busy:C,error:A,run:E}=rn();async function T(_){_.preventDefault(),!(!h.trim()||C)&&await E("save",async()=>c(await ae.createChannel({name:h.trim(),topic:v.trim(),sectionId:p,memberIds:b.filter(L=>L!==o)})),"common.saveFailed")}const R=n.filter(_=>b.includes(_.id));return S?r.jsx(ql,{title:m("info.addMembers"),onClose:l,className:"jv-channel-dialog",children:r.jsx(A6,{candidates:n.filter(_=>!b.includes(_.id)),bots:i,busy:!1,onCancel:()=>N(!1),onConfirm:_=>{k(L=>[...L,..._]),N(!1)}})}):r.jsx(ql,{title:m("sidebar.newChannel"),onClose:l,className:"jv-channel-dialog",children:r.jsxs("form",{onSubmit:_=>void T(_),children:[r.jsxs("div",{className:"ui-field",children:[r.jsx("label",{htmlFor:`${u}-name`,children:m("info.name")}),r.jsx("input",{id:`${u}-name`,value:h,maxLength:80,autoFocus:!0,placeholder:m("info.newChannel"),onChange:_=>f(_.target.value)})]}),r.jsxs("div",{className:"ui-field",children:[r.jsx("label",{htmlFor:`${u}-topic`,children:m("info.topic")}),r.jsx("input",{id:`${u}-topic`,value:v,maxLength:200,placeholder:m("dialogs.optional"),onChange:_=>y(_.target.value)})]}),r.jsxs("div",{className:"ui-field",children:[r.jsx("label",{htmlFor:`${u}-section`,children:m("info.section")}),r.jsx(o6,{id:`${u}-section`,value:p,sections:e,onChange:w})]}),r.jsxs("div",{className:"jv-members",children:[r.jsxs("div",{className:"jv-members-head",children:[r.jsxs("span",{children:[m("channel.members")," · ",R.length]}),r.jsxs("button",{type:"button",className:"ui-button",onClick:()=>N(!0),children:[r.jsx(Fe,{name:"person-add"}),m("info.addMembers")]})]}),R.map(_=>r.jsxs("div",{className:"jv-member-option",children:[r.jsx(vr,{member:_,bots:i,size:24}),r.jsx("span",{className:"jv-member-name",children:_.name}),r.jsx("span",{className:"jv-muted",children:_.id===o?m("common.you"):_.kind==="bot"?"Bot":m("common.member")}),_.id!==o&&r.jsx(kt,{icon:"close",label:m("members.remove",{name:_.name}),className:"jv-member-remove",onClick:()=>k(L=>L.filter(I=>I!==_.id))})]},_.id))]}),A&&r.jsx("p",{className:"jv-form-error",role:"alert",children:A}),r.jsxs("div",{className:"ui-dialog-actions",children:[r.jsx("span",{className:"ui-spacer"}),r.jsx("button",{type:"button",className:"ui-button",onClick:l,children:m("common.cancel")}),r.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:C||!h.trim(),children:m("common.create")})]})]})})}function iF({section:e,onClose:n,onSaved:i,onDeleted:o}){const l=j.useId(),[c,u]=j.useState((e==null?void 0:e.name)??""),[h,f]=j.useState(!1),[v,y]=j.useState("");async function p(b){if(b.preventDefault(),!(!c.trim()||h)){f(!0),y("");try{i(e?await ae.updateSection(e.id,{name:c.trim()}):await ae.createSection({name:c.trim()}))}catch(k){y(Vt(k,"common.saveFailed")),f(!1)}}}async function w(){if(!(!e||!confirm(m("dialogs.deleteSection",{name:e.name})))){f(!0);try{await ae.deleteSection(e.id),o==null||o(e.id)}catch(b){y(Vt(b,"dialogs.deleteFailed")),f(!1)}}}return r.jsx(ql,{title:m(e?"dialogs.editSection":"sidebar.newSection"),onClose:n,children:r.jsxs("form",{onSubmit:b=>void p(b),children:[r.jsxs("div",{className:"ui-field",children:[r.jsx("label",{htmlFor:`${l}-name`,children:m("dialogs.sectionName")}),r.jsx("input",{id:`${l}-name`,value:c,maxLength:80,autoFocus:!0,placeholder:m("dialogs.newSection"),onChange:b=>u(b.target.value)})]}),v&&r.jsx("p",{className:"jv-form-error",role:"alert",children:v}),r.jsxs("div",{className:"ui-dialog-actions",children:[e&&r.jsx("button",{type:"button",className:"ui-button jv-danger",disabled:h,onClick:()=>void w(),children:m("common.delete")}),r.jsx("span",{className:"ui-spacer"}),r.jsx("button",{type:"button",className:"ui-button",onClick:n,children:m("common.cancel")}),r.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:h||!c.trim(),children:m(e?"common.save":"common.create")})]})]})})}function rF({bot:e,chats:n,onClose:i,onConfirm:o}){const[l,c]=j.useState(!1),[u,h]=j.useState(!1);return r.jsx(ql,{title:m("deleteBot.title",{name:e.name}),onClose:i,className:"jv-dialog",children:r.jsxs("div",{className:"jv-dialog-body",children:[r.jsx("p",{children:m("deleteBot.after")}),r.jsxs("ul",{className:"jv-dialog-list",children:[r.jsx("li",{children:m("deleteBot.chats",{count:n})}),r.jsx("li",{children:m("deleteBot.messages",{name:m("member.deleted",{name:e.name})})}),r.jsx("li",{children:m("deleteBot.history")})]}),r.jsxs("label",{className:"jv-checkline",children:[r.jsx("input",{type:"checkbox",checked:l,onChange:f=>c(f.target.checked)}),r.jsx("span",{children:m("deleteBot.files")})]}),r.jsx("p",{className:"jv-hint",children:m("deleteBot.filesHint")}),r.jsxs("div",{className:"jv-dialog-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",onClick:i,children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",disabled:u,onClick:()=>{h(!0),o(l).finally(()=>h(!1))},children:m(u?"deleteBot.deleting":"common.delete")})]})]})})}function M6({title:e,body:n,confirm:i,onClose:o,onConfirm:l}){const[c,u]=j.useState(!1);return r.jsx(ql,{title:e,onClose:o,className:"jv-dialog",children:r.jsxs("div",{className:"jv-dialog-body",children:[r.jsx("p",{children:n}),r.jsxs("div",{className:"jv-dialog-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",onClick:o,children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",disabled:c,onClick:()=>{u(!0),l().finally(()=>u(!1))},children:c?m("deleteBot.working"):i})]})]})})}function oF({target:e,x:n,y:i,onClose:o,onOpenBot:l,onSettings:c,onPin:u,onMute:h,onDeleteChat:f,onDeleteBot:v}){const y=j.useRef(null);j.useEffect(()=>{const b=S=>{var N;(N=y.current)!=null&&N.contains(S.target)||o()},k=S=>{S.key==="Escape"&&o()};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",k)}},[o]);const p=e.chat,w={left:Math.max(8,Math.min(n,window.innerWidth-200)),top:Math.max(8,Math.min(i,window.innerHeight-210))};return r.jsxs("div",{ref:y,className:"ui-popover jv-entry-menu",role:"menu","aria-label":m("entry.menu"),style:w,children:[p&&r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{u(p,!p.pinned),o()},children:[r.jsx(Fe,{name:"pin"}),r.jsx("span",{className:"ui-menu-copy",children:m(p.pinned?"entry.unpin":"entry.pin")})]}),p&&r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{h(p,!p.muted),o()},children:[r.jsx(Fe,{name:p.muted?"bell":"bell-slash"}),r.jsx("span",{className:"ui-menu-copy",children:m(p.muted?"entry.unmute":"entry.mute")})]}),e.kind==="dm"?r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{l(e.bot),o()},children:[r.jsx(Fe,{name:"gear"}),r.jsx("span",{className:"ui-menu-copy",children:m("entry.botInfo")})]}):r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{c(e.chat),o()},children:[r.jsx(Fe,{name:"info"}),r.jsx("span",{className:"ui-menu-copy",children:m("entry.channelInfo")})]}),!(e.kind==="dm"&&e.bot.agent)&&r.jsx("hr",{className:"ui-menu-divider"}),e.kind==="dm"?!e.bot.agent&&r.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{v(e.bot),o()},children:[r.jsx(Fe,{name:"close"}),r.jsx("span",{className:"ui-menu-copy",children:m("entry.deleteBot")})]}):r.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{f(e.chat),o()},children:[r.jsx(Fe,{name:"close"}),r.jsx("span",{className:"ui-menu-copy",children:m("entry.deleteChannel")})]})]})}function sF({files:e,initialIndex:n=0,onClose:i}){const[o,l]=j.useState(n),[c,u]=j.useState("preview"),[h,f]=j.useState(!1),[v,y]=j.useState(""),[p,w]=j.useState(""),[b,k]=j.useState(""),[S,N]=j.useState(!0),[C,A]=j.useState(0),[E,T]=j.useState(!1),[R,_]=j.useState(!1),L=j.useRef(null),I=j.useRef(null),H=j.useRef(new Map),O=e[o],P=ju(O),U=s6(P),Y=vq(P)&&O.size>pq,K=!U&&!Y&&P!=="download";j.useEffect(()=>{const he=L.current,oe=document.activeElement;return he.showModal(),()=>{he.close(),oe!=null&&oe.isConnected&&oe.focus({preventScroll:!0})}},[]),j.useEffect(()=>{const he=new AbortController;return y(""),w(""),k(""),u("preview"),T(!1),_(!1),N(K),K&&(Wc(P)?d6(O,he.signal).then(w):u6(O,he.signal).then(y)).then(()=>N(!1)).catch(oe=>{he.signal.aborted||(k(Vt(oe,"files.readError")),N(!1))}),()=>he.abort()},[O.id,C]),j.useEffect(()=>{I.current&&(I.current.scrollTop=H.current.get(`${o}:${c}`)??0)},[o,c,S]);const q=()=>{var he;return H.current.set(`${o}:${c}`,((he=I.current)==null?void 0:he.scrollTop)??0)},Q=he=>{q(),l(Math.max(0,Math.min(e.length-1,he)))},V=j.useMemo(()=>P==="html"&&v?xq(v):null,[P,v]),Z=K&&["markdown","html"].includes(P)&&!S&&!b,ue=Wc(P)||U&&!R?"ui-image-view":P==="html"&&c==="preview"?"ui-html-view":P==="markdown"&&c==="preview"?"ui-document":"",z=r.jsxs("a",{className:"ui-button",href:Ai(O),download:O.name,children:[r.jsx(Fe,{name:"cloud-download"}),m("files.downloadFile")]});return Po.createPortal(r.jsxs("dialog",{ref:L,className:"ui-viewer","aria-labelledby":"jvPreviewTitle","data-wide":h||void 0,onCancel:he=>{he.preventDefault(),i()},onKeyDown:he=>{!["ArrowLeft","ArrowRight"].includes(he.key)||["SELECT","INPUT","TEXTAREA"].includes(he.target.tagName)||(he.preventDefault(),Q(o+(he.key==="ArrowLeft"?-1:1)))},children:[r.jsxs("header",{className:"ui-preview-header",children:[r.jsxs("div",{className:"ui-preview-heading",children:[r.jsx("h1",{id:"jvPreviewTitle",children:O.name}),r.jsxs("small",{children:[m(l6[P])," · ",c6(O.size)]})]}),r.jsxs("div",{className:"ui-preview-actions",children:[Z&&r.jsx("button",{type:"button",className:"ui-button",onClick:()=>{q(),u(c==="source"?"preview":"source")},children:m(c==="source"?"files.showPreview":P==="html"?"files.showSource":"files.showText")}),E&&r.jsx(kt,{icon:"window",label:m("files.openTab"),onClick:()=>window.open(Ij(O),"_blank","noopener,noreferrer")}),r.jsx("a",{className:"ui-iconbtn",href:Ai(O),download:O.name,"aria-label":m("files.download",{name:O.name}),title:m("files.download",{name:O.name}),children:r.jsx(Fe,{name:"cloud-download"})}),r.jsx(kt,{icon:h?"arrows-contract":"arrows-expand",label:m(h?"files.narrow":"files.widen"),"data-action":"ui-wide",onClick:()=>f(!h)}),r.jsx(kt,{icon:"close",label:m("files.closePreview"),"data-action":"ui-close",onClick:i})]})]}),V&&c==="preview"&&!S&&!b&&r.jsxs("div",{className:"jv-run-tip",role:"status",children:[r.jsx("p",{children:E?m("files.running"):m("files.scripts",{count:V.count,hosts:V.hosts.length?m("files.scriptHosts",{hosts:V.hosts.slice(0,3).join(m("common.listSeparator"))+(V.hosts.length>3?m("files.andMore"):"")}):""})}),r.jsx("button",{type:"button",className:"ui-button",onClick:()=>T(!E),children:m(E?"files.stop":"files.run")})]}),r.jsx("div",{className:`ui-preview-body ${ue}`,ref:I,tabIndex:-1,children:U?R?r.jsxs("div",{className:"ui-fallback",children:[r.jsx(Fe,{name:`file-${P}`}),r.jsx("strong",{children:m("files.cantPlay")}),r.jsx("p",{children:m("files.cantPlayHint")}),z]}):P==="video"?r.jsx("video",{className:"ui-preview-video",src:Ai(O),controls:!0,preload:"metadata",playsInline:!0,onError:()=>_(!0)},O.id):r.jsx("audio",{className:"ui-preview-audio",src:Ai(O),controls:!0,preload:"metadata",onError:()=>_(!0)},O.id):K?S?r.jsx("p",{className:"ui-unloaded",children:m("files.reading")}):b?r.jsxs("div",{className:"ui-error",role:"alert",children:[r.jsx("p",{children:b}),r.jsx("button",{type:"button",className:"ui-button",onClick:()=>A(he=>he+1),children:m("common.retry")})]}):Wc(P)?r.jsx("img",{className:"ui-preview-image",src:p,alt:O.name}):c==="source"||P==="text"?r.jsx("pre",{className:"ui-source",tabIndex:0,children:v}):P==="html"?E?r.jsx("iframe",{title:m("files.runningTitle",{name:O.name}),sandbox:"allow-scripts",src:Ij(O),referrerPolicy:"no-referrer",className:"ui-html-frame"},"run"):r.jsx("iframe",{title:O.name,sandbox:"",srcDoc:bq(v),referrerPolicy:"no-referrer",className:"ui-html-frame"},"static"):r.jsx("article",{className:"ui-prose",children:r.jsx(Bo,{text:v})}):r.jsxs("div",{className:"ui-fallback",children:[r.jsx(Fe,{name:"file"}),r.jsx("strong",{children:m("files.downloadToView")}),r.jsx("p",{children:m(Y?"files.tooLarge":"files.unsupported")}),z]})}),e.length>1&&r.jsxs("footer",{className:"ui-preview-nav",children:[r.jsx(kt,{icon:"chevron-left",label:m("files.previous"),disabled:o===0,onClick:()=>Q(o-1)}),r.jsx("select",{id:"ui-preview-select","aria-label":m("files.choose"),value:o,onChange:he=>Q(Number(he.target.value)),children:e.map((he,oe)=>r.jsx("option",{value:oe,children:he.name},he.id))}),r.jsxs("span",{children:[o+1," / ",e.length]}),r.jsx(kt,{icon:"chevron-right",label:m("files.next"),disabled:o===e.length-1,onClick:()=>Q(o+1)})]})]}),document.body)}function lF({dialog:e,entryMenu:n,confirm:i,preview:o,infoBot:l,bots:c,statuses:u,chats:h,sections:f,members:v,connections:y,meId:p,onDialog:w,onEntryMenu:b,onConfirm:k,onPreview:S,onInfoBot:N,onSettings:C,onAddMachine:A,onChannelInfo:E,onOpenChatId:T,chatSaved:R,openChat:_,onSectionSaved:L,onSectionDeleted:I,updateBot:H,openAnywhere:O,removeChannel:P,deleteBot:U,pinChat:Y,muteChat:K}){return r.jsxs(r.Fragment,{children:[(e==null?void 0:e.kind)==="channel"&&r.jsx(aF,{sections:f,members:Oi(v),bots:c,me:p,onClose:()=>w(null),onSaved:q=>{R(q),w(null),_(q)}}),(e==null?void 0:e.kind)==="members"&&r.jsx(nF,{chat:h.find(q=>q.id===e.chat.id)??e.chat,members:Oi(v),bots:c,onClose:()=>w(null),onChanged:R}),(e==null?void 0:e.kind)==="section"&&r.jsx(iF,{section:e.section,onClose:()=>w(null),onSaved:L,onDeleted:I}),n&&r.jsx(oF,{target:n.target,x:n.at.x,y:n.at.y,onClose:()=>b(null),onOpenBot:q=>N(q.id),onSettings:q=>{q.type==="channel"&&E(q)},onPin:(q,Q)=>void Y(q,Q),onMute:(q,Q)=>void K(q,Q),onDeleteChat:q=>k({kind:"chat",chat:q}),onDeleteBot:q=>k({kind:"bot",bot:q})}),(i==null?void 0:i.kind)==="chat"&&r.jsx(M6,{title:m("app.deleteChannelTitle",{name:i.chat.title}),confirm:m("common.delete"),onClose:()=>k(null),body:m("app.deleteChannelBody"),onConfirm:async()=>{await P(i.chat),k(null)}}),(i==null?void 0:i.kind)==="bot"&&r.jsx(rF,{bot:i.bot,chats:h.filter(q=>q.type==="dm"&&q.botId===i.bot.id).length,onClose:()=>k(null),onConfirm:async q=>{await U(i.bot,q),k(null)}}),l&&r.jsx(mq,{bot:l,status:u[l.id],connections:y,chats:h,onSaved:H,onOpenChat:q=>{N(null),T(q)},onOpenSubscription:O,onManageModels:()=>{N(null),C("models")},onManageSecrets:()=>{N(null),C("secrets")},onManageConnectors:()=>{N(null),C("connectors")},onAddMachine:()=>{N(null),A()},onClose:()=>N(null)},l.id),o&&r.jsx(sF,{files:o.files,initialIndex:o.index,onClose:()=>S(null)})]})}function _6(e,n,i){const[o,l]=j.useState(null),[c,u]=j.useState(!1);return j.useEffect(()=>{const h=e.trim();if(!h){l(null),u(!1);return}let f=!0;u(!0);const v=setTimeout(()=>void ae.search(h,n).then(y=>{f&&l(y)}).catch(y=>{f&&i(y)}).finally(()=>{f&&u(!1)}),250);return()=>{f=!1,clearTimeout(v)}},[e,n]),{result:o,loading:c}}function R6(e,n,i){var o;return e.type==="thread"?`#${((o=n.find(l=>l.id===e.parentId))==null?void 0:o.title)??m("search.channel")} › ${e.title}`:e.type==="channel"?`#${e.title}`:zi(i.find(l=>l.id===e.botId))}function O6({text:e,query:n,room:i=24}){const o=e.replace(/[*`~#>|]/g,"").replace(/\s+/g," ").trim(),l=o.toLocaleLowerCase().indexOf(n.trim().toLocaleLowerCase());if(l<0||!n.trim())return r.jsx(r.Fragment,{children:o.slice(0,120)});const c=Math.max(0,l-i),u=l+n.trim().length;return r.jsxs(r.Fragment,{children:[c>0&&"…",o.slice(c,l),r.jsx("mark",{className:"jv-hit",children:o.slice(l,u)}),o.slice(u,u+120)]})}const cF=e=>new Date(e).toDateString()===new Date().toDateString()?Oo(e):qh(e);function D6({message:e,chat:n,chats:i,members:o,query:l,showPlace:c=!0,onOpen:u}){return r.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>u(n,e.id),children:[r.jsxs("span",{className:"jv-hit-head",children:[r.jsx("strong",{children:zi(o.find(h=>h.id===e.senderId))}),c&&r.jsx("span",{className:"jv-hit-place",children:R6(n,i,o)}),r.jsx("time",{dateTime:new Date(e.createdAt).toISOString(),children:cF(e.createdAt)})]}),r.jsx("span",{className:"jv-hit-text",children:r.jsx(O6,{text:Pg(e),query:l})})]})}const Gj=5;function gh({label:e,items:n,empty:i}){const[o,l]=j.useState(!1);return!n.length&&!i?null:r.jsxs("section",{className:"jv-result-group","aria-label":e,children:[r.jsxs("h3",{className:"jv-result-head",children:[e,r.jsx("span",{children:n.length})]}),n.length?o?n:n.slice(0,Gj):r.jsx("p",{className:"jv-result-empty",children:i}),!o&&n.length>Gj&&r.jsxs("button",{type:"button",className:"jv-result-more",onClick:()=>l(!0),children:[m("search.showAll",{count:n.length}),r.jsx(Fe,{name:"chevron-down"})]})]})}function uF({query:e,shown:n,chats:i,members:o,onOpenChat:l,onOpenMessage:c,onError:u}){const{result:h,loading:f}=_6(e,void 0,u),v=((h==null?void 0:h.chats)??[]).filter(p=>!n.has(p.id)),y=p=>{var w,b;return r.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>l(p),children:[r.jsxs("span",{className:"jv-hit-head",children:[r.jsx("strong",{children:p.type==="thread"?p.title:`#${p.title}`}),p.type==="thread"&&r.jsx("span",{className:"jv-hit-place",children:R6(p,i,o).split(" › ")[0]})]}),(((w=p.note)==null?void 0:w.text)||p.topic)&&r.jsx("span",{className:"jv-hit-text",children:r.jsx(O6,{text:((b=p.note)==null?void 0:b.text)||p.topic,query:e})})]},p.id)};return r.jsxs("div",{className:"jv-results","aria-live":"polite",children:[r.jsx(gh,{label:m("search.threads"),items:v.filter(p=>p.type==="thread").map(y)}),r.jsx(gh,{label:m("search.channels"),items:v.filter(p=>p.type==="channel").map(y)}),h?r.jsx(gh,{label:m("search.messages"),empty:m("search.noMessages"),items:h.messages.map(({message:p,chat:w})=>r.jsx(D6,{message:p,chat:w,chats:i,members:o,query:e,onOpen:c},p.id))}):f&&r.jsx("p",{className:"jv-result-empty",children:m("search.searching")})]})}function z6({className:e,...n}){return r.jsx("div",{"data-slot":"input-group",role:"group",className:Ln("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 dF=Bv("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-xs [&>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 L6({className:e,align:n="inline-start",...i}){return r.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:Ln(dF({align:n}),e),onClick:o=>{var l,c;o.target.closest("button")||(c=(l=o.currentTarget.parentElement)==null?void 0:l.querySelector("input"))==null||c.focus()},...i})}function B6({className:e,...n}){return r.jsx(Xe,{"data-slot":"input-group-control",className:Ln("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),...n})}function hF({className:e,children:n,...i}){return r.jsxs(j_,{"data-slot":"scroll-area",className:Ln("relative",e),...i,children:[r.jsx(w_,{"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}),r.jsx(fF,{}),r.jsx(k_,{})]})}function fF({className:e,orientation:n="vertical",...i}){return r.jsx(u_,{"data-slot":"scroll-area-scrollbar",orientation:n,className:Ln("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:r.jsx(v_,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Ro({leading:e,title:n,titleEnd:i,sub:o,subEnd:l,trailing:c,active:u,unread:h,line:f,more:v,static:y,className:p="",onContextMenu:w,...b}){const k=o!==void 0,S=r.jsxs(r.Fragment,{children:[e,r.jsxs("span",{className:"ui-row-text",children:[r.jsxs("span",{className:"ui-row-line",children:[r.jsx("span",{className:"ui-row-title",children:n}),i&&r.jsx("span",{className:"ui-row-end",children:i})]}),k&&r.jsxs("span",{className:"ui-row-line ui-row-sub",children:[r.jsx("span",{className:"ui-row-digest",children:o}),l]})]}),c]}),N={"data-active":u||void 0,"data-unread":h||void 0,"data-line":f||void 0,"data-two":k||void 0},C=y?r.jsx("div",{className:`ui-row ${p}`,...N,children:S}):r.jsx("button",{type:"button",className:`ui-row ${p}`,"aria-current":u?"page":void 0,...N,...b,onContextMenu:v?void 0:w,children:S});return v?r.jsxs("div",{className:"ui-row-wrap",onContextMenu:w,children:[C,r.jsx("button",{type:"button",className:"ui-row-more","aria-label":v.label,title:v.label,onClick:v.onClick,children:r.jsx(Fe,{name:"more"})})]}):C}const I6="jarvy-collapsed-sections",mF=()=>{try{return JSON.parse(localStorage.getItem(I6)??"[]")}catch{return[]}};function Yj({chat:e}){return e.alerts>0?r.jsx("span",{className:"jv-badge","aria-label":m("sidebar.alerts",{count:e.alerts}),children:e.alerts}):e.unread>0?r.jsx("span",{className:"jv-count","aria-label":m("sidebar.unread",{count:e.unread}),children:e.unread}):null}function P6(e){const n=e.hint;if(!n||n.createdAt<e.updatedAt-1e3)return null;const i=n.chatType==="thread"&&n.chatId!==e.id,o={actor:n.actor,emoji:n.detail,title:n.title.length>16?`${n.title.slice(0,16)}…`:n.title};return n.kind==="reaction"?m(i?"hint.reactionInThread":"hint.reaction",o):m(i?"hint.threadSummary":n.chatType==="thread"?"hint.summary":"hint.notice",o)}function pF(e){var n;return e.type==="channel"&&P6(e)&&((n=e.hint)==null?void 0:n.chatType)==="thread"&&e.hint.chatId!==e.id?e.hint.chatId:null}function Kj(e,n){const i=P6(e),o=e.lastMessage&&Us(e.lastMessage),l=i??(o?n&&e.lastSender?m("sidebar.said",{name:e.lastSender,text:o}):o:n?e.topic:"");if(!(!l&&!e.atMe))return r.jsxs(r.Fragment,{children:[e.atMe&&r.jsx("span",{className:"jv-at-me",children:m("sidebar.atMe")}),r.jsx("span",{className:i?"jv-hint-line":void 0,children:l})]})}const Xj=e=>{const n=e.getBoundingClientRect();return{x:n.right-168,y:n.bottom+4}};function vF({chats:e,sections:n,bots:i,members:o,onOpenMessage:l,onOpenFound:c,onError:u,working:h,asking:f,selected:v,filter:y,followed:p,followedOpen:w,onFilterChange:b,onSelect:k,onOpenBot:S,onOpenFollowed:N,onMenu:C,onEditSection:A}){const[E,T]=j.useState(mF),R=V=>T(Z=>{const ue=Z.includes(V)?Z.filter(z=>z!==V):[...Z,V];return localStorage.setItem(I6,JSON.stringify(ue)),ue}),_=y.toLocaleLowerCase(),L=e.filter(V=>{var Z;return V.type!=="thread"&&`${V.title} ${V.topic} ${((Z=i.find(ue=>ue.id===V.botId))==null?void 0:Z.name)??""}`.toLocaleLowerCase().includes(_)}),I=(p==null?void 0:p.unread)??0,H=(p==null?void 0:p.mentions)??0,O=L.filter(V=>V.type==="channel").sort((V,Z)=>Number(Z.pinned)-Number(V.pinned)||V.title.localeCompare(Z.title,"zh-CN")),P=i.map(V=>({bot:V,chat:e.find(Z=>Z.type==="dm"&&Z.botId===V.id)})).filter(({bot:V})=>V.name.toLocaleLowerCase().includes(_)).sort((V,Z)=>{var ue,z,he,oe;return Number(Z.bot.agent)-Number(V.bot.agent)||+!!((ue=Z.chat)!=null&&ue.pinned)-+!!((z=V.chat)!=null&&z.pinned)||(((he=Z.chat)==null?void 0:he.updatedAt)??0)-(((oe=V.chat)==null?void 0:oe.updatedAt)??0)}),U=V=>r.jsx(Ro,{active:v===V.id,unread:V.unread>0,onClick:()=>k(V),onContextMenu:Z=>{Z.preventDefault(),C({kind:"channel",chat:V},{x:Z.clientX,y:Z.clientY})},leading:r.jsx("span",{className:"ui-row-glyph",children:V.pinned?r.jsx(B0,{"aria-label":m("sidebar.pinned")}):r.jsx("span",{className:"jv-hash","aria-hidden":"true",children:"#"})}),title:r.jsx("span",{title:V.title,children:V.title}),titleEnd:V.muted&&r.jsx("span",{"aria-label":m("sidebar.muted"),children:r.jsx(Fe,{name:"bell-slash"})}),sub:Kj(V,!0)??(V.alerts||V.unread?"":void 0),subEnd:r.jsx(Yj,{chat:V}),more:{label:m("sidebar.more",{name:V.title}),onClick:Z=>C({kind:"channel",chat:V},Xj(Z.currentTarget))}},V.id),Y=({bot:V,chat:Z})=>{const ue=f.has(V.id)?"asking":h.has(V.id)?"working":void 0,z=!!Z&&v===Z.id;return r.jsx(Ro,{active:z,unread:!!(Z!=null&&Z.unread),onClick:()=>Z?k(Z):S(V),onContextMenu:he=>{he.preventDefault(),C({kind:"dm",bot:V,chat:Z},{x:he.clientX,y:he.clientY})},leading:r.jsxs(r.Fragment,{children:[r.jsx(Ii,{color:V.color,mood:V.mood,size:36,badge:ue,crown:V.agent}),ue&&r.jsx("span",{className:"sr-only",children:m(ue==="asking"?"sidebar.asking":"sidebar.working")})]}),title:r.jsx("span",{title:V.name,children:V.name}),titleEnd:Z&&r.jsxs(r.Fragment,{children:[(Z==null?void 0:Z.muted)&&r.jsx("span",{"aria-label":m("sidebar.muted"),children:r.jsx(Fe,{name:"bell-slash"})}),(Z==null?void 0:Z.pinned)&&r.jsx(B0,{"aria-label":m("sidebar.pinned")}),Z&&r.jsx("time",{dateTime:new Date(Z.updatedAt).toISOString(),children:Oo(Z.updatedAt)})]}),sub:Z&&(Kj(Z,!1)??(Z.alerts||Z.unread?"":void 0)),subEnd:Z&&r.jsx(Yj,{chat:Z}),more:{label:m("sidebar.more",{name:V.name}),onClick:he=>C({kind:"dm",bot:V,chat:Z},Xj(he.currentTarget))}},V.id)},K=(V,Z,ue,z,he)=>r.jsxs("div",{className:"jv-side-section-head",children:[r.jsxs("button",{type:"button",className:"jv-side-section-toggle","aria-expanded":!ue,onClick:()=>R(V),children:[r.jsx("span",{className:"jv-side-chevron",children:r.jsx(Fe,{name:ue?"chevron-right":"chevron-down"})}),r.jsxs("span",{className:"jv-side-section-name",children:[Z,ue&&z&&r.jsx("span",{className:"jv-dot","aria-label":m("sidebar.hasUnread")})]})]}),he&&r.jsx("button",{type:"button",className:"jv-side-section-edit","aria-label":m("sidebar.editSection",{name:Z}),onClick:()=>A(he),children:r.jsx(Fe,{name:"pencil"})})]}),q=V=>!_&&E.includes(V),Q=(V,Z,ue,z)=>r.jsxs("div",{className:"jv-side-section",children:[K(V,Z,q(V),ue.some(he=>he.unread>0),z),!q(V)&&ue.map(U)]},V);return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mx-3 mt-1 mb-2 shrink-0",role:"search",children:r.jsxs(z6,{className:"h-9 bg-background",children:[r.jsx(B6,{id:"jarvy-search",type:"search",value:y,onChange:V=>b(V.target.value),placeholder:m("sidebar.search"),"aria-label":m("sidebar.search"),onKeyDown:V=>{V.key==="Escape"&&y&&(V.preventDefault(),b(""))},className:"text-sm"}),r.jsx(L6,{align:"inline-start",children:r.jsx(Io,{"aria-hidden":"true"})})]})}),r.jsx(hF,{className:"min-h-0 flex-1",type:"auto",children:_?r.jsxs("nav",{className:"jv-side-nav jv-side-search px-3 pb-6","aria-label":m("sidebar.results"),children:[r.jsx(gh,{label:m("sidebar.chats"),items:[...O.map(U),...P.map(Y)]}),r.jsx(uF,{query:y,shown:new Set(O.map(V=>V.id)),chats:e,members:o,onOpenChat:c,onOpenMessage:l,onError:u})]}):r.jsxs("nav",{className:"jv-side-nav px-3 pb-6","aria-label":m("sidebar.nav"),children:[!!(p!=null&&p.total)&&r.jsx(Ro,{line:!0,className:"jv-side-top",active:w,unread:I>0,onClick:N,leading:r.jsx(Fe,{name:"chat-bubble"}),title:m("sidebar.followed"),trailing:H>0?r.jsx("span",{className:"jv-badge",children:H}):I>0&&r.jsx("span",{className:"jv-count",children:I})}),n.map(V=>Q(`s:${V.id}`,V.name,O.filter(Z=>Z.sectionId===V.id),V)),O.some(V=>!V.sectionId||!n.some(Z=>Z.id===V.sectionId))&&Q("channels",m("sidebar.channels"),O.filter(V=>!V.sectionId||!n.some(Z=>Z.id===V.sectionId))),r.jsxs("div",{className:"jv-side-section",children:[K("dms",m("sidebar.dms"),q("dms"),P.some(({chat:V})=>!!(V!=null&&V.unread))),!q("dms")&&P.map(Y),!q("dms")&&P.length===0&&r.jsx("p",{className:"jv-side-empty",children:m("sidebar.noDms")})]})]})})]})}function gF({chats:e,sections:n,bots:i,members:o,followed:l,followedOpen:c,working:u,asking:h,selected:f,filter:v,creating:y,createMenu:p,onFilterChange:w,onOpenFollowed:b,onOpenChat:k,onOpenBot:S,onOpenMenu:N,onEditSection:C,onCreate:A,onFind:E,onOpenFound:T,onError:R,onToggleCreate:_}){const L=j.useRef(null);return j.useEffect(()=>{if(!p)return;const I=H=>{var O;(O=L.current)!=null&&O.contains(H.target)||_(!1)};return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[p]),r.jsxs("aside",{className:"ui-sidebar","aria-label":m("sidebar.label"),children:[r.jsx(hr,{place:"sidebar",title:r.jsx("span",{className:"sr-only",children:m("sidebar.label")}),actions:r.jsx("div",{className:"ui-column-actions",children:r.jsxs("div",{className:"jarvy-sidebar-create",ref:L,children:[r.jsx(kt,{icon:"add",label:m("sidebar.create"),"aria-expanded":p,"aria-haspopup":"menu",disabled:y,onClick:()=>_(!p)}),p&&r.jsxs("div",{className:"ui-popover jarvy-create-menu",role:"menu","aria-label":m("sidebar.createMenu"),children:[r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("channel"),children:[r.jsx(Fe,{name:"list-bullets"}),r.jsx("span",{className:"ui-menu-copy",children:m("sidebar.newChannel")})]}),r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("section"),children:[r.jsx(Fe,{name:"folder"}),r.jsx("span",{className:"ui-menu-copy",children:m("sidebar.newSection")})]}),r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("bot"),children:[r.jsx(Fe,{name:"person-add"}),r.jsx("span",{className:"ui-menu-copy",children:m("sidebar.newBot")})]})]})]})})}),r.jsx(vF,{chats:e,sections:n,bots:i,members:o,onOpenMessage:E,onOpenFound:T,onError:R,working:u,asking:h,selected:f,filter:v,onFilterChange:w,followed:l,followedOpen:c,onOpenFollowed:b,onSelect:k,onOpenBot:S,onMenu:N,onEditSection:C})]})}function yF({textarea:e,value:n,setValue:i,inside:o,outside:l,bots:c,onInvite:u,participants:h}){const[f,v]=j.useState(null),[y,p]=j.useState(0),[w,b]=j.useState(null),k=j.useRef(null),S=j.useRef(null),N=j.useRef(null);j.useLayoutEffect(()=>{N.current===null||!e.current||(e.current.focus(),e.current.setSelectionRange(N.current,N.current),N.current=null)},[n,e]);const C=(z,he)=>z.name.toLowerCase().includes(he.toLowerCase()),A=f===null?[]:o.filter(z=>C(z,f)),E=h?A.filter(z=>h.has(z.id)):A,T=h?A.filter(z=>!h.has(z.id)):[],R=E.length>0&&T.length>0,_=[...E,...T],L=f===null?[]:l.filter(z=>C(z,f)),I=w?l.filter(z=>C(z,w.search)):[],H=_.length+(L.length?1:0),O=()=>{v(null),b(null)};function P(z=n){const he=e.current,oe=he?/(?:^|[^\p{Script=Latin}\p{Nd}_])@([^\s@]*)$/u.exec(z.slice(0,he.selectionStart)):null;v(oe?oe[1]:null),p(0),b(null)}function U(z){const he=e.current;if(!he)return;o.some(F=>F.id===z.id)||u(z);const oe=n.slice(0,he.selectionStart).replace(/@([^\s@]*)$/u,`@${z.name} `),D=oe+n.slice(he.selectionStart);N.current=oe.length,i(D),O()}function Y(z){w||b({search:f??"",active:0}),z&&requestAnimationFrame(()=>{var he;return(he=S.current)==null?void 0:he.focus()})}function K(){var z;b(null),(z=e.current)==null||z.focus()}function q(z){if(!H||z.nativeEvent.isComposing)return!1;const he=y===_.length;return z.key==="ArrowDown"||z.key==="ArrowUp"?(z.preventDefault(),p((y+(z.key==="ArrowDown"?1:-1)+H)%H),b(null),!0):(z.key==="Enter"||z.key==="Tab")&&!he?(z.preventDefault(),U(_[y]),!0):(z.key==="Enter"||z.key==="Tab"||z.key==="ArrowRight")&&he?(z.preventDefault(),Y(!0),!0):z.key==="Escape"?(z.preventDefault(),O(),!0):!1}function Q(z){!w||z.nativeEvent.isComposing||((z.key==="ArrowDown"||z.key==="ArrowUp")&&I.length?(z.preventDefault(),b({...w,active:(w.active+(z.key==="ArrowDown"?1:-1)+I.length)%I.length})):z.key==="Enter"?(z.preventDefault(),I[w.active]&&U(I[w.active])):(z.key==="Escape"||z.key==="ArrowLeft"&&!w.search)&&(z.preventDefault(),K()))}const V=z=>{var oe;const he=z.relatedTarget;(!he||!((oe=k.current)!=null&&oe.contains(he))&&he!==e.current)&&O()},Z=(z,he)=>r.jsxs("button",{type:"button",role:"option","aria-selected":he,className:"ui-menu-item","data-active":he||void 0,onMouseDown:oe=>{oe.preventDefault(),U(z)},children:[r.jsx(vr,{member:z,bots:c,size:20}),r.jsx("span",{className:"ui-menu-copy",children:z.name}),r.jsx("span",{className:"jv-muted",children:z.kind==="bot"?"Bot":m("common.member")})]},z.id);return{menu:H>0?r.jsxs("div",{ref:k,className:"jv-mention-box","data-side":w?"":void 0,onBlur:V,children:[r.jsxs("div",{className:"ui-popover jv-mention-menu",role:"listbox","aria-label":m("mention.menu"),children:[R&&r.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:m("mention.inThread")}),E.map((z,he)=>Z(z,he===y)),R&&r.jsx("div",{className:"jv-mention-sep",role:"separator"}),R&&r.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:m("mention.inChannel")}),T.map((z,he)=>Z(z,E.length+he===y)),L.length>0&&r.jsxs("button",{type:"button",className:"ui-menu-item jv-mention-more","aria-haspopup":"listbox","aria-expanded":!!w,"data-active":y===_.length||void 0,onMouseEnter:()=>{p(_.length),Y(!1)},onMouseDown:z=>{z.preventDefault(),p(_.length),Y(!0)},children:[r.jsx("span",{className:"ui-menu-copy",children:m("mention.outside")}),r.jsx("span",{className:"jv-muted",children:L.length}),r.jsx(Fe,{name:"chevron-right"})]})]}),w&&r.jsxs("div",{className:"ui-popover jv-mention-side",role:"listbox","aria-label":m("mention.outsideList"),children:[r.jsxs("div",{className:"jv-mention-side-head",children:[r.jsx("button",{type:"button",className:"jv-mention-back","aria-label":m("common.back"),onMouseDown:z=>{z.preventDefault(),K()},children:r.jsx(Fe,{name:"chevron-left"})}),r.jsx("input",{ref:S,type:"search",value:w.search,placeholder:m("common.searchMembers"),"aria-label":m("mention.searchOutside"),onChange:z=>b({search:z.target.value,active:0}),onKeyDown:Q})]}),r.jsx("div",{className:"jv-mention-side-list",children:I.length?I.map((z,he)=>Z(z,he===w.active)):r.jsx("p",{className:"jv-mention-empty",children:m("common.noMatch")})}),r.jsx("p",{className:"ui-menu-note ui-small",children:m("mention.invites")})]})]}):null,track:P,onKeyDown:q,close:O,leaves:V}}const Qj={text:null,files:[],quote:null,passages:[],key:null,signature:null,outgoing:null,sending:!1};function q6(e,n){var l;const i=((l=n.text)==null?void 0:l.trim())??"",o=e.text??"";return{text:o.trim()?i?`${i}
823
+
824
+ ${o}`:o:i||e.text,files:[...n.files.filter(c=>!e.files.some(u=>u.id===c.id)),...e.files],quote:e.quote??n.quote,passages:[...n.passages,...e.passages],outgoing:null}}class xF{constructor(n){$e(this,"drafts",new Map);$e(this,"listeners",new Set);$e(this,"timer",null);$e(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));this.storageKey=n;try{const i=JSON.parse(localStorage.getItem(n)??"{}");for(const[o,l]of Object.entries(i)){const c={...Qj,...l,sending:!1};this.drafts.set(o,c.outgoing?{...c,...q6(c,c.outgoing)}:c)}}catch{localStorage.removeItem(n)}}get(n){return this.drafts.get(n)??Qj}update(n,i){const o=this.get(n),l=typeof i=="function"?i(o):i;this.drafts.set(n,{...o,...l}),this.listeners.forEach(u=>u());const c=Object.keys(l).every(u=>u==="text"||u==="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[o,{sending:l,...c}]of this.drafts)((i=c.text)!=null&&i.trim()||c.files.length||c.quote||c.passages.length||c.outgoing)&&(n[o]=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(o=>{var l;return[...o.files,...((l=o.outgoing)==null?void 0:l.files)??[]]});await Promise.all(i.map(o=>n(o.id).catch(l=>console.warn(`Pending attachment ${o.id} was not deleted on log-out`,l)))),this.drafts.clear(),localStorage.removeItem(this.storageKey),this.listeners.forEach(o=>o())}}const bF=e=>`jarvy-drafts:${e}`,Zj=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");function Fg(e,n,i){e.update(n.chatId,{quote:{id:n.id,name:zi(i.find(o=>o.id===n.senderId)),text:Pg(n).replace(/\s+/g," ").slice(0,160)}})}function F6(e,n){return j.useSyncExternalStore(e.subscribe,()=>e.get(n))}function Hg({chatId:e,id:n,drafts:i,placeholder:o,disabled:l=!1,mention:c,initialText:u,formRef:h,scrollRef:f,extra:v,onSend:y,onError:p,onNotice:w}){const b=F6(i,e),k=b.sending,[S,N]=j.useState([]),[C,A]=j.useState(!1),[E,T]=j.useState(!1),R=S.filter($=>$.chatId===e),_=R.length>0,L=j.useRef(new Map),I=j.useRef(null),H=j.useRef(null),O=b.text??u??"",P=b.files,U=b.quote,Y=$=>i.update(e,{text:$}),K=yF({textarea:I,value:O,setValue:Y,inside:(c==null?void 0:c.inside)??[],outside:(c==null?void 0:c.outside)??[],bots:(c==null?void 0:c.bots)??[],onInvite:$=>c==null?void 0:c.onInvite($),participants:c==null?void 0:c.participants});async function q($){var ce;const X=e;if(!$.length)return;if(_){w(m("composer.busy"));return}if(P.length+$.length>5){w(m("composer.tooMany",{count:5}));return}if($.some(J=>J.size===0||J.size>nb)){w(m("composer.size",{limit:`${nb/1024**3} GB`}));return}const ee=$.map(J=>({key:Zj(),chatId:X,name:J.name,done:0})),me=ee.map(J=>J.key),te=(J,je)=>N(Re=>Re.map(De=>De.key===J?{...De,done:je}:De));N(J=>[...J,...ee]);for(const J of me)L.current.set(J,new AbortController);try{for(const[J,je]of $.entries()){const Re=me[J];try{const De=await ae.uploadAttachment(X,je,Pe=>te(Re,Pe),(ce=L.current.get(Re))==null?void 0:ce.signal);i.update(X,Pe=>({files:[...Pe.files,De]}))}catch(De){if(!(De instanceof DOMException&&De.name==="AbortError"))throw De}finally{N(De=>De.filter(Pe=>Pe.key!==Re))}}}catch(J){p(J)}finally{N(J=>J.filter(je=>!me.includes(je.key)));for(const J of me)L.current.delete(J)}}async function Q($){const X=e;try{await ae.removeAttachment($),i.update(X,ee=>({files:ee.files.filter(me=>me.id!==$)}))}catch(ee){p(ee)}}function V($){const X=[...$.clipboardData.files];if(!X.length)return;$.preventDefault();const ee=new Date().toISOString().replace(/\D/g,"").slice(0,14);q(X.map((me,te)=>me.type.startsWith("image/")&&/^image\.\w+$/.test(me.name)?new File([me],`${m("composer.pasted")}-${ee}${X.length>1?`-${te+1}`:""}.${me.name.split(".").pop()}`,{type:me.type}):me))}const Z=$=>$.dataTransfer.types.includes("Files");function ue($){!Z($)||l||($.preventDefault(),$.dataTransfer.dropEffect="copy",A(!0))}function z($){Z($)&&($.preventDefault(),A(!1),l||q([...$.dataTransfer.files]))}async function he($){$==null||$.preventDefault();const X=e,ee=i.get(X),me=(ee.text??u??"").trim(),te=ee.files,ce=ee.quote,J=ee.passages,Re=[J.map((He,at)=>`[[q${at+1}]]`).join(`
825
+ `),me].filter(Boolean).join(`
826
+
827
+ `);if(!Re&&!te.length||ee.sending||_||l)return;const De=JSON.stringify([Re,te.map(He=>He.id),(ce==null?void 0:ce.id)??null,J]),Pe=ee.signature===De&&ee.key?ee.key:Zj(),Le={text:me,files:te,quote:ce,passages:J};i.update(X,{text:"",files:[],quote:null,passages:[],key:Pe,signature:De,outgoing:Le,sending:!0});try{await y(Re,te.map(He=>He.id),Pe,ce==null?void 0:ce.id,J.map(({messageId:He,text:at})=>({messageId:He,text:at}))),i.update(X,{key:null,signature:null,outgoing:null})}catch(He){i.update(X,at=>q6(at,Le)),p(He)}finally{i.update(X,{sending:!1})}}const oe=j.useCallback(()=>{const $=I.current,X=H.current,ee=f==null?void 0:f.current;if(!$||!X)return;const me=ee==null?void 0:ee.scrollTop,te=()=>{const De=getComputedStyle($),Pe=parseFloat(De.paddingTop)+parseFloat(De.paddingBottom);return $.style.height="auto",{content:$.scrollHeight-Pe,pad:Pe}},ce=X.getAttribute("data-tall");ce!==null&&X.removeAttribute("data-tall");const J=parseFloat(getComputedStyle($).lineHeight)||20,je=te().content<=J+8;ce!==null&&X.setAttribute("data-tall",ce);const Re=te();$.style.height=`${Re.content+Re.pad}px`,T(!je),ee&&me!==void 0&&ee.scrollTop!==me&&ee.scrollTo({top:me,behavior:"instant"})},[f]);j.useLayoutEffect(()=>{oe();const $=I.current;if(!$)return;const X=new ResizeObserver(()=>oe());return X.observe($),()=>X.disconnect()},[O,e,oe]);const D=j.useRef(null),F=j.useRef(null);j.useLayoutEffect(()=>{const $=H.current;if(!$)return;const X=$.style.height;$.style.height="",delete $.dataset.sliding;const ee=Math.round($.getBoundingClientRect().height),me=D.current;if(D.current=ee,X&&($.style.height=X),me===null||Math.abs(ee-me)<12)return;const te=performance.now();cancelAnimationFrame(F.current??0),$.dataset.sliding="";const ce=J=>{const je=Math.min(1,(J-te)/160),Re=1-(1-je)**3;je<1?($.style.height=`${Math.round(me+(ee-me)*Re)}px`,F.current=requestAnimationFrame(ce)):($.style.height="",delete $.dataset.sliding,F.current=null)};F.current=requestAnimationFrame(ce)}),j.useEffect(()=>()=>cancelAnimationFrame(F.current??0),[]);const ie=$=>{const X=I.current;!X||l||$.target===X||$.target.closest("button, input, textarea, label")||($.preventDefault(),X.focus(),X.setSelectionRange(X.value.length,X.value.length))};return r.jsxs("form",{ref:h,className:`ui-compose-wrap${C?" jarvy-dropping":""}`,onSubmit:$=>void he($),onDragEnter:ue,onDragOver:ue,onDragLeave:$=>{$.currentTarget.contains($.relatedTarget)||A(!1)},onDrop:z,children:[P.length+R.length>0&&r.jsxs("div",{className:"jarvy-pending-files",children:[P.map($=>r.jsxs("span",{className:"jarvy-file-chip",children:[r.jsx(Fe,{name:"paperclip"}),r.jsx("span",{title:$.name,children:$.name}),r.jsx("button",{type:"button","aria-label":m("composer.removeFile",{name:$.name}),onClick:()=>void Q($.id),children:"×"})]},$.id)),R.map($=>r.jsxs("span",{className:"jarvy-file-chip","data-uploading":!0,children:[r.jsx(Fe,{name:"paperclip"}),r.jsx("span",{title:$.name,children:$.name}),r.jsxs("span",{className:"jarvy-file-percent",children:[Math.floor($.done*100),"%"]}),r.jsx("button",{type:"button","aria-label":m("composer.cancelUpload",{name:$.name}),onClick:()=>{var X;return(X=L.current.get($.key))==null?void 0:X.abort()},children:"×"}),r.jsx("span",{className:"jarvy-file-progress",role:"progressbar","aria-label":m("composer.uploading",{name:$.name}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round($.done*100),children:r.jsx("span",{style:{width:`${$.done*100}%`}})})]},$.key))]}),U&&r.jsxs("div",{className:"jv-compose-quote",children:[r.jsx("span",{className:"jv-compose-quote-label",children:m("composer.replying")}),r.jsx("span",{className:"jv-reply-author",children:U.name}),r.jsx("span",{className:"jv-reply-text",children:U.text||m("common.attachment")}),r.jsx("button",{type:"button","aria-label":m("composer.cancelReply"),onClick:()=>i.update(e,{quote:null}),children:"×"})]}),r.jsx(Fq,{quotes:b.passages,onRemove:$=>i.update(e,X=>({passages:X.passages.filter((ee,me)=>me!==$)}))}),r.jsxs("div",{ref:H,className:"ui-composer jv-composer","data-tall":E||void 0,onMouseDown:ie,children:[c&&K.menu,C&&r.jsx("span",{className:"jarvy-drop-hint",role:"status",children:m("composer.drop")}),r.jsxs("label",{className:"jarvy-attach-trigger",title:m("composer.attach"),onMouseDown:$=>$.preventDefault(),children:[r.jsx(Fe,{name:"add"}),r.jsx("input",{type:"file",multiple:!0,"aria-label":m("composer.attach"),disabled:k||_||l||P.length>=5,onChange:$=>{var ee;const X=[...$.target.files??[]];$.target.value="",q(X),(ee=I.current)==null||ee.focus()}})]}),r.jsx("textarea",{ref:I,id:n,rows:1,maxLength:32e3,value:O,onPaste:V,placeholder:o,disabled:l,"aria-label":m("composer.input"),onChange:$=>{Y($.target.value),c&&K.track($.target.value)},onKeyDown:$=>{c&&K.onKeyDown($)||$.key==="Enter"&&!$.shiftKey&&!$.nativeEvent.isComposing&&($.preventDefault(),he())},onClick:()=>{c&&K.track()},onBlur:c?K.leaves:void 0}),v,r.jsx("button",{type:"submit",className:"ui-round ui-send","aria-label":m("composer.send"),disabled:k||_||l||!O.trim()&&!P.length&&!b.passages.length,children:r.jsx(Fe,{name:"arrow-up"})})]})]})}function H6({messages:e,members:n,me:i,activeQuestion:o,onSettled:l,onPreview:c,onQuote:u,onReact:h,onFold:f,onJump:v,onError:y,bot:p,onBotCard:w}){const b=N6(),k=p&&r.jsx(vr,{member:n.find(S=>S.id===p.id)??{id:p.id,kind:"bot",name:p.name},bots:[p],size:22,onBot:w});return r.jsx(r.Fragment,{children:e.map((S,N)=>{const C=e[N-1],A=e[N+1],E=S.role==="assistant"&&!!(A!=null&&A.question)&&A.senderId===S.senderId,T=S.folded;return r.jsxs(j.Fragment,{children:[fg(S.createdAt,C==null?void 0:C.createdAt)&&r.jsx(k5,{time:S.createdAt}),r.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"&&r.jsx("span",{className:"jarvy-bubble-avatar",children:k??r.jsx(Ii,{color:"gray",size:22})}),r.jsxs("div",{className:"jv-dm-stack",children:[w5(S,C)&&r.jsx(av,{time:S.createdAt,className:"jv-dm-time"}),T?r.jsx("div",{className:"ui-bubble jv-folded-bubble",children:r.jsx(E6,{message:S})}):r.jsxs(r.Fragment,{children:[S.replyTo&&r.jsx(w6,{message:S,members:n,onJump:v}),S.question?r.jsx(m6,{message:{...S,question:S.question},keyboard:S.id===o,onSettled:l}):r.jsxs("div",{className:"ui-bubble",children:[S.content&&r.jsx(C6,{whole:b.has(S.id),children:r.jsx(y6,{message:S,members:n,me:i,onJump:v})}),S.attachments.length>0&&r.jsx(h6,{files:S.attachments,onOpen:R=>c(S.attachments,R)})]}),r.jsx(k6,{message:S,me:i,members:n,onReact:h,onError:y})]})]}),r.jsxs("div",{className:"jv-row-actions",children:[r.jsx(S6,{message:S,me:i,onReply:u,onReact:h,onError:y}),r.jsx(kt,{icon:S.folded?"unfold":"fold",label:m(S.folded?"actions.unfold":"actions.fold"),onClick:()=>{S.folded&&b.add(S.id),f(S,!S.folded)}})]})]})]},S.id)})})}const Lr=Math.PI*2,ba=(e,n=0,i=1)=>Math.min(i,Math.max(n,e)),Sn=(e,n,i)=>e+(n-e)*i,bv=e=>(e=ba(e),e<.5?2*e*e:1-(-2*e+2)**2/2),jF=e=>1-(1-ba(e))**3,$c=e=>{e=ba(e);const n=1.9;return 1+(n+1)*(e-1)**3+n*(e-1)**2},gn=(e,n,i,o=bv)=>o((e-n)/(i-n)),ra=(e,n,i,o,l)=>e<o?gn(e,n,i):1-gn(e,o,l),ks=(e,n,i,o)=>e<n||e>n+i?0:4*o*((e-n)/i)*(1-(e-n)/i);class th{constructor(n,i){$e(this,"x",0);$e(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 x0={hop:{name:"hop",dur:2,pose:e=>({squash:1+.22*ra(e,0,.14,.16,.22),lift:ks(e,.2,.46,.3),lid:.22*ra(e,0,.12,.16,.22),eyeScale:1+.08*ra(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?gn(e,.1,.55,$c):1-gn(e,1.5,1.75),i=e>1.6&&e<2.6?Math.sin(Lr*(e-1.6)*1.4)*.05*(1-gn(e,1.9,2.6)):0;return{spin:Lr*bv(gn(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:Sn(.22,.1,ba(n)),earR:Sn(.22,.1,ba(n))}},beats:[[1.55,e=>{e.squash(1.5),e.ears(1.5,1.5)}]]},hopSpin:{name:"hopSpin",dur:2.9,pose:e=>({spin:Lr*bv(gn(e,.55,1.35)),lift:ks(e,.55,.8,.3),squash:1+.2*gn(e,.1,.45),lid:.2*ra(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*ba(gn(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 o=0,l=0;n.forEach((u,h)=>{o+=ks(e,u,.3,.13),e>u-.1&&(l=Sn(h?i[h-1]:0,i[h],gn(e,u-.1,u+.12,$c)))});const c=ra(e,0,.12,1.7,1.95);return{lift:o,tilt:l*(1-gn(e,1.3,1.6)),happy:c,blush:c,mouth:c>.5?2:0,mouthOpen:.95,earL:Sn(.22,.12,c),earR:Sn(.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=ra(e,.15,.7,3.1,3.55),i=ba((e-.3)/3),o=Math.sin(Lr*(1.6*i+.35*(i-Math.sin(Lr*i)/Lr)))*n;return{tilt:.115*o,look:[.014*o,-.004*n],mouth:n>.5?1:0,lid:.12*n,blush:.32*n,earL:Sn(.22,.16,n),earR:Sn(.22,.16,n)}}},flick:{name:"flick",dur:1.8,pose:e=>({look:[.035*ra(e,.05,.2,1.1,1.4),.012*ra(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?gn(e,.05,.45,$c):1-gn(e,1.6,1.95);return{tilt:.17*n,earR:Sn(.22,.03,ba(n)),earL:Sn(.22,.42,ba(n)),eyeScale:1+.1*ba(n),look:[0,.03*ba(n)]}},beats:[[1.95,e=>e.tilt(-.9)]]},look:{name:"look",dur:3,pose:e=>{const n=e<.9?-.42*gn(e,.1,.4,jF):e<1.9?Sn(-.42,.42,gn(e,.95,1.3)):.42*(1-gn(e,2,2.35)),i=e<.85?-gn(e,0,.1):e<1.85?Sn(-1,1,gn(e,.85,.95)):1-gn(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?gn(e,0,1):0,i=ra(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:Sn(.22,.03,n),earR:Sn(.22,.03,n),tilt:.03*Math.sin(Lr*e*.9)*n,happy:ra(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?gn(e,.1,2):0,i=n*Math.max(0,Math.sin(Lr*e*.8)),o=ra(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+ks(e,2.42,.22,.07),squash:1+.05*n,earL:.22+.2*n,earR:.22+.2*n,eyeScale:1+.16*o}},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=ra(e,.14,.16,.42,.5),i=ra(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=ra(e,.08,.2,1.6,1.9);return{earL:Sn(.22,.05,n),earR:Sn(.22,.05,n),eyeScale:1+.12*n,lift:ks(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),o=e%.36/.36,l=ra(e,0,.2,2.7,3),c=i===0?0:i%2?.13:-.13,u=i%2?-.13:.13;return{tilt:Sn(c,u,$c(o*1.4))*l,lift:e<2.6?ks(o,.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?gn(e,.05,.6,$c):1-gn(e,1.4,1.52),i=ba(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:ks(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*ra(e,.16,.24,.4,.75)}),beats:[[.18,e=>{e.squash(1.6),e.tilt(1.6)}]]}},wF=[["flick",3],["tilt",3],["look",2],["sway",2],["stretch",2],["spin",1]],kF=[["flick",3],["sway",3]],Wj=8,Jj=12,SF=150,CF=45e3,NF=1/8;class EF{constructor(){$e(this,"act",null);$e(this,"name",null);$e(this,"at",0);$e(this,"beat",0);$e(this,"last",0);$e(this,"weight",0);$e(this,"carried",!1);$e(this,"squash",new th(220,11));$e(this,"roll",new th(55,2.6));$e(this,"earL",new th(260,9));$e(this,"earR",new th(260,9));$e(this,"lift",0);$e(this,"vy",0);$e(this,"tilt",0);$e(this,"turn",0);$e(this,"vTilt",0);$e(this,"vTurn",0);$e(this,"quiet",0);$e(this,"next",0);$e(this,"lastAct",null);$e(this,"blink",-1e9);$e(this,"blinkAt",0);$e(this,"hold",0)}get playing(){return this.name}play(n,i,o=!1){this.carried||o&&this.act&&(i-this.at)/1e3<.8||(this.act=x0[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=x0.land,this.name="land",this.at=i,this.beat=0))}idle(n,i,o,l=!1){if(this.quiet=o?0:this.quiet+i,!this.next){this.next=n+(Wj+Math.random()*Jj)*1e3;return}if(o||this.act||this.carried||n<this.next)return;if(!l&&this.quiet>SF*1e3){this.next=n+CF,this.quiet=0,this.play("doze",n);return}const c=(l||this.lastAct==="doze"?kF:wF).filter(([v])=>v!==this.lastAct),u=c.reduce((v,[,y])=>v+y,0);let h=Math.random()*u,f=c[0][0];for(const[v,y]of c)if(h-=y,h<=0){f=v;break}this.next=n+(Wj+Math.random()*Jj)*1e3,this.play(!l&&Math.random()<NF?"puff":f,n)}apply(n,i){const o=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===x0.land?1:ba(l/.1))*ba((c.dur-l)/.18):Math.max(0,this.weight-o/.18),this.hold=this.carried?Math.min(1,this.hold+o/.12):Math.max(0,this.hold-o/.2);const u=this.weight,h=this.carried?{squash:.8,tilt:.13*Math.sin(Lr*1.1*l),eyeScale:1.1,mouth:1}:c?c.pose(l):{};if(c&&!this.carried)for(const[L,I]of c.beats??[])l<L||this.beat>L||(this.beat=L+1,I({squash:H=>this.squash.kick(H),tilt:H=>this.roll.kick(H),ears:(H,O)=>{this.earL.kick(H),this.earR.kick(O)}}));const f=(h.lift??0)*u+.22*this.hold,v=o?(f-this.lift)/o:0,y=v-this.vy;this.lift=f,this.vy=v,this.earL.kick(1.4*y),this.earR.kick(1.4*y);const p=4,w=o/p;for(let L=0;L<p;L++)this.squash.step(w),this.roll.step(w),this.earL.step(w),this.earR.step(w);const b=(h.tilt??0)*u+this.roll.value,k=(h.spin??0)*u,S=o?(b-this.tilt)/o:0,N=o?(k-this.turn)/o:0,C=S-this.vTilt,A=N-this.vTurn;this.tilt=b,this.vTilt=S,this.turn=k,this.vTurn=N,this.earL.kick(-.5*C-.4*A),this.earR.kick(.5*C+.4*A);const E=n.squash,T=(L,I)=>{I!==void 0&&(n[L]=Sn(n[L],I,u))};if(T("eyeScale",h.eyeScale),T("lid",h.lid),T("open",h.open),T("blush",h.blush),T("mouthOpen",h.mouthOpen),T("earL",h.earL),T("earR",h.earR),T("spin",h.spin===void 0?void 0:n.spin+h.spin),T("yaw",h.yaw===void 0?void 0:n.yaw+h.yaw),h.look&&(n.look=[Sn(n.look[0],h.look[0],u),Sn(n.look[1],h.look[1],u)]),u>.5)for(const L of["kind","happy","mouth"]){const I=h[L];I!==void 0&&(n[L]=I)}const R=h.squash===void 0?1:h.squash;n.squash=ba(E*Sn(1,R,u)+this.squash.value+.025*Math.abs(this.roll.value)*u,.82,1.24),n.tilt+=b,n.lift+=f,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 _=(i-this.blink)/160;return _>=0&&_<=1&&(n.open*=1-.94*Math.sin(Math.PI*_)),{face:n,zoom:h.zoom?Sn(1,h.zoom,u):1}}shake(){this.squash.kick(-2.2)}}const TF=64,AF=200,MF=33,_F=800;function ew(){try{return VS({gpu:!0})??null}catch{return null}}class U6{constructor(){$e(this,"persona",new EF);$e(this,"input",{motion:"sleep",mood:"normal",lookX:0,lookY:0});$e(this,"color",0);$e(this,"crown",!1);$e(this,"near",!1);$e(this,"onFrame",null);$e(this,"rig",new RP);$e(this,"canvases",new Map);$e(this,"reduced",matchMedia("(prefers-reduced-motion: reduce)"));$e(this,"spare",null);$e(this,"running",!1);$e(this,"frame",0);$e(this,"last",0);$e(this,"drawn",0);$e(this,"stirred",0);$e(this,"visibility",()=>{cancelAnimationFrame(this.frame),document.hidden||(this.frame=requestAnimationFrame(this.tick))});$e(this,"tick",n=>{var v;this.frame=requestAnimationFrame(this.tick);const i=[...this.canvases].filter(([y])=>y.offsetWidth>0);if(!this.running||!i.length){this.last=0;return}const o=this.input,l=o.motion!=="idle"&&o.motion!=="sleep",c=i.every(([y])=>y.offsetWidth<TF);if(c&&((this.near||this.persona.playing||l)&&(this.stirred=n),n-this.drawn<(n-this.stirred<_F?MF:AF)-4))return;this.drawn=n,(v=this.onFrame)==null||v.call(this,n),o.reduced=this.reduced.matches;const u=this.rig.frame(n,o);!o.reduced&&!c&&this.persona.idle(n,this.last?Math.min(50,n-this.last):16,l,o.motion==="sleep"),this.last=n;const{face:h,zoom:f}=this.persona.apply(u,n);for(const[y,p]of i){const w=y.getContext("2d"),b=Math.round(y.offsetWidth*Math.min(2,devicePixelRatio||1)),k=p.zoom*f;w&&(p.figure||(p.figure=this.spare??ew(),this.spare=null),p.figure&&(y.width!==b?y.width=y.height=b:w.clearRect(0,0,b,b),p.figure.paint(w,b,this.color,h,{zoom:k,shadow:p.shadow}),this.crown&&(w.globalAlpha=Math.min(1,Math.max(0,Math.cos(h.spin)*1.6-.2)),YS(w,b,$S(h,k)),w.globalAlpha=1)))}})}shake(){this.rig.shake()}add(n,i,o=!0){return this.canvases.set(n,{zoom:i,shadow:o,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=ew(),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 o of this.canvases.values())(i=o.figure)==null||i.dispose(),o.figure=null}}const b0=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function $6(e,n,i,o){const l=j.useRef(null);j.useEffect(()=>{const h=l.current;l.current={chat:i,id:o},!(!h||h.chat!==i||!o||o===h.id)&&(b0()||e.play("listen",performance.now()))},[o,i]);const c=j.useRef(!1);j.useEffect(()=>{if(!b0()){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 u=j.useRef(null);j.useEffect(()=>{const h=n.view.done;!h||u.current===n.view.startedAt||(u.current=n.view.startedAt,!(h.outcome!=="completed"||b0())&&e.play(["joy","hopSpin","dance"][Math.floor(Math.random()*3)],performance.now()))},[n.view.done,n.view.startedAt])}function RF(e,n,i,o,l,c=0){const v=n.offsetWidth,y=n.offsetHeight,p=n.offsetLeft,w=n.offsetTop,b=Math.max(300,Math.round(i*.4));e.style.maxHeight="";const k=e.hasAttribute("data-fit"),S=e.offsetHeight,N=Z=>Z==="left"||Z==="right",C=Z=>Z==="left"?p-10-8:Z==="right"?i-p-v-10-8:Z==="below"?o-w-y-10-8:w-10-8,A=p+v/2>i/2,E=Z=>k?N(Z)?Math.min(b,Math.max(160,C(Z))):Math.min(b,A?p+v-8:i-p-8):e.offsetWidth,T=Z=>N(Z)?E(Z)<=C(Z):Math.min(120,S)<=C(Z),R=c>.05?"right":c<-.05?"left":null,L=(R==="left"||R===null&&C("left")>=C("right")?["left","right"]:["right","left"]).find(T)??(C("below")>=C("above")?"below":"above"),I=e.dataset.side,O=I!==void 0&&I!==L&&N(I)===N(L)&&T(I)&&C(I)+40>=C(L)?I:L,P=k&&(O==="left"||!N(O)&&A),U=O==="left"?p-10:O==="right"?p+v+10:A?p+v:p;e.style.width="",e.style.maxWidth=k?`${E(O)}px`:"",P?(e.style.left="",e.style.right=`${i-U}px`):(e.style.right="",k&&(e.style.left=`${U}px`));const Y=e.offsetWidth,K=k?P?U-Y:U:O==="left"?p-10-Y:O==="right"?p+v+10:Math.min(Math.max(8,p+v-Y),Math.max(8,i-Y-8)),q=l&&K<l.right&&K+Y>l.left?l.bottom+6:0,Q=Math.min(Math.max(8,q),Math.max(8,o-140));let V;O==="below"?(V=Math.max(8,Math.min(w+y+10,o-8-Math.min(S,120))),e.style.maxHeight=`${Math.max(40,o-V-8)}px`):O==="above"?(e.style.maxHeight=`${Math.max(40,w-10-Q)}px`,V=Math.max(Q,w-10-e.offsetHeight)):(e.style.maxHeight=`${Math.max(120,o-Q-8)}px`,V=Math.min(Math.max(Q,w+6),Math.max(Q,o-e.offsetHeight-8))),k||(e.style.left=`${K}px`),e.style.top=`${V}px`,e.dataset.side=O,e.style.setProperty("--npc-tail",N(O)?`${Math.min(e.offsetHeight-18,Math.max(18,w+Math.min(v,y)/2-V))}px`:`${Math.min(Y-18,Math.max(18,p+v/2-K))}px`)}const tw=.06,OF=matchMedia("(prefers-reduced-motion: reduce)");function nh({text:e,limit:n,streaming:i=!1}){const[,o]=j.useState(0),l=j.useRef({text:"",count:0,rate:tw,at:performance.now()}),c=performance.now(),u=l.current;u.count=Math.min(u.text.length,u.count+u.rate*(c-u.at)),u.at=c,e!==u.text&&(u.text=e,u.count=Math.min(u.count,e.length),u.rate=Math.max(tw,(e.length-u.count)/n));const h=!OF.matches&&u.count<e.length;j.useEffect(()=>{if(!h)return;const v=requestAnimationFrame(()=>o(y=>y+1));return()=>cancelAnimationFrame(v)});const f=h?e.slice(0,Math.floor(u.count)).replace(/[\uD800-\uDBFF]$/,""):e;return r.jsxs(r.Fragment,{children:[f,(h||i)&&r.jsx("i",{className:"jv-npc-caret"})]})}function DF({className:e,children:n,onReading:i}){const o=j.useRef(null),l=j.useRef(null),c=j.useRef(i),[u,h]=j.useState(!1);return c.current=i,j.useEffect(()=>{const f=o.current,v=l.current;if(!f||!v)return;let y=!0,p=0;const w=()=>{f.scrollTop=f.scrollHeight,p=f.scrollTop},b=()=>{y&&w(),h(f.scrollTop>1)},k=()=>{const N=f.scrollHeight-f.scrollTop-f.clientHeight<4;N&&!y?(y=!0,p=f.scrollTop,c.current(!1)):!N&&y&&(f.scrollTop<p-1?(y=!1,c.current(!0)):w()),h(f.scrollTop>1)},S=new ResizeObserver(b);return S.observe(v),S.observe(f),b(),f.addEventListener("scroll",k,{passive:!0}),()=>{S.disconnect(),f.removeEventListener("scroll",k),c.current(!1)}},[]),r.jsx("span",{ref:o,className:`${e} jv-npc-tail`,"data-above":u||void 0,children:r.jsx("span",{ref:l,children:n})})}const V6={think:s9,mutter:Z9,read:j9,write:F9,run:T3,script:h9,compact:n9,retry:du,ask:Y4,say:z9,chat:W4,tool:iE},jv=e=>m("npc.duration",{value:la(Math.max(0,e)/1e3,{maximumFractionDigits:1,minimumFractionDigits:1})}),zF={completed:"npc.done",interrupted:"npc.done.interrupted",failed:"npc.done.failed"};function G6({view:e,name:n,cat:i,area:o,avoid:l,layout:c,facing:u,toolbar:h,onHint:f}){var U,Y,K;const v=j.useRef(null),y=j.useRef(null),[p,w]=j.useState(!1),[,b]=j.useState(0);j.useLayoutEffect(()=>{c.current=()=>{var ue;if(!v.current||!i.current||!o.current)return;const Q=o.current.getBoundingClientRect(),V=l.current?l.current.getBoundingClientRect().top-Q.top:Q.height,Z=(ue=y.current)==null?void 0:ue.getBoundingClientRect();p?v.current.removeAttribute("data-fit"):v.current.setAttribute("data-fit",""),RF(v.current,i.current,Q.width,V,Z?{left:Z.left-Q.left,right:Z.right-Q.left,bottom:Z.bottom-Q.top}:null,u())},c.current();const q=new ResizeObserver(()=>{var Q;return(Q=c.current)==null?void 0:Q.call(c)});for(const Q of[v.current,y.current])Q&&q.observe(Q);return()=>{q.disconnect(),c.current=null}},[p]);const k=e.steps.some(q=>q.state==="running");j.useEffect(()=>{if(!p||!k)return;const q=setInterval(()=>b(Q=>Q+1),200);return()=>clearInterval(q)},[p,k]),j.useEffect(()=>{if(!p)return;const q=Q=>{Q.key==="Escape"&&w(!1)};return addEventListener("keydown",q),()=>removeEventListener("keydown",q)},[p]);const S=(U=e.steps[0])==null?void 0:U.id;j.useEffect(()=>{w(!1)},[S]);const[N,C]=j.useState(!1),[A,E]=j.useState(!1),[T,R]=j.useState(null);j.useEffect(()=>{if(!N)return;const q=Q=>{var V;(V=v.current)!=null&&V.contains(Q.target)||C(!1)};return document.addEventListener("pointermove",q),()=>document.removeEventListener("pointermove",q)},[N]);const _=N||A;j.useEffect(()=>{var q;R(_?((q=e.shown)==null?void 0:q.id)??null:null)},[_]);const L=T&&e.steps.find(q=>q.id===T)||e.shown,I=L?L.look:e.done?"action":null;let H=null;if((L==null?void 0:L.look)==="thought"||(L==null?void 0:L.look)==="mutter"){const q=(L.line??"").replace(/\n\s*\n\s*/g,`
828
+
829
+ `).trim(),Q=r.jsx(nh,{text:q,limit:300,streaming:L.look==="thought"&&L.state==="running"},L.id),[V,Z]=m("npc.mutter",{text:""}).split("");H=r.jsx(DF,{className:L.look==="thought"?"jv-npc-thought":"jv-npc-murmur",onReading:E,children:L.look==="thought"?Q:r.jsxs(r.Fragment,{children:[V,Q,Z]})},L.id)}else if((L==null?void 0:L.look)==="speech")H=r.jsx("span",{className:"jv-npc-speech",children:r.jsx(nh,{text:L.line??"",limit:1500,streaming:L.state==="running"&&L.icon==="say"},L.id)});else if(L){const q=V6[L.icon];H=r.jsxs("span",{className:"jv-npc-action","data-state":L.state,children:[r.jsx(q,{}),r.jsx(nh,{text:L.title,limit:300},L.id),L.state==="running"&&r.jsx("i",{className:"jv-npc-dots"})]})}else e.done&&(H=r.jsxs("span",{className:"jv-npc-action","data-state":e.done.outcome==="completed"?"ok":"failed",children:[e.done.outcome==="completed"?r.jsx(na,{}):r.jsx(Fl,{}),r.jsx(nh,{text:m(zF[e.done.outcome],{duration:jv(e.done.ms)}),limit:300},`done:${e.done.ms}`)]}));const O=e.steps.length>0,P=(L==null?void 0:L.icon)==="ask"&&L.state==="running";return j.useEffect(()=>{H||C(!1)},[!H]),r.jsxs(r.Fragment,{children:[h==null?void 0:h(y,()=>w(!1)),r.jsx("div",{ref:v,className:"jv-npc","data-open":p||void 0,"data-look":p?void 0:I??void 0,"data-kind":L==null?void 0:L.icon,"data-fading":!p&&!L&&((Y=e.done)==null?void 0:Y.fading)||void 0,hidden:!p&&!H,onPointerEnter:q=>{q.pointerType==="mouse"&&C(!0)},onPointerLeave:()=>C(!1),children:p?r.jsxs("section",{className:"jv-npc-panel","aria-label":m("npc.panel"),children:[r.jsxs("header",{children:[r.jsx("strong",{children:m("npc.panel")}),e.startedAt>0&&r.jsx("span",{children:jv((e.endedAt??Date.now()+e.skew)-e.startedAt)}),r.jsx("button",{type:"button",onClick:()=>w(!1),"aria-label":m("npc.collapse"),title:m("npc.collapse"),children:r.jsx(B9,{})})]}),r.jsx("ol",{children:e.steps.map(q=>r.jsx(LF,{step:q,skew:e.skew},q.id))})]}):r.jsxs(r.Fragment,{children:[I==="speech"&&r.jsxs("span",{className:"jv-npc-name",children:[n,(L==null?void 0:L.to)&&r.jsx("em",{children:m("npc.to",{chat:L.to})})]}),O?r.jsx("div",{role:"button",tabIndex:0,className:"jv-npc-line",onClick:()=>w(!0),title:m("npc.expand"),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),w(!0))},children:H}):r.jsx("div",{className:"jv-npc-line",children:H}),P&&e.answer&&((K=L.options)==null?void 0:K.some(q=>q.value))&&r.jsx("div",{className:"jv-npc-options",children:L.options.map(q=>r.jsx("button",{type:"button",onClick:()=>e.answer(q.value),children:q.label},q.label))}),P&&!e.answer&&L.hint&&(f?r.jsxs("button",{type:"button",className:"jv-npc-hint",onClick:f,children:[L.hint,r.jsx(Jc,{"aria-hidden":"true"})]}):r.jsx("p",{className:"jv-npc-hint",children:L.hint}))]})})]})}function LF({step:e,skew:n}){const[i,o]=j.useState(!1),l=V6[e.icon],c=e.detail;return r.jsxs("li",{"data-state":e.state,style:e.depth?{paddingLeft:`${e.depth*16}px`}:void 0,children:[r.jsxs("button",{type:"button","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>o(u=>!u),children:[r.jsx(l,{className:"jv-npc-kind"}),r.jsx("span",{className:"jv-npc-title",children:e.title}),r.jsxs("span",{className:"jv-npc-state",children:[e.state==="running"?r.jsx(H4,{}):e.state==="ok"?r.jsx(na,{}):r.jsx(Fl,{}),m(`npc.state.${e.state}`)]}),r.jsx("span",{className:"jv-npc-time",children:jv((e.endedAt??Date.now()+n)-e.startedAt)}),c&&r.jsx(Ti,{className:"jv-npc-chevron"})]}),i&&c&&r.jsx("pre",{"data-kind":e.icon,children:c})]})}const yh="src/web/thread/ThreadPane.tsx",Bh="npm run build",BF=["export function ThreadPane({ thread, replies }: Props) {"," const scroll = useRef<HTMLDivElement>(null);"," useLayoutEffect(() => {"," scroll.current!.scrollTop = scroll.current!.scrollHeight;"," }, [thread.id]);"," …"].join(`
830
+ `),IF=["> 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(`
831
+ `),Y6={question:"npc.demo.question",options:[{value:"yes",label:"npc.demo.yes"},{value:"no",label:"npc.demo.no"}]},PF=[{kind:"think",text:"npc.demo.think1",ms:4200},{kind:"read",target:yh,ms:2600,output:BF},{kind:"think",text:"npc.demo.think2",ms:3800},{kind:"write",target:yh,ms:2600,output:["- useLayoutEffect(() => scrollToEnd(), [thread.id]);","+ useLayoutEffect(() => {","+ requestAnimationFrame(() => scrollToEnd(scroll.current));","+ }, [thread.id, replies.length]);"].join(`
832
+ `)},{kind:"mutter",text:"npc.demo.mutter1"},{kind:"run",target:Bh,ms:3200,failed:!0,output:IF},{kind:"mutter",text:"npc.demo.mutter2"},{kind:"compact",ms:3400,output:"context: 412,380 → 38,210 tokens"},{kind:"write",target:yh,ms:2e3,output:"+ const el = scroll.current; if (el) scrollToEnd(el);"},{kind:"run",target:Bh,ms:3e3,output:["> vite build","✓ 2331 modules transformed.","✓ built in 4.9s"].join(`
833
+ `)},{kind:"say",text:"npc.demo.post",to:"npc.demo.channel"},{kind:"ask",...Y6},{kind:"say",replies:{yes:"npc.demo.replyYes",no:"npc.demo.replyNo"}}],wv=[{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",...Y6}},{key:"read",label:"npc.pose.read",motion:"read",step:{kind:"read",target:yh}},{key:"work",label:"npc.pose.work",motion:"work",fast:!0,step:{kind:"run",target:Bh}},{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:Bh,failed:!0}},{key:"done",label:"npc.pose.done",motion:"stretch",mood:"happy",done:!0},{key:"groom",label:"npc.pose.groom",motion:"groom"}];function qF({controls:e,onReplay:n,toolbar:i}){const[o,l]=j.useState(!1);return r.jsxs("div",{ref:i,className:"jv-npc-toolbar",role:"toolbar","aria-label":m("npc.toolbar"),children:[r.jsxs("div",{className:"jv-npc-toolbar-row",children:[r.jsx("span",{children:m("npc.toolbar")}),r.jsx("button",{type:"button",className:"jv-npc-icon",onClick:n,"aria-label":m("npc.replay"),title:m("npc.replay"),children:r.jsx(v3,{})}),r.jsxs(Vr,{value:e.baseMood,onValueChange:c=>e.setBaseMood(c),children:[r.jsx(Yr,{className:"jv-npc-mood","aria-label":m("npc.mood"),title:m("npc.mood"),children:r.jsx(Gr,{})}),r.jsx(Kr,{className:"jv-select-menu",position:"popper",sideOffset:4,children:UN.map(c=>r.jsx(Da,{value:c,children:m(`npc.mood.${c}`)},c))})]}),r.jsxs("button",{type:"button",className:"jv-npc-toggle","aria-expanded":o,onClick:()=>l(c=>!c),children:[r.jsx(Y9,{}),m("npc.poses")]})]}),o&&r.jsx("div",{className:"jv-npc-poses",role:"group","aria-label":m("npc.poses"),children:wv.map(c=>{var u;return r.jsx("button",{type:"button","aria-pressed":((u=e.pose)==null?void 0:u.key)===c.key,onClick:()=>e.hold(c.key),children:m(c.label)},c.key)})})]})}const FF={think:"think",mutter:"mutter",read:"read",write:"write",run:"run",compact:"compact",ask:"ask",say:"say"},nw=e=>e.text?[...m(e.text)].slice(0,e.typed).join(""):"";function HF(e){var o;if(e.kind==="think"||e.kind==="mutter")return m(`npc.step.${e.kind}`);if(e.kind==="ask"&&e.answer)return m("npc.step.ask.ok",{answer:m(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 m(`npc.step.${i}.${n}`,{target:((o=e.target)==null?void 0:o.split("/").pop())??"",chat:e.to?`#${m(e.to)}`:""})}function aw(e){var o;const n=e.kind==="think"?"thought":e.kind==="mutter"?"mutter":e.kind==="say"||e.kind==="ask"?"speech":"action",i=e.kind==="ask"?m(e.question):nw(e);return{id:String(e.id),look:n,icon:FF[e.kind],state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:0,title:HF(e),line:n==="action"?void 0:i,to:e.to?`#${m(e.to)}`:void 0,options:e.kind==="ask"&&e.state==="running"?(o=e.options)==null?void 0:o.map(l=>({label:m(l.label),value:l.value})):void 0,detail:e.kind==="ask"?m(e.question):e.text?nw(e):e.output}}const j0={steps:[],phase:"before",startedAt:0,endedAt:null,flash:null,shake:0,recapUntil:0},UF=40,iw=6e3,rw=500,$F={think:"think",mutter:"work",read:"read",write:"work",run:"work",compact:"yawn",ask:"ask",say:"turn"};class w0 extends Error{}const VF=e=>({...e,id:-1,state:e.failed?"failed":"running",startedAt:Date.now(),endedAt:null,typed:e.text?[...m(e.text)].length:0});function GF(e,n){const[i,o]=j.useState(j0),[l,c]=j.useState(n),[u,h]=j.useState(0),[f,v]=j.useState(null),[,y]=j.useState(0),p=j.useRef(null);j.useEffect(()=>{if(!e||f)return;let T=!0;const R=new Set,_=O=>new Promise((P,U)=>{const Y=setTimeout(()=>{R.delete(Y),T?P():U(new w0)},O);R.add(Y)}),L=(O,P)=>o(U=>({...U,steps:U.steps.map(Y=>Y.id===O?{...Y,...P}:Y)})),I=(O,P)=>o(U=>({...U,flash:{mood:O,until:Date.now()+P}})),H=async(O,P,U)=>{const Y=[...m(P)].length,K=U?Math.max(16,U/Y):UF;for(let q=1;q<=Y;q++)L(O,{typed:q}),await _(K)};return(async()=>{o({...j0}),await _(700);const O=Date.now();let P="";o(Y=>({...Y,phase:"turn",startedAt:O}));for(const[Y,K]of PF.entries()){const{ms:q,failed:Q,replies:V,...Z}=K,ue=V?V[P]:K.text;if(o(z=>({...z,steps:[...z.steps,{...Z,text:ue,id:Y,state:"running",startedAt:Date.now(),endedAt:null,typed:0}]})),K.kind==="ask"){if(P=await new Promise(z=>{p.current=z}),p.current=null,!T)throw new w0;L(Y,{state:"ok",endedAt:Date.now(),answer:K.options.find(z=>z.value===P)});continue}ue?await H(Y,ue,K.kind==="think"?q??null:null):await _(q??1e3),(K.kind==="mutter"||K.kind==="say")&&await _(1100),L(Y,{state:Q?"failed":"ok",endedAt:Date.now()}),Q&&(o(z=>({...z,shake:z.shake+1})),I("dizzy",2600),await _(900))}const U=Date.now();for(o(Y=>({...Y,phase:"stretch",endedAt:U,recapUntil:U+iw})),U-O>2e4&&I("happy",3200),await _(2200);;)o(Y=>({...Y,phase:"idle"})),await _(9e3),o(Y=>({...Y,phase:"groom"})),await _(2800)})().catch(O=>{if(!(O instanceof w0))throw O}),()=>{var O;T=!1;for(const P of R)clearTimeout(P);(O=p.current)==null||O.call(p,"")}},[e,u,f]),j.useEffect(()=>{var L;const T=Date.now(),R=[((L=i.flash)==null?void 0:L.until)??0,i.recapUntil-rw,i.recapUntil].filter(I=>I>T);if(!R.length)return;const _=setTimeout(()=>y(I=>I+1),Math.min(...R)-T+20);return()=>clearTimeout(_)});const w=wv.find(T=>T.key===f)??null,b=Date.now(),k=w?null:i.phase==="turn"?[...i.steps].reverse().find(T=>T.state==="running")??null:null,S=w?w.motion:k?$F[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,A=w?w.step?VF(w.step):null:k??(i.phase==="turn"?i.steps.at(-1)??null:null);return{...{view:{steps:i.steps.map(aw),shown:A?aw(A):null,startedAt:i.startedAt,endedAt:i.endedAt,skew:0,answer:T=>{var R;return(R=p.current)==null?void 0:R.call(p,T)},done:w!=null&&w.done?{ms:31400,outcome:"completed",fading:!1}:!w&&C?{ms:i.endedAt-i.startedAt,outcome:"completed",fading:b>=i.recapUntil-rw}:null},motion:S,fast:w?!!w.fast:(k==null?void 0:k.kind)==="write"||(k==null?void 0:k.kind)==="run",mood:(w==null?void 0:w.mood)??N??l,shake:i.shake,canRecap:!w&&i.endedAt!==null&&!C,showRecap:()=>o(T=>({...T,recapUntil:Date.now()+iw}))},controls:{pose:w,baseMood:l,setBaseMood:c,replay:()=>{v(null),h(T=>T+1)},hold:T=>{v(T),o(R=>{var _;return{...j0,shake:R.shake+((_=wv.find(L=>L.key===T))!=null&&_.shake?1:0)}})}}}}const YF=4e3,ow={turn:null,last:null,skew:0};function KF(e,n){const i=[...e.steps];let o=e.dropped;for(const l of n)if(l.op==="step"){const c=i.findIndex(u=>u.id===l.step.id);c>=0?i[c]=l.step:i.push(l.step)}else if(l.op==="text"){const c=i.findIndex(v=>v.id===l.id),u=i[c];if(!u)continue;const h=(u.text??"")+l.append,f=Math.max(0,h.length-YF);i[c]={...u,text:h.slice(f),omitted:(u.omitted??0)+f}}else{const c=i.findIndex(u=>u.id===l.id);c>=0&&(i.splice(c,1),o++)}return{...e,steps:i,dropped:o}}function XF(e){const[n,i]=j.useState(ow);return j.useEffect(()=>{if(i(ow),!e)return;const o=new EventSource(`/api/bots/${encodeURIComponent(e)}/live`),l=c=>JSON.parse(c.data);return o.addEventListener("snapshot",c=>{const u=l(c);i(h=>({...h,turn:u.turn,skew:u.now-Date.now()}))}),o.addEventListener("start",c=>{const{turn:u}=l(c);i(h=>({...h,turn:u}))}),o.addEventListener("patch",c=>{const{patches:u}=l(c);i(h=>h.turn?{...h,turn:KF(h.turn,u)}:h)}),o.addEventListener("end",c=>{const{outcome:u,endedAt:h}=l(c);i(f=>f.turn?{...f,turn:null,last:{...f.turn,outcome:u,endedAt:h}}:f)}),()=>o.close()},[e]),n}const k0=new Set(["messages.read","messages.search","chats.list","chats.info","threads.list","members.list","bots.list","sections.list","history.read","list","describe"]),oa=e=>e.state==="running"?"running":e.state==="failed"?"failed":"ok",S0=e=>(e==null?void 0:e.split("/").filter(Boolean).pop())??"",QF=e=>{const n=(e??"").split(`
834
+ `)[0].trim();return n.length>40?`${n.slice(0,39)}…`:n},sw=e=>e.type==="channel"?`#${e.title}`:e.title;function C0(e){return e?e.omitted?`${e.head}
835
+ ${m("npc.live.omitted",{count:la(e.omitted)})}
836
+ ${e.tail}`:e.head+e.tail:""}const lw=e=>e.omitted?`${m("npc.live.omitted",{count:la(e.omitted)})}
837
+ `:"";function N0(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 ZF(e,n,i){const o={id:e.id,state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:n},l=(f,v,y)=>({...o,look:"action",icon:f,title:v,detail:y});switch(e.kind){case"thinking":return{...o,look:"thought",icon:"think",title:m("npc.step.think"),line:e.text??"",detail:lw(e)+(e.text??"")};case"text":return{...o,look:"mutter",icon:"mutter",title:m("npc.step.mutter"),line:e.text??"",detail:lw(e)+(e.text??"")};case"compaction":return l("compact",m(`npc.live.compact.${oa(e)}`),e.tokensBefore!=null&&e.tokensAfter!=null?m("npc.live.tokens",{before:la(e.tokensBefore),after:la(e.tokensAfter)}):C0(e.output));case"retry":return l("retry",e.state==="running"?m("npc.live.retry.running",{attempt:e.attempt??1,max:e.maxAttempts??1}):m(`npc.live.retry.${oa(e)}`),C0(e.output))}const c=e.input??{},u=C0(e.output),h=[c.path??c.command??c.args,u].filter(Boolean).join(`
838
+
839
+ `);switch(e.tool){case"read":return l("read",m(`npc.live.read.${oa(e)}`,{target:S0(c.path)}),h);case"edit":return l("write",m(`npc.live.edit.${oa(e)}`,{target:S0(c.path)}),h);case"write":return l("write",m(`npc.live.write.${oa(e)}`,{target:S0(c.path)}),h);case"bash":return l("run",m(`npc.live.run.${oa(e)}`,{target:QF(c.command)}),h);case"bash_job":{const f=c.command??"";return c.action==="list"?l("read",m(`npc.live.jobList.${oa(e)}`),h):c.action==="read"?l("read",m(`npc.live.jobRead.${oa(e)}`,{target:f}),h):c.action==="wait"?l("run",m(`npc.live.jobWait.${oa(e)}`,{target:f}),h):c.action==="stop"?l("run",m(`npc.live.jobStop.${oa(e)}`,{target:f}),h):l("run",m(`npc.live.tool.${oa(e)}`,{tool:"bash_job"}),h)}case"codemode":return l("script",m(`npc.live.script.${oa(e)}`),h);case"chat":return WF(e,o,i,u);default:return l("tool",m(`npc.live.tool.${oa(e)}`,{tool:e.tool??""}),h)}}function WF(e,n,i,o){const l=e.input??{},c=l.action??"",u=l.chat,h=u&&(u.id===null?u.type!=="dm":u.id!==i)?sw(u):void 0;if(c==="messages.send")return{...n,look:"speech",icon:"say",to:h,line:l.text??"",detail:[l.text,e.state==="failed"?o:""].filter(Boolean).join(`
840
+
841
+ `),title:e.state==="failed"?m("npc.live.sendFailed"):h?m(`npc.step.post.${e.state==="running"?"running":"ok"}`,{chat:h}):m(`npc.step.say.${e.state==="running"?"running":"ok"}`)};if(c==="messages.ask"){const y=JF(e);return{...n,look:"speech",icon:"ask",to:h,line:l.text??"",options:(l.options??[]).map(p=>({label:p})),hint:h?m("npc.live.answerIn",{chat:h}):m("npc.live.answerBelow"),detail:[l.text,...(l.options??[]).map(p=>`· ${p}`),o].filter(Boolean).join(`
842
+ `),title:e.state==="running"?m("npc.step.ask.running"):y?m("npc.step.ask.ok",{answer:y}):m(e.state==="failed"?"npc.live.askFailed":"npc.live.askClosed")}}if(c==="environments.switch")return{...n,look:"action",icon:"tool",title:m(`npc.live.switch.${oa(e)}`),detail:o};if(c==="context.handoff")return{...n,look:"action",icon:"compact",title:m(`npc.live.handoff.${oa(e)}`),detail:[l.text,o].filter(Boolean).join(`
843
+
844
+ `)};const f=u?sw(u):"",v=k0.has(c)?f?m(`npc.live.browse.${e.state==="running"?"running":"ok"}`,{chat:f}):m(`npc.live.browseAll.${e.state==="running"?"running":"ok"}`):m(`npc.live.tool.${oa(e)}`,{tool:c||"chat"});return{...n,look:"action",icon:k0.has(c)?"chat":"tool",title:e.state==="failed"&&k0.has(c)?m("npc.live.tool.failed",{tool:c}):v,detail:o}}function JF(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(m("common.listSeparator"))}catch{return null}}function cw(e,n){const i=new Map(e.steps.map(l=>[l.id,l.parentId])),o=l=>{let c=0,u=l.parentId;for(;u&&c<4;)c++,u=i.get(u)??null;return c};return e.steps.map(l=>ZF(l,o(l),n))}function ah(e){var i;const n=((i=e.line)==null?void 0:i.length)??0;if(e.look==="speech"){const o=Math.min(7e3,Math.max(2500,1500+50*n))+Math.min(1500,n/.06);return{firm:o,light:o}}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 eH=4e3,uw=1500;function dw(e,n,i,o){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 u=[];for(const k of e.filter(S=>S.state!=="running"&&S.endedAt!==null&&ah(S).firm).sort((S,N)=>S.endedAt-N.endedAt)){const S=l(k.endedAt),N=u.at(-1);N&&k.look==="speech"&&(N.end=Math.min(N.end,Math.max(N.start+uw,S)));const C=Math.max(S,(N==null?void 0:N.end)??0);C-S>eH||u.push({step:k,start:C,end:C+ah(k).firm})}const h=(c==null?void 0:c.look)==="speech"?c:null;if(h){const k=l(h.startedAt);for(let S=u.length-1;S>=0;S--){const N=u[S];N.start>=k&&N.start>n?u.splice(S,1):N.end>k&&(N.end=Math.max(N.start+uw,k))}}let f=null;for(const k of e){if(k.state==="running"||k.endedAt===null||!ah(k).light)continue;const S=l(k.endedAt)+ah(k).light;S>n&&(!f||k.endedAt>=f.step.endedAt)&&(f={step:k,end:S})}const v=u.find(k=>k.start<=n&&n<k.end),y=(v==null?void 0:v.step)??(h||c&&c.look!=="thought"||f==null?void 0:f.step),p=y??h??c??(o?e.at(-1)??null:null),w=[...u.flatMap(k=>[k.start,k.end]),(f==null?void 0:f.end)??0].filter(k=>k>n);return{shown:p,lingering:!!y,next:w.length?Math.min(...w):0,wordsEnd:((b=u.at(-1))==null?void 0:b.end)??0}}const hw=6e3,fw=500,tH=2e4,nH=10*6e4;function K6(e,n,i,o){var _;const{turn:l,last:c,skew:u}=XF(e),[h,f]=j.useState(null),[v,y]=j.useState(0),[p,w]=j.useState(0),[,b]=j.useState(0),k=j.useRef(new Set),S=j.useMemo(()=>l?cw(l,n):c?cw(c,n):[],[l,c,n]);j.useEffect(()=>{for(const L of(l==null?void 0:l.steps)??[])L.state==="failed"&&!k.current.has(L.id)&&(k.current.add(L.id),y(I=>I+1),f({mood:"dizzy",until:Date.now()+2600}))},[l]),j.useEffect(()=>{c&&(k.current.clear(),w(Math.max(Date.now(),dw(S,Date.now(),u,!1).wordsEnd)+hw),c.outcome==="completed"&&c.endedAt-c.startedAt>tH&&f({mood:"happy",until:Date.now()+3200}))},[c]);const N=Date.now(),C=dw(S,N,u,l!==null),A=C.shown,E=S.filter(L=>L.state==="running").sort((L,I)=>I.startedAt-L.startedAt)[0],T=E&&E.look!=="thought"?N0(E):C.lingering&&A?N0(A):E?N0(E):l?{motion:"think",fast:!1}:o,R=!l&&!A&&c!==null&&N<p;return j.useEffect(()=>{const L=[(h==null?void 0:h.until)??0,p-fw,p,C.next].filter(H=>H>Date.now()),I=setTimeout(()=>b(H=>H+1),L.length?Math.min(...L)-Date.now()+20:1e3);return()=>clearTimeout(I)}),{view:{steps:S,shown:A,skew:u,startedAt:((_=l??c)==null?void 0:_.startedAt)??0,endedAt:l?null:(c==null?void 0:c.endedAt)??null,done:R?{ms:c.endedAt-c.startedAt,outcome:c.outcome,fading:N>=p-fw}:null},motion:T.motion,fast:T.fast,mood:h&&h.until>N?h.mood:i,shake:v,canRecap:!l&&c!==null&&!R&&N+u-c.endedAt<nH,showRecap:()=>w(Date.now()+hw)}}const X6="jarvy-floating-bot",Vc=10,aH=4,Gc=.3,iH=.86,ih=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,rh=new URLSearchParams(location.search).get("npc")==="demo",rH={zz:r.jsxs(r.Fragment,{children:[r.jsx("i",{children:"z"}),r.jsx("i",{children:"Z"})]}),ask:"?",sweat:r.jsxs("svg",{viewBox:"0 0 20 28",children:[r.jsx("path",{d:"M10 1C10 1 2 13 2 18.5a8 8 0 0 0 16 0C18 13 10 1 10 1Z"}),r.jsx("ellipse",{cx:"7",cy:"18",rx:"1.8",ry:"3"})]}),sparkle:r.jsx("svg",{viewBox:"0 0 100 100",children:[[14,22,9],[86,18,7],[90,46,4.5]].map(([e,n,i])=>r.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 Q6({motion:e}){const n=AP[e];return n?r.jsx("span",{className:"jv-figure-mark","data-mark":n,"aria-hidden":"true",children:rH[n]}):null}function ff(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 oH(){try{const e=JSON.parse(localStorage.getItem(X6)??"");if(e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1)return e}catch{}return{x:1,y:0}}function sH({bot:e,chatId:n,status:i,area:o,avoid:l,lastMine:c,onOpen:u}){const h=j.useRef(null),f=j.useRef(null),v=j.useRef(oH()),y=j.useRef(null),p=j.useRef(!1),w=j.useRef(null),[b]=j.useState(()=>new U6),k=b.input,S=b.persona,[N,C]=j.useState(!1),A=j.useRef(null),E=GF(rh,e.mood),T=K6(rh?null:e.id,n,e.mood,ff(i)),R=rh?E:T;k.motion=R.motion,k.fast=R.fast,k.mood=R.mood;function _(){const O=o.current.getBoundingClientRect(),P=h.current.offsetWidth,U=l.current?l.current.getBoundingClientRect().top-O.top:O.height,K=(parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--jv-titlebar"))||0)+Math.max(Vc,Math.round(Gc*P)),q=Math.max(Vc,O.width-P-Vc),Q=Math.max(K,U-P-Vc);return{minX:Vc,minY:K,maxX:q,maxY:Q}}function L(){var Y;const O=(Y=o.current)==null?void 0:Y.getBoundingClientRect(),P=h.current;if(!O||!P)return 0;const U=O.width/2-P.offsetWidth/2;return U>0?Math.max(-1,Math.min(1,(U-P.offsetLeft)/U)):0}function I(){var U;if(!h.current||!o.current)return;const O=_(),P=h.current;P.style.left=`${O.minX+v.current.x*(O.maxX-O.minX)}px`,P.style.top=`${O.minY+v.current.y*(O.maxY-O.minY)}px`,(U=A.current)==null||U.call(A)}j.useLayoutEffect(()=>{I();const O=new ResizeObserver(I);for(const P of[o.current,l.current,h.current])P&&O.observe(P);return()=>O.disconnect()},[]);const H=i!=null&&i.error?`${i.runId??""}:${i.error}`:null;return j.useEffect(()=>{(H||R.shake)&&b.shake()},[H,R.shake]),j.useEffect(()=>{const O=Y=>{(Y.pointerType==="mouse"||Y.type==="pointerdown")&&(w.current={x:Y.clientX,y:Y.clientY})},P=Y=>{Y.relatedTarget||(w.current=null)},U=Y=>{const K=Y.target;if(K.id!=="jarvy-composer")return;const q=K.getBoundingClientRect();w.current={x:q.left+q.width/2,y:q.top+q.height/2}};return window.addEventListener("pointermove",O),window.addEventListener("pointerdown",O),document.addEventListener("pointerout",P),document.addEventListener("input",U),document.addEventListener("focusin",U),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerdown",O),document.removeEventListener("pointerout",P),document.removeEventListener("input",U),document.removeEventListener("focusin",U)}},[]),$6(S,R,n,c),b.color=(Ri[e.color]??Ri.gray).hex,b.crown=e.agent,j.useEffect(()=>{if(!f.current)return;b.onFrame=()=>{var Q;const P=h.current;if(!P)return;const U=P.getBoundingClientRect(),Y=w.current;k.lookX=Y?Math.max(-1,Math.min(1,(Y.x-U.left-U.width/2)/320)):0,k.lookY=Y?Math.max(-1,Math.min(1,(Y.y-U.top-U.height/2)/320)):0;const K=!!((Q=y.current)!=null&&Q.moved)&&k.motion==="idle";(k.faceX===void 0||!(K||k.motion==="sleep"))&&(k.faceX=L());const q=S.playing??"";P.dataset.act!==q&&(q?P.dataset.act=q:delete P.dataset.act)};const O=b.add(f.current,iH/(1+2*Gc));return C(b.start()),()=>{O(),b.stop(),b.onFrame=null}},[]),r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:h,type:"button",className:"jv-floating-bot","data-live":N||void 0,"data-motion":R.motion,title:e.name,"aria-label":m("avatar.openInfo",{name:e.name}),onPointerDown:O=>{if(O.button!==0)return;const P=O.currentTarget;P.setPointerCapture(O.pointerId),y.current={id:O.pointerId,x:O.clientX,y:O.clientY,left:P.offsetLeft,top:P.offsetTop,moved:!1}},onPointerMove:O=>{const P=y.current;if(!P||P.id!==O.pointerId)return;const U=O.clientX-P.x,Y=O.clientY-P.y;if(!P.moved&&Math.hypot(U,Y)<aH)return;!P.moved&&!ih()&&S.carry(!0,performance.now()),P.moved=!0;const K=_(),q=Math.min(K.maxX,Math.max(K.minX,P.left+U)),Q=Math.min(K.maxY,Math.max(K.minY,P.top+Y));v.current={x:K.maxX>K.minX?(q-K.minX)/(K.maxX-K.minX):0,y:K.maxY>K.minY?(Q-K.minY)/(K.maxY-K.minY):0},I()},onPointerUp:O=>{const P=y.current;!P||P.id!==O.pointerId||(y.current=null,p.current=P.moved,P.moved&&(localStorage.setItem(X6,JSON.stringify(v.current)),ih()||S.carry(!1,performance.now())))},onPointerCancel:()=>{y.current=null,ih()||S.carry(!1,performance.now())},onClick:()=>{if(p.current){p.current=!1;return}ih()||S.play("poke",performance.now()),R.canRecap?R.showRecap():u()},style:{"--jv-avatar-size":"100%"},children:[r.jsx("canvas",{ref:f,"aria-hidden":"true",style:{inset:`${-Gc*100}%`,width:`${(1+2*Gc)*100}%`,height:`${(1+2*Gc)*100}%`}}),!N&&r.jsx(Ii,{color:e.color,mood:R.mood,size:88,crown:e.agent,asleep:R.motion==="sleep"}),r.jsx(Q6,{motion:R.motion})]}),r.jsx(G6,{view:R.view,name:e.name,cat:h,area:o,avoid:l,layout:A,facing:L,toolbar:rh?(O,P)=>r.jsx(qF,{controls:E.controls,toolbar:O,onReplay:()=>{P(),E.controls.replay()}}):void 0})]})}function lH({className:e,...n}){return r.jsx("div",{"data-slot":"card",className:Ln("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...n})}function cH({className:e,...n}){return r.jsx("div",{"data-slot":"card-header",className:Ln("grid gap-1 px-5",e),...n})}function uH({className:e,...n}){return r.jsx("div",{"data-slot":"card-title",className:Ln("font-semibold leading-none",e),...n})}function dH({className:e,...n}){return r.jsx("div",{"data-slot":"card-content",className:Ln("px-5",e),...n})}function hH({bot:e,connections:n,onSaved:i,onManage:o}){return r.jsxs(lH,{className:"jarvy-model-picker jv-ui",children:[r.jsx(cH,{children:r.jsx(uH,{children:m("botModel.pickFor",{name:e.name})})}),r.jsx(dH,{children:r.jsx(ZS,{bot:e,connections:n,onSaved:i,onManage:o})})]})}function fH({chat:e,inChannel:n,bots:i,members:o,meId:l,drafts:c,composeReady:u,botName:h,activeBot:f,status:v,connections:y,activity:p,history:w,divider:b,activeQuestion:k,pane:S,onPane:N,onToggleInfo:C,find:A,onNav:E,onBot:T,hasBotDirects:R,onInvite:_,onQuote:L,onReply:I,onReact:H,onFold:O,onJump:P,onSettled:U,onSend:Y,onPreview:K,onSaveNote:q,notice:Q,createBot:V,creating:Z,updateBot:ue,onManageModels:z,error:he,chatArea:oe,transcript:D,composeWrap:F,hidden:ie,onOpenThread:$,onBotCard:X}){var He;const{messages:ee,loading:me,hasOlder:te,loadingOlder:ce,top:J,away:je,unseen:Re,toLatest:De}=w,Pe=ee.filter(at=>at.senderId===l),Le=(He=Pe[Pe.length-1])==null?void 0:He.id;return r.jsxs("main",{className:"ui-chat","aria-label":m("chat.area"),ref:oe,hidden:ie,children:[!n&&r.jsx(kt,{icon:"layout-sidebar-left",className:"ui-mobile-only jv-floating-nav",label:m("common.openNav"),onClick:E}),!n&&R&&r.jsx(kt,{icon:"people",className:"jv-floating-dms",label:m("chat.botDms",{name:h}),"aria-pressed":(S==null?void 0:S.kind)==="botdms",onClick:()=>N((S==null?void 0:S.kind)==="botdms"?null:{kind:"botdms"})}),r.jsx("span",{className:"sr-only",role:"status","aria-label":m("chat.botStatus"),children:n?"":p}),e?r.jsxs(r.Fragment,{children:[n?r.jsx(eF,{chat:e,members:Oi(o),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):A.search(e)}):f&&!ie&&r.jsx(sH,{bot:f,chatId:e.id,status:v,area:oe,avoid:F,lastMine:Le,onOpen:()=>T(f.id)}),n&&r.jsx(tF,{chat:e,onSave:q}),r.jsxs("div",{className:"jv-transcript",children:[r.jsxs("div",{className:`ui-transcript jarvy-transcript${n?" jv-channel-transcript":""}`,ref:D,"aria-label":m("chat.transcript"),role:"log",children:[!n&&!(f!=null&&f.connectionId)&&f&&r.jsx("div",{className:"jarvy-model-onboarding",children:r.jsx(hH,{bot:f,connections:y,onSaved:ue,onManage:z})}),me?r.jsx("p",{className:"jarvy-empty-text",children:m("chat.loading")}):ee.length===0?n?r.jsx("div",{className:"jarvy-empty-chat",children:r.jsx("p",{children:m("chat.empty")})}):f!=null&&f.connectionId?r.jsx("div",{className:"jarvy-empty-chat",children:r.jsx("h2",{children:m("chat.start",{name:h})})}):null:r.jsxs(r.Fragment,{children:[te&&r.jsx("div",{ref:J,className:"jv-history-more","aria-live":"polite",children:ce?m("chat.loadingOlder"):""}),n?r.jsx(Lh,{messages:ee,members:o,bots:i,me:l,divider:b,activeQuestion:k,onSettled:U,onPreview:K,onReply:I,onOpenThread:$,onQuote:L,onReact:H,onFold:O,onJump:P,onBotCard:X,onError:he}):r.jsx(H6,{messages:ee,members:o,me:l,activeQuestion:k,bot:f,onSettled:U,onPreview:K,onQuote:L,onReact:H,onFold:O,onJump:P,onBotCard:X,onError:he})]})]}),je&&ee.length>0&&r.jsx("div",{className:"jv-to-latest",children:r.jsxs("button",{type:"button",onClick:De,"aria-label":m("chat.toLatest"),children:[Re>0&&r.jsx("span",{children:m("chat.unseen",{count:Re})}),r.jsx(Fe,{name:"chevron-down"})]})})]}),r.jsx(Hg,{chatId:e.id,id:"jarvy-composer",drafts:c,formRef:F,scrollRef:D,disabled:!u,placeholder:n?m("chat.toChannel",{name:e.title}):f!=null&&f.connectionId?m("chat.toBot",{name:h}):m("chat.pickModel"),mention:n?{bots:i,inside:Oi(o).filter(at=>at.id!==l&&e.memberIds.includes(at.id)),outside:Oi(o).filter(at=>!e.memberIds.includes(at.id)),onInvite:at=>_(e.id,at)}:void 0,onSend:Y,onError:he,onNotice:Q})]}):r.jsx("div",{className:"jarvy-empty-chat jarvy-first-chat",children:i.length?r.jsx("p",{children:m("chat.pick")}):r.jsxs("button",{className:"ui-button ui-primary",onClick:V,disabled:Z,children:[r.jsx(Fe,{name:"person-add"}),m("sidebar.newBot")]})}),e&&r.jsx(qg,{container:D,drafts:c,chatId:e.id,source:at=>ee.find(Lt=>Lt.id===at),members:o,onNotice:Q})]})}const mH=10,mw=288,zr=12,pH=620;function vH(e,n,i){const o=Math.max(zr,n.height-i-zr),l=f=>Math.min(Math.max(zr,f),o);if(n.width>pH)return{left:Math.min(Math.max(zr,e.right+mH),n.width-mw-zr),top:l(e.top-8),width:mw};const c=e.bottom+6,u=e.top-6-i,h=c+i+zr<=n.height?c:u>=zr?u:l(c);return{left:zr,top:h,width:n.width-zr*2}}function gH({bot:e,status:n,connections:i,anchor:o,onClose:l,onMessage:c,onInfo:u}){var b;const h=j.useRef(null);j.useEffect(()=>{const k=C=>{var E;const A=C.target;(E=h.current)!=null&&E.contains(A)||A!=null&&A.closest(".jv-avatar-button")||l()},S=C=>{C.key==="Escape"&&l()},N=C=>{var A;(A=h.current)!=null&&A.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)}},[]),j.useEffect(()=>{var k;(k=h.current)==null||k.focus({preventScroll:!0})},[e.id]);const[f,v]=j.useState(0);j.useLayoutEffect(()=>{h.current&&v(h.current.offsetHeight)},[e.id,o]);const y=v6(e,n),p=(b=i.find(k=>k.id===e.connectionId))==null?void 0:b.models.find(k=>k.id===e.modelId),w=vH(o,{width:window.innerWidth,height:window.innerHeight},f);return Po.createPortal(r.jsxs("div",{ref:h,className:"jv-bot-card",role:"dialog","aria-label":e.name,tabIndex:-1,style:w,children:[r.jsxs("header",{className:"jv-bot-card-head",children:[r.jsx(Ii,{color:e.color,mood:e.mood,size:44,crown:e.agent,asleep:(n==null?void 0:n.status)==="stop"}),r.jsxs("div",{children:[r.jsx("h2",{children:e.name}),r.jsx("span",{className:"jv-bot-card-role",children:e.agent?m("botCard.agent"):"Bot"})]})]}),e.description&&r.jsx("p",{className:"jv-bot-card-about",children:e.description}),r.jsxs("dl",{className:"jv-bot-card-facts",children:[r.jsxs("div",{children:[r.jsx("dt",{children:m("botCard.state")}),r.jsx("dd",{"data-tone":y.tone,children:y.label})]}),r.jsxs("div",{children:[r.jsx("dt",{children:m("botCard.worksIn")}),r.jsx("dd",{children:Lq(e)})]}),p&&r.jsxs("div",{children:[r.jsx("dt",{children:m("usage.model")}),r.jsx("dd",{title:p.name,children:p.name})]})]}),r.jsxs("div",{className:"jv-bot-card-actions",children:[r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{c(),l()},children:m("botCard.message")}),r.jsx(ke,{type:"button",variant:"outline",size:"sm",onClick:()=>{u(),l()},children:m("botCard.info")})]})]}),document.body)}class yH{constructor(){$e(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 Ug(e,n){const i=j.useRef(n);i.current=n,j.useEffect(()=>e.on(o=>i.current(o)),[e])}const wu=(e,n)=>e.some(i=>i.id===n.id)?e.map(i=>i.id===n.id?n:i):e;function mf(e,n){if(e.some(o=>o.id===n.id))return wu(e,n);if(e[0]&&n.sequence<e[0].sequence)return e;const i=e.findIndex(o=>o.sequence>n.sequence);return i<0?[...e,n]:[...e.slice(0,i),n,...e.slice(i)]}const $g=(e,n)=>e.sequence>n+1;function Z6(e,n,i){var l;const o=((l=n.at(-1))==null?void 0:l.sequence)??i;return[...e.filter(c=>c.sequence<=i),...n,...e.filter(c=>c.sequence>o)]}const xH=e=>ta(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function bH(e,n){const[i,o]=j.useState([]);return j.useEffect(()=>{if(o([]),!e)return;let l=!0;return ae.botDirects(e).then(c=>{l&&o(c.chats)}).catch(()=>{}),()=>{l=!1}},[e,n]),i}function jH({bot:e,chats:n,members:i,bots:o,me:l,live:c,onClose:u,onPreview:h,onError:f}){const[v,y]=j.useState(null),[p,w]=j.useState(null),[b,k]=j.useState(0);j.useEffect(()=>{if(!v){w(null);return}let C=!0;return ae.messages(v).then(A=>{C&&w(A.messages)}).catch(A=>{C&&f(A)}),()=>{C=!1}},[v,b]),j.useEffect(()=>w(null),[v]),Ug(c,C=>{if(C.kind==="reconnected"){k(E=>E+1);return}if(C.kind==="chat"||C.message.chatId!==v)return;const A=C.message;w(E=>E&&(C.kind==="message"?mf(E,A):wu(E,A)))});const S=C=>i.find(A=>A.id!==e.id&&C.memberIds.includes(A.id)),N=n.find(C=>C.id===v);return r.jsxs("aside",{className:"ui-pane jv-pane","aria-label":m("chat.botDms",{name:e.name}),children:[r.jsx(hr,{place:"pane",leading:N&&r.jsx(kt,{icon:"chevron-left",label:m("directs.back"),onClick:()=>y(null)}),title:N?m("directs.between",{name:e.name,other:zi(S(N))}):m("chat.botDms",{name:e.name}),actions:r.jsx(kt,{icon:"close",label:m("common.close"),onClick:u})}),N?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ui-pane-body jv-pane-body",children:p===null?r.jsx("p",{className:"jv-picker-empty",children:m("threads.loading")}):p.length===0?r.jsx("p",{className:"jv-picker-empty",children:m("chat.empty")}):r.jsx(Lh,{messages:p,members:i,bots:o,me:l,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:h})}),r.jsx("p",{className:"jv-readonly",children:m("directs.readOnly")})]}):r.jsx("div",{className:"ui-pane-body jv-pane-body",children:n.length===0?r.jsx("p",{className:"jv-picker-empty",children:m("sidebar.noDms")}):n.map(C=>{const A=S(C);return r.jsxs("button",{type:"button",className:"jv-thread-item",onClick:()=>y(C.id),children:[r.jsxs("span",{className:"jv-thread-item-head",children:[r.jsx(vr,{member:A,bots:o,size:20}),r.jsx("strong",{children:zi(A)}),r.jsx("span",{className:"jv-muted",children:xH(C.updatedAt)})]}),C.lastMessage&&r.jsx("span",{className:"jv-muted jv-thread-item-meta",children:Us(C.lastMessage)})]},C.id)})})]})}function wH({x:e,y:n,admin:i,onAdmin:o,onRemove:l,onClose:c}){const u=j.useRef(null);j.useEffect(()=>{const f=y=>{var p;(p=u.current)!=null&&p.contains(y.target)||c()},v=y=>{y.key==="Escape"&&c()};return document.addEventListener("pointerdown",f),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",v)}},[c]);const h={right:Math.max(8,window.innerWidth-e),top:Math.max(8,Math.min(n,window.innerHeight-100))};return r.jsxs("div",{ref:u,className:"ui-popover jv-entry-menu",role:"menu","aria-label":m("members.menu"),style:h,children:[i!==null&&r.jsxs(r.Fragment,{children:[r.jsx("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{o(),c()},children:r.jsx("span",{className:"ui-menu-copy",children:m(i?"members.removeAdmin":"members.makeAdmin")})}),r.jsx("hr",{className:"ui-menu-divider"})]}),r.jsx("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{l(),c()},children:r.jsx("span",{className:"ui-menu-copy",children:m("members.removeFromChannel")})})]})}function kH({channel:e,members:n,bots:i,statuses:o,me:l,onAdd:c,onBot:u,onChanged:h,onError:f}){const[v,y]=j.useState(null),[p,w]=j.useState(null),b=async(A,E)=>{try{h(await ae.setAdmin(e.id,A.id,E))}catch(T){f(T)}},k=n.filter(A=>e.memberIds.includes(A.id)),S=k.filter(A=>A.kind!=="bot").sort((A,E)=>+(E.id===l)-+(A.id===l)),N=k.filter(A=>A.kind==="bot"),C=A=>{const E=A.kind==="bot"?i.find(_=>_.id===A.id):void 0,T=o[A.id],R=A.kind==="bot"?v6(E,T):void 0;return r.jsx(Ro,{static:!E,"aria-label":E?m("members.view",{name:A.name}):void 0,onClick:E?()=>u(A.id):void 0,leading:r.jsx(vr,{member:A,bots:i,size:32,working:(T==null?void 0:T.status)==="running"&&T.activity!=="asking"}),title:r.jsxs(r.Fragment,{children:[A.name,A.id===l&&r.jsx("span",{className:"jv-role",children:m("common.you")}),A.id===e.createdBy?r.jsx("span",{className:"jv-role",children:m("members.creator")}):e.adminIds.includes(A.id)&&r.jsx("span",{className:"jv-role",children:m("members.admin")})]}),titleEnd:R&&r.jsx("span",{className:"jv-member-state","data-tone":R.tone,children:R.label}),more:A.id!==l?{label:m("members.more",{name:A.name}),onClick:_=>{const L=_.currentTarget.getBoundingClientRect();w({member:A,x:L.right,y:L.bottom+4})}}:void 0},A.id)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-member-bar",children:[r.jsx("span",{children:m("members.count",{count:k.length})}),r.jsxs("button",{type:"button",className:"ui-button ui-primary jv-member-pane-add",onClick:c,children:[r.jsx(Fe,{name:"person-add"}),m("common.add")]})]}),r.jsx("div",{className:"ui-pane-body jv-pane-body",children:[["people",m("members.people"),S],["bots","Bot",N]].map(([A,E,T])=>T.length>0&&r.jsxs("section",{className:"jv-member-group","aria-label":E,children:[r.jsxs("h3",{children:[E," · ",T.length]}),T.map(C)]},A))}),p&&r.jsx(wH,{x:p.x,y:p.y,onClose:()=>w(null),onRemove:()=>y(p.member),admin:p.member.kind==="bot"&&p.member.id!==e.createdBy?e.adminIds.includes(p.member.id):null,onAdmin:()=>void b(p.member,!e.adminIds.includes(p.member.id))}),v&&r.jsx(M6,{title:m("members.removeTitle",{name:v.name,channel:e.title}),body:m("members.removeBody"),confirm:m("members.removeConfirm"),onClose:()=>y(null),onConfirm:async()=>{try{h(await ae.removeMember(e.id,v.id)),y(null)}catch(A){f(A)}}})]})}function pw({label:e,value:n,empty:i,maxLength:o,required:l=!1,onSave:c}){const u=j.useId(),[h,f]=j.useState(null),[v,y]=j.useState(!1);j.useEffect(()=>f(null),[n]);const p=async()=>{if(!(h===null||v||l&&!h.trim())){if(h.trim()===n){f(null);return}y(!0);try{await c(h.trim()),f(null)}catch{}finally{y(!1)}}};return r.jsxs("div",{className:"jv-info-field",children:[r.jsxs("div",{className:"jv-info-label",children:[r.jsx("label",{htmlFor:u,children:e}),h===null&&r.jsx(kt,{icon:"pencil",label:m("info.edit",{name:e}),className:"jv-info-edit",onClick:()=>f(n)})]}),h===null?r.jsx("p",{className:"jv-info-value","data-empty":!n||void 0,children:n||i}):r.jsxs("div",{className:"jv-inline-edit",children:[r.jsx("input",{id:u,value:h,maxLength:o,autoFocus:!0,placeholder:i,onChange:w=>f(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!w.nativeEvent.isComposing&&(w.preventDefault(),p()),w.key==="Escape"&&(w.stopPropagation(),f(null))}}),r.jsx("button",{type:"button",className:"ui-button",onClick:()=>f(null),children:m("common.cancel")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:v||l&&!h.trim(),onClick:()=>void p(),children:m("common.save")})]})]})}function SH({channel:e,page:n,sections:i,members:o,bots:l,statuses:c,me:u,onPage:h,onPin:f,onMute:v,onAdd:y,onBot:p,onDelete:w,onChanged:b,onClose:k,onError:S}){const N=j.useId(),C=async E=>{try{b(await ae.updateChannel(e.id,E))}catch(T){throw S(T),T}},A=o.filter(E=>e.memberIds.includes(E.id)).length;return r.jsxs("aside",{className:"ui-pane jv-pane","aria-label":m(n==="members"?"info.memberList":"entry.channelInfo"),children:[r.jsx(hr,{place:"pane",leading:n==="members"&&r.jsx(kt,{icon:"chevron-left",label:m("info.back"),className:"jv-pane-back",onClick:()=>h("main")}),title:m(n==="members"?"channel.members":"entry.channelInfo"),sub:`#${e.title}`,actions:r.jsx(kt,{icon:"close",label:m("common.close"),onClick:k})}),n==="members"?r.jsx(kH,{channel:e,members:o,bots:l,statuses:c,me:u,onAdd:y,onBot:p,onChanged:b,onError:S}):r.jsxs("div",{className:"ui-pane-body jv-pane-body jv-info",children:[r.jsxs("div",{className:"jv-info-actions",children:[r.jsxs("button",{type:"button","aria-pressed":e.pinned,onClick:f,children:[r.jsx(Fe,{name:"pin"}),m("entry.pin")]}),r.jsxs("button",{type:"button","aria-pressed":e.muted,onClick:v,children:[r.jsx(Fe,{name:e.muted?"bell-slash":"bell"}),m("entry.mute")]}),r.jsxs("button",{type:"button",onClick:y,children:[r.jsx(Fe,{name:"person-add"}),m("info.addMembers")]})]}),r.jsx(pw,{label:m("info.name"),value:e.title,empty:m("info.newChannel"),maxLength:80,required:!0,onSave:E=>C({name:E})}),r.jsx(pw,{label:m("info.topic"),value:e.topic,empty:m("info.noTopic"),maxLength:200,onSave:E=>C({topic:E})}),r.jsxs("div",{className:"jv-info-field",children:[r.jsx("div",{className:"jv-info-label",children:r.jsx("label",{htmlFor:N,children:m("info.section")})}),r.jsx(o6,{id:N,value:e.sectionId,sections:i,onChange:E=>void C({sectionId:E}).catch(()=>{})})]}),r.jsxs("nav",{className:"jv-info-menu","aria-label":m("info.menu"),children:[r.jsxs("button",{type:"button",className:"ui-menu-item",onClick:()=>h("members"),children:[r.jsx(Fe,{name:"people"}),r.jsx("span",{className:"ui-menu-copy",children:m("channel.members")}),r.jsx("span",{className:"jv-muted",children:A}),r.jsx(Fe,{name:"chevron-right"})]}),r.jsxs("button",{type:"button",className:"ui-menu-item jv-menu-danger",onClick:w,children:[r.jsx(Fe,{name:"trash"}),r.jsx("span",{className:"ui-menu-copy",children:m("entry.deleteChannel")})]})]})]})]})}function CH({chat:e,chats:n,members:i,focusKey:o,onOpenMessage:l,onClose:c,onError:u}){const[h,f]=j.useState(""),v=j.useRef(null);j.useEffect(()=>{var b,k;(b=v.current)==null||b.focus(),(k=v.current)==null||k.select()},[o,e.id]);const{result:y,loading:p}=_6(h,e.id,u),w=e.type==="channel"?`#${e.title}`:m(e.type==="thread"?"search.inThread":"search.inDm");return r.jsxs("aside",{className:"ui-pane jv-pane jv-search-pane","aria-label":m("search.paneLabel"),children:[r.jsx(hr,{place:"pane",title:m("search.title"),sub:w,actions:r.jsx(kt,{icon:"close",label:m("search.close"),onClick:c})}),r.jsx("div",{className:"jv-pane-search",children:r.jsx("input",{ref:v,type:"search",value:h,placeholder:m(e.type==="channel"?"search.channelPlaceholder":"search.placeholder"),"aria-label":m("search.placeholder"),onChange:b=>f(b.target.value),onKeyDown:b=>{b.key==="Escape"&&(b.preventDefault(),h?f(""):c())}})}),r.jsx("div",{className:"ui-pane-body jv-pane-body jv-results","aria-live":"polite",children:h.trim()?y?y.messages.length?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"jv-result-count",children:m(y.messages.length>=60?"search.countLatest":"search.count",{count:y.messages.length})}),y.messages.map(({message:b,chat:k})=>r.jsx(D6,{message:b,chat:k,chats:n,members:i,query:h,showPlace:k.id!==e.id,onOpen:l},b.id))]}):r.jsx("p",{className:"jv-result-empty",children:m("search.noMessages")}):p&&r.jsx("p",{className:"jv-result-empty",children:m("search.searching")}):r.jsx("p",{className:"jv-result-empty",children:m("search.prompt")})})]})}const NH=e=>ta(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function EH({chat:e,channelName:n,expanded:i=!1,onTitle:o,onStatus:l,onSummary:c,onConclude:u}){var E;const[h,f]=j.useState(null),[v,y]=j.useState(null),[p,w]=j.useState(!1),[b,k]=j.useState(i);j.useEffect(()=>{f(null),y(null),k(i)},[e.id,i]);const S=async(T,R)=>{w(!0);try{await T(),R()}catch{}finally{w(!1)}},N=e.status==="done",C=e.note,A=((E=C==null?void 0:C.text.split(`
845
+ `).find(T=>T.trim()&&!T.startsWith("#")))==null?void 0:E.replace(/[*`|>-]/g,"").trim())??"";return r.jsxs("div",{className:"jv-thread-meta","data-open":b||void 0,children:[r.jsxs("div",{className:"jv-thread-title-row",children:[h===null?r.jsxs(r.Fragment,{children:[r.jsx("h2",{className:"jv-thread-title",title:e.title,children:e.title}),r.jsx(kt,{icon:"pencil",label:m("thread.rename"),onClick:()=>f(e.title)})]}):r.jsxs("form",{className:"jv-inline-edit",onSubmit:T=>{T.preventDefault(),h.trim()&&S(()=>o(h.trim()),()=>f(null))},children:[r.jsx("input",{value:h,autoFocus:!0,maxLength:80,"aria-label":m("thread.title"),onChange:T=>f(T.target.value),onKeyDown:T=>{T.key==="Escape"&&f(null)}}),r.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:p||!h.trim(),children:m("common.save")})]}),r.jsx("button",{type:"button",className:"jv-thread-status","data-done":N||void 0,disabled:p,title:m("thread.toggleStatus"),onClick:()=>void S(()=>l(N?"open":"done"),()=>{}),children:N?r.jsxs(r.Fragment,{children:[r.jsx(Fe,{name:"check"}),m("channel.threadDone")]}):m("threads.open")})]}),v!==null?r.jsxs("div",{className:"jv-summary","data-editing":!0,children:[r.jsx("textarea",{className:"jv-notice-input",value:v,autoFocus:!0,"aria-label":m("thread.summary"),onChange:T=>y(T.target.value)}),r.jsxs("div",{className:"jv-notice-actions",children:[r.jsx("button",{type:"button",className:"ui-button",onClick:()=>y(null),children:m("common.cancel")}),r.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:p||!v.trim(),onClick:()=>void S(()=>c(v.trim()),()=>y(null)),children:m("common.save")})]})]}):C?r.jsxs("div",{className:"jv-summary",children:[r.jsxs("div",{className:"jv-summary-head",children:[r.jsxs("button",{type:"button",className:"jv-summary-toggle","aria-expanded":b,onClick:()=>k(!b),children:[r.jsx("strong",{children:m("thread.summary")}),!b&&r.jsx("span",{className:"jv-summary-first",children:A}),r.jsx(Fe,{name:b?"chevron-down":"chevron-right"})]}),b&&r.jsxs("span",{className:"jv-muted jv-summary-meta",children:[C.updatedBy.name," · ",NH(C.updatedAt)," · ",m("notice.version",{version:C.version})]}),r.jsx(kt,{icon:"pencil",label:m("thread.editSummary"),onClick:()=>y(C.text)})]}),b&&r.jsx("div",{className:"jv-summary-body ui-bubble jv-flat",children:r.jsx(Bo,{text:C.text})}),b&&!N&&r.jsxs("button",{type:"button",className:"ui-button jv-conclude",disabled:p,onClick:()=>void S(u,()=>{}),children:[r.jsx(Fe,{name:"check"}),m("thread.conclude",{channel:n})]})]}):r.jsxs("button",{type:"button",className:"jv-summary-empty",onClick:()=>y(""),children:[r.jsx(Fe,{name:"add"}),m("thread.addSummary")]})]})}const TH=20,vw=500;class W6{constructor(){$e(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>vw)){this.kept.set(n,i);for(const o of this.kept.keys()){if(this.kept.size<=TH)break;this.kept.delete(o)}}}removed(n){var i;for(const[o,l]of this.kept)(o===n||((i=l.chat)==null?void 0:i.parentId)===n)&&this.kept.delete(o)}clear(){this.kept.clear()}heard(n){var c;if(n.kind==="reconnected")return;if(n.kind==="chat"){const u=this.kept.get(n.chat.id);u!=null&&u.chat&&(u.chat=n.chat);return}const i=n.message;for(const u of this.kept.values())((c=u.root)==null?void 0:c.id)===i.id&&(u.root=i);const o=this.kept.get(i.chatId);if(!o)return;if(n.kind==="updated"||o.messages.some(u=>u.id===i.id)){o.messages=wu(o.messages,i);return}const l=o.messages.at(-1);if(l&&$g(i,l.sequence)||o.messages.length>=vw){this.kept.delete(i.chatId);return}o.messages=mf(o.messages,i)}}function J6(e,n){if(e.scrollHeight-e.scrollTop-e.clientHeight<n)return{bottom:!0};const i=e.getBoundingClientRect();let o;for(const l of e.querySelectorAll("[data-message]")){const c=l.getBoundingClientRect();if(c.bottom<=i.top)continue;const u={bottom:!1,id:l.dataset.message,offset:c.top-i.top};if(c.top>=i.top&&c.top<i.bottom)return u;if(o??(o=u),c.top>=i.bottom)break}return o??{bottom:!0}}function Ih(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 eC{constructor(){$e(this,"stop")}get on(){return this.stop!==void 0}start(n,i){this.release();const o=new ResizeObserver(()=>Ih(n,i));for(const u of n.children)o.observe(u);const l=["wheel","touchstart","pointerdown","keydown"],c=()=>this.release();for(const u of l)n.addEventListener(u,c,{passive:!0});this.stop=()=>{o.disconnect();for(const u of l)n.removeEventListener(u,c)}}release(){var n;(n=this.stop)==null||n.call(this),this.stop=void 0}}const Vg=()=>document.visibilityState==="visible"&&document.hasFocus();function Gg(e){return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}}const E0=50;function gw({threadId:e,mode:n,showSummary:i=!1,focus:o,onSearch:l,channel:c,drafts:u,members:h,bots:f,me:v,live:y,memory:p,onClose:w,onToggleMode:b,onNav:k,onChanged:S,onInvite:N,onPreview:C,onError:A,onNotice:E,onOpenMessage:T,onBotCard:R}){var Bn;const[_,L]=j.useState(null),[I,H]=j.useState(null),[O,P]=j.useState([]),[U,Y]=j.useState(null),[K,q]=j.useState(!1),[Q,V]=j.useState(!1),Z=j.useRef(O),ue=j.useRef(K),z=j.useRef(null),he=j.useRef(null),oe=j.useRef(!1);Z.current=O,ue.current=K;const D=j.useRef(null),F=j.useRef(null),ie=j.useRef(null),$=j.useRef(!1),X=j.useRef(!0),[ee,me]=j.useState(!1),te=j.useRef(0),ce=j.useRef(0),J=j.useRef(0),je=j.useRef({bottom:!0}),Re=j.useRef(null),De=j.useRef(_),Pe=j.useRef(I),[Le]=j.useState(()=>new eC),He=j.useRef(!1);De.current=_,Pe.current=I,j.useEffect(()=>{L(null),H(null),P([]),q(!1),Y(null),$.current=!1,X.current=!0,me(!1),te.current=0,ce.current=0,J.current=0},[e]);const at=async ge=>{const Ee=await ae.message(ge).catch(()=>null);if(!Ee||Ee.chatId!==e)return(Ee==null?void 0:Ee.chatId)??null;const Oe=Math.max(0,Ee.sequence-1-E0/2);return{...await ae.messages(e,Oe),hasOlder:Oe>0}},Lt=async()=>{const ge=Z.current[0];if((ge==null?void 0:ge.chatId)===e)return{...await ae.messages(e,ge.sequence-1),after:ge.sequence-1};const Ee=o&&ie.current!==e?await at(o.id):null;return Ee&&typeof Ee=="object"?Ee:await ae.latestMessages(e,E0)},Gt=ge=>{const Ee=ge.after;P(Oe=>Ee===void 0?ge.messages:Z6(Oe.filter(qe=>qe.chatId===e),ge.messages,Ee)),ge.hasOlder!==void 0&&q(ge.hasOlder)},ft=ge=>{const Ee=Z.current,Oe=Ee.at(-1),qe=Math.max((Oe==null?void 0:Oe.chatId)===e?Oe.sequence:0,J.current);if($g(ge,qe)&&!Ee.some(Be=>Be.id===ge.id)){Lt().then(Gt).catch(A);return}J.current=Math.max(J.current,ge.sequence),P(Be=>mf(Be,ge))};Ug(y,ge=>{if(ge.kind==="reconnected"){if(!$.current)return;He.current=!0,Promise.all([ae.chat(e),Lt()]).then(async([Oe,qe])=>{L(Oe),Gt(qe),He.current=!1,Oe.rootMessageId&&H(await ae.message(Oe.rootMessageId))}).catch(A);return}if(ge.kind==="chat"){const Oe=ge.chat;Oe.id===e&&L(qe=>qe&&{...Oe,readSequence:Math.max(qe.readSequence,Oe.readSequence)});return}const Ee=ge.message;Ee.id===(I==null?void 0:I.id)?H(Ee):Ee.chatId===e&&(ge.kind==="message"?ft(Ee):P(Oe=>wu(Oe,Ee)))});const Cn=async()=>{var Oe;const ge=Z.current[0],Ee=D.current;if(!(!ge||!ue.current||oe.current)){oe.current=!0,V(!0);try{const qe=await ae.olderMessages(e,ge.sequence,E0);if(((Oe=Z.current[0])==null?void 0:Oe.id)!==ge.id)return;he.current=Ee?Ee.scrollHeight-Ee.scrollTop:null,P(Be=>{var mt;return((mt=Be[0])==null?void 0:mt.id)===ge.id?[...qe.messages,...Be]:Be}),q(qe.hasOlder)}catch(qe){A(qe)}finally{oe.current=!1,V(!1)}}};j.useEffect(()=>{let ge=!0;je.current={bottom:!0},Re.current=null;const Ee=()=>{ge=!1,Le.release();const qe=De.current;$.current&&!He.current&&(qe==null?void 0:qe.id)===e&&p.keep(e,{messages:Z.current.filter(Be=>Be.chatId===e),hasOlder:ue.current,place:je.current,seen:te.current,chat:qe,root:Pe.current})},Oe=o?void 0:p.take(e);return Oe!=null&&Oe.chat?(Re.current=Oe.place,te.current=Oe.seen,L(Oe.chat),H(Oe.root??null),P(Oe.messages),q(Oe.hasOlder),ie.current!==e&&(ie.current=e,Y(Oe.chat.readSequence)),Ee):(Promise.all([ae.chat(e),Lt()]).then(async([qe,Be])=>{if(ge&&(L(qe),Gt(Be),ie.current!==e&&(ie.current=e,Y(qe.readSequence)),qe.rootMessageId)){const mt=await ae.message(qe.rootMessageId);ge&&H(mt)}}).catch(qe=>{ge&&A(qe)}),Ee)},[e]),j.useLayoutEffect(()=>{const ge=D.current;if(!ge||!_)return;if(he.current!==null){ge.scrollTo({top:ge.scrollHeight-he.current,behavior:"instant"}),he.current=null;return}const Ee=()=>ge.scrollTo({top:ge.scrollHeight,behavior:"instant"}),Oe=O.at(-1),qe=(Oe==null?void 0:Oe.senderId)===v&&Oe.sequence>ce.current;if(ce.current=Math.max(ce.current,(Oe==null?void 0:Oe.sequence)??0),$.current)(X.current||qe)&&(Le.release(),ge.scrollTo({top:ge.scrollHeight,behavior:"smooth"}));else{if(!O.length&&!I)return;$.current=!0;const Be=o?ge.querySelector(`[data-message="${o.id}"]`):null;if(Be){if(X.current=!1,Be.scrollIntoView({block:"center"}),o!=null&&o.passage&&x6(Be,o.passage))return;Be.classList.add("jv-jump"),setTimeout(()=>Be.classList.remove("jv-jump"),1600);return}const mt=Re.current;if(Re.current=null,mt&&Ih(ge,mt)){X.current=!1,je.current=mt,Le.start(ge,mt),me(!0);return}Ee(),requestAnimationFrame(Ee)}(X.current||qe)&&(te.current=(Oe==null?void 0:Oe.sequence)??0)},[O,I,_]),j.useLayoutEffect(()=>{const ge=D.current,Ee=je.current;ge&&$.current&&Ih(ge,Ee)&&Le.start(ge,Ee)},[n]),j.useEffect(()=>{$.current&&o&&_e(o.id,o.passage)},[o]),j.useEffect(()=>{const ge=D.current,Ee=z.current;if(!ge||!Ee||!K||!$.current)return;const Oe=new IntersectionObserver(qe=>{var Be;(Be=qe[0])!=null&&Be.isIntersecting&&$.current&&Cn()},{root:ge,rootMargin:"400px 0px 0px 0px"});return Oe.observe(Ee),()=>Oe.disconnect()},[K,O,e,_]),j.useEffect(()=>{const ge=D.current,Ee=F.current;if(!ge||!Ee)return;let Oe=0;const qe=()=>{cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>{$.current&&ge.clientHeight&&!Le.on&&(je.current=J6(ge,120))})},Be=new ResizeObserver(()=>{if(qe(),!!$.current){if(ge.scrollHeight-ge.clientHeight<8){mt();return}X.current&&(ge.scrollHeight-ge.scrollTop-ge.clientHeight<8||ge.scrollTo({top:ge.scrollHeight,behavior:"instant"}))}});Be.observe(Ee),Be.observe(ge);const mt=()=>{var $n;Le.on||(X.current=ge.scrollHeight-ge.scrollTop-ge.clientHeight<120,X.current&&(te.current=Math.max(te.current,(($n=Z.current.at(-1))==null?void 0:$n.sequence)??0)),me(!X.current),qe())};return mt(),ge.addEventListener("scroll",mt,{passive:!0}),()=>{Be.disconnect(),ge.removeEventListener("scroll",mt),cancelAnimationFrame(Oe)}},[D.current,e,_]),j.useEffect(()=>{const ge=O.at(-1);if(!_||!ge||ge.chatId!==_.id)return;const Ee=()=>{if(!Vg()||_.readSequence>=ge.sequence)return;const Oe={..._,readSequence:ge.sequence,unread:0,mentions:0,alerts:0,atMe:!1,hint:null};L(Oe),ae.markRead(_.id,ge.sequence).then(()=>S(Oe)).catch(A)};return Ee(),Gg(Ee)},[O,_]);const wn=async ge=>{try{const Ee=await ge();L(Ee),S(Ee)}catch(Ee){throw A(Ee),Ee}},fn=async(ge,Ee,Oe)=>{try{const qe=await ae.react(ge.id,Ee,Oe),Be=mt=>mt.id===qe.id?{...mt,reactions:qe.reactions}:mt;P(mt=>mt.map(Be)),H(mt=>mt&&Be(mt))}catch(qe){A(qe)}},ye=async(ge,Ee)=>{try{const Oe=await ae.fold(ge.id,Ee),qe=Be=>Be.id===Oe.id?{...Be,folded:Oe.folded}:Be;P(Be=>Be.map(qe)),H(Be=>Be&&qe(Be))}catch(Oe){A(Oe)}},_e=(ge,Ee)=>{Le.release();const Oe=()=>{var Be;return ge?(Be=D.current)==null?void 0:Be.querySelector(`[data-message="${ge}"]`):null},qe=Oe();if(qe){zh(qe,Ee);return}if(!ge){E(m("app.sourceGone"));return}at(ge).then(Be=>{if(typeof Be=="string"&&T){T(Be,ge,Ee);return}if(!Be||typeof Be=="string"){E(m("thread.sourceElsewhere"));return}Gt(Be),requestAnimationFrame(()=>{const mt=Oe();mt&&zh(mt,Ee)})})},We={onQuote:ge=>Fg(u,ge,h),onReact:fn,onFold:ye,onJump:_e,onError:A,...R?{onBotCard:R}:{}},tt=async(ge,Ee,Oe,qe,Be=[],mt=!1)=>{const $n=await ae.send(e,ge,Ee,Oe,mt,qe,Be),Ba=c?[...new Set(Ig(ge,Oi(h)).filter(Yt=>!c.memberIds.includes(Yt.member.id)).map(Yt=>Yt.member.name))]:[];Ba.length&&E(m("app.notInChannel",{names:Ba.join(m("common.listSeparator")),count:Ba.length})),ft($n)},ct=(c==null?void 0:c.title)??m("search.channel"),on=h.find(ge=>ge.id===(I==null?void 0:I.senderId)),On=ee?O.filter(ge=>ge.sequence>te.current&&ge.senderId!==v).length:0,yn=new Set([...I?[I.senderId,...I.mentions]:[],...O.flatMap(ge=>[ge.senderId,...ge.mentions])]);return yn.delete(v),r.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":m("thread.label"),onKeyDown:ge=>{_&&l&&(ge.ctrlKey||ge.metaKey)&&ge.key.toLowerCase()==="f"&&(ge.preventDefault(),l(_))},children:[r.jsx(hr,{place:n==="pane"?"pane":"content",leading:r.jsxs(r.Fragment,{children:[n==="full"&&r.jsx(kt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:m("common.openNav"),onClick:k}),n==="embed"&&r.jsx(kt,{icon:"chevron-left",className:"ui-mobile-only",label:m("thread.backToList"),onClick:w}),n==="full"&&r.jsxs("button",{type:"button",className:"jv-crumb",onClick:w,children:[r.jsx(Fe,{name:"chevron-left"}),r.jsx("span",{className:"jv-hash",children:"#"}),ct]}),n==="embed"&&r.jsxs("button",{type:"button",className:"jv-crumb",title:m("thread.inChannel"),onClick:b,children:[r.jsx("span",{className:"jv-hash",children:"#"}),ct]})]}),title:n==="pane"?m("thread.label"):void 0,sub:n==="pane"?`#${ct}`:void 0,actions:r.jsxs("div",{className:"ui-column-actions",children:[_&&l&&r.jsx(kt,{icon:"search",label:m("thread.search"),onClick:()=>l(_)}),_&&r.jsxs("button",{type:"button",className:"ui-button jv-follow","data-on":_.following||void 0,title:m(_.following?"thread.followingHint":"thread.notFollowingHint"),onClick:()=>void wn(()=>ae.follow(e,!_.following)).catch(()=>{}),children:[r.jsx(Fe,{name:"bell"}),m(_.following?"threads.following":"thread.follow")]}),n!=="embed"&&r.jsx(kt,{icon:n==="pane"?"arrows-expand":"arrows-contract",className:"jv-desktop-only",label:m(n==="pane"?"thread.expand":"thread.collapse"),onClick:b}),n==="pane"&&r.jsx(kt,{icon:"close",label:m("thread.close"),onClick:w})]})}),_&&r.jsx("div",{className:n==="pane"?"jv-thread-pin":"jv-thread-pin jv-thread-pin-wide",children:r.jsx(EH,{chat:_,channelName:ct,expanded:i,onTitle:ge=>wn(()=>ae.updateThread(e,{title:ge})),onStatus:ge=>wn(()=>ae.updateThread(e,{status:ge})),onSummary:ge=>wn(()=>ae.setNote(e,ge)),onConclude:async()=>{var ge;try{await tt(`${m("thread.conclusion")}
846
+
847
+ ${((ge=_.note)==null?void 0:ge.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),Ee=>Ee.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await wn(()=>ae.updateThread(e,{status:"done"})),E(m("thread.concluded",{channel:ct}))}catch(Ee){throw A(Ee),Ee}}})}),r.jsxs("div",{className:"jv-transcript",children:[r.jsx("div",{ref:D,className:n==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:r.jsxs("div",{ref:F,children:[I&&r.jsx(Lh,{messages:[{...I,thread:null}],members:h,bots:f,me:v,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:C,onReact:fn,onFold:ye,onJump:_e,onError:A}),r.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:r.jsx("span",{children:O.length?m("channel.replies",{count:((Bn=I==null?void 0:I.thread)==null?void 0:Bn.replies)??O.length}):m("thread.noReplies")})}),K&&r.jsx("div",{ref:z,className:"jv-history-more","aria-live":"polite",children:Q?m("chat.loadingOlder"):""}),r.jsx(Lh,{messages:O,members:h,bots:f,me:v,divider:U??Number.MAX_SAFE_INTEGER,before:I==null?void 0:I.createdAt,onSettled:ge=>P(Ee=>Ee.map(Oe=>Oe.id===ge.id?ge:Oe)),onPreview:C,...We})]})}),ee&&O.length>0&&r.jsx("div",{className:"jv-to-latest",children:r.jsxs("button",{type:"button","aria-label":m("thread.toLatest"),onClick:()=>{var ge;Le.release(),(ge=D.current)==null||ge.scrollTo({top:D.current.scrollHeight,behavior:"smooth"})},children:[On>0&&r.jsx("span",{children:m("chat.unseen",{count:On})}),r.jsx(Fe,{name:"chevron-down"})]})})]}),r.jsx(Hg,{chatId:e,id:"jarvy-thread-composer",drafts:u,placeholder:m("thread.reply"),scrollRef:D,disabled:!_,initialText:O.length===0&&I&&I.senderId!==v&&on&&!on.deleted?`@${on.name} `:void 0,mention:{bots:f,inside:Oi(h).filter(ge=>ge.id!==v&&!!(c!=null&&c.memberIds.includes(ge.id))),outside:Oi(h).filter(ge=>!(c!=null&&c.memberIds.includes(ge.id))),onInvite:N,participants:yn},onSend:tt,onError:A,onNotice:E}),r.jsx(qg,{container:D,drafts:u,chatId:e,members:h,onNotice:E,source:ge=>ge===(I==null?void 0:I.id)?I:O.find(Ee=>Ee.id===ge)})]})}function yw(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 AH(e,n){return e[0]-n[0]||e[1]-n[1]||(e[2]<n[2]?-1:e[2]>n[2]?1:0)}const Ph=e=>(n,i)=>AH(yw(n,e),yw(i,e)),T0={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},MH=(e,n)=>[...e].sort(Ph(n));function tC(e){const n=`jarvy-thread-sort-${e}`,[i,o]=j.useState(()=>{const l=localStorage.getItem(n);return l==="created"||l==="status"?l:"updated"});return[i,l=>{o(l),localStorage.setItem(n,l)}]}function nC({value:e,onChange:n}){return r.jsxs(Vr,{value:e,onValueChange:i=>n(i),children:[r.jsxs(Yr,{className:"jv-thread-sort","aria-label":m("threadSort.current",{order:m(T0[e])}),title:m("threadSort.title"),children:[r.jsx(a9,{}),r.jsx(Gr,{})]}),r.jsx(Kr,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(T0).map(i=>r.jsx(Da,{value:i,children:m(T0[i])},i))})]})}const xw={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}}),RH=e=>({...e,epoch:e.epoch+1}),OH=(e,n)=>`${e.epoch}:${n?e.counts[n]??0:0}`,DH=e=>`${e.epoch}:${e.unlisted}`,zH=e=>ta(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function LH({channel:e,members:n,bots:i,changes:o,onOpen:l,onClose:c,onError:u}){const[h,f]=j.useState(null),[v,y]=j.useState("open"),[p,w]=tC("channel");j.useEffect(()=>{let S=!0;return ae.channelThreads(e.id).then(N=>{S&&f(N.threads)}).catch(N=>{S&&u(N)}),()=>{S=!1}},[e.id,OH(o,e.id)]);const b=MH((h??[]).filter(S=>v==="all"||S.status===v),p),k=S=>(h??[]).filter(N=>N.status===S).length;return r.jsxs("aside",{className:"ui-pane jv-pane","aria-label":m("threads.list"),children:[r.jsx(hr,{place:"pane",title:m("channel.threads"),sub:`#${e.title}`,actions:r.jsxs("div",{className:"ui-column-actions",children:[r.jsx(nC,{value:p,onChange:w}),r.jsx(kt,{icon:"close",label:m("threads.closeList"),onClick:c})]})}),r.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":m("threads.byStatus"),children:[["open",m("threads.openCount",{count:k("open")})],["done",m("threads.doneCount",{count:k("done")})],["all",m("threads.all")]].map(([S,N])=>r.jsx("button",{type:"button",role:"tab","aria-selected":v===S,onClick:()=>y(S),children:N},S))}),r.jsx("div",{className:"ui-pane-body jv-pane-body",children:h===null?r.jsx("p",{className:"jv-picker-empty",children:m("threads.loading")}):b.length===0?r.jsx("p",{className:"jv-picker-empty",children:m("threads.none")}):b.map(S=>{const N=n.find(C=>{var A;return C.id===((A=S.root)==null?void 0:A.senderId)});return r.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>l(S.id),children:[r.jsxs("span",{className:"jv-thread-item-head",children:[r.jsx("strong",{children:S.title}),S.alerts>0?r.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&r.jsx("span",{className:"jv-count",children:S.unread}),r.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:m(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&r.jsxs("span",{className:"jv-thread-item-root",children:[r.jsx(vr,{member:N,bots:i,size:16}),r.jsx("span",{children:Us(S.root)})]}),r.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[m("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${zH(S.lastReplyAt)}`:"",S.following?` · ${m("threads.following")}`:""]})]},S.id)})})]})}class BH{constructor(){$e(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 A0=(e,n)=>n==="all"||(n==="unread"?e.unread>0:e.status===n),oh=(e,n)=>[...new Map(e.map(i=>[i.id,i])).values()].sort(Ph(n));function IH(e,n,i){const[o,l]=j.useState({items:[],next:null,ready:!1}),[c,u]=j.useState(!1),[h,f]=j.useState(!1),v=j.useRef({filter:n,sort:i,generation:0}),y=j.useRef(o),p=j.useRef(new Map);y.current=o;const w=E=>{y.current=E,l(E)};async function b(E){const T=v.current.generation;u(!0),f(!1);try{const R=await ae.followedThreads({filter:n,sort:i,cursor:E});if(T!==v.current.generation)return;const _=y.current,L=R.next?R.threads.at(-1):void 0,I=[...p.current.values()].filter(H=>A0(H,n)&&(!L||Ph(i)(H,L)<=0));w({items:oh([...E?_.items:[],...R.threads,...I],i),next:R.next,ready:!0})}catch{T===v.current.generation&&f(!0)}finally{T===v.current.generation&&u(!1)}}j.useEffect(()=>{v.current={filter:n,sort:i,generation:v.current.generation+1},w({items:[],next:null,ready:!1}),b()},[n,i]);const k=j.useRef(new Map);function S(E){if(k.current.has(E)){k.current.set(E,!0);return}k.current.set(E,!1);const T=v.current.generation;ae.followedThread(E).then(R=>N(R,T),R=>{R instanceof lr&&R.status===404&&T===v.current.generation&&w({...y.current,items:y.current.items.filter(_=>_.id!==E)})}).finally(()=>{const R=k.current.get(E);k.current.delete(E),R&&S(E)})}function N(E,T){if(T!==v.current.generation)return;C(E);const R=y.current,_=R.items.some(H=>H.id===E.id),L=R.items.at(-1),I=E.following&&A0(E,v.current.filter)&&(R.next===null||!L||Ph(v.current.sort)(E,L)<0);(_||R.ready&&I)&&w({...R,items:oh([...R.items,E],v.current.sort)})}j.useEffect(()=>e.on(E=>{if(E.kind==="changed")S(E.id);else if(E.kind==="reconnected")A();else{const T=E.chat,R=y.current,_=R.items.find(I=>I.id===T.id);if(!_){T.following&&S(T.id);return}const L={..._,title:T.title,status:T.status??_.status,unread:T.unread,mentions:T.mentions,alerts:T.alerts,following:T.following};C(L),w({...R,items:oh([...R.items,L],v.current.sort)})}}),[e]);function C(E){E.following?p.current.delete(E.id):y.current.items.some(T=>T.id===E.id)&&p.current.set(E.id,E)}async function A(){const E=v.current.generation,T=await ae.followedThreads({filter:v.current.filter,sort:v.current.sort}).catch(()=>null);if(!T||E!==v.current.generation)return;const R=y.current,_=R.items.length>T.threads.length;w({items:oh([...R.items,...T.threads],v.current.sort),next:_?R.next:T.next,ready:!0})}return{items:o.items.filter(E=>A0(E,n)),find:E=>o.items.find(T=>T.id===E),ready:o.ready,more:o.next!==null,loading:c,failed:h,loadMore:()=>{o.next&&!c&&b(o.next)},retry:()=>void b(o.next??void 0)}}const PH=e=>ta(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),qH={all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"};function FH({events:e,summary:n,chats:i,members:o,bots:l,onNav:c,renderThread:u}){const[h,f]=j.useState(null),[v,y]=j.useState("all"),[p,w]=tC("followed"),b=IH(e,v,p),k=h?b.find(h.id)??h:void 0,S=j.useRef(null),N=j.useRef(null);j.useEffect(()=>{if(!S.current||!N.current||!b.more||b.loading||b.failed)return;const A=new IntersectionObserver(E=>{var T;(T=E[0])!=null&&T.isIntersecting&&b.loadMore()},{root:S.current,rootMargin:"0px 0px 400px 0px"});return A.observe(N.current),()=>A.disconnect()},[b.more,b.loading,b.failed,b.items]);const C=[["all",m("threads.all")],["unread",n!=null&&n.unreadThreads?m("threads.unreadCount",{count:n.unreadThreads}):m("threads.unread")],["open",m("threads.openCount",{count:(n==null?void 0:n.open)??0})],["done",m("threads.doneCount",{count:(n==null?void 0:n.done)??0})]];return r.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":m("sidebar.followed"),"data-open":k?"":void 0,children:[r.jsxs("section",{className:"jv-followed-list","aria-label":m("threads.list"),children:[r.jsx(hr,{place:"content",leading:r.jsx(kt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:m("common.openNav"),onClick:c}),title:m("sidebar.followed"),actions:r.jsx("div",{className:"ui-column-actions",children:r.jsx(nC,{value:p,onChange:w})})}),r.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":m("threads.filter"),children:C.map(([A,E])=>r.jsx("button",{type:"button",role:"tab","aria-selected":v===A,onClick:()=>y(A),children:E},A))}),r.jsxs("div",{className:"jv-followed-items",ref:S,children:[b.ready&&b.items.length===0&&!b.more?r.jsx("p",{className:"jv-picker-empty",children:m(qH[v])}):b.items.map(A=>{const E=o.find(R=>{var _;return R.id===((_=A.root)==null?void 0:_.senderId)}),T=i.find(R=>R.id===A.parentId);return r.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":A.unread>0||void 0,"aria-current":A.id===(h==null?void 0:h.id)||void 0,onClick:()=>f(A),children:[r.jsxs("span",{className:"jv-thread-item-head",children:[r.jsx("strong",{children:A.title}),A.alerts>0?r.jsx("span",{className:"jv-badge",children:A.alerts}):A.unread>0&&r.jsx("span",{className:"jv-count",children:A.unread}),r.jsx("span",{className:"jv-thread-status","data-done":A.status==="done"||void 0,children:m(A.status==="done"?"channel.threadDone":"threads.open")})]}),A.root&&r.jsxs("span",{className:"jv-thread-item-root",children:[r.jsx(vr,{member:E,bots:l,size:16}),r.jsx("span",{children:Us(A.root)})]}),r.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(T==null?void 0:T.title)??""," · ",m("channel.replies",{count:A.replies}),A.lastReplyAt?` · ${PH(A.lastReplyAt)}`:"",A.following?"":` · ${m("threads.notFollowing")}`]})]},A.id)}),r.jsx("div",{ref:N,className:"jv-followed-end",children:b.failed?r.jsxs(r.Fragment,{children:[r.jsx("p",{role:"alert",children:m("threads.loadFailed")}),r.jsx(ke,{variant:"outline",size:"sm",onClick:b.retry,children:m("common.retry")})]}):(b.loading||!b.ready)&&r.jsx("p",{role:"status",children:m("threads.loading")})})]})]}),k?u(k,()=>f(null)):r.jsx("div",{className:"jv-followed-empty",children:r.jsx("p",{children:m("threads.pick")})})]})}function HH({pane:e,followedView:n,threadEvents:i,followed:o,chats:l,sections:c,members:u,bots:h,statuses:f,meId:v,drafts:y,changes:p,live:w,memory:b,paneChannel:k,activeBot:S,botDirects:N,find:C,onPane:A,onNav:E,onBackToChannel:T,onAddMembers:R,onOpenBot:_,onPin:L,onMute:I,onDeleteChannel:H,onChannelSaved:O,onThreadChanged:P,onInvite:U,onPreview:Y,onNotice:K,onError:q,onBotCard:Q,paneWidth:V,onResize:Z}){var D,F;const ue=(e==null?void 0:e.kind)==="thread"?e:null,z=(ue==null?void 0:ue.mode)==="full",he=()=>A(null),oe=(ie,$,X)=>void ae.chat(ie).then(ee=>C.openMessage(ee,$,X),q);return r.jsxs(r.Fragment,{children:[n&&!z&&r.jsx(FH,{events:i,summary:o,chats:l,members:u,bots:h,onNav:E,renderThread:(ie,$)=>r.jsx(gw,{threadId:ie.id,mode:"embed",channel:l.find(X=>X.id===ie.parentId),drafts:y,members:u,bots:h,me:v,live:w,memory:b,onNav:E,onChanged:P,onClose:$,onToggleMode:()=>T({id:ie.id,parentId:ie.parentId},!0),onInvite:X=>U(ie.parentId,X),onPreview:Y,onError:q,onNotice:K,onOpenMessage:oe,onBotCard:Q},ie.id)}),ue&&r.jsx(gw,{threadId:ue.id,mode:ue.mode,showSummary:ue.summary,focus:ue.focus,onSearch:C.search,channel:l.find(ie=>ie.id===ue.parentId),drafts:y,members:u,bots:h,me:v,live:w,memory:b,onNav:E,onChanged:P,onClose:()=>z?T(ue,!1):he(),onToggleMode:()=>z?T(ue,!0):A({...ue,mode:"full"}),onInvite:ie=>U(ue.parentId,ie),onPreview:Y,onError:q,onNotice:K,onOpenMessage:oe,onBotCard:Q},`${ue.id}:${((D=ue.focus)==null?void 0:D.id)??""}:${((F=ue.focus)==null?void 0:F.passage)??""}`),(e==null?void 0:e.kind)==="search"&&r.jsx(CH,{chat:e.chat,chats:l,members:u,focusKey:C.focusKey,onOpenMessage:C.openMessage,onClose:he,onError:q}),(e==null?void 0:e.kind)==="threads"&&k&&r.jsx(LH,{channel:k,members:u,bots:h,changes:p,onOpen:ie=>A({kind:"thread",id:ie,parentId:k.id,mode:"pane"}),onClose:he,onError:q}),(e==null?void 0:e.kind)==="info"&&k&&r.jsx(SH,{channel:k,page:e.page,sections:c,members:Oi(u),bots:h,statuses:f,me:v,onPage:ie=>A({kind:"info",page:ie}),onPin:()=>L(k),onMute:()=>I(k),onAdd:()=>R(k),onBot:_,onDelete:()=>H(k),onChanged:O,onClose:he,onError:q}),(e==null?void 0:e.kind)==="botdms"&&S&&!k&&r.jsx(jH,{bot:S,chats:N,members:u,bots:h,me:v,live:w,onClose:he,onPreview:Y,onError:q}),e&&!z&&r.jsx("div",{className:"jv-resize",style:{right:V-4},onPointerDown:Z,role:"separator","aria-orientation":"vertical","aria-label":m("app.resizePane")})]})}const bw="@goodfish/jarvy",aC="0.17.0",UH={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},$H="Apache-2.0",kv=UH.url.replace(/^git\+/,"").replace(/\.git$/,""),jw=`${kv}/blob/v${aC}`,VH=[{label:"about.source",detail:kv.replace(/^https:\/\//,""),href:kv},{label:"about.package",detail:bw,href:`https://www.npmjs.com/package/${bw}`},{label:"about.license",detail:$H,href:`${jw}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${jw}/THIRD_PARTY_NOTICE.md`}];function GH(){return r.jsxs("div",{className:"jv-page",children:[r.jsx("header",{className:"jv-page-header",children:r.jsx("h2",{children:m("settings.about")})}),r.jsxs("div",{className:"jv-list",children:[r.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[r.jsxs("div",{className:"jv-row-text",children:[r.jsx("strong",{children:"Jarvy"}),r.jsx("span",{children:m("about.tagline")})]}),r.jsx("span",{className:"jv-row-meta",children:m("about.version",{version:aC})})]}),VH.map(e=>r.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[r.jsxs("div",{className:"jv-row-text",children:[r.jsx("strong",{children:m(e.label)}),r.jsx("span",{children:e.detail})]}),r.jsx(Ll,{"aria-hidden":"true"})]},e.label))]})]})}function YH(){const[e,n]=j.useState(document.documentElement.classList.contains("dark")),i=l=>{Oh(l?"dark":"light"),n(l)},o=(l,c,u,h,f)=>r.jsxs("button",{type:"button",role:"radio","aria-checked":u,lang:f,className:"jv-list-row jv-choice-row",onClick:h,children:[r.jsx("span",{className:"jv-row-text",children:r.jsx("strong",{children:c})}),u&&r.jsx(na,{"aria-hidden":"true"})]},l);return r.jsxs("div",{className:"jv-page",children:[r.jsx("header",{className:"jv-page-header",children:r.jsx("h2",{children:m("settings.general")})}),r.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[r.jsx("h3",{id:"general-language",className:"jv-section-title",children:m("general.language")}),r.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:qw.map(l=>o(l,D0(l,"name"),sr()===l,()=>Uw(l),l))})]}),r.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[r.jsx("h3",{id:"general-theme",className:"jv-section-title",children:m("general.theme")}),r.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[o("light",m("general.light"),!e,()=>i(!1)),o("dark",m("general.dark"),e,()=>i(!0))]})]})]})}const KH=`<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>
848
+ `,XH=`<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>
849
+ `,QH='<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>',ZH=`<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>
850
+ `,WH=`<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>
851
+ `,JH=`<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>
852
+ `,eU=`<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>
853
+ `,tU=`<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>
854
+ `,nU=`<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>
855
+ `,aU=`<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>
856
+ `,iU=`<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>
857
+ `,rU=`<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>
858
+ `,oU=`<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>
859
+ `,sU=`<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>
860
+ `,lU=`<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>
861
+ `,cU=`<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>
862
+ `,uU=`<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>
863
+ `,dU=`<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>
864
+ `,hU=`<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>
865
+ `,fU=`<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>
866
+ `,mU=`<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>
867
+ `,pU=`<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>
868
+ `,vU=`<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>
869
+ `,gU=`<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>
870
+ `,yU=`<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>
871
+ `,xU=`<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>
872
+ `,bU=`<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>
873
+ `,jU=`<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>
874
+ `,wU=`<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>
875
+ `,kU=`<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>
876
+ `,SU=Object.assign({"./antgroup.svg":KH,"./anthropic.svg":XH,"./antigravity.svg":QH,"./azure.svg":ZH,"./baseten.svg":WH,"./bedrock.svg":JH,"./cerebras.svg":eU,"./cloudflare.svg":tU,"./deepseek.svg":nU,"./fireworks.svg":aU,"./githubcopilot.svg":iU,"./google.svg":rU,"./groq.svg":oU,"./huggingface.svg":sU,"./kimi.svg":lU,"./meta.svg":cU,"./minimax.svg":uU,"./mistral.svg":dU,"./moonshot.svg":hU,"./nvidia.svg":fU,"./openai.svg":mU,"./opencode.svg":pU,"./openrouter.svg":vU,"./qwen.svg":gU,"./together.svg":yU,"./vercel.svg":xU,"./vertexai.svg":bU,"./xai.svg":jU,"./xiaomimimo.svg":wU,"./zai.svg":kU}),ww={"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"},CU=e=>e&&ww[e]?SU[`./${ww[e]}.svg`]:void 0;function Yg({name:e,provider:n}){var o;const i=CU(n);return i?r.jsx("span",{className:"jv-provider-mark","data-logo":"","aria-hidden":"true",dangerouslySetInnerHTML:{__html:i}}):r.jsx("span",{className:"jv-provider-mark","aria-hidden":"true",children:((o=[...e.trim()][0])==null?void 0:o.toUpperCase())??"?"})}function iC(e){const n=e.authType==="oauth";return e.configured?{ok:!0,label:m(n?"status.signedIn":"status.configured")}:{ok:!1,label:m(n?"status.signedOut":"status.notConfigured")}}const rC=[{id:"custom",label:"group.custom"},{id:"subscription",label:"group.subscription"},{id:"api_key",label:"group.apiKey"}],oC=e=>e.custom?"custom":e.authType==="oauth"?"subscription":"api_key",NU={id:"custom",name:"OpenAI / Anthropic compatible",authType:"api_key",api:"openai-completions",modelCount:0};function EU({onBack:e,onSelect:n}){const[i,o]=j.useState([]),[l,c]=j.useState(""),[u,h]=j.useState(""),[f,v]=j.useState(!0),[y,p]=j.useState(0);j.useEffect(()=>{let k=!0;return v(!0),h(""),ae.modelProviders().then(S=>{k&&o(S.providers)}).catch(S=>{k&&h(Vt(S,"picker.loadFailed"))}).finally(()=>{k&&v(!1)}),()=>{k=!1}},[y]);const w=[NU,...i].filter(k=>`${k.name} ${k.id}`.toLowerCase().includes(l.toLowerCase())),b=k=>oC({authType:k.authType,custom:k.id==="custom"});return r.jsxs("div",{className:"jv-page",children:[r.jsxs("header",{className:"jv-page-header",children:[r.jsx(ke,{variant:"ghost",size:"icon-sm",className:"jv-back",onClick:e,"aria-label":m("picker.back"),children:r.jsx(Av,{})}),r.jsx("h2",{children:m("models.add")})]}),r.jsxs("label",{className:"jv-search",children:[r.jsx(Io,{}),r.jsx("input",{autoFocus:!0,"aria-label":m("picker.search"),placeholder:m("picker.searchPlaceholder"),value:l,onChange:k=>c(k.target.value)})]}),rC.filter(k=>w.some(S=>b(S)===k.id)).map(({id:k,label:S})=>r.jsxs("section",{className:"jv-section","aria-label":m(S),children:[r.jsx("h3",{className:"jv-section-title",children:m(S)}),r.jsx("div",{className:"jv-list",children:w.filter(N=>b(N)===k).map(N=>r.jsxs("button",{className:"jv-list-row",type:"button",onClick:()=>n(N),children:[r.jsx(Yg,{name:N.id==="custom"?"+":N.name,provider:N.id}),r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:N.name}),N.id!=="custom"&&N.authType!=="oauth"&&r.jsx("span",{children:m("picker.keyHint",{count:N.modelCount})})]}),r.jsx(Ti,{className:"jv-row-chevron"})]},`${N.id}:${N.authType}`))})]},k)),f&&r.jsx("p",{role:"status",className:"jv-hint",children:m("picker.loading")}),u&&r.jsxs("div",{className:"jv-empty",role:"alert",children:[r.jsx("strong",{children:u}),r.jsx(ke,{variant:"outline",onClick:()=>p(k=>k+1),children:m("picker.retry")})]}),!f&&!u&&!w.length&&r.jsx("div",{className:"jv-empty",children:r.jsx("strong",{children:m("picker.noMatch")})})]})}const TU=Bv("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 AU({className:e,variant:n,...i}){return r.jsx("span",{"data-slot":"badge",className:Ln(TU({variant:n}),e),...i})}function sC({className:e,...n}){return r.jsx(FM,{"data-slot":"label",className:Ln("flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function MU({connection:e,providerName:n,authType:i,ensureConnection:o,onChanged:l}){var U,Y;const[c,u]=j.useState({phase:"idle"}),[h,f]=j.useState(""),{busy:v,error:y,setError:p,run:w}=rn(),[b,k]=j.useState(0),S=j.useRef(void 0),N=e==null?void 0:e.id,C=j.useRef(l);C.current=l;const A=j.useRef(c.phase);A.current=c.phase,j.useEffect(()=>{if(!N)return;const K=N;let q=!0,Q;async function V(){var Z;try{let ue=await ae.authStatus(K);if(!q)return;if(S.current&&((Z=ue.prompt)==null?void 0:Z.type)==="select"){const he=S.current;if(S.current=void 0,ue=await ae.authInput(K,ue.prompt.id,he),!q)return}const z=A.current==="running"&&ue.phase!=="running";A.current=ue.phase,u(ue),z&&await C.current(),ue.phase==="running"&&q&&(Q=setTimeout(()=>void V(),750))}catch(ue){q&&p(Vt(ue,"auth.statusFailed"))}}return V(),()=>{q=!1,clearTimeout(Q)}},[N,c.phase,b]),j.useEffect(()=>f(""),[(U=c.prompt)==null?void 0:U.id]);async function E(K){await w("act",async()=>{const q=await K();u(q),q.phase!=="running"&&await l()},"common.failed")}function T(K){S.current=K,E(async()=>{const q=N??await o();return ae.authStart(q)})}const R=n==="openai-codex"&&i==="oauth",_=n==="openai"&&i==="oauth",L=c.phase==="running",I=c.prompt,H=c.event,O=(H==null?void 0:H.type)==="auth_url"?H.url:(H==null?void 0:H.type)==="device_code"?H.verificationUri:null,P=K=>{I&&N&&E(()=>ae.authInput(N,I.id,K))};return r.jsxs("section",{className:"jv-auth","aria-label":m("auth.title"),children:[r.jsxs("div",{className:"jv-auth-header",children:[r.jsx("h3",{children:m("auth.title")}),r.jsx(AU,{variant:"outline","data-state":L?"running":e!=null&&e.configured?"connected":"disconnected",children:m(L?"auth.running":e!=null&&e.configured?i==="oauth"?"status.signedIn":"status.configured":i==="oauth"?"status.signedOut":"status.notConfigured")})]}),L?r.jsxs("div",{className:"jv-auth-flow",children:[O&&r.jsx(ke,{asChild:!0,variant:"outline",children:r.jsx("a",{style:{color:"inherit",textDecoration:"none"},href:O,target:"_blank",rel:"noopener noreferrer",children:m("auth.openPage")})}),(H==null?void 0:H.type)==="device_code"&&r.jsx("p",{children:m("auth.code",{code:H.userCode})}),(I==null?void 0:I.type)==="select"&&r.jsx("div",{className:"flex flex-wrap gap-2",children:(Y=I.options)==null?void 0:Y.map(K=>r.jsx(ke,{type:"button",variant:"outline",disabled:v,onClick:()=>P(K.id),children:R&&K.id==="browser"?m("auth.browser"):R&&K.id==="device_code"?m("auth.deviceCode"):K.label},K.id))}),I&&I.type!=="select"&&r.jsxs("div",{className:"jv-auth-input",children:[r.jsx(sC,{htmlFor:`oauth-input-${N??n}`,children:I.type==="manual_code"?m(_?"auth.redirectFull":"auth.redirectOrCode"):I.message}),I.type==="manual_code"&&r.jsx("p",{className:"jv-auth-note",children:m("auth.manualNote")}),r.jsx(Xe,{id:`oauth-input-${N??n}`,type:I.type==="text"?"text":"password",autoComplete:"off",value:h,disabled:v,onChange:K=>f(K.target.value),onKeyDown:K=>{K.key==="Enter"&&!K.nativeEvent.isComposing&&(K.preventDefault(),P(h))}}),r.jsx(ke,{type:"button",variant:"outline",disabled:v||!h.trim(),onClick:()=>P(h),children:m("common.continue")})]}),!I&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:m("auth.waiting")}),(H==null?void 0:H.type)==="info"&&r.jsx("p",{className:"text-sm",children:H.message}),r.jsx(ke,{type:"button",variant:"ghost",disabled:v,onClick:()=>void E(()=>ae.authCancel(N)),children:m("auth.cancel")})]}):r.jsxs(r.Fragment,{children:[n==="antigravity"&&r.jsxs("p",{className:"jv-auth-risk",role:"note",children:[r.jsx(Hh,{"aria-hidden":"true"}),m("auth.antigravityRisk")]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[R?r.jsxs(r.Fragment,{children:[r.jsx(ke,{type:"button",variant:"outline",disabled:v,onClick:()=>T("browser"),children:m("auth.browser")}),r.jsx(ke,{type:"button",variant:"outline",disabled:v,onClick:()=>T("device_code"),children:m("auth.deviceCode")})]}):r.jsx(ke,{type:"button",variant:"outline",disabled:v,onClick:()=>T(),children:m(i==="api_key"?"auth.configureCredential":e!=null&&e.configured?"auth.signInAgain":"auth.signIn")}),(e==null?void 0:e.configured)&&r.jsx(ke,{type:"button",variant:"outline",disabled:v,onClick:()=>void E(async()=>(await ae.authLogout(N),{phase:"idle"})),children:m(i==="api_key"?"auth.removeCredential":"auth.signOut")})]})]}),(y||c.phase==="error")&&r.jsx("p",{role:"alert",className:"jarvy-model-feedback",children:y||m("error.loginFailed")}),y&&r.jsx(ke,{type:"button",variant:"link",disabled:v,onClick:()=>{p(""),k(K=>K+1)},children:m("auth.refresh")})]})}const lC=e=>e.authType==="oauth"&&e.configured&&$N.includes(e.providerName),cC=.2;function _U(e){const[n,i]=j.useState({}),o=e.filter(lC).map(l=>l.id).join(",");return j.useEffect(()=>{let l=!0;for(const c of o?o.split(","):[])ae.connectionQuota(c).then(u=>{l&&i(h=>({...h,[c]:u}))},()=>{});return()=>{l=!1}},[o]),n}function RU({quota:e}){if(!e||e.state!=="ok"||!e.windows.length)return null;const n=e.windows.filter(o=>!o.name),i=n.length?n.slice(0,2):[...e.windows].sort((o,l)=>o.remaining-l.remaining).slice(0,2);return r.jsx(r.Fragment,{children:i.map(o=>r.jsxs(j.Fragment,{children:[" · ",r.jsx("span",{className:"jv-quota-brief","data-low":o.remaining<cC||void 0,children:o.kind==="credits"&&o.amount?m("quota.creditsLeft",{amount:xh(o.amount.left,o.amount.unit)}):m("quota.summary",{label:OU(Sv(o)),percent:dC(o.remaining)})})]},uC(o)))})}const OU=e=>sr()==="zh"&&/[\x21-\x7e]$/.test(e)?`${e} `:e;function DU({connection:e}){const[n,i]=j.useState(),[o,l]=j.useState(!1),[c,u]=j.useState(""),[,h]=j.useState(0),f=e.id;j.useEffect(()=>{let p=!0;i(void 0),u(""),ae.connectionQuota(f).then(b=>{p&&i(b)},b=>{p&&u(Vt(b,"common.failed"))});const w=setInterval(()=>h(b=>b+1),3e4);return()=>{p=!1,clearInterval(w)}},[f]);async function v(){l(!0),u("");try{i(await ae.connectionQuota(f,!0))}catch(p){u(Vt(p,"common.failed"))}finally{l(!1)}}if((n==null?void 0:n.state)==="none"&&!n.link)return null;const y=n!=null&&n.checkedAt?m(n.source==="response"?"quota.fromReply":"quota.checked",{time:BU(n.checkedAt)}):"";return r.jsxs("section",{className:"jv-section","aria-label":m("quota.title"),children:[r.jsxs("div",{className:"jv-section-head",children:[r.jsxs("h3",{className:"jv-section-title",children:[m("quota.title"),(n==null?void 0:n.plan)&&r.jsx("span",{children:LU(n.plan)})]}),n&&n.state!=="none"&&r.jsxs("div",{className:"jv-section-actions",children:[y&&r.jsx("span",{className:"jv-quota-when",children:y}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>void v(),children:[r.jsx(du,{className:o?"animate-spin":void 0}),m("quota.refresh")]})]})]}),r.jsxs("div",{className:"jv-panel jv-quota",children:[!n&&!c&&r.jsx("p",{role:"status",className:"jv-hint",children:m("quota.checking")}),(n==null?void 0:n.state)==="none"&&r.jsxs("div",{className:"jv-quota-none",children:[r.jsx("p",{className:"jv-hint",children:m("quota.noReport")}),r.jsx(ke,{asChild:!0,variant:"outline",size:"sm",children:r.jsxs("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",children:[m("quota.openPage"),r.jsx(Ll,{})]})})]}),(n==null?void 0:n.state)==="unchecked"&&r.jsx("p",{className:"jv-hint",children:m("quota.unchecked")}),(n==null?void 0:n.state)==="ok"&&!n.windows.length&&r.jsx("p",{className:"jv-hint",children:m("quota.unlimited")}),n==null?void 0:n.windows.map(p=>r.jsx(zU,{window:p},uC(p))),(c||(n==null?void 0:n.error))&&r.jsx("p",{role:"alert",className:"jv-quota-error",children:c||((n==null?void 0:n.state)==="failed"?m("quota.failed",{error:n.error}):m("quota.stale",{error:n.error}))})]})]})}function zU({window:e}){const n=e.remaining<cC;return r.jsxs("div",{className:"jv-quota-row","data-low":n||void 0,children:[r.jsxs("div",{className:"jv-quota-line",children:[r.jsx("strong",{children:Sv(e)}),r.jsx("span",{children:e.kind==="credits"&&e.amount?m("quota.creditsLeft",{amount:xh(e.amount.left,e.amount.unit)}):m("quota.left",{percent:dC(e.remaining)})})]}),r.jsx("div",{className:"jv-quota-bar",role:"meter","aria-label":Sv(e),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.remaining*100),children:r.jsx("span",{style:{width:`${Math.max(e.remaining>0?2:0,e.remaining*100)}%`}})}),(e.resetsAt||e.amount)&&r.jsxs("div",{className:"jv-quota-meta",children:[r.jsx("span",{children:e.resetsAt?IU(e.resetsAt):""}),e.amount&&r.jsx("span",{children:m("quota.amountLeft",{left:xh(e.amount.left,e.amount.unit),total:xh(e.amount.total,e.amount.unit)})})]})]})}const uC=e=>`${e.kind}-${e.hours??""}-${e.name??""}`;function Sv(e){const n=e.kind==="hours"?m("quota.hours",{count:e.hours??0}):e.kind==="pool"?"":m(`quota.${e.kind}`),i=e.name==="premium"||e.name==="chat"||e.name==="completions"?m(`quota.${e.name}`):e.name;return i?n&&e.kind!=="month"?m("quota.named",{name:i,window:n}):i:n}const dC=e=>la(e,{style:"percent",maximumFractionDigits:0}),xh=(e,n)=>n==="usd"?la(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",maximumFractionDigits:2}):la(e,{maximumFractionDigits:0}),LU=e=>e.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase());function BU(e){const n=Math.floor((Date.now()-e)/6e4);return n<1?m("quota.justNow"):n<60?m("quota.minutesAgo",{count:n}):m("quota.hoursAgo",{count:Math.floor(n/60)})}function IU(e){const n=Math.ceil((e-Date.now())/6e4);if(n<=0)return m("quota.resetsSoon");if(n<60)return m("quota.resetsInMinutes",{count:n});if(n<1440)return m("quota.resetsInHours",{count:Math.round(n/60)});const i=sr()==="zh";return m("quota.resetsOn",{date:ta(e,{month:i?"long":"short",day:"numeric",hour:i?"2-digit":"numeric",minute:"2-digit"})})}async function PU(e,n,i){try{return await ae.autoconfigModel({modelId:e.id,api:e.api||n,...i?{choice:i}:{}})}catch(o){return{status:"error",message:Vt(o,"auto.failed")}}}function qU(e,n){if(n.status!=="matched")return{...e,auto:n};const{fields:i,...o}=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:o}}const hC=e=>`${e.provider} / ${e.modelId}`;function kw({items:e,onPick:n}){return r.jsx("div",{className:"jv-auto-sources",children:e.map(i=>r.jsxs("button",{type:"button",onClick:()=>n(i),children:[r.jsx("span",{className:"jv-mono",children:hC(i)}),i.official&&r.jsx("em",{children:m("auto.official")}),r.jsx("small",{children:i.api})]},`${i.provider}/${i.modelId}`))})}function FU({state:e,modelId:n,onRun:i}){const o=c=>i({provider:c.provider,modelId:c.modelId}),l=(e==null?void 0:e.status)==="pending";return r.jsxs("div",{className:"jv-autoconfig","aria-live":"polite",children:[r.jsxs(ke,{type:"button",variant:"outline",size:"sm",disabled:!n.trim()||l,onClick:()=>i(),children:[r.jsx(C3,{}),m(l?"auto.pending":"auto.run")]}),e&&!l&&r.jsxs("div",{className:"jv-auto-result",children:[e.status==="matched"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{children:Tv("auto.matched",{source:r.jsx("strong",{className:"jv-mono",children:hC(e.source)}),note:e.reseller?m("auto.reseller"):"",suffix:m("auto.applied")})}),e.apiMismatch&&r.jsx("p",{className:"jv-auto-warn",children:m("auto.apiMismatch",{api:e.source.api})}),e.alternatives.length>0&&r.jsxs("details",{children:[r.jsx("summary",{children:m("auto.changeSource")}),r.jsx(kw,{items:e.alternatives,onPick:o})]})]}),e.status==="choose"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{children:e.reason==="multiple"?m("auto.multiple"):m("auto.similar",{modelId:n})}),r.jsx(kw,{items:e.options,onPick:o})]}),e.status==="none"&&r.jsx("p",{children:m("auto.notFound")}),e.status==="error"&&r.jsx("p",{role:"alert",children:e.message})]})]})}const M0=["openai","openrouter","deepseek","zai","qwen","together","baseten","chat-template","qwen-chat-template","string-thinking","ant-ling"],fC=[["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"]],mC=e=>e==="xhigh"||e==="max";function pC(e,n){const i=e[n];return i===null||i===void 0&&mC(n)?"unsupported":i===void 0?"default":"custom"}function HU(e){return e.reasoning?fC.filter(([n])=>pC(e.thinkingLevelMap,n)!=="unsupported").map(([,n])=>m(n)):[m("thinking.level.off")]}function UU({model:e,api:n,onChange:i}){const o=e.thinkingLevelMap,l=(h,f,v)=>{const y={...o};f==="default"?delete y[h]:f==="unsupported"?y[h]=null:y[h]=v??(typeof o[h]=="string"?o[h]:h),i({thinkingLevelMap:y})},c=n==="openai-completions",u=e.thinkingFormat&&!M0.includes(e.thinkingFormat)?[...M0,e.thinkingFormat]:M0;return r.jsxs("section",{className:"jv-thinking",children:[r.jsx("h4",{children:m("thinking.title")}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("thinking.format")}),r.jsxs(Vr,{value:e.thinkingFormat||"default",disabled:!c&&!e.thinkingFormat,onValueChange:h=>i({thinkingFormat:h==="default"?"":h}),children:[r.jsx(Yr,{"aria-label":m("thinking.format"),children:r.jsx(Gr,{})}),r.jsxs(Kr,{className:"jv-select-menu",children:[r.jsx(Da,{value:"default",children:m("thinking.protocolDefault")}),u.map(h=>r.jsx(Da,{value:h,children:h},h))]})]}),!c&&r.jsx("small",{className:"jv-field-hint",children:m("thinking.onlyCompletions")})]}),r.jsx("div",{className:"jv-thinking-levels",role:"group","aria-label":m("thinking.levels"),children:fC.map(([h,f])=>{const v=pC(o,h);return r.jsxs("div",{className:"jv-thinking-level",children:[r.jsxs("span",{children:[m(f),r.jsx("code",{children:h})]}),r.jsxs(Vr,{value:v,onValueChange:y=>l(h,y),children:[r.jsx(Yr,{"aria-label":m("thinking.levelName",{level:m(f)}),children:r.jsx(Gr,{})}),r.jsxs(Kr,{className:"jv-select-menu",children:[!mC(h)&&r.jsx(Da,{value:"default",children:m("thinking.supportedDefault")}),r.jsx(Da,{value:"unsupported",children:m("thinking.unsupported")}),r.jsx(Da,{value:"custom",children:m("thinking.supportedCustom")})]})]}),v==="custom"?r.jsx(Xe,{className:"jv-mono",required:!0,"aria-label":m("thinking.levelValue",{level:m(f)}),maxLength:80,value:o[h]??"",onChange:y=>l(h,"custom",y.target.value)}):r.jsx("span",{})]},h)})}),r.jsx("p",{className:"jv-field-hint",children:m("thinking.supported",{levels:HU(e).join(" · ")})})]})}const _0=[{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"}],$U=()=>({id:"",name:"",reasoning:!1,input:["text"],contextWindow:null,maxTokens:null,thinkingFormat:"",thinkingLevelMap:{},compat:{},cost:null});function Cv({value:e,onChange:n,allowDefault:i=!1}){const o=_0.some(l=>l.id===e)||!e?_0:[..._0,{id:e,label:e}];return r.jsxs(Vr,{value:e||"default",onValueChange:l=>n(l==="default"?"":l),children:[r.jsx(Yr,{"aria-label":m("editor.protocol"),children:r.jsx(Gr,{})}),r.jsxs(Kr,{className:"jv-select-menu",children:[i&&r.jsx(Da,{value:"default",children:m("card.defaultProtocol")}),o.map(l=>r.jsx(Da,{value:l.id,children:l.label},l.id))]})]})}const VU=e=>e>=1e6?`${+(e/1e6).toFixed(2)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e),Sw={pending:"auto.pending",choose:"auto.tagChoose",none:"auto.tagNone",error:"auto.failed"};function GU({value:e,onChange:n}){const i=f=>Object.keys(f).length?JSON.stringify(f,null,2):"",[o,l]=j.useState(()=>i(e)),[c,u]=j.useState(""),h=j.useRef(null);return j.useEffect(()=>{var f;try{if(JSON.stringify(JSON.parse(o||"{}"))===JSON.stringify(e))return}catch{}l(i(e)),u(""),(f=h.current)==null||f.setCustomValidity("")},[e]),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("card.compat")}),r.jsx(Ps,{ref:h,className:"jv-mono jv-compat",rows:Math.min(10,Math.max(2,o.split(`
877
+ `).length)),placeholder:"{}",value:o,onChange:f=>{l(f.target.value);try{const v=JSON.parse(f.target.value||"{}");if(!v||typeof v!="object"||Array.isArray(v))throw new Error;n(v),u(""),f.currentTarget.setCustomValidity("")}catch{u(m("card.jsonObject")),f.currentTarget.setCustomValidity(m("card.jsonObject"))}}}),c&&r.jsx("small",{role:"alert",children:c})]})}function YU({draft:e,protocol:n,onChange:i,onRemove:o,onAutoconfig:l}){const{model:c}=e,[u,h]=j.useState(!c.id),[f,v]=j.useState(!1),[y,p]=j.useState(()=>(c.headerNames??[]).map(S=>({name:S,value:"",saved:!0}))),w=S=>i({...e,model:{...c,...S}}),b=(S,N)=>r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:S}),N]}),k=(S,N,C)=>{const A=y.map((T,R)=>R===S?{...T,[N]:C}:T);p(A);const E={...c.headerUpdates};!y[S].saved&&y[S].name&&y[S].name!==A[S].name&&(E[y[S].name]=null);for(const T of A)T.name&&(T.value||!T.saved)&&(E[T.name]=T.value);w({headerUpdates:E})};return r.jsxs("article",{className:`jv-model-card ${e.selected?"is-selected":""}`,children:[r.jsxs("div",{className:"jv-model-summary",children:[r.jsx("input",{type:"checkbox",checked:e.selected,"aria-label":m("card.use",{name:c.id||m("card.newModel")}),onChange:S=>i({...e,selected:S.target.checked})}),r.jsxs("button",{type:"button","aria-expanded":u,className:"jv-model-expand",onClick:()=>h(!u),children:[r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:c.name||c.id||m("card.newModel")}),r.jsx("span",{className:"jv-mono",children:c.id||m("card.enterId")})]}),r.jsxs("span",{className:"jv-chips",children:[c.contextWindow&&r.jsx("span",{className:"jv-chip",children:VU(c.contextWindow)}),c.input.includes("image")&&r.jsx("span",{className:"jv-chip",children:m("card.image")}),c.reasoning&&r.jsx("span",{className:"jv-chip",children:m("card.reasoning")}),e.auto&&Sw[e.auto.status]&&r.jsx("span",{className:"jv-chip jv-chip-warn",children:m(Sw[e.auto.status])})]}),r.jsx(Di,{className:"jv-expand-icon"})]}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-model-remove","aria-label":m("card.remove",{name:c.id||m("card.newModel")}),onClick:o,children:r.jsx(wh,{})})]}),u&&r.jsxs("div",{className:"jv-model-fields",children:[r.jsxs("div",{className:"jv-field-grid",children:[b(m("card.modelId"),r.jsx(Xe,{className:"jv-mono",required:!0,value:c.id,onChange:S=>w({id:S.target.value}),placeholder:"model-id"})),b(m("card.modelName"),r.jsx(Xe,{value:c.name,onChange:S=>w({name:S.target.value}),placeholder:m("card.optional")}))]}),r.jsx(FU,{state:e.auto,modelId:c.id,onRun:l}),r.jsxs("section",{children:[r.jsx("h4",{children:m("card.capabilities")}),r.jsxs("div",{className:"flex flex-wrap gap-5",children:[r.jsxs("label",{className:"jarvy-model-check",children:[r.jsx("input",{type:"checkbox",checked:c.reasoning,onChange:S=>w({reasoning:S.target.checked})}),m("card.reasoningThinking")]}),r.jsxs("label",{className:"jarvy-model-check",children:[r.jsx("input",{type:"checkbox",checked:c.input.includes("image"),onChange:S=>w({input:S.target.checked?["text","image"]:["text"]})}),m("card.imageInput")]})]})]}),c.reasoning&&r.jsx(UU,{model:c,api:c.api||n,onChange:w}),r.jsxs("section",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h4",{children:m("card.specs")}),r.jsx(ke,{type:"button",variant:"link",size:"sm",onClick:()=>v(!f),children:m(f?"card.hidePrices":"card.editPrices")})]}),r.jsxs("div",{className:"jv-field-grid",children:[b(m("card.context"),r.jsx(Xe,{type:"number",min:1,value:c.contextWindow??"",placeholder:m("card.notProvided"),onChange:S=>w({contextWindow:S.target.value?Number(S.target.value):null})})),b(m("card.maxOutput"),r.jsx(Xe,{type:"number",min:1,value:c.maxTokens??"",placeholder:m("card.notProvided"),onChange:S=>w({maxTokens:S.target.value?Number(S.target.value):null})}))]}),r.jsx("h4",{className:"jv-cost-title",children:m("card.costTitle")}),r.jsx("div",{className:"jv-costs",children:[["input","card.costInput"],["output","card.costOutput"],["cacheRead","card.costCacheRead"],["cacheWrite","card.costCacheWrite"]].map(([S,N])=>{var C,A;return r.jsxs("div",{children:[r.jsx(sC,{children:m(N)}),f?r.jsx(Xe,{type:"number",step:"any",min:0,value:((C=c.cost)==null?void 0:C[S])??"",onChange:E=>w({cost:{input:0,output:0,cacheRead:0,cacheWrite:0,...c.cost,[S]:Number(E.target.value)}})}):r.jsx("span",{children:((A=c.cost)==null?void 0:A[S])??m("card.notProvided")})]},S)})})]}),r.jsxs("details",{className:"jv-advanced",children:[r.jsxs("summary",{children:[m("card.advanced"),r.jsx(Di,{className:"size-4"})]}),r.jsxs("div",{className:"jv-advanced-fields",children:[r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("card.apiOverride")}),r.jsx(Cv,{allowDefault:!0,value:c.api??"",onChange:S=>w({api:S,baseUrl:void 0})})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("card.headers")}),y.map((S,N)=>r.jsxs("div",{className:"jv-header-row",children:[r.jsx(Xe,{className:"jv-mono","aria-label":"Header Name",placeholder:"Header-Name",readOnly:S.saved,value:S.name,onChange:C=>k(N,"name",C.target.value)}),r.jsx(Xe,{"aria-label":"Header Value",type:"password",autoComplete:"off",placeholder:S.saved?m("card.headerSaved"):"value",value:S.value,onChange:C=>k(N,"value",C.target.value)}),r.jsx(ke,{type:"button",size:"icon-sm",variant:"ghost","aria-label":m("card.removeHeader"),onClick:()=>{p(y.filter((C,A)=>A!==N)),S.name&&w({headerUpdates:{...c.headerUpdates,[S.name]:null}})},children:r.jsx(wh,{})})]},N)),r.jsxs(ke,{type:"button",variant:"outline",size:"sm",className:"self-start",onClick:()=>p([...y,{name:"",value:"",saved:!1}]),children:[r.jsx(Mi,{}),m("card.addHeader")]})]}),r.jsx(GU,{value:c.compat,onChange:S=>w({compat:S})})]})]})]})]})}let KU=0;const sh=(e,n,i=!1)=>({key:`draft-${++KU}`,model:e,selected:n,...i?{originalId:e.id}:{}});function XU({connection:e,preset:n,defaultName:i,saved:o=!1,onBack:l,onSaved:c,onConnected:u,onChanged:h}){const f=e?e.kind==="custom":(n==null?void 0:n.id)==="custom",v=(e==null?void 0:e.authType)??n.authType,[y,p]=j.useState(e?f?e.providerName:e.displayName:f?"":i),[w,b]=j.useState((e==null?void 0:e.baseUrl)??""),[k,S]=j.useState((e==null?void 0:e.api)??n.api),[N,C]=j.useState(""),[A,E]=j.useState(()=>((e==null?void 0:e.models)??[]).map(J=>sh(J,!0,!0))),[T,R]=j.useState([]),[_,L]=j.useState(""),{busy:I,error:H,setError:O,run:P}=rn(),[U,Y]=j.useState(!1),[K,q]=j.useState(o?m("editor.saved"):""),[Q,V]=j.useState(null),Z=j.useRef(e==null?void 0:e.id);function ue(J){E(je=>{const Re=new Set(je.map(De=>De.model.id));return[...je,...J.filter(De=>!Re.has(De.id)).map(De=>sh(De,!1))]})}j.useEffect(()=>{if(f)return;let J=!0;return Y(!0),(e?ae.modelCatalog(e.id):ae.providerModels(n.id)).then(Re=>{if(!J)return;const De=new Set(Re.models.map(Pe=>Pe.id));e!=null&&e.configured&&E(Pe=>Pe.filter(Le=>Le.selected||Le.originalId!==void 0||De.has(Le.model.id))),ue(Re.models)}).catch(Re=>{J&&O(Vt(Re,"editor.fetchFailed"))}).finally(()=>{J&&Y(!1)}),()=>{J=!1}},[e==null?void 0:e.id,e==null?void 0:e.configured,n==null?void 0:n.id,f]);async function z(){Y(!0),O(""),q("");try{const J=await ae.discoverModels({connectionId:Z.current,baseUrl:w,api:k,...N.trim()?{apiKey:N}:{}});ue(J.models),q(J.models.length?m("editor.fetched",{count:J.models.length}):m("editor.noneReturned"))}catch(J){O(Vt(J,"editor.fetchFailed"))}finally{Y(!1)}}async function he(J,je){const Re=A.filter(Pe=>J.includes(Pe.key)&&Pe.model.id.trim());if(!Re.length)return;O(""),q(""),E(Pe=>Pe.map(Le=>Re.some(He=>He.key===Le.key)?{...Le,auto:{status:"pending"}}:Le));const De={matched:0,choose:0,none:0,error:0};for(const Pe of Re){const Le=await PU(Pe.model,k,je);De[Le.status]++,E(He=>He.map(at=>at.key===Pe.key?qU(at,Le):at))}Re.length>1&&q(m("editor.autoSummary",{parts:[m("editor.autoMatched",{count:De.matched}),De.choose&&m("editor.autoChoose",{count:De.choose}),De.none&&m("editor.autoNone",{count:De.none}),De.error&&m("editor.autoFailed",{count:De.error})].filter(Boolean).join(m("common.listSeparator"))}))}async function oe(){if(!Z.current){const J=await ae.createModelConnection({providerName:n.id,displayName:y,kind:"builtin",authType:v,baseUrl:w,api:k});Z.current=J.id}return await u(Z.current),Z.current}async function D(J){J.preventDefault(),q(""),await P("save",async()=>{let je;Z.current?(je=await ae.updateModelConnection(Z.current,{displayName:y,...f?{providerName:y}:{},baseUrl:w,api:k}),f&&N.trim()&&await ae.saveModelCredential(je.id,N)):(je=await ae.createModelConnection({providerName:f?y:n.id,displayName:y,kind:f?"custom":"builtin",authType:v,baseUrl:w,api:k,...f&&N.trim()?{apiKey:N}:{}}),Z.current=je.id);for(const Re of A)Re.selected&&await ae.saveConnectionModel(je.id,Re.model,Re.originalId);for(const Re of new Set([...T,...A.filter(De=>De.originalId&&!De.selected).map(De=>De.originalId)]))await ae.deleteConnectionModel(je.id,Re);C(""),await c(je.id),q(m("editor.saved"))},"editor.saveFailed")}async function F(){q(""),await P("reset",async()=>V(await ae.modelResetPlan(e.id)),"editor.resetFailed")}async function ie(){q(""),await P("reset",async()=>{const je=await ae.resetModelConnection(e.id);V(null),R([]),b(je.baseUrl),S(je.api),E(je.models.map(Re=>sh(Re,!0,!0))),ue((await ae.modelCatalog(je.id)).models),await h()},"editor.resetFailed")&&q(m("editor.resetDone"))}async function $(){!e||!confirm(m("editor.confirmDelete",{name:e.displayName}))||await P("delete",async()=>{await ae.deleteModelConnection(e.id),await h(),l()},"editor.deleteFailed")}const X=A.filter(J=>`${J.model.id} ${J.model.name}`.toLowerCase().includes(_.toLowerCase())),ee=A.filter(J=>J.selected).length,me=f?(e==null?void 0:e.displayName)??m("group.custom"):(e==null?void 0:e.displayName)??n.name,te=e?iC(e):null,ce=A.some(J=>{var je;return((je=J.auto)==null?void 0:je.status)==="pending"});return r.jsxs("form",{className:"jv-editor",onChange:()=>q(""),onSubmit:J=>void D(J),children:[r.jsxs("header",{className:"jv-editor-header",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-back",disabled:I,onClick:l,"aria-label":m("editor.back"),children:r.jsx(Av,{})}),r.jsx(Yg,{name:me,provider:e?e.kind==="builtin"?e.providerName:void 0:n==null?void 0:n.id}),r.jsxs("div",{className:"jv-row-text",children:[r.jsx("strong",{children:me}),r.jsx("span",{children:f?"OpenAI / Anthropic compatible":m(v==="oauth"?"group.subscription":"group.apiKey")})]}),te&&r.jsx("span",{className:"jv-status","data-ok":te.ok||void 0,children:te.label}),e&&r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-danger-icon",disabled:I,onClick:()=>void $(),"aria-label":m("editor.delete"),children:r.jsx(wh,{})})]}),r.jsxs("div",{className:"jv-editor-scroll",children:[r.jsxs("section",{className:"jv-section","aria-label":m("editor.connection"),children:[r.jsx("h3",{className:"jv-section-title",children:m("editor.connection")}),r.jsx("div",{className:"jv-panel",children:f?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("editor.providerName")}),r.jsx(Xe,{className:"jv-mono",required:!0,maxLength:80,"aria-label":m("editor.providerName"),placeholder:"my-provider",value:y,onChange:J=>p(J.target.value)})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("editor.protocol")}),r.jsx(Cv,{value:k,onChange:S})]})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("editor.url")}),r.jsx(Xe,{required:!0,type:"url","aria-label":m("editor.url"),value:w,placeholder:"https://api.example.com/v1",onChange:J=>b(J.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("editor.key")}),r.jsx(Xe,{type:"password",autoComplete:"new-password","aria-label":m("editor.key"),placeholder:m(e!=null&&e.configured?"editor.keySaved":"editor.keyPlaceholder"),value:N,onChange:J=>C(J.target.value)})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("editor.name")}),r.jsx(Xe,{required:!0,maxLength:100,"aria-label":m("editor.name"),value:y,onChange:J=>p(J.target.value)})]}),r.jsx(MU,{connection:e,providerName:(e==null?void 0:e.providerName)??n.id,authType:v,ensureConnection:oe,onChanged:h}),r.jsxs("details",{className:"jv-advanced",children:[r.jsxs("summary",{children:[r.jsx(Di,{}),m("editor.settings")]}),r.jsxs("div",{className:"jv-advanced-fields",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("editor.url")}),r.jsx(Xe,{className:"jv-mono",value:w,placeholder:m("editor.defaultUrl"),onChange:J=>b(J.target.value)})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:"API Protocol"}),r.jsx(Cv,{value:k,onChange:S})]})]})]})]})})]}),e&&lC(e)&&r.jsx(DU,{connection:e}),r.jsxs("section",{className:"jv-section","aria-label":m("editor.models"),children:[r.jsxs("div",{className:"jv-section-head",children:[r.jsxs("h3",{className:"jv-section-title",children:[m("settings.models")," ",r.jsx("span",{children:m("editor.selected",{selected:ee,total:A.length})})]}),r.jsxs("div",{className:"jv-section-actions",children:[f&&r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:I||U||!w.trim()||!(N.trim()||e!=null&&e.configured),onClick:()=>void z(),children:[r.jsx(_v,{}),m(U?"editor.fetching":"editor.fetch")]}),ee>0&&r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:I||ce,onClick:()=>void he(A.filter(J=>J.selected).map(J=>J.key)),children:[r.jsx(C3,{}),m("editor.autoSelected")]}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>E([...A,sh($U(),!0)]),children:[r.jsx(Mi,{}),m("editor.addManually")]}),e&&!f&&r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:I||U||!!Q,onClick:()=>void F(),children:[r.jsx(v3,{}),m("editor.reset")]})]})]}),Q&&r.jsx(QU,{plan:Q,busy:I,onCancel:()=>V(null),onConfirm:()=>void ie()}),A.length>6&&r.jsxs("div",{className:"jv-models-filter",children:[r.jsxs("label",{className:"jv-search",children:[r.jsx(Io,{}),r.jsx("input",{"aria-label":m("editor.filter"),placeholder:m("editor.filterPlaceholder"),value:_,onChange:J=>L(J.target.value)})]}),r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(J=>J.map(je=>X.includes(je)?{...je,selected:!0}:je)),children:m("editor.selectVisible")})]}),U&&!f&&r.jsx("p",{role:"status",className:"jv-hint",children:m("editor.loadingCatalog")}),r.jsx("div",{className:"jv-model-cards",children:X.map(J=>r.jsx(YU,{draft:J,protocol:k,onAutoconfig:je=>void he([J.key],je),onChange:je=>E(Re=>Re.map(De=>De.key===J.key?je:De)),onRemove:()=>{J.originalId&&R(je=>[...je,J.originalId]),E(je=>je.filter(Re=>Re.key!==J.key))}},J.key))}),!U&&!A.length&&r.jsxs("div",{className:"jv-empty",children:[r.jsx("strong",{children:m("editor.empty")}),r.jsx("span",{children:m(f?"editor.emptyCustom":"editor.emptyBuiltin")})]})]})]}),r.jsxs("footer",{className:"jv-editor-footer",children:[r.jsx("div",{"aria-live":"polite",children:H?r.jsx("p",{role:"alert",children:H}):K?r.jsx("p",{role:"status",children:K}):null}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:I||U||ce,children:m(I?"editor.saving":"editor.save")})]})]})}function QU({plan:e,busy:n,onCancel:i,onConfirm:o}){const l=[...new Set(e.removed.flatMap(u=>u.bots))],c=m("common.listSeparator");return r.jsxs("div",{className:"jv-reset-confirm",role:"group","aria-label":m("editor.resetTitle"),children:[r.jsx("strong",{children:m("editor.resetTitle")}),e.reset.length>0&&r.jsx("p",{children:m("editor.resetModels",{count:e.reset.length})}),e.removed.length>0&&r.jsx("p",{children:m("editor.resetRemoves",{count:e.removed.length,names:e.removed.map(u=>u.name||u.id).join(c)})}),l.length>0&&r.jsx("p",{className:"jv-reset-bots",children:m("editor.resetBots",{count:l.length,bots:l.join(c)})}),r.jsx("p",{children:m("editor.resetKeeps")}),r.jsxs("div",{className:"jv-reset-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:i,children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:n,onClick:o,children:m("editor.resetConfirm")})]})]})}function ZU({connections:e,onChanged:n}){const[i,o]=j.useState("list"),[l,c]=j.useState(),[u,h]=j.useState(),[f,v]=j.useState(0),y=_U(i==="list"?e:[]),p=()=>{o("list"),h(void 0),c(void 0),v(0)},w=k=>oC({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"?r.jsx(EU,{onBack:p,onSelect:k=>{c(k),h(void 0),o("editor")}}):i==="editor"?r.jsx(XU,{connection:e.find(k=>k.id===u),preset:l,defaultName:b,saved:f>0,onBack:p,onChanged:n,onConnected:async k=>{await n(),h(k),c(void 0)},onSaved:async k=>{await n(),h(k),c(void 0),v(S=>S+1)}},f):r.jsxs("div",{className:"jv-page",children:[r.jsxs("header",{className:"jv-page-header",children:[r.jsx("h2",{children:m("settings.models")}),r.jsxs(ke,{className:"jv-primary",onClick:()=>o("choose"),children:[r.jsx(Mi,{}),m("models.add")]})]}),!e.length&&r.jsx("div",{className:"jv-empty",children:r.jsx("strong",{children:m("models.empty")})}),rC.filter(k=>e.some(S=>w(S)===k.id)).map(({id:k,label:S})=>r.jsxs("section",{className:"jv-section","aria-label":m(S),children:[r.jsx("h3",{className:"jv-section-title",children:m(S)}),r.jsx("div",{className:"jv-list",children:e.filter(N=>w(N)===k).map(N=>{const C=iC(N);return r.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>{h(N.id),c(void 0),o("editor")},children:[r.jsx(Yg,{name:N.displayName,provider:N.kind==="builtin"?N.providerName:void 0}),r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:N.displayName}),r.jsxs("span",{children:[N.models.length?m("models.count",{count:N.models.length}):m("models.none"),r.jsx(RU,{quota:y[N.id]})]})]}),r.jsx("span",{className:"jv-status","data-ok":C.ok||void 0,children:C.label}),r.jsx(Ti,{className:"jv-row-chevron"})]},N.id)})})]},k))]})}function WU({info:e,onSaved:n}){const[i,o]=j.useState(String(e.ports.from)),[l,c]=j.useState(String(e.ports.to)),[u,h]=j.useState(null),[f,v]=j.useState(!1),y=i!==String(e.ports.from)||l!==String(e.ports.to),p=async w=>{w.preventDefault(),v(!0),h(null);try{const b=await ae.setPortRange({from:Number(i),to:Number(l)});n(b),o(String(b.ports.from)),c(String(b.ports.to)),h({error:!1,text:m("ports.rangeSaved")})}catch(b){h({error:!0,text:Vt(b)})}finally{v(!1)}};return r.jsxs("section",{className:"jv-section","aria-labelledby":"network-ports",children:[r.jsx("h3",{id:"network-ports",className:"jv-section-title",children:m("ports.range")}),r.jsxs("form",{className:"jv-panel jv-conn-ports",onSubmit:w=>void p(w),children:[r.jsxs("div",{className:"jv-conn-range",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("ports.rangeFrom")}),r.jsx(Xe,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:i,onChange:w=>{o(w.target.value),h(null)}})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("ports.rangeTo")}),r.jsx(Xe,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:l,onChange:w=>{c(w.target.value),h(null)}})]})]}),r.jsx("small",{className:"jv-hint",children:m("ports.rangeHint")}),r.jsxs("div",{className:"jv-form-footer",children:[u?r.jsx("p",{className:u.error?"jv-note-error":"jv-hint",role:u.error?"alert":"status",children:u.text}):r.jsx("span",{}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:f||!y,children:m("common.save")})]})]})]})}function JU(){var w;const[e,n]=j.useState(null),[i,o]=j.useState(null),[l,c]=j.useState(!1),[u,h]=j.useState(!1),[f,v]=j.useState(!1);j.useEffect(()=>{ae.connection().then(n).catch(()=>v(!0))},[]);const y=b=>r.jsxs("div",{className:"jv-page",children:[r.jsx("header",{className:"jv-page-header",children:r.jsx("h2",{children:m("settings.network")})}),r.jsxs("section",{className:"jv-section","aria-labelledby":"network-lan",children:[r.jsx("h3",{id:"network-lan",className:"jv-section-title",children:m("connection.lan")}),b]}),f&&r.jsx("p",{className:"jv-note-error",role:"alert",children:m("common.failed")}),e&&r.jsx(WU,{info:e,onSaved:n})]});if(!e)return y(null);if(!e.https)return y(r.jsx("div",{className:"jv-list",children:r.jsx("div",{className:"jv-list-row jv-static-row jv-conn-local",children:r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:m("connection.localOnly")}),r.jsx("span",{children:Tv("connection.localOnlyHint",{flag:r.jsx("code",{children:"--host 0.0.0.0"})})})]})})}));const p=async()=>{h(!0),v(!1);try{n(await ae.setConnection(!e.allowHttp))}catch{v(!0)}finally{h(!1)}};return y(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"jv-list",role:"group","aria-label":m("connection.addresses"),children:e.addresses.map(b=>r.jsxs("div",{className:"jv-list-row jv-static-row",children:[r.jsx("span",{className:"jv-row-text",children:r.jsx("code",{children:b})}),r.jsx(ke,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m(i===b?"ui.copied":"connection.copy"),onClick:()=>void Kl(b).then(k=>o(k?b:null)),children:i===b?r.jsx(na,{}):r.jsx(Os,{})})]},b))}),r.jsxs("div",{className:"jv-list jv-conn-cert",children:[r.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-root",children:[r.jsx("span",{className:"jv-row-text",children:r.jsx("strong",{children:m("connection.root")})}),r.jsx(ke,{asChild:!0,variant:"outline",size:"sm",children:r.jsxs("a",{href:"/api/connection/root.crt",children:[r.jsx(_v,{}),m("connection.download")]})})]}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-print",children:[r.jsx("span",{children:m("connection.fingerprint")}),r.jsx("code",{children:(w=e.fingerprint)==null?void 0:w.replaceAll(":",":​")}),e.fingerprintSha1&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:m("connection.fingerprintSha1")}),r.jsx("code",{children:e.fingerprintSha1.replaceAll(":",":​")})]})]}),r.jsxs("button",{type:"button",className:"jv-list-row jv-conn-disclosure","aria-expanded":l,onClick:()=>c(!l),children:[r.jsx("span",{className:"jv-row-text",children:r.jsx("strong",{children:m("connection.howTo")})}),r.jsx(Di,{"aria-hidden":"true"})]}),l&&r.jsx("div",{className:"jv-list-row jv-static-row jv-conn-steps",children:r.jsxs("ul",{children:[r.jsx("li",{children:m("connection.howMac")}),r.jsx("li",{children:m("connection.howWindows")}),r.jsx("li",{children:m("connection.howIos")}),r.jsx("li",{children:m("connection.howAndroid")}),r.jsx("li",{children:m("connection.howRestart")})]})})]}),r.jsx("div",{className:"jv-list",children:r.jsxs("button",{type:"button",role:"switch","aria-checked":e.allowHttp,disabled:u,className:"jv-list-row jv-choice-row jv-conn-http",onClick:()=>void p(),children:[r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:m("connection.allowHttp")}),r.jsx("span",{children:m("connection.allowHttpHint")})]}),r.jsx("span",{className:"jv-conn-switch","aria-hidden":"true"})]})})]}))}const Cw=e=>ta(e,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function e$({secret:e,bots:n,open:i,onToggle:o,onChanged:l,onDeleted:c}){const[u,h]=j.useState(null),[f,v]=j.useState(e.description),[y,p]=j.useState(""),[w,b]=j.useState(!1),[k,S]=j.useState(!1),{busy:N,error:C,run:A}=rn();j.useEffect(()=>{i&&ae.secretUses(e.id).then(L=>h(L.uses)).catch(()=>h([]))},[i,e.id,e.uses]);const E=L=>{L.preventDefault(),A("save",async()=>{l(await ae.updateSecret(e.id,{description:f.trim(),...y?{value:y}:{}})),p(""),b(!1)})},T=new Set(e.grants.map(L=>L.botId)),R=L=>{var I;return((I=n.find(H=>H.id===L))==null?void 0:I.name)??m("secrets.deletedBot")},_=f.trim()!==e.description||!!y;return r.jsxs(a6,{id:`secret-${e.id}`,open:i,onToggle:o,busy:N,error:C,text:r.jsxs(r.Fragment,{children:[r.jsx("strong",{className:"jv-mono",children:e.name}),r.jsx("span",{children:e.description||m("secrets.noDescription")})]}),meta:e.readable?r.jsx("span",{className:"jv-row-meta",children:T.size?m("secrets.grantCount",{count:T.size}):m("secrets.notGranted")}):r.jsx("span",{className:"jv-status","data-busy":"",children:m("secrets.unreadable")}),remove:m("secrets.delete"),confirming:k?{title:m("secrets.deleteTitle",{name:e.name}),body:m("secrets.deleteBody"),confirm:m("secrets.deleteConfirm")}:null,onAskRemove:()=>S(!0),onCancel:()=>S(!1),onConfirm:()=>void A("delete",async()=>{await ae.deleteSecret(e.id),c()}),children:[r.jsxs("p",{className:"jv-secret-meta",children:[m("secrets.fingerprint")," ",r.jsx("code",{children:e.fingerprint})," · ",m("secrets.updated",{time:Cw(e.updatedAt)})," · ",e.uses?m("secrets.usedCount",{count:e.uses}):m("secrets.neverUsed")]}),!e.readable&&r.jsx("p",{className:"jv-note-error",children:m("secrets.unreadableHint")}),r.jsx(JP,{secret:e,bots:n,onChanged:l}),r.jsxs("form",{className:"jv-secret-edit",onSubmit:E,"aria-label":m("secrets.edit"),children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("secrets.description")}),r.jsx(Xe,{maxLength:200,placeholder:m("secrets.descriptionPlaceholder"),value:f,onChange:L=>v(L.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("secrets.newValue")}),r.jsx(hf,{value:y,visible:w,onChange:p,onVisible:b,placeholder:m("secrets.newValuePlaceholder")})]}),r.jsx("div",{className:"jv-secret-actions",children:r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:N||!_,children:m("common.save")})})]}),r.jsx("h4",{className:"jv-secret-heading",children:m("secrets.uses")}),u&&u.length?r.jsx("ul",{className:"jv-secret-uses",children:u.map(L=>r.jsxs("li",{children:[r.jsxs("span",{children:[R(L.botId)," · ",Cw(L.at)," · ",m(L.how==="ssh_sign"?"secrets.useSsh":"secrets.useCommand")]}),L.detail&&r.jsx("code",{children:L.detail})]},L.id))}):r.jsx("p",{className:"jv-hint",children:m("secrets.noUses")})]})}const Nw=(e,n)=>e.name.localeCompare(n.name);function t$(){const[e,n]=j.useState(null),[i,o]=j.useState(""),[l,c]=j.useState([]),[u,h]=j.useState(!1),[f,v]=j.useState(null),[y,p]=j.useState(null);j.useEffect(()=>{ae.secrets().then(b=>{n([...b.secrets].sort(Nw)),o(b.keyLocation)}).catch(b=>p(Vt(b))),ae.bots().then(b=>c(b.bots)).catch(()=>c([]))},[]);const w=b=>n(k=>k&&k.map(S=>S.id===b.id?b:S));return r.jsxs("div",{className:"jv-page",children:[r.jsxs("header",{className:"jv-page-header",children:[r.jsx("h2",{children:m("settings.secrets")}),!u&&r.jsxs(ke,{className:"jv-primary",onClick:()=>h(!0),children:[r.jsx(Mi,{}),m("secrets.add")]})]}),u&&r.jsx(n$,{onCancel:()=>h(!1),onSaved:b=>{h(!1),n(k=>[...k??[],b].sort(Nw)),v(b.id)}}),e&&!e.length&&!u&&r.jsx("div",{className:"jv-empty",children:r.jsx("strong",{children:m("secrets.empty")})}),e&&e.length>0&&r.jsx("section",{className:"jv-section","aria-label":m("settings.secrets"),children:r.jsx("div",{className:"jv-list",children:e.map(b=>r.jsx(e$,{secret:b,bots:l,open:f===b.id,onToggle:()=>v(f===b.id?null:b.id),onChanged:w,onDeleted:()=>{v(null),n(k=>k&&k.filter(S=>S.id!==b.id))}},b.id))})}),i&&r.jsxs("section",{className:"jv-section","aria-labelledby":"secrets-key",children:[r.jsx("h3",{id:"secrets-key",className:"jv-section-title",children:m("secrets.masterKey")}),r.jsx("div",{className:"jv-list",children:r.jsx("div",{className:"jv-list-row jv-static-row jv-secret-key",children:r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:m("secrets.keyFile")}),r.jsx("code",{children:i}),r.jsx("span",{children:m("secrets.keyHint")})]})})})]}),y&&r.jsx("p",{className:"jv-note-error",role:"alert",children:y})]})}function n$({onCancel:e,onSaved:n}){const[i,o]=j.useState(""),[l,c]=j.useState(""),[u,h]=j.useState(""),[f,v]=j.useState(!1),{busy:y,error:p,run:w}=rn(),b=async k=>{k.preventDefault(),await w("add",async()=>n(await ae.createSecret({name:i.trim(),description:l.trim(),value:u})))};return r.jsxs("form",{className:"jv-panel jv-secret-form",onSubmit:k=>void b(k),"aria-label":m("secrets.add"),children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("secrets.name")}),r.jsx(Xe,{className:"jv-mono",required:!0,autoFocus:!0,maxLength:64,placeholder:"GITHUB_TOKEN",value:i,onChange:k=>o(k.target.value.toUpperCase())})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("secrets.description")}),r.jsx(Xe,{maxLength:200,placeholder:m("secrets.descriptionPlaceholder"),value:l,onChange:k=>c(k.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("secrets.value")}),r.jsx(hf,{value:u,visible:f,onChange:h,onVisible:v,required:!0})]}),p&&r.jsx("p",{className:"jv-note-error",role:"alert",children:p}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",onClick:e,children:m("common.cancel")}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:y||!i.trim()||!u,children:m("common.save")})]})]})}const a$=8,i$=e=>ta(e,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function r$({connector:e,bots:n,open:i,callbackUrl:o,onToggle:l,onChanged:c,onDeleted:u}){const h=j.useId(),f=e.provider==="custom_mcp",[v,y]=j.useState(e.name),[p,w]=j.useState(e.url),[b,k]=j.useState(e.authKind),[S,N]=j.useState(e.oauthClientId??""),[C,A]=j.useState(""),[E,T]=j.useState([]),[R,_]=j.useState(""),[L,I]=j.useState(null),[H,O]=j.useState(null),[P,U]=j.useState(""),[Y,K]=j.useState(!1),{busy:q,error:Q,run:V,setError:Z}=rn();j.useEffect(()=>{y(e.name),w(e.url),k(e.authKind),N(e.oauthClientId??"")},[e.id,e.name,e.url,e.authKind,e.oauthClientId]),j.useEffect(()=>{if(!f||(H==null?void 0:H.phase)!=="waiting")return;const te=window.setInterval(()=>{ae.connectorOAuthStatus(e.id).then(ce=>{O(ce.oauth),c(ce.connector),ce.oauth.phase==="error"&&ce.oauth.error&&Z(ce.oauth.error)}).catch(()=>{})},1500);return()=>window.clearInterval(te)},[f,H==null?void 0:H.phase,e.id,c,Z]);const ue=()=>void V("oauth",async()=>{const te=await ae.startConnectorOAuth(e.id,o);O(te),te.authUrl&&window.open(te.authUrl,"_blank","noopener,noreferrer"),te.phase==="completed"&&c(await ae.probeConnector(e.id))}),z=te=>{te.preventDefault(),P.trim()&&V("manual",async()=>{const ce=await ae.completeConnectorOAuth(e.id,{callbackUrl:P.trim()});O(ce),U("");const J=await ae.connectorOAuthStatus(e.id);c(J.connector)})},he=te=>{te.preventDefault(),V("save",async()=>{const ce=E.length?Object.fromEntries(E.filter(Re=>Re.key.trim()&&Re.value).map(Re=>[Re.key.trim(),Re.value])):void 0,J=S.trim(),je=J!==(e.oauthClientId??"");c(await ae.updateConnector(e.id,{name:v.trim(),url:p.trim(),authKind:b,...ce&&Object.keys(ce).length?{headers:ce}:{},...b==="oauth"?{...je?{clientId:J}:{},...C?{clientSecret:C}:{}}:{}})),A(""),T([])})},oe=te=>{te.preventDefault();const ce=v.trim();!ce||ce===e.name||V("save",async()=>{c(await ae.updateConnector(e.id,{name:ce}))})},D=()=>{L===null&&ae.connectorUses(e.id).then(te=>I(te.uses)).catch(()=>I([]))},F=te=>{var ce;return((ce=n.find(J=>J.id===te))==null?void 0:ce.name)??m("connectors.deletedBot")},ie=e.account||(e.status==="connected"?e.statusDetail:""),$=!!(ie&&e.name.includes(ie)),X=e.status==="connected"?!$&&ie?ie:m("connectors.toolCount",{count:e.tools.length}):e.statusDetail||m(e.status==="needs_auth"?"connectors.statusNeedsAuth":"connectors.statusError"),ee=R.trim().toLowerCase(),me=ee?e.tools.filter(te=>te.name.toLowerCase().includes(ee)||(te.description??"").toLowerCase().includes(ee)):e.tools;return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"jv-list-row jv-secret-row","aria-expanded":i,"aria-controls":h,onClick:l,children:[r.jsxs("span",{className:"jv-connector-row",children:[r.jsx(qs,{provider:e.provider,badge:!0}),r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:e.name}),r.jsx("span",{children:X})]})]}),e.status!=="connected"&&r.jsx("span",{className:"jv-connector-status","data-state":e.status,children:m(e.status==="needs_auth"?"connectors.statusNeedsAuth":"connectors.statusError")}),r.jsx(Di,{className:"jv-row-chevron","aria-hidden":"true"})]}),i&&r.jsxs("div",{id:h,className:"jv-list-row jv-static-row jv-secret-details",children:[e.status!=="connected"&&r.jsxs("div",{className:"jv-connector-alert",children:[r.jsxs("div",{className:"jv-connector-alert-head",children:[r.jsx("p",{className:"jv-connector-alert-msg",children:e.statusDetail||m("connectors.statusNeedsAuth")}),f&&e.authKind==="oauth"&&r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:q,onClick:ue,children:m("connectors.reconnect")})]}),!f&&r.jsx("p",{className:"jv-connector-env-note",children:m("connectors.presetReconnectHint")}),f&&(H==null?void 0:H.phase)==="waiting"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"jv-connector-drawer-row",children:[r.jsxs("span",{className:"jv-connector-waiting",children:[r.jsx("span",{className:"jv-connector-waiting-dot"}),m("connectors.oauthWaiting")]}),H.authUrl&&r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:()=>window.open(H.authUrl,"_blank","noopener,noreferrer"),children:[r.jsx(Ll,{}),m("connectors.openBrowser")]})]}),r.jsxs("details",{className:"jv-connector-manual",children:[r.jsx("summary",{children:m("connectors.manualFallback")}),r.jsxs("form",{className:"jv-connector-manual-row",onSubmit:z,children:[r.jsx(Xe,{value:P,onChange:te=>U(te.target.value),placeholder:m("connectors.manualPlaceholder")}),r.jsx(ke,{type:"submit",size:"sm",variant:"outline",disabled:q||!P.trim(),children:m("connectors.manualSubmit")})]})]})]})]}),r.jsx(df,{grantedIds:e.grants.map(te=>te.botId),onceIds:new Set(e.grants.filter(te=>te.scope==="once").map(te=>te.botId)),bots:n,onGrant:async(te,ce)=>{let J=e;for(const je of te)J=await ae.grantConnector(e.id,je,ce);c(J)}}),r.jsxs("details",{className:"jv-connector-disclosure",children:[r.jsx("summary",{children:r.jsxs("span",{className:"jv-connector-disclosure-title",children:[r.jsx(Ti,{"aria-hidden":"true"}),m("connectors.toolsSummary",{count:e.tools.length})]})}),r.jsxs("div",{className:"jv-connector-disclosure-body",children:[r.jsxs("div",{className:"jv-connector-tools-bar",children:[e.tools.length>a$&&r.jsx(Xe,{value:R,onChange:te=>_(te.target.value),placeholder:m("connectors.searchTools")}),r.jsxs(ke,{type:"button",variant:"ghost",size:"sm",disabled:q,onClick:()=>void V("probe",async()=>c(await ae.probeConnector(e.id))),children:[r.jsx(du,{}),m("connectors.refreshTools")]})]}),e.tools.length?me.length?r.jsx("div",{className:"jv-connector-tools",children:me.map(te=>{const ce=te.write!==!1;return r.jsx("div",{className:"jv-connector-tool",children:r.jsxs("div",{className:"jv-connector-tool-info",children:[r.jsx("code",{children:te.name}),r.jsx("span",{className:"jv-connector-tag","data-kind":ce?"write":"read",children:m(ce?"connectors.writeTag":"connectors.readOnlyTag")}),te.description&&r.jsx("span",{className:"jv-connector-tool-desc",title:te.description,children:te.description})]})},te.name)})}):r.jsx("p",{className:"jv-hint",children:m("connectors.noMatchingTools")}):r.jsx("p",{className:"jv-hint",children:m("connectors.noTools")})]})]}),e.uses>0&&r.jsxs("details",{className:"jv-connector-disclosure",onToggle:te=>{te.currentTarget.open&&D()},children:[r.jsx("summary",{children:r.jsxs("span",{className:"jv-connector-disclosure-title",children:[r.jsx(Ti,{"aria-hidden":"true"}),m("connectors.usesSummary",{count:e.uses})]})}),r.jsx("div",{className:"jv-connector-disclosure-body",children:L&&r.jsx("ul",{className:"jv-secret-uses",children:L.map(te=>r.jsxs("li",{children:[r.jsxs("span",{children:[F(te.botId)," · ",te.toolName," · ",i$(te.at)," · ",m(te.outcome==="ok"?"connectors.useOk":te.outcome==="denied"?"connectors.useDenied":"connectors.useError")]}),te.detail&&r.jsx("code",{children:te.detail})]},te.id))})})]}),!f&&r.jsxs("details",{className:"jv-connector-disclosure",children:[r.jsx("summary",{children:r.jsxs("span",{className:"jv-connector-disclosure-title",children:[r.jsx(Ti,{"aria-hidden":"true"}),m("connectors.accountSettings")]})}),r.jsxs("form",{className:"jv-connector-disclosure-body jv-connector-form",onSubmit:oe,children:[r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.name")}),r.jsx(Xe,{value:v,maxLength:80,onChange:te=>y(te.target.value)})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.identifier")}),r.jsx("code",{className:"jv-connector-slug",children:e.slug})]})]}),r.jsx("div",{className:"jv-secret-actions",children:r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:q||!v.trim()||v.trim()===e.name,children:m("common.save")})})]})]}),f&&r.jsxs("details",{className:"jv-connector-disclosure",children:[r.jsx("summary",{children:r.jsxs("span",{className:"jv-connector-disclosure-title",children:[r.jsx(Ti,{"aria-hidden":"true"}),m("connectors.connectionSettings")]})}),r.jsxs("form",{className:"jv-connector-disclosure-body jv-connector-form",onSubmit:he,children:[r.jsxs("div",{className:"jv-connector-setting-row",children:[r.jsx("span",{className:"jv-secret-heading",children:m("connectors.identifier")}),r.jsx("code",{className:"jv-connector-slug",children:e.slug})]}),r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.name")}),r.jsx(Xe,{value:v,maxLength:80,onChange:te=>y(te.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.url")}),r.jsx(Xe,{type:"url",value:p,onChange:te=>w(te.target.value),placeholder:m("connectors.urlPlaceholder")})]})]}),r.jsxs("div",{className:"jv-connector-setting-row",children:[r.jsx("span",{className:"jv-secret-heading",children:m("connectors.auth")}),r.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":m("connectors.auth"),children:["oauth","headers","none"].map(te=>r.jsx("button",{type:"button",role:"radio","aria-checked":b===te,onClick:()=>k(te),children:m(te==="oauth"?"connectors.authOAuth":te==="headers"?"connectors.authHeaders":"connectors.authNone")},te))})]}),b==="oauth"&&r.jsxs("details",{className:"jv-advanced",children:[r.jsxs("summary",{children:[r.jsx(Di,{}),m("connectors.advancedOAuth")]}),r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.oauthClientId")}),r.jsx(Xe,{value:S,onChange:te=>N(te.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.oauthClientSecret")}),r.jsx(Xe,{type:"password",value:C,placeholder:e.hasClientSecret?"••••••••":"",onChange:te=>A(te.target.value)})]})]})]}),b==="headers"&&r.jsxs("div",{className:"jv-connector-headers",children:[e.headerNames.length>0&&r.jsx("p",{className:"jv-hint",children:m("connectors.headersSaved",{names:e.headerNames.join(", ")})}),E.map((te,ce)=>r.jsxs("div",{className:"jv-header-row",children:[r.jsx(Xe,{className:"jv-mono",placeholder:m("connectors.headerName"),value:te.key,onChange:J=>T(je=>je.map((Re,De)=>De===ce?{...Re,key:J.target.value}:Re))}),r.jsx(Xe,{type:"password",placeholder:m("connectors.headerValue"),value:te.value,onChange:J=>T(je=>je.map((Re,De)=>De===ce?{...Re,value:J.target.value}:Re))}),r.jsx(ke,{type:"button",size:"sm",variant:"ghost",onClick:()=>T(J=>J.filter((je,Re)=>Re!==ce)),children:m("common.cancel")})]},ce)),r.jsx("div",{children:r.jsx(ke,{type:"button",size:"sm",variant:"outline",onClick:()=>T(te=>[...te,{key:"Authorization",value:""}]),children:m("connectors.addHeader")})})]}),r.jsx("div",{className:"jv-secret-actions",children:r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:q,children:m("common.save")})})]})]}),Y?r.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":m("connectors.deleteTitle",{name:e.name}),children:[r.jsx("strong",{children:m("connectors.deleteTitle",{name:e.name})}),r.jsx("p",{children:m("connectors.deleteBody")}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>K(!1),children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:q,onClick:()=>void V("delete",async()=>{await ae.deleteConnector(e.id),u()}),children:m("connectors.deleteConfirm")})]})]}):r.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:q,onClick:()=>f?K(!0):void V("delete",async()=>{await ae.deleteConnector(e.id),u()}),children:m(f?"connectors.delete":"connectors.disconnect")})}),Q&&r.jsx("p",{className:"jv-note-error",role:"alert",children:Q})]})]})}function o$({preset:e,connectedCount:n,callbackUrl:i,onConnected:o}){const[l,c]=j.useState("closed"),[u,h]=j.useState(null),[f,v]=j.useState(""),[y,p]=j.useState(""),[w,b]=j.useState(""),[k,S]=j.useState(!1),[N,C]=j.useState(!1),A=j.useRef(null),{busy:E,error:T,run:R,setError:_}=rn(),L=e.authMethods.includes("oauth"),I=e.authMethods.includes("headers"),H=e.managedClient,O=L&&(!H||H.ready),P=()=>{if(A.current){const z=A.current;A.current=null,ae.cancelPresetOAuth(z).catch(()=>{})}h(null),v(""),b(""),_(""),c("closed")};j.useEffect(()=>()=>{A.current&&ae.cancelPresetOAuth(A.current).catch(()=>{})},[]),j.useEffect(()=>{if(l!=="oauth"||(u==null?void 0:u.phase)!=="waiting"||!u.flowId)return;const z=u.flowId,he=window.setInterval(()=>{ae.presetOAuthStatus(z).then(oe=>{h(oe.oauth),oe.oauth.phase==="completed"&&oe.connector?(A.current=null,c("closed"),h(null),o(oe.connector)):oe.oauth.phase==="error"&&(A.current=null,_(oe.oauth.error||m("common.failed")))}).catch(()=>{})},1500);return()=>window.clearInterval(he)},[l,u==null?void 0:u.phase,u==null?void 0:u.flowId,o,_]);const U=()=>void R("oauth",async()=>{_(""),c("oauth");const z=await ae.startPresetOAuth(e.id,i);if(h(z),A.current=z.flowId??null,z.phase==="completed"&&z.flowId){const he=await ae.presetOAuthStatus(z.flowId);A.current=null,he.connector&&(c("closed"),h(null),o(he.connector));return}z.authUrl&&window.open(z.authUrl,"_blank","noopener,noreferrer")}),Y=()=>{if(_(""),l!=="closed"){P();return}if(O){U();return}if(I){c("token");return}c("env_guide")},K=z=>{z.preventDefault(),y.trim()&&R("token",async()=>{const he=await ae.connectPresetToken(e.id,y.trim(),f.trim()||void 0);p(""),v(""),c("closed"),o(he)})},q=z=>{if(z.preventDefault(),!w.trim()||!(u!=null&&u.flowId))return;const he=u.flowId;R("manual",async()=>{const oe=await ae.completePresetOAuth(he,{callbackUrl:w.trim()});h(oe.oauth),oe.oauth.phase==="completed"&&oe.connector&&(A.current=null,b(""),c("closed"),h(null),o(oe.connector))})},Q=()=>{var z;(z=navigator.clipboard)==null||z.writeText(i).then(()=>{S(!0),window.setTimeout(()=>S(!1),1800)}).catch(()=>{})},V=()=>{var z;u!=null&&u.authUrl&&((z=navigator.clipboard)==null||z.writeText(u.authUrl).then(()=>{C(!0),window.setTimeout(()=>C(!1),1800)}).catch(()=>{}))},Z=(H==null?void 0:H.variables.join(" / "))??"",ue=n>0?m("connectors.addAccount"):m("connectors.connect");return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"jv-list-row jv-static-row jv-connector-preset-row",children:r.jsxs("span",{className:"jv-connector-row",children:[r.jsx(qs,{provider:e.id,badge:!0}),r.jsxs("span",{className:"jv-row-text",children:[r.jsx("strong",{children:e.name}),n>0&&r.jsx("span",{children:m("connectors.connectedAccounts",{count:n})})]}),r.jsx(ke,{type:"button",variant:l==="closed"?"outline":"ghost",size:"sm",disabled:E,onClick:Y,children:l==="closed"?ue:m("common.cancel")})]})}),l==="oauth"&&r.jsxs("div",{className:"jv-connector-drawer",children:[(E||(u==null?void 0:u.phase)==="waiting")&&r.jsxs("div",{className:"jv-connector-waiting",children:[r.jsx("span",{className:"jv-connector-waiting-dot","aria-hidden":"true"}),r.jsx("span",{children:m("connectors.oauthWaiting")})]}),n>0&&e.id==="github"&&r.jsx("p",{className:"jv-connector-env-note",children:m("connectors.multiAccountOAuthHint",{name:e.name})}),r.jsx("div",{className:"jv-connector-drawer-foot",children:r.jsxs("div",{className:"jv-connector-drawer-row",children:[(u==null?void 0:u.authUrl)&&r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:()=>window.open(u.authUrl,"_blank","noopener,noreferrer"),children:[r.jsx(Ll,{}),m("connectors.openBrowser")]}),n>0&&(u==null?void 0:u.authUrl)&&r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:V,children:[N?r.jsx(na,{}):r.jsx(Os,{}),m(N?"connectors.copied":"connectors.copyAuthUrl")]}),!u&&!E&&T&&r.jsx(ke,{type:"button",variant:"outline",size:"sm",onClick:U,children:m("connectors.reconnect")}),I&&r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:()=>{P(),c("token")},children:m("connectors.useToken")})]})}),(u==null?void 0:u.phase)==="waiting"&&r.jsxs("details",{className:"jv-connector-manual",children:[r.jsx("summary",{children:m("connectors.manualFallback")}),r.jsxs("form",{className:"jv-connector-manual-row",onSubmit:q,children:[r.jsx(Xe,{value:w,onChange:z=>b(z.target.value),placeholder:m("connectors.manualPlaceholder")}),r.jsx(ke,{type:"submit",size:"sm",variant:"outline",disabled:E||!w.trim(),children:m("connectors.manualSubmit")})]})]}),T&&r.jsx("p",{className:"jv-note-error",role:"alert",children:T})]}),l==="token"&&r.jsxs("form",{className:"jv-connector-drawer",onSubmit:K,children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.optionalName")}),r.jsx(Xe,{maxLength:80,value:f,onChange:z=>v(z.target.value),placeholder:m("connectors.accountNamePlaceholder",{name:e.name})})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.tokenLabel")}),r.jsxs("div",{className:"jv-connector-drawer-row",children:[r.jsx(Xe,{type:"password",autoFocus:!0,value:y,onChange:z=>p(z.target.value),placeholder:m("connectors.tokenPlaceholder")}),r.jsx(ke,{type:"submit",className:"jv-primary",size:"sm",disabled:E||!y.trim(),children:m("connectors.connect")})]})]}),r.jsx("div",{className:"jv-connector-drawer-foot",children:O?r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:U,children:m("connectors.useWebSignIn")}):H?r.jsxs("p",{className:"jv-connector-env-note",children:[m("connectors.envHint",{variables:Z,callback:i})," ",r.jsx("button",{type:"button",className:"jv-connector-link-btn",onClick:Q,children:m(k?"connectors.copied":"connectors.copyCallback")})]}):r.jsx("span",{})}),T&&r.jsx("p",{className:"jv-note-error",role:"alert",children:T})]}),l==="env_guide"&&r.jsxs("div",{className:"jv-connector-drawer",children:[r.jsx("p",{className:"jv-connector-env-note",children:m("connectors.gmailEnvHint",{variables:Z,callback:i})}),r.jsx("div",{className:"jv-connector-drawer-foot",children:r.jsxs(ke,{type:"button",variant:"outline",size:"sm",onClick:Q,children:[k?r.jsx(na,{}):r.jsx(Os,{}),m(k?"connectors.copied":"connectors.copyCallback")]})})]})]})}const Ew=(e,n)=>e.name.localeCompare(n.name)||e.statusDetail.localeCompare(n.statusDetail)||e.createdAt-n.createdAt,s$=e=>e==="localhost"||e==="127.0.0.1"||e==="[::1]"||e==="::1",l$=()=>window.location.protocol==="http:"&&!s$(window.location.hostname)?`https://${window.location.host}`:window.location.origin;function c$(){const[e,n]=j.useState(null),[i,o]=j.useState([]),[l,c]=j.useState(null),[u,h]=j.useState([]),[f,v]=j.useState(!1),[y,p]=j.useState(null),[w,b]=j.useState(null);j.useEffect(()=>{ae.connectors().then(T=>{n([...T.connectors].sort(Ew)),o(T.presets),c(T.publicUrl)}).catch(T=>b(Vt(T))),ae.bots().then(T=>h(T.bots)).catch(()=>h([]))},[]);const k=`${l??l$()}/api/connectors/oauth/callback`,S=new Map;for(const T of e??[])S.set(T.provider,(S.get(T.provider)??0)+1);const N=i.filter(T=>T.id!=="custom_mcp"),C=T=>{n(R=>[...R??[],T].sort(Ew)),p(T.id)},A=T=>n(R=>R&&R.map(_=>_.id===T.id?T:_)),E=T=>{p(R=>R===T?null:R),n(R=>R&&R.filter(_=>_.id!==T))};return r.jsxs("div",{className:"jv-page",children:[r.jsxs("header",{className:"jv-page-header",children:[r.jsx("h2",{children:m("settings.connectors")}),!f&&r.jsxs(ke,{className:"jv-primary",onClick:()=>v(!0),children:[r.jsx(Mi,{}),m("connectors.addCustom")]})]}),f&&r.jsx(u$,{onCancel:()=>v(!1),onCreated:T=>{v(!1),C(T)}}),e&&e.length>0&&r.jsxs("section",{className:"jv-section","aria-labelledby":"connectors-connected",children:[N.length>0&&r.jsx("h3",{id:"connectors-connected",className:"jv-section-title",children:m("connectors.connectedSection")}),r.jsx("div",{className:"jv-list",children:e.map(T=>r.jsx(r$,{connector:T,bots:u,open:y===T.id,callbackUrl:k,onToggle:()=>p(y===T.id?null:T.id),onChanged:A,onDeleted:()=>E(T.id)},T.id))})]}),N.length>0&&r.jsxs("section",{className:"jv-section","aria-labelledby":"connectors-available",children:[e&&e.length>0&&r.jsx("h3",{id:"connectors-available",className:"jv-section-title",children:m("connectors.availableSection")}),r.jsx("div",{className:"jv-list",children:N.map(T=>r.jsx(o$,{preset:T,connectedCount:S.get(T.id)??0,callbackUrl:k,onConnected:C},T.id))})]}),w&&r.jsx("p",{className:"jv-note-error",role:"alert",children:w})]})}function u$({onCancel:e,onCreated:n}){const[i,o]=j.useState(""),[l,c]=j.useState(""),[u,h]=j.useState("oauth"),[f,v]=j.useState(""),[y,p]=j.useState(""),[w,b]=j.useState([{key:"Authorization",value:""}]),{busy:k,error:S,run:N}=rn(),C=A=>{A.preventDefault(),N("create",async()=>{const E=u==="headers"?Object.fromEntries(w.filter(T=>T.key.trim()&&T.value).map(T=>[T.key.trim(),T.value])):void 0;n(await ae.createConnector({provider:"custom_mcp",name:i.trim(),url:l.trim(),authKind:u,...E&&Object.keys(E).length?{headers:E}:{},...u==="oauth"&&f.trim()?{clientId:f.trim()}:{},...u==="oauth"&&y?{clientSecret:y}:{}}))})};return r.jsxs("form",{className:"jv-panel jv-secret-form jv-connector-form",onSubmit:C,"aria-label":m("connectors.addCustom"),children:[r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.name")}),r.jsx(Xe,{required:!0,autoFocus:!0,maxLength:80,placeholder:m("connectors.namePlaceholder"),value:i,onChange:A=>o(A.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.url")}),r.jsx(Xe,{type:"url",required:!0,placeholder:m("connectors.urlPlaceholder"),value:l,onChange:A=>c(A.target.value)})]})]}),r.jsxs("div",{className:"jv-connector-setting-row",children:[r.jsx("span",{className:"jv-secret-heading",children:m("connectors.auth")}),r.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":m("connectors.auth"),children:["oauth","headers","none"].map(A=>r.jsx("button",{type:"button",role:"radio","aria-checked":u===A,onClick:()=>h(A),children:m(A==="oauth"?"connectors.authOAuth":A==="headers"?"connectors.authHeaders":"connectors.authNone")},A))})]}),u==="oauth"&&r.jsxs("details",{className:"jv-advanced",children:[r.jsxs("summary",{children:[r.jsx(Di,{}),m("connectors.advancedOAuth")]}),r.jsxs("div",{className:"jv-field-grid",children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.oauthClientId")}),r.jsx(Xe,{value:f,onChange:A=>v(A.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("connectors.oauthClientSecret")}),r.jsx(Xe,{type:"password",value:y,onChange:A=>p(A.target.value)})]})]})]}),u==="headers"&&r.jsxs("div",{className:"jv-connector-headers",children:[w.map((A,E)=>r.jsxs("div",{className:"jv-header-row",children:[r.jsx(Xe,{className:"jv-mono",placeholder:m("connectors.headerName"),value:A.key,onChange:T=>b(R=>R.map((_,L)=>L===E?{..._,key:T.target.value}:_))}),r.jsx(Xe,{type:"password",placeholder:m("connectors.headerValue"),value:A.value,onChange:T=>b(R=>R.map((_,L)=>L===E?{..._,value:T.target.value}:_))}),r.jsx(ke,{type:"button",size:"sm",variant:"ghost",onClick:()=>b(T=>T.filter((R,_)=>_!==E)),children:m("common.cancel")})]},E)),r.jsx("div",{children:r.jsx(ke,{type:"button",size:"sm",variant:"outline",onClick:()=>b(A=>[...A,{key:"Authorization",value:""}]),children:m("connectors.addHeader")})})]}),S&&r.jsx("p",{className:"jv-note-error",role:"alert",children:S}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",onClick:e,children:m("common.cancel")}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:k||!i.trim()||!l.trim(),children:m("connectors.connect")})]})]})}const Tw=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"]];function d$({bots:e}){const{range:n,setRange:i,data:o,error:l,reload:c}=PS(IS.overview,"all");return r.jsxs("div",{className:"jv-page jv-usage-page",children:[r.jsx("header",{className:"jv-page-header",children:r.jsx("h2",{children:m("settings.usage")})}),r.jsxs("div",{className:"jv-usage",children:[r.jsx(qS,{range:n,setRange:i,busy:!o&&!l,reload:c}),r.jsx(FS,{loading:!o,error:l,empty:!(o!=null&&o.models.length),reload:c}),o&&o.models.length>0&&!l&&r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"jv-section","aria-labelledby":"usage-models",children:[r.jsx("h3",{id:"usage-models",className:"jv-section-title",children:m("usage.byModel")}),r.jsx(HS,{models:o.models,note:!1})]}),r.jsxs("section",{className:"jv-section","aria-labelledby":"usage-bots",children:[r.jsx("h3",{id:"usage-bots",className:"jv-section-title",children:m("usage.byBot")}),r.jsx(h$,{rows:o.bots,bots:e})]}),o.models.some(u=>u.cost===null)&&o.models.some(u=>u.cost!==null)&&r.jsx("p",{className:"jv-usage-note",children:m("usage.noteCosts")})]})]})]})}function h$({rows:e,bots:n}){return r.jsxs("table",{className:"jv-usage-table jv-usage-bots",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Bot"}),Tw.map(([i,o])=>r.jsx("th",{scope:"col",children:m(o)},i)),r.jsx("th",{scope:"col",children:m("usage.cost")})]})}),r.jsx("tbody",{children:e.map(i=>{const o=n.find(l=>l.id===i.botId);return r.jsxs("tr",{children:[r.jsx("th",{scope:"row",children:r.jsxs("span",{className:"jv-usage-bot",children:[o&&r.jsx(Ii,{color:o.color,mood:o.mood,size:22}),r.jsx("strong",{children:(o==null?void 0:o.name)??i.botId})]})}),Tw.map(([l,c])=>r.jsx("td",{"data-label":m(c),title:la(i[l]),children:pv(i[l])},l)),vv(i.cost)]},i.botId)})})]})}const f$=[{id:"general",label:"settings.general",icon:Q9},{id:"models",label:"settings.models",icon:m9},{id:"usage",label:"settings.usage",icon:c9},{id:"secrets",label:"settings.secrets",icon:jh},{id:"connectors",label:"settings.connectors",icon:u3},{id:"network",label:"settings.network",icon:N9},{id:"about",label:"settings.about",icon:Dv}];function m$({connections:e,bots:n,onChanged:i,onClose:o,initialTab:l="general"}){const[c,u]=j.useState(l),h=j.useRef(null);return j.useEffect(()=>{var f;(f=h.current)==null||f.scrollIntoView({block:"nearest",inline:"nearest"})},[c]),r.jsx(KS,{open:!0,onOpenChange:f=>{f||o()},children:r.jsxs(XS,{className:"jv-settings-shell","aria-describedby":void 0,children:[r.jsxs("nav",{className:"jv-settings-nav","aria-label":m("settings.sections"),children:[r.jsx(QS,{className:"jv-settings-title",children:m("settings.title")}),r.jsx("div",{className:"jv-settings-tabs",children:f$.map(f=>r.jsx(Ro,{line:!0,ref:c===f.id?h:void 0,active:c===f.id,onClick:()=>u(f.id),leading:r.jsx(f.icon,{}),title:m(f.label)},f.id))})]}),r.jsx("main",{className:"jv-settings-content",children:c==="general"?r.jsx(YH,{}):c==="models"?r.jsx(ZU,{connections:e,onChanged:i}):c==="usage"?r.jsx(d$,{bots:n}):c==="secrets"?r.jsx(t$,{}):c==="connectors"?r.jsx(c$,{}):c==="network"?r.jsx(JU,{}):r.jsx(GH,{})})]})})}const Aw="Jarvy";let Mw=null,ir=null,Ss=null;function p$(){return document.querySelector('link[rel="icon"][type="image/png"]')}function v$(e){if(!(ir!=null&&ir.complete)||!ir.naturalWidth)return null;const n=64,i=document.createElement("canvas");i.width=i.height=n;const o=i.getContext("2d");if(!o)return null;o.drawImage(ir,0,0,n,n);const l=e>9?"9+":String(e),c=l.length>1?21:18;return o.fillStyle="#e5484d",o.beginPath(),o.arc(n-c,c,c,0,Math.PI*2),o.fill(),o.fillStyle="#fff",o.font=`bold ${l.length>1?26:30}px system-ui, sans-serif`,o.textAlign="center",o.textBaseline="middle",o.fillText(l,n-c,c+2),i.toDataURL("image/png")}function _w(e){var o;(o=bu())==null||o.setBadge(e),document.title=e>0?`(${e>99?"99+":e}) ${Aw}`:Aw;const n=p$();if(!n)return;if(Mw??(Mw=n.href),Ss??(Ss=document.querySelector('link[rel="icon"][type="image/svg+xml"]')),e<=0){n.href=Mw,Ss&&!Ss.isConnected&&document.head.prepend(Ss);return}const i=v$(e);i&&(n.href=i,Ss==null||Ss.remove())}function g$(e){j.useEffect(()=>{ir||(ir=new Image,ir.src="/favicon.svg"),ir.complete?_w(e):ir.onload=()=>_w(e)},[e])}const lh=50;function vC({chatId:e,ready:n,scroller:i,me:o,memory:l,onError:c}){const[u,h]=j.useState([]),[f,v]=j.useState(!1),[y,p]=j.useState(!1),[w,b]=j.useState(!1),k=j.useRef(u),S=j.useRef(e),N=j.useRef(0),C=j.useRef(!1),A=j.useRef(!1),E=j.useRef(0);k.current=u,S.current=e,A.current=y;const T=j.useRef(null),R=j.useRef(!1),_=j.useRef(void 0),L=j.useRef(!0),I=j.useRef(!1),H=j.useRef(null),[O,P]=j.useState(!1),U=j.useRef(0),Y=j.useRef({bottom:!0}),K=j.useRef(null),[q]=j.useState(()=>new eC),Q=j.useRef(null),V=j.useRef(!1);j.useEffect(()=>{if(h([]),p(!1),I.current=!1,L.current=!0,E.current=0,Y.current={bottom:!0},K.current=null,!n||!e)return;let $=!0;const X=++N.current;P(!1),U.current=0;const ee=()=>{var te;$=!1,q.release(),I.current&&!V.current&&((te=k.current[0])==null?void 0:te.chatId)===e&&l.keep(e,{messages:k.current,hasOlder:A.current,place:Y.current,seen:U.current})},me=l.take(e);return me?(R.current=!0,K.current=me.place,U.current=me.seen,h(me.messages),p(me.hasOlder),v(!1),ee):(v(!0),ae.latestMessages(e,lh).then(te=>{!$||X!==N.current||(R.current=!0,h(te.messages),p(te.hasOlder),v(!1))}).catch(te=>{$&&(v(!1),c(te))}),ee)},[e,n]);function Z($,X){var te;if($.chatId!==S.current)return;if(!X){h(ce=>wu(ce,$));return}const ee=k.current,me=Math.max(((te=ee.at(-1))==null?void 0:te.chatId)===$.chatId?ee.at(-1).sequence:0,E.current);if($g($,me)&&!ee.some(ce=>ce.id===$.id)){ue($.chatId).catch(c);return}E.current=Math.max(E.current,$.sequence),h(ce=>mf(ce,$))}async function ue($){V.current=!0;try{await z($)}finally{V.current=!1}}async function z($){const X=k.current[0],ee=++N.current;if(!X||X.chatId!==$){const ce=await ae.latestMessages($,lh);S.current===$&&ee===N.current&&(R.current=!0,h(ce.messages),p(ce.hasOlder),v(!1));return}const me=X.sequence-1,te=await ae.messages($,me);S.current!==$||ee!==N.current||(h(ce=>Z6(ce.filter(J=>J.chatId===$),te.messages,me)),v(!1))}async function he(){const $=k.current[0],X=i.current;if(!(!$||!A.current||C.current)){C.current=!0,b(!0);try{const ee=await ae.olderMessages($.chatId,$.sequence,lh);if(S.current!==$.chatId)return;T.current=X?X.scrollHeight-X.scrollTop:null,h(me=>{var te;return((te=me[0])==null?void 0:te.id)===$.id?[...ee.messages,...me]:me}),p(ee.hasOlder)}catch(ee){c(ee)}finally{C.current=!1,b(!1)}}}j.useEffect(()=>{const $=i.current;if(!$)return;let X=0;const ee=()=>{cancelAnimationFrame(X),X=requestAnimationFrame(()=>{I.current&&$.clientHeight&&!q.on&&(Y.current=J6($,160))})},me=new ResizeObserver(()=>{if(ee(),!!I.current){if($.scrollHeight-$.clientHeight<8){J();return}L.current&&($.scrollHeight-$.scrollTop-$.clientHeight<8||$.scrollTo({top:$.scrollHeight,behavior:"instant"}))}}),te=()=>{me.disconnect(),me.observe($);for(const je of $.children)me.observe(je)};te();const ce=new MutationObserver(te);ce.observe($,{childList:!0});const J=()=>{var je;if(!I.current){L.current=!0,P(!1);return}q.on||(L.current=$.scrollHeight-$.scrollTop-$.clientHeight<160,P(!L.current),L.current&&(U.current=((je=k.current.at(-1))==null?void 0:je.sequence)??0),ee())};return J(),$.addEventListener("scroll",J,{passive:!0}),()=>{me.disconnect(),ce.disconnect(),$.removeEventListener("scroll",J),cancelAnimationFrame(X)}},[i.current,e]),j.useLayoutEffect(()=>{const $=i.current,X=u.at(-1);if($){if(Q.current){const{id:ee,passage:me}=Q.current,te=$.querySelector(`[data-message="${ee}"]`);Q.current=null,K.current=null,R.current=!1,_.current=X==null?void 0:X.id,te&&(I.current=!0,L.current=!1,P(!0),zh(te,me));return}if(T.current!==null)$.scrollTo({top:$.scrollHeight-T.current,behavior:"instant"}),T.current=null;else if(K.current&&u.length&&Ih($,K.current))Y.current=K.current,q.start($,K.current),K.current=null,R.current=!1,I.current=!0,L.current=!1,P(!0);else if(R.current&&u.length){K.current=null;const ee=()=>$.scrollTo({top:$.scrollHeight,behavior:"instant"});ee(),requestAnimationFrame(ee),R.current=!1,I.current=!0,L.current=!0}else X&&X.id!==_.current&&(L.current||X.senderId===o)&&(q.release(),$.scrollTo({top:$.scrollHeight,behavior:"smooth"}));_.current=X==null?void 0:X.id,L.current&&(U.current=(X==null?void 0:X.sequence)??0)}},[u]),j.useEffect(()=>{const $=i.current,X=H.current;if(!$||!X||!y||!I.current)return;const ee=new IntersectionObserver(me=>{var te;(te=me[0])!=null&&te.isIntersecting&&I.current&&he()},{root:$,rootMargin:"400px 0px 0px 0px"});return ee.observe(X),()=>ee.disconnect()},[y,u,e,f]);async function oe($,X){var De;if(q.release(),k.current.some(Pe=>Pe.id===$)){D($,X);return}const me=S.current,te=await ae.message($);if(te.chatId!==me)return te.chatId;const ce=++N.current,[J,je]=await Promise.all([ae.olderMessages(te.chatId,te.sequence,lh),ae.messages(te.chatId,te.sequence-1)]);if(S.current!==te.chatId||ce!==N.current)return;const Re=((De=je.messages.at(-1))==null?void 0:De.sequence)??te.sequence;Q.current={id:$,passage:X},E.current=0,h(Pe=>[...J.messages,...je.messages,...Pe.filter(Le=>Le.chatId===te.chatId&&Le.sequence>Re)]),p(J.hasOlder)}function D($,X){var me;q.release();const ee=(me=i.current)==null?void 0:me.querySelector(`[data-message="${$}"]`);ee&&zh(ee,X)}const F=O?u.filter($=>$.sequence>U.current&&$.senderId!==o).length:0;return{messages:u,setMessages:h,loading:f,hasOlder:y,loadingOlder:w,refresh:ue,heard:Z,top:H,away:O,unseen:F,toLatest:()=>{q.release();const $=i.current;$==null||$.scrollTo({top:$.scrollHeight,behavior:"smooth"})},toMessage:oe,cancel:()=>{N.current++}}}function y$({ready:e,selected:n,messages:i,chats:o,chatList:l,setChats:c,onError:u}){const h=o.find(f=>f.id===n);j.useEffect(()=>{const f=n,v=i.at(-1);if(!e||!f||!v||v.chatId!==f)return;const y=()=>{const p=l.current.find(w=>w.id===f);!Vg()||((p==null?void 0:p.readSequence)??0)>=v.sequence&&!(p!=null&&p.hint)&&!(p!=null&&p.alerts)||gC(c,f,v.sequence,u)};return y(),Gg(y)},[i,n,e,h==null?void 0:h.readSequence,h==null?void 0:h.alerts,h==null?void 0:h.hint])}function gC(e,n,i,o){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)),ae.markRead(n,i).catch(o)}const Rw="jarvy-seen-failure";function x$(e,n){const i=e!=null&&e.error?`${e.botId}:${e.runId??""}:${e.error}`:null,[o,l]=j.useState(()=>localStorage.getItem(Rw));return{call:i&&i!==o?"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(Rw,i),l(i))}}}const Ow={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 yC({call:e}){if(!e)return null;const n=e==="ask"?Ow.ask:Ow.mark;return r.jsx("span",{className:"jv-call","data-call":e,"aria-hidden":"true",children:r.jsxs("svg",{viewBox:"0 0 24 36",children:[r.jsx("path",{className:"jv-call-edge",d:n}),r.jsx("path",{d:n})]})})}const Dw=()=>matchMedia("(prefers-reduced-motion: reduce)").matches;function b$({view:e,onView:n,agent:i,figure:o,call:l,asleep:c,alerts:u,username:h,accountMenu:f,onToggleAccount:v,onSettings:y,onToggleTheme:p,onLogOut:w}){const b=j.useRef(null),k=j.useRef(null),S=j.useRef(null);j.useEffect(()=>b.current&&o.live?o.stage.add(b.current,.74,!1):void 0,[o.live,!!i]),j.useEffect(()=>{if(!f)return;const C=A=>{var T,R;const E=A.target;!((T=k.current)!=null&&T.contains(E))&&!((R=S.current)!=null&&R.contains(E))&&v(!1)};return document.addEventListener("pointerdown",C),()=>document.removeEventListener("pointerdown",C)},[f]);const N=o.stage.persona;return r.jsxs(r.Fragment,{children:[r.jsxs("nav",{className:"jv-rail","aria-label":m("rail.label"),children:[r.jsxs("div",{className:"jv-rail-top",children:[i&&r.jsxs("button",{type:"button",className:"jv-rail-item jv-rail-agent","data-still":!o.live||void 0,"aria-current":e==="home"?"page":void 0,title:i.name,onPointerEnter:C=>{C.pointerType==="mouse"&&(o.stage.near=!0,!Dw()&&!N.playing&&N.play("look",performance.now()))},onPointerLeave:()=>{o.stage.near=!1},onClick:()=>{Dw()||N.play("hop",performance.now()),n("home")},children:[o.live?r.jsx("canvas",{ref:b,"aria-hidden":"true"}):r.jsx(Ii,{color:i.color,mood:l==="error"?"dizzy":i.mood,size:30,crown:i.agent,asleep:c}),r.jsx(yC,{call:l}),l&&r.jsx("span",{className:"sr-only",children:m(`home.call.${l}`)}),r.jsx("span",{className:"jv-rail-label",children:i.name})]}),r.jsxs("button",{type:"button",className:"jv-rail-item","aria-current":e==="chats"?"page":void 0,title:m("rail.chats"),onClick:()=>n("chats"),children:[r.jsx(zv,{"aria-hidden":"true"}),u>0&&r.jsx("span",{className:"jv-rail-badge",role:"status","aria-label":m("sidebar.alerts",{count:u}),children:u>99?"99+":u}),r.jsx("span",{className:"jv-rail-label",children:m("rail.chats")})]}),r.jsxs("button",{type:"button",className:"jv-rail-item","aria-current":e==="envs"?"page":void 0,title:m("rail.environments"),onClick:()=>n("envs"),children:[r.jsx(T3,{"aria-hidden":"true"}),r.jsx("span",{className:"jv-rail-label",children:m("rail.environments")})]})]}),r.jsx("button",{ref:S,type:"button",className:"jv-rail-item jv-rail-account","aria-label":m("account.menuFor",{name:h}),title:h,"aria-expanded":f,onClick:()=>v(!f),children:r.jsx("span",{className:"ui-user-avatar",children:r.jsx("span",{children:h.slice(0,2).toUpperCase()})})})]}),f&&r.jsxs("div",{ref:k,className:"ui-popover jarvy-account-menu",role:"menu","aria-label":m("account.menu"),children:[r.jsx("div",{className:"ui-menu-note ui-small",children:h}),r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:y,children:[r.jsx(Fe,{name:"gear"}),r.jsx("span",{className:"ui-menu-copy",children:m("settings.title")})]}),r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:p,children:[r.jsx(Fe,{name:"moon"}),r.jsx("span",{className:"ui-menu-copy",children:m("account.toggleTheme")})]}),r.jsx("hr",{className:"ui-menu-divider"}),r.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:w,children:[r.jsx(Fe,{name:"arrow-bracket-to-left"}),r.jsx("span",{className:"ui-menu-copy",children:m("account.signOut")})]})]})]})}const zw=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,j$=".jv-dock, .jv-npc, .jv-home-cat, .ui-popover, dialog, [role=dialog]",w$=".jv-emoji-menu, .ui-popover, dialog[open], [role=dialog]";function k$({bot:e,chat:n,meId:i,members:o,drafts:l,live:c,dockRef:u,opener:h,onOpenDm:f,ensureDm:v,onRead:y,onSent:p,onPreview:w,onNotice:b,onError:k}){var he,oe;const[S,N]=j.useState(null),C=j.useRef(0),A=j.useRef(null),[E]=j.useState(()=>new W6),T=(n==null?void 0:n.id)??null,R=S==="open",_=vC({chatId:T,ready:S!==null,scroller:A,me:i,memory:E,onError:k}),{messages:L,setMessages:I}=_;Ug(c,D=>{if(D.kind==="reconnected"){S&&T&&_.refresh(T).catch(k);return}D.kind!=="chat"&&S&&_.heard(D.message,D.kind==="message")}),j.useLayoutEffect(()=>{const D=A.current;if(!D)return;const F=D.querySelectorAll(":scope > [data-message]"),ie=F[Math.max(0,F.length-2)];D.style.setProperty("--fit",ie?`${Math.ceil(D.scrollHeight-ie.offsetTop+8)}px`:"0px")},[L,R]);const H=L.at(-1);j.useEffect(()=>{if(!R||!n||!H||n.readSequence>=H.sequence&&!n.alerts)return;const D=()=>{Vg()&&y(n,H.sequence)};return D(),Gg(D)},[R,H==null?void 0:H.sequence,n==null?void 0:n.readSequence,n==null?void 0:n.alerts]);function O(){clearTimeout(C.current),E.clear(),N("open"),n||v().catch(k),setTimeout(()=>{var D,F;return(F=(D=u.current)==null?void 0:D.querySelector("textarea"))==null?void 0:F.focus({preventScroll:!0})},zw()?0:200)}h.current=O;function P(){var D,F;(F=(D=document.activeElement)==null?void 0:D.blur)==null||F.call(D),N("closing"),C.current=window.setTimeout(()=>N(null),zw()?0:320)}j.useEffect(()=>()=>clearTimeout(C.current),[]);const U=F6(l,T??""),Y=!((he=U.text)!=null&&he.trim())&&!U.files.length&&!U.quote&&!U.passages.length;j.useEffect(()=>{if(!R||!Y)return;const D=F=>{var ie,$;($=(ie=F.target).closest)!=null&&$.call(ie,j$)||P()};return document.addEventListener("pointerdown",D),()=>document.removeEventListener("pointerdown",D)},[R,Y]);async function K(D,F,ie,$,X){const ee=n??await v(),me=await ae.send(ee.id,D,F,ie,!1,$,X);_.heard(me,!0),p(me)}const q=D=>I(F=>F.map(ie=>ie.id===D.id?{...ie,...D}:ie));async function Q(D,F,ie){try{const $=await ae.react(D.id,F,ie);q({...D,reactions:$.reactions})}catch($){k($)}}async function V(D,F){try{const ie=await ae.fold(D.id,F);q({...D,folded:ie.folded})}catch(ie){k(ie)}}const Z=(D,F)=>D?void _.toMessage(D,F).catch(()=>b(m("app.sourceGone"))):b(m("app.sourceGone")),ue=R?(oe=[...L].reverse().find(D=>{var F;return((F=D.question)==null?void 0:F.state)==="pending"}))==null?void 0:oe.id:void 0,z=!!e.connectionId;return r.jsxs("div",{ref:u,className:"jv-dock","data-state":S??void 0,onKeyDown:D=>{D.key==="Escape"&&R&&!D.defaultPrevented&&!document.querySelector(w$)&&(D.preventDefault(),P())},children:[r.jsx("div",{className:"jv-dock-wrap",children:r.jsxs("div",{ref:A,className:"ui-transcript jv-dock-log",role:"log","aria-label":m("home.recent"),"aria-hidden":!R,children:[_.hasOlder&&r.jsx("div",{ref:_.top,className:"jv-history-more","aria-live":"polite",children:_.loadingOlder?m("chat.loadingOlder"):""}),r.jsx(H6,{messages:L,members:o,me:i,activeQuestion:ue,bot:e,onSettled:q,onPreview:w,onQuote:D=>Fg(l,D,o),onReact:(D,F,ie)=>void Q(D,F,ie),onFold:(D,F)=>void V(D,F),onJump:Z,onError:k})]})}),r.jsxs("div",{className:"jv-dock-bar",children:[r.jsx("button",{type:"button",className:"jv-dock-icon",title:m("home.talk",{name:e.name}),"aria-label":m("home.talk",{name:e.name}),"aria-expanded":R,tabIndex:R?-1:0,onClick:O,children:r.jsx(zv,{"aria-hidden":"true"})}),r.jsx("div",{className:"jv-dock-input","aria-hidden":!R,inert:!R,children:n&&r.jsx(Hg,{chatId:n.id,id:"jv-dock-composer",drafts:l,scrollRef:A,disabled:!z,placeholder:z?m("chat.toBot",{name:e.name}):m("chat.pickModel"),onSend:K,onError:k,onNotice:b,extra:r.jsx("button",{type:"button",className:"jv-dock-go",title:m("home.openDm"),"aria-label":m("home.openDm"),onClick:f,children:r.jsx(Jc,{"aria-hidden":"true"})})})})]}),n&&R&&r.jsx(qg,{container:A,drafts:l,chatId:n.id,source:D=>L.find(F=>F.id===D),members:o,onNotice:b})]})}const S$=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,C$=()=>1;function N$({bot:e,chat:n,status:i,figure:o,call:l,onSeen:c,meId:u,members:h,drafts:f,live:v,onOpenDm:y,onBotInfo:p,ensureDm:w,onRead:b,onPreview:k,onNotice:S,onError:N}){var Z;const C=j.useRef(null),A=j.useRef(null),E=j.useRef(null),T=j.useRef(null),R=j.useRef(null),_=j.useRef(null),[L,I]=j.useState(),H=o.stage,O=K6(e.id,(n==null?void 0:n.id)??null,e.mood,ff(i));Object.assign(H.input,{motion:O.motion,fast:O.fast,mood:l==="error"?"dizzy":O.mood}),$6(H.persona,O,(n==null?void 0:n.id)??null,L);const P=i!=null&&i.error?`${i.runId??""}:${i.error}`:null;j.useEffect(()=>{(P||O.shake)&&H.shake()},[P,O.shake]);const[U,Y]=j.useState(null),K=!!P&&U===P;j.useEffect(()=>{if(!K)return;const ue=he=>{var oe,D;(D=(oe=he.target).closest)!=null&&D.call(oe,".jv-npc, .jv-home-cat")||Y(null)},z=he=>{he.key==="Escape"&&Y(null)};return document.addEventListener("pointerdown",ue),document.addEventListener("keydown",z),()=>{document.removeEventListener("pointerdown",ue),document.removeEventListener("keydown",z)}},[K]);const q=K&&i&&P?{...O.view,shown:E$(P,BS(i)),done:null}:((Z=O.view.shown)==null?void 0:Z.icon)==="ask"&&!O.view.shown.to?{...O.view,shown:{...O.view.shown,hint:m("home.answerInDm")}}:O.view;function Q(){var ue;S$()||H.persona.play("poke",performance.now()),l==="reply"?(ue=_.current)==null||ue.call(_):l==="ask"?y():l==="error"?(c(),Y(P)):O.canRecap?O.showRecap():p()}j.useEffect(()=>E.current&&o.live?H.add(E.current,.9):void 0,[o.live]),j.useLayoutEffect(()=>{const ue=new ResizeObserver(()=>{var z;return(z=R.current)==null?void 0:z.call(R)});for(const z of[C.current,T.current])z&&ue.observe(z);return()=>ue.disconnect()},[]);const V=i!=null&&i.error?"error":(i==null?void 0:i.status)==="running"?"running":!i||i.status==="stop"?"stopped":"idle";return r.jsxs("section",{ref:C,className:"jv-home","aria-label":e.name,children:[r.jsxs("div",{ref:A,className:"jv-home-figure",children:[r.jsxs("button",{type:"button",className:"jv-home-cat","data-still":!o.live||void 0,title:e.name,onClick:Q,"aria-label":l?`${m(`home.call.${l}`)}, ${e.name}`:m("avatar.openInfo",{name:e.name}),children:[o.live?r.jsx("canvas",{ref:E,"aria-hidden":"true"}):r.jsx(Ii,{color:e.color,mood:l==="error"?"dizzy":O.mood,size:168,crown:e.agent,asleep:O.motion==="sleep"}),l?r.jsx(yC,{call:l}):r.jsx(Q6,{motion:O.motion})]}),r.jsx("h1",{className:"jv-home-name",children:e.name}),r.jsx("p",{className:"sr-only",role:"status",children:V==="idle"?"":m(V==="error"?"activity.error":V==="running"?"activity.running":"activity.stopped")})]}),r.jsx(G6,{view:q,name:e.name,cat:A,area:C,avoid:T,layout:R,facing:C$,onHint:y}),r.jsx(k$,{bot:e,chat:n,meId:u,members:h,drafts:f,live:v,dockRef:T,opener:_,onOpenDm:y,ensureDm:w,onRead:b,onSent:ue=>I(ue.id),onPreview:k,onNotice:S,onError:N})]})}const E$=(e,n)=>({id:`failure:${e}`,look:"speech",icon:"say",state:"failed",startedAt:0,endedAt:0,depth:0,title:n,line:m("home.failed",{reason:n})});function T$(e,n,i){const[o]=j.useState(()=>new U6),[l,c]=j.useState(!1);if(e){const u=ff(n);o.color=(Ri[e.color]??Ri.gray).hex,o.crown=e.agent,Object.assign(o.input,{motion:u.motion,fast:u.fast,mood:i?"dizzy":e.mood})}return j.useEffect(()=>{if(!e)return;const u={x:-1,y:-1},h=f=>{u.x=f.clientX,u.y=f.clientY};return window.addEventListener("pointermove",h),o.onFrame=()=>{const f=o.largest();if(!f||u.x<0)return;const v=f.getBoundingClientRect(),y=v.width>100?320:220;o.input.lookX=Math.max(-1,Math.min(1,(u.x-v.left-v.width/2)/y)),o.input.lookY=Math.max(-1,Math.min(1,(u.y-v.top-v.height/2)/y))},c(o.start()),()=>{window.removeEventListener("pointermove",h),o.onFrame=null,o.stop()}},[!!e]),{stage:o,live:l}}function A$({onCancel:e,onSaved:n}){const[i,o]=j.useState(""),[l,c]=j.useState("22"),[u,h]=j.useState(""),[f,v]=j.useState(""),[y,p]=j.useState(""),[w,b]=j.useState(""),[k,S]=j.useState(null),[N,C]=j.useState(""),[A,E]=j.useState(!1),[T,R]=j.useState("password"),{busy:_,error:L,setError:I,run:H}=rn(),O=e6(!!k&&T==="key"),P={host:i.trim(),port:Number(l)||22,user:u.trim()},U=q=>H("add",async()=>{try{await q()}catch(Q){throw Q instanceof lr&&Q.code==="ssh_key_expired"&&O.renew(),Q}}),Y=q=>{q.preventDefault(),U(k?async()=>n(await ae.addMachine({...P,name:f.trim(),directory:y.trim(),description:w.trim(),hostKeys:k,...T==="key"?{keyId:O.key.keyId}:{password:N}})):async()=>S(await ae.scanMachine(P)))},K=P.user&&P.host?`${P.user}@${P.host}`:"";return r.jsxs("form",{className:"jv-panel jv-machine-form",autoComplete:"off",onSubmit:Y,"aria-label":m("machines.add"),"aria-busy":_||void 0,children:[k?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"jv-machine-where",children:[f.trim()&&r.jsx("strong",{children:f.trim()}),r.jsxs("code",{children:[P.user,"@",P.host,P.port===22?"":`:${P.port}`]})]}),r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("machines.fingerprint")}),r.jsx("div",{className:"jv-machine-prints",children:k.fingerprints.map(q=>r.jsx("code",{children:q},q))}),r.jsx("span",{className:"jv-field-hint",children:m("machines.fingerprintHint")})]}),r.jsx("div",{className:"jv-seg jv-machine-login",role:"radiogroup","aria-label":m("machines.login"),children:["password","key"].map(q=>r.jsx("button",{type:"button",role:"radio","aria-checked":T===q,disabled:_,onClick:()=>{R(q),I("")},children:m(q==="password"?"machines.byPassword":"machines.byKey")},q))}),T==="password"?r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.password")}),r.jsx(hf,{value:N,visible:A,onChange:C,onVisible:E,required:!0,warnShort:!1}),r.jsx("span",{className:"jv-field-hint",children:m("machines.passwordHint")})]}):r.jsxs("div",{className:"jv-field",children:[r.jsx("span",{children:m("machines.publicKey")}),O.key?r.jsx(lu,{publicKey:O.key.publicKey}):O.error?r.jsx("p",{className:"jv-note-error",role:"alert",children:O.error}):r.jsx("p",{className:"jv-hint",children:"…"}),r.jsx("span",{className:"jv-field-hint",children:m("machines.keyHint",{user:P.user})})]})]}):r.jsxs("div",{className:"jv-machine-fields",children:[r.jsxs("div",{className:"jv-machine-address",children:[r.jsxs("label",{className:"jv-field jv-machine-host",children:[r.jsx("span",{children:m("machines.host")}),r.jsx(Xe,{required:!0,autoFocus:!0,maxLength:253,spellCheck:!1,placeholder:m("machines.hostPlaceholder"),value:i,onChange:q=>o(q.target.value)})]}),r.jsxs("label",{className:"jv-field jv-machine-port",children:[r.jsx("span",{children:m("machines.port")}),r.jsx(Xe,{required:!0,inputMode:"numeric",maxLength:5,value:l,onChange:q=>c(q.target.value.replace(/\D/g,""))})]})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.user")}),r.jsx(Xe,{required:!0,maxLength:64,spellCheck:!1,autoCapitalize:"off",value:u,onChange:q=>h(q.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.name")}),r.jsx(Xe,{maxLength:40,placeholder:K,value:f,onChange:q=>v(q.target.value)})]}),r.jsxs("label",{className:"jv-field jv-machine-wide",children:[r.jsx("span",{children:m("machines.directory")}),r.jsx(Xe,{className:"jv-mono",maxLength:1e3,spellCheck:!1,placeholder:m("machines.directoryPlaceholder"),value:y,onChange:q=>p(q.target.value)})]}),r.jsxs("label",{className:"jv-field jv-machine-wide",children:[r.jsx("span",{children:m("machines.description")}),r.jsx(Ps,{maxLength:2e3,rows:3,placeholder:m("machines.descriptionPlaceholder"),value:w,onChange:q=>b(q.target.value)})]})]}),L&&r.jsx("p",{className:"jv-note-error",role:"alert",children:L}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",disabled:_,onClick:()=>{k?(S(null),C(""),I("")):e()},children:m(k?"machines.back":"common.cancel")}),r.jsx(ke,{type:"submit",className:"jv-primary",disabled:_||!P.host||!P.user||!!k&&(T==="key"?!O.key:!N),children:m(k?T==="key"?_?"machines.verifying":"machines.verify":_?"machines.connecting":"machines.connect":_?"machines.scanning":"machines.next")})]})]})}const M$=["auto","bash","powershell"],Lw={win32:"devices.platform.win32",darwin:"devices.platform.darwin",linux:"devices.platform.linux"},bh=e=>[Lw[e.platform]?m(Lw[e.platform]):e.platform,e.arch].filter(Boolean).join(" · "),xC=e=>e.online?e.paused?"paused":"online":"offline",Bw=(e,n)=>m(n==="powershell"?"devices.shellPowershell":e.platform==="win32"?"devices.shellBash":"devices.shellBashOther");function _$({device:e,bots:n,onChanged:i,onDeleted:o}){const[l,c]=j.useState(e.name),[u,h]=j.useState(e.directory),[f,v]=j.useState(e.description),[y,p]=j.useState(!1),{busy:w,error:b,setError:k,run:S}=rn(),N=E=>{E.preventDefault(),S("save",async()=>{const T=await ae.updateDevice(e.id,{name:l.trim(),directory:u.trim(),description:f.trim()});i(T),c(T.name),h(T.directory),v(T.description)})},C=l.trim()!==e.name||u.trim()!==e.directory||f.trim()!==e.description,A=xC(e);return r.jsx("div",{className:"jv-list jv-machine-detail",children:r.jsxs("div",{className:"jv-list-row jv-static-row jv-secret-details",children:[r.jsxs("form",{className:"jv-secret-edit jv-machine-edit",onSubmit:N,"aria-label":e.name,children:[r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.name")}),r.jsx(Xe,{required:!0,maxLength:40,value:l,onChange:E=>c(E.target.value)})]}),r.jsxs("label",{className:"jv-field",children:[r.jsx("span",{children:m("machines.directory")}),r.jsx(Xe,{className:"jv-mono",required:!0,maxLength:1e3,spellCheck:!1,value:u,onChange:E=>h(E.target.value)})]}),r.jsxs("label",{className:"jv-field jv-machine-description",children:[r.jsx("span",{children:m("machines.description")}),r.jsx(Ps,{maxLength:2e3,rows:3,placeholder:m("machines.descriptionPlaceholder"),value:f,onChange:E=>v(E.target.value)})]}),r.jsx("div",{className:"jv-secret-actions",children:r.jsx(ke,{type:"submit",variant:"outline",size:"sm",disabled:w||!C||!l.trim(),children:m("common.save")})})]}),r.jsxs("div",{className:"jv-machine-part jv-device-facts",children:[r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m("devices.system")}),r.jsx("span",{className:"jv-env-value",children:bh(e)||"—"})]}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m("devices.state")}),r.jsx("span",{className:"jv-env-value",children:r.jsxs("span",{className:"jv-status","data-ok":A==="online"||void 0,children:[m(`devices.${A}`),A==="offline"&&e.seenAt?` · ${m("devices.seen",{time:new Date(e.seenAt).toLocaleString()})}`:""]})})]}),r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-type",children:[r.jsx("span",{children:m("devices.shell")}),r.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":m("devices.shell"),children:M$.map(E=>r.jsx("button",{type:"button",role:"radio","aria-checked":e.shell===E,disabled:w||E!=="auto"&&!e.shells[E],title:E!=="auto"?e.shells[E]??m("devices.shellMissing"):void 0,onClick:()=>{E!==e.shell&&S("shell",async()=>i(await ae.updateDevice(e.id,{shell:E})))},children:E==="auto"?e.activeShell?`${m("devices.shellAuto")} · ${Bw(e,e.activeShell)}`:m("devices.shellAuto"):Bw(e,E)},E))})]}),e.platform&&!e.activeShell&&r.jsx("p",{className:"jv-hint","data-warn":!0,children:m("devices.noShell")}),e.client&&r.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[r.jsx("span",{children:m("devices.client")}),r.jsx("code",{children:e.client})]})]}),r.jsx("div",{className:"jv-machine-part",children:r.jsx(df,{grantedIds:e.botIds,bots:n,onGrant:async(E,T)=>{let R=e;for(const _ of E)R=await ae.grantDevice(e.id,_,T);i(R)}})}),y?r.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":m("devices.unpairTitle",{name:e.name}),children:[r.jsx("strong",{children:m("devices.unpairTitle",{name:e.name})}),r.jsx("p",{children:m("devices.unpairBody")}),r.jsxs("div",{className:"jv-secret-actions",children:[r.jsx(ke,{type:"button",variant:"ghost",size:"sm",onClick:()=>{p(!1),k("")},children:m("common.cancel")}),r.jsx(ke,{type:"button",className:"jv-primary",size:"sm",disabled:w,onClick:()=>void S("delete",async()=>{await ae.deleteDevice(e.id),o()}),children:m("devices.unpairConfirm")})]})]}):r.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:r.jsx(ke,{type:"button",variant:"ghost",size:"sm",disabled:w,onClick:()=>p(!0),children:m("devices.unpair")})}),b&&r.jsx("p",{className:"jv-note-error",role:"alert",children:b})]})})}function R$(){const e=window.location.origin,n=`${e}/api/devices/connector.mjs`,i=e.startsWith("https:")?" -k":"";return r.jsx("div",{className:"jv-list jv-machine-detail",children:r.jsxs("div",{className:"jv-list-row jv-static-row jv-secret-details jv-device-connect",children:[r.jsx("p",{className:"jv-hint",children:m("devices.connectHint")}),r.jsx("h4",{className:"jv-secret-heading",children:m("devices.connectWindows")}),r.jsx(lu,{publicKey:`curl.exe${i} -o connector.mjs ${n}; node connector.mjs ${e}`}),r.jsx("h4",{className:"jv-secret-heading",children:m("devices.connectOther")}),r.jsx(lu,{publicKey:`curl${i} -o connector.mjs ${n} && node connector.mjs ${e}`}),r.jsx("p",{className:"jv-hint",children:m("devices.connectAfter")})]})})}let ch=null;const R0=3;function O$({bots:e,statuses:n,adding:i,onAdding:o,onSaved:l}){const[c,u]=j.useState(null),[h,f]=j.useState(null),[v,y]=j.useState(null),[p,w]=j.useState(!1),[b,k]=j.useState(ch),[S,N]=j.useState(i),[C,A]=j.useState("");j.useEffect(()=>{ae.machines().then(D=>u(D.machines)).catch(D=>f(Vt(D)))},[]),j.useEffect(()=>{let D=!0;const F=()=>void ae.devices().then($=>{D&&y($.devices)}).catch(()=>{});F();const ie=setInterval(F,5e3);return()=>{D=!1,clearInterval(ie)}},[]),j.useEffect(()=>{i&&N(!0)},[i]);const E=e.filter(D=>D.environment.computer),T=D=>e.filter(F=>F.environment.current==="ssh"&&F.environment.currentName===D.name),R=D=>e.filter(F=>F.environment.current==="device"&&F.environment.currentName===D.name),_=D=>D.environment.current==="computer"?[D]:[],L=(b==null?void 0:b.kind)==="machine"?c==null?void 0:c.find(D=>D.id===b.id):void 0,I=(b==null?void 0:b.kind)==="sandbox"?E.find(D=>D.id===b.id):void 0,H=(b==null?void 0:b.kind)==="device"?v==null?void 0:v.find(D=>D.id===b.id):void 0,O=!L&&!I&&!H,P=i?void 0:H??(O?v==null?void 0:v[0]:void 0),U=i||P?void 0:L??(O?c==null?void 0:c[0]:void 0),Y=i||U||P?void 0:I??(O&&(c||h)?E[0]:void 0),K=D=>{ch=D,k(D),o(!1),N(!0)},q=P?R(P):U?T(U):Y?_(Y):[],Q=Y&&n[Y.id],V=D=>r.jsx(z$,{bots:D,statuses:n}),Z=C.trim().toLocaleLowerCase(),ue=D=>D.toLocaleLowerCase().includes(Z),z=c==null?void 0:c.filter(D=>ue(`${D.name} ${vh(D)}`)),he=v==null?void 0:v.filter(D=>ue(`${D.name} ${bh(D)}`)),oe=E.filter(D=>ue(`${D.name} ${m("envs.sandboxOf",{name:D.name})}`));return r.jsxs("section",{className:"jv-envs","data-open":S||void 0,"aria-label":m("rail.environments"),children:[r.jsxs("aside",{className:"jv-envs-list",children:[r.jsx(hr,{place:"sidebar",title:r.jsx("span",{className:"sr-only",children:m("rail.environments")}),actions:r.jsx(kt,{icon:"add",label:m("machines.add"),"aria-pressed":i,onClick:()=>{o(!0),N(!0)}})}),r.jsx("div",{className:"mx-3 mt-1 mb-2 shrink-0",role:"search",children:r.jsxs(z6,{className:"h-9 bg-background",children:[r.jsx(B6,{type:"search",value:C,onChange:D=>A(D.target.value),placeholder:m("envs.search"),"aria-label":m("envs.search"),onKeyDown:D=>{D.key==="Escape"&&C&&(D.preventDefault(),A(""))},className:"text-sm"}),r.jsx(L6,{align:"inline-start",children:r.jsx(Io,{"aria-hidden":"true"})})]})}),r.jsxs("div",{className:"jv-envs-scroll",children:[he==null?void 0:he.map(D=>r.jsx(Ro,{active:(P==null?void 0:P.id)===D.id,onClick:()=>K({kind:"device",id:D.id}),leading:r.jsx(Ml,{type:"device"}),title:D.name,sub:bh(D)||m("devices.kindDevice"),trailing:r.jsxs(r.Fragment,{children:[V(R(D)),r.jsx(D$,{device:D})]})},D.id)),z==null?void 0:z.map(D=>r.jsx(Ro,{active:(U==null?void 0:U.id)===D.id,onClick:()=>K({kind:"machine",id:D.id}),leading:r.jsx(Ml,{type:"ssh"}),title:D.name,sub:r.jsx("span",{className:"jv-mono",children:vh(D)}),trailing:r.jsxs(r.Fragment,{children:[V(T(D)),r.jsx("span",{className:"jv-envs-state"})]})},D.id)),oe.map(D=>{const F=D.environment.computer;return r.jsx(Ro,{active:(Y==null?void 0:Y.id)===D.id,onClick:()=>K({kind:"sandbox",id:D.id}),leading:r.jsx(Ml,{type:F.type}),title:m("envs.sandboxOf",{name:D.name}),sub:m(F.type==="vm"?"environment.type.vm":"environment.type.container"),trailing:r.jsxs(r.Fragment,{children:[V(_(D)),r.jsx("span",{className:"jv-envs-state","data-state":F.state,role:"img","aria-label":m(yv[F.state]),title:m(yv[F.state])})]})},D.id)}),Z&&c&&!(z!=null&&z.length)&&!(he!=null&&he.length)&&!oe.length&&r.jsx("p",{className:"jv-envs-none",children:m("envs.noMatch")}),h&&r.jsx("p",{className:"jv-note-error",role:"alert",children:h})]})]}),r.jsxs("main",{className:"jv-envs-detail jv-ui",children:[r.jsx(hr,{place:"content",as:"h2",leading:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"jv-envs-back","aria-label":m("envs.back"),onClick:()=>{N(!1),o(!1)},children:r.jsx(Mv,{"aria-hidden":"true"})}),P?r.jsx(Ml,{type:"device"}):U?r.jsx(Ml,{type:"ssh"}):Y?r.jsx(Ml,{type:Y.environment.computer.type}):null]}),title:i?m(p?"devices.connect":"machines.add"):P?P.name:U?U.name:Y?m("envs.sandboxOf",{name:Y.name}):"",sub:P?bh(P):U?r.jsx("span",{className:"jv-mono",children:vh(U)}):void 0}),r.jsxs("div",{className:"jv-envs-body",children:[!i&&q.length>0&&r.jsxs("p",{className:"jv-envs-here",children:[V(q),m("envs.workingHere",{names:q.map(D=>D.name).join(m("common.listSeparator")),count:q.length})]}),i&&r.jsx("div",{className:"jv-seg jv-envs-add-kind",role:"radiogroup","aria-label":m("machines.add"),children:[!1,!0].map(D=>r.jsx("button",{type:"button",role:"radio","aria-checked":p===D,onClick:()=>w(D),children:m(D?"devices.kindDevice":"devices.kindMachine")},String(D)))}),i&&p?r.jsx(R$,{}):i?r.jsx(A$,{onCancel:()=>{o(!1),N(!1)},onSaved:D=>{u(F=>[...F??[],D]),K({kind:"machine",id:D.id})}}):P?r.jsx(_$,{device:P,bots:e,onChanged:D=>y(F=>F&&F.map(ie=>ie.id===D.id?D:ie)),onDeleted:()=>{ch=null,k(null),N(!1),y(D=>D&&D.filter(F=>F.id!==P.id))}},P.id):U?r.jsx(eq,{machine:U,bots:e,onChanged:D=>u(F=>F&&F.map(ie=>ie.id===D.id?D:ie)),onDeleted:()=>{ch=null,k(null),N(!1),u(D=>D&&D.filter(F=>F.id!==U.id))}},U.id):Y?r.jsxs(r.Fragment,{children:[r.jsx(JS,{bot:Y,onSaved:l,heading:!1},Y.id),r.jsx(i6,{bot:Y,runs:`${(Q==null?void 0:Q.status)??"stop"}:${(Q==null?void 0:Q.runId)??""}`},`ports-${Y.id}`)]}):null]})]})]})}function Ml({type:e}){const n=e==="device"?I4:e==="ssh"?Bl:e==="vm"?I9:f9;return r.jsx("span",{className:"ui-tile","data-kind":e,children:r.jsx(n,{"aria-hidden":"true"})})}function D$({device:e}){const n=xC(e),i=m(`devices.${n}`);return r.jsx("span",{className:"jv-envs-state","data-state":n==="online"?"running":n==="paused"?"preparing":"stopped",role:"img","aria-label":i,title:i})}function z$({bots:e,statuses:n}){return r.jsxs("span",{className:"jv-envs-faces",title:e.map(i=>i.name).join(m("common.listSeparator"))||void 0,children:[e.slice(0,R0).map(i=>{var o;return r.jsx(Ii,{color:i.color,mood:i.mood,size:22,crown:i.agent,asleep:((o=n[i.id])==null?void 0:o.status)==="stop"},i.id)}),e.length>R0&&r.jsxs("span",{className:"jv-envs-more",children:["+",e.length-R0]})]})}function L$({onLogin:e}){const[n,i]=j.useState(""),[o,l]=j.useState(""),[c,u]=j.useState(!1),[h,f]=j.useState(!1),[v,y]=j.useState(null),[p,w]=j.useState(document.documentElement.classList.contains("dark"));async function b(k){if(k.preventDefault(),!h){f(!0),y(null);try{const S=await ae.login(n.trim(),o);l(""),e(S.username)}catch(S){y(S instanceof lr&&S.status===401?"login.wrong":S instanceof lr&&S.status===429?"login.tooMany":"login.offline")}finally{f(!1)}}}return r.jsxs("div",{className:"jv-login",children:[r.jsxs("div",{className:"jv-login-corner",children:[r.jsx("div",{className:"jv-login-locales",role:"group","aria-label":m("general.language"),children:qw.map(k=>r.jsx("button",{type:"button",lang:k,"aria-pressed":sr()===k,title:D0(k,"name"),onClick:()=>Uw(k),children:D0(k,"short")},k))}),r.jsx("button",{className:"jv-login-theme",type:"button",onClick:()=>{Oh(p?"light":"dark"),w(!p)},"aria-label":m(p?"login.themeLight":"login.themeDark"),children:r.jsx(Fe,{name:p?"sun":"moon"})})]}),r.jsx("main",{className:"jv-login-stage",children:r.jsxs("div",{className:"jv-login-wrap",children:[r.jsxs("header",{className:"jv-login-brand",children:[r.jsx("img",{className:"jv-login-logo",src:"/icon.svg",alt:"",width:64,height:64}),r.jsx("h1",{children:"Jarvy"}),r.jsx("p",{children:m("login.subtitle")})]}),r.jsxs("form",{className:"jv-login-form",onSubmit:k=>void b(k),"aria-label":m("login.form"),"aria-busy":h,children:[r.jsxs("div",{className:"jv-login-field",children:[r.jsx("label",{htmlFor:"login-username",children:m("login.username")}),r.jsx("input",{id:"login-username",autoComplete:"username",autoFocus:!0,required:!0,disabled:h,value:n,onChange:k=>i(k.target.value)})]}),r.jsxs("div",{className:"jv-login-field",children:[r.jsx("label",{htmlFor:"login-password",children:m("login.password")}),r.jsxs("div",{className:"jv-login-password",children:[r.jsx("input",{id:"login-password",type:c?"text":"password",autoComplete:"current-password",required:!0,disabled:h,value:o,onChange:k=>l(k.target.value)}),r.jsx("button",{type:"button",className:"jv-login-visibility","aria-label":m(c?"login.hidePassword":"login.showPassword"),onClick:()=>u(!c),children:r.jsx(Fe,{name:c?"eye-slash":"eye"})})]})]}),v&&r.jsx("p",{className:"jv-login-error",role:"alert",children:m(v)}),r.jsx("button",{className:"jv-login-submit",type:"submit",disabled:h,children:m(h?"login.submitting":"login.submit")})]})]})})]})}function B$({selected:e,chats:n,transcript:i,openChat:o,setPane:l,paneRef:c,blocked:u}){const[h,f]=j.useState(null),[v,y]=j.useState(0);j.useEffect(()=>{var b;!h||e!==h.chatId||i.loading||((b=i.messages[0])==null?void 0:b.chatId)!==h.chatId||(i.toMessage(h.id,h.passage),f(null))},[h,e,i.loading,i.messages]);function p(b,k,S){if(b.type==="thread"){const T=n.find(R=>R.id===b.parentId);T&&o(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,A=(N==null?void 0:N.kind)==="thread"&&(C||N.mode==="full")||(N==null?void 0:N.kind)==="search"&&C;A&&l(null);const E=b.id===e;o(b),E&&!A?i.toMessage(k,S):f({chatId:b.id,id:k,passage:S})}function w(b){l({kind:"search",chat:b}),y(k=>k+1)}return j.useEffect(()=>{const b=k=>{var N,C;if(u||k.defaultPrevented||!(k.ctrlKey||k.metaKey)||k.key.toLowerCase()!=="f")return;const S=n.find(A=>A.id===e);S&&(((N=c.current)==null?void 0:N.kind)==="search"&&((C=document.activeElement)!=null&&C.closest(".jv-search-pane"))||(k.preventDefault(),w(S)))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[u,n,e]),{openMessage:p,search:w,focusKey:v}}const I$=45e3,P$=25e3;function q$(e,n,i){let o,l=Date.now(),c="";const u=()=>{o==null||o.close(),l=Date.now();const y=new EventSource(c?`${e}?after=${encodeURIComponent(c)}`:e);y.addEventListener("heartbeat",()=>{l=Date.now()});for(const[p,w]of Object.entries(n))y.addEventListener(p,b=>{l=Date.now();const k=b;k.lastEventId&&(c=k.lastEventId),w(k)});y.onerror=i,o=y},h=y=>{Date.now()-l>y&&u()},f=setInterval(()=>h(I$),1e4),v=()=>{document.visibilityState==="visible"&&h(P$)};return window.addEventListener("online",u),document.addEventListener("visibilitychange",v),window.addEventListener("pageshow",v),u(),()=>{clearInterval(f),window.removeEventListener("online",u),document.removeEventListener("visibilitychange",v),window.removeEventListener("pageshow",v),o==null||o.close()}}function F$(e,n){let i=null,o=Promise.resolve();return()=>i??(i=new Promise((l,c)=>setTimeout(()=>{o=o.then(()=>{i=null;const u=e();return u.then(l,c),u.catch(()=>{})})},n)))}const H$=null;function Iw(){var ii,jr,Ko,Ft,Dn,bi;const[e,n]=j.useState("loading"),[i,o]=j.useState(""),[l,c]=j.useState([]),[u,h]=j.useState({}),f=j.useRef(new Map),[v,y]=j.useState([]),[p,w]=j.useState([]),[b,k]=j.useState([]),[S,N]=j.useState(null),[C,A]=j.useState({}),[E,T]=j.useState(null),[R,_]=j.useState(null),[L,I]=j.useState(null),[H,O]=j.useState(null),P=(G,be)=>O(Te=>(Te==null?void 0:Te.id)===G.id?null:{id:G.id,anchor:be}),U=()=>O(null),[Y,K]=j.useState([]),[q,Q]=j.useState(null),[V,Z]=j.useState(!1),[ue,z]=j.useState(!1),[he,oe]=j.useState(!1),[D,F]=j.useState(""),[ie,$]=j.useState(!1),[X,ee]=j.useState(null),[me,te]=j.useState(()=>{const G=localStorage.getItem("jarvy-view");return G==="home"||G==="envs"?G:"chats"}),[ce,J]=j.useState(!1);j.useEffect(()=>{localStorage.setItem("jarvy-view",me)},[me]);const[je,Re]=j.useState(!1),[De,Pe]=j.useState(420),[Le,He]=j.useState(xw),[at,Lt]=j.useState(null),[Gt]=j.useState(()=>new BH),[ft]=j.useState(()=>new yH),[Cn]=j.useState(()=>new W6);j.useEffect(()=>ft.on(G=>Cn.heard(G)),[ft,Cn]);const[wn,fn]=j.useState(""),ye=j.useRef(null),_e=j.useRef(null),We=j.useRef(null),[tt,ct]=j.useState(null),[on,On]=j.useState(null),[yn,Bn]=j.useState(null),ge=j.useRef(E);ge.current=E;const Ee=j.useRef(0),Oe=j.useRef(v);Oe.current=v;const qe=j.useRef(X);qe.current=X;const Be=j.useMemo(()=>new xF(bF(i)),[i]);j.useEffect(()=>{const G=()=>Be.save();return window.addEventListener("pagehide",G),()=>window.removeEventListener("pagehide",G)},[Be]);const mt=((ii=b.find(G=>G.kind==="user"&&G.name===i))==null?void 0:ii.id)??"",$n=j.useRef(mt);$n.current=mt;const Ba=j.useRef(b);Ba.current=b;const Yt=vC({chatId:E,ready:e==="ready",scroller:ye,me:mt,memory:Cn,onError:gt}),{messages:Vo,setMessages:Pi}=Yt,gr=B$({selected:E,chats:v,transcript:Yt,openChat:da,setPane:ee,paneRef:qe,blocked:!!L||!!q}),Jr=((jr=v.find(G=>G.id===E))==null?void 0:jr.botId)??R??((Ko=l[0])==null?void 0:Ko.id);async function Ia(G){const be=(f.current.get(G)??0)+1;f.current.set(G,be);const Te=await ae.botStatus(G);f.current.get(G)===be&&h(ot=>({...ot,[G]:Te}))}j.useEffect(()=>{e==="ready"&&Jr&&Ia(Jr).catch(gt)},[e,Jr]);const Et=l.find(G=>G.agent),sn=Et?u[Et.id]:void 0,cn=v.find(G=>G.type==="dm"&&G.botId===(Et==null?void 0:Et.id)),Pa=me==="home"&&!!Et,qa=me==="envs",ka=Pa||qa,ai=j.useRef(ka);ai.current=ka;const ua=x$(sn,cn),Sa=T$(Et,sn,ua.call==="error");j.useEffect(()=>{e==="ready"&&Et&&Ia(Et.id).catch(gt)},[e,Et==null?void 0:Et.id]);const Fa=((Ft=v.find(G=>G.id===E&&G.type==="channel"))==null?void 0:Ft.memberIds.filter(G=>l.some(be=>be.id===G)).join(","))??"";j.useEffect(()=>{if(e==="ready"&&Fa)for(const G of Fa.split(","))Ia(G).catch(gt)},[e,Fa]);async function Ca(G){var yt,en;const[be,Te,ot,pt,un]=await Promise.all([ae.bots(),ae.chats(),ae.modelConnections(),ae.sections(),ae.members()]);o(G),c(be.bots),y(Te.chats),K(ot.connections),w(pt.sections),k(un.members),Lt(Te.followed);const it=Te.chats.find(Xt=>Xt.type!=="thread");T((it==null?void 0:it.id)??null),it&&A({[it.id]:it.readSequence}),_(((yt=Te.chats[0])==null?void 0:yt.botId)??((en=be.bots[0])==null?void 0:en.id)??null),n("ready")}j.useEffect(()=>{Oh(localStorage.getItem("jarvy-theme")==="dark"?"dark":"light"),ae.me().then(G=>Ca(G.username)).catch(()=>n("login"))},[]),j.useEffect(()=>{if(e!=="ready")return;let G=!0;const be=it=>{G&&gt(it)},Te=async()=>{const it=ge.current;G&&it&&await Yt.refresh(it)},ot=()=>void ae.sections().then(it=>{G&&w(it.sections)}).catch(it=>{G&&gt(it)}),pt=({chat:it,parent:yt,followed:en,message:Xt},pa)=>{const Ht=tn=>tn.type!=="thread"&&tn.memberIds.includes($n.current);for(const tn of yt?[it,yt]:[it])Ht(tn)&&Vn(tn);en&&Lt(en),it.type==="thread"&&Gt.emit({kind:"changed",id:it.id}),He(tn=>_H(tn,it.id,it.type==="dm"&&!Ht(it))),Xt&&pa?(Yt.heard(Xt,pa==="message"),ft.emit({kind:pa,message:Xt}),pa==="message"&&YI(Xt,it,$n.current,Ba.current)):ft.emit({kind:"chat",chat:it})},un=q$("/api/events",{ready:it=>{JSON.parse(it.data).resumed||(Cn.clear(),ft.emit({kind:"reconnected"}),He(RH),qi().catch(be),Te().catch(be),ot(),Gt.emit({kind:"reconnected"}),ae.bots().then(yt=>{if(G){c(yt.bots);for(const en of yt.bots)Ia(en.id).catch(Xt=>{G&&gt(Xt)})}}).catch(yt=>{G&&gt(yt)}))},sections:ot,bots:()=>{ae.bots().then(it=>{G&&c(it.bots)}).catch(be),qi().catch(be)},message:it=>pt(JSON.parse(it.data),"message"),"message.updated":it=>pt(JSON.parse(it.data),"updated"),chat:it=>pt(JSON.parse(it.data)),"chat.removed":it=>{var Xt;const{chatId:yt,followed:en}=JSON.parse(it.data);y(pa=>pa.filter(Ht=>Ht.id!==yt)),Lt(en),Cn.removed(yt),ge.current===yt&&T(null),((Xt=qe.current)==null?void 0:Xt.kind)==="thread"&&qe.current.parentId===yt&&ee(null),Gt.emit({kind:"reconnected"})},bot:it=>{var pa;const{botId:yt,status:en,bot:Xt}=JSON.parse(it.data);f.current.set(yt,(f.current.get(yt)??0)+1),h(Ht=>({...Ht,[yt]:en})),en.error&&!ai.current&&((pa=Oe.current.find(Ht=>Ht.id===ge.current))==null?void 0:pa.botId)===en.botId&&fn(BS(en)),Xt&&c(Ht=>Ht.map(tn=>tn.id===Xt.id?Xt:tn))}},()=>{ae.me().catch(it=>{G&&it instanceof lr&&it.status===401&&n("login")})});return()=>{G=!1,un(),Yt.cancel(),Ee.current++}},[e]),y$({ready:e==="ready"&&!ka,selected:E,messages:Vo,chats:v,chatList:Oe,setChats:y,onError:gt});const Na=G=>v.reduce((be,Te)=>be+(Te.type==="thread"||Te.id===G?0:Te.alerts),0)+((at==null?void 0:at.mentions)??0);g$(e==="ready"?Na():0),j.useEffect(()=>{if(!wn)return;const G=setTimeout(()=>fn(""),4800);return()=>clearTimeout(G)},[wn]),j.useEffect(()=>{const G=be=>{be.defaultPrevented||L||q||(be.key==="Escape"&&(Z(!1),z(!1),oe(!1)),(be.ctrlKey||be.metaKey)&&be.key.toLowerCase()==="k"&&(be.preventDefault(),te("chats"),oe(window.matchMedia("(max-width: 620px)").matches),requestAnimationFrame(()=>{var Te;return(Te=document.querySelector("#jarvy-search"))==null?void 0:Te.focus()})))};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[L,q]),j.useEffect(()=>{const G=window.matchMedia("(max-width: 620px)"),be=()=>{G.matches||oe(!1)};return G.addEventListener("change",be),()=>G.removeEventListener("change",be)},[]);function gt(G){if(G instanceof lr&&G.status===401){n("login");return}fn(Vt(G,"common.failed"))}const[qi]=j.useState(()=>F$(async()=>{const G=++Ee.current,be=await ae.chats();return G===Ee.current&&(y(be.chats),Lt(be.followed)),be.chats},100));async function Ha(){const[G,be]=await Promise.all([ae.modelConnections(),ae.bots()]);K(G.connections),c(be.bots)}const Fi=()=>void ae.members().then(G=>k(G.members)).catch(gt);function Ua(G){c(be=>be.map(Te=>Te.id===G.id?G:Te)),Fi()}function da(G){var Te;const be=pF(G);be?ee({kind:"thread",id:be,parentId:G.id,mode:"pane",summary:((Te=G.hint)==null?void 0:Te.kind)==="note"}):G.id!==ge.current&&ee(null),Re(!1),te("chats"),A(ot=>({...ot,[G.id]:G.readSequence})),T(G.id),G.botId&&_(G.botId),oe(!1),Z(!1),z(!1)}const $a=G=>ee((X==null?void 0:X.kind)==="info"&&X.page===G?null:{kind:"info",page:G});function Vn(G){y(be=>be.some(Te=>Te.id===G.id)?be.map(Te=>Te.id===G.id?G:Te):[G,...be])}async function gi(G){if(!ie){$(!0);try{const be=await ae.createChat(G);Vn(be),da(be),requestAnimationFrame(()=>{var Te;return(Te=document.querySelector("#jarvy-composer"))==null?void 0:Te.focus()})}catch(be){gt(be)}finally{$(!1)}}}async function yi(){if(!ie){$(!0);try{const G=await ae.createBot(Bq(Oi(b).map(Te=>Te.name))),be=await ae.createChat(G.id);c(Te=>[...Te,G]),Vn(be),Fi(),da(be)}catch(G){gt(G)}finally{$(!1)}}}async function Ea(G){try{await ae.deleteChat(G.id),await qi(),ge.current===G.id&&T(null),fn(m("app.channelDeleted"))}catch(be){gt(be)}}async function ha(G,be){try{Vn(await ae.pin(G.id,be))}catch(Te){gt(Te)}}async function Hi(G,be){try{Vn(await ae.mute(G.id,be))}catch(Te){gt(Te)}}async function mn(G,be){try{await ae.deleteBot(G.id,be);const Te=new Set(v.filter(ot=>ot.type==="dm"&&ot.botId===G.id).map(ot=>ot.id));y(ot=>ot.filter(pt=>!Te.has(pt.id)).map(pt=>pt.memberIds.includes(G.id)?{...pt,memberIds:pt.memberIds.filter(un=>un!==G.id)}:pt)),c(ot=>ot.filter(pt=>pt.id!==G.id)),Fi(),ge.current&&Te.has(ge.current)&&T(null),L===G.id&&I(null),fn(m("app.botDeleted",{name:G.name}))}catch(Te){gt(Te)}}async function ln(G,be,Te,ot,pt){const un=E,it=await ae.send(un,G,be,Te,!1,ot,pt),yt=Oe.current.find(Xt=>Xt.id===un),en=(yt==null?void 0:yt.type)==="channel"?[...new Set(Ig(G,Oi(b)).filter(Xt=>!yt.memberIds.includes(Xt.member.id)).map(Xt=>Xt.member.name))]:[];en.length&&fn(m("app.notInChannel",{names:en.join(m("common.listSeparator")),count:en.length})),Yt.heard(it,!0)}function Nn(G,be){ae.addMember(G,be.id).then(Te=>{Vn(Te),fn(m("app.memberAdded",{name:be.name,channel:Te.title}))}).catch(gt)}async function fa(G){try{const be=await ae.openThread(G.id);ee({kind:"thread",id:be.id,parentId:G.chatId,mode:"pane"})}catch(be){gt(be)}}function Go(G,be){const Te=v.find(ot=>ot.id===G.parentId);Te&&da(Te),ee(be?{kind:"thread",id:G.id,parentId:G.parentId,mode:"pane"}:null)}function xi(G){I(null);const be=v.find(Te=>Te.id===(G.type==="thread"?G.parentId:G.id));be&&da(be),G.type==="thread"&&ee({kind:"thread",id:G.id,parentId:G.parentId,mode:"pane"})}const yr=j.useRef(xi);yr.current=xi,j.useEffect(()=>{var G;return(G=bu())==null?void 0:G.onOpenChat(be=>void ae.chat(be).then(Te=>yr.current(Te)).catch(()=>{}))},[]);async function Ui(G,be,Te){try{const ot=await ae.react(G.id,be,Te);Pi(pt=>pt.map(un=>un.id===ot.id?{...un,reactions:ot.reactions}:un))}catch(ot){gt(ot)}}async function xr(G,be){try{const Te=await ae.fold(G.id,be);Pi(ot=>ot.map(pt=>pt.id===Te.id?{...pt,folded:Te.folded}:pt))}catch(Te){gt(Te)}}function eo(G){Fg(Be,G,b)}const to=(G,be)=>G?void Yt.toMessage(G,be).then(async Te=>{Te&&gr.openMessage(await ae.chat(Te),G,be)}).catch(()=>fn(m("app.sourceGone"))):fn(m("app.sourceGone"));function Va(G){Gt.emit({kind:"chat",chat:G})}function br(G){G.preventDefault();const be=ot=>Pe(Math.min(Math.max(340,window.innerWidth-ot.clientX),Math.round(window.innerWidth*.6))),Te=()=>{window.removeEventListener("pointermove",be),window.removeEventListener("pointerup",Te),document.body.style.cursor=""};window.addEventListener("pointermove",be),window.addEventListener("pointerup",Te),document.body.style.cursor="col-resize"}async function pe(){try{await Be.clear(G=>ae.removeAttachment(G)),await ae.logout(),n("login"),Z(!1),Q(null),f.current.clear(),h({}),ee(null),Lt(null),He(xw),Cn.clear(),o(""),T(null),y([]),c([]),K([]),Pi([])}catch(G){gt(G)}}const Ne=e==="ready"&&v.some(G=>G.id===E);j.useEffect(()=>{const G=ye.current;if(!G)return;let be=0,Te=G.clientHeight;const ot=()=>{be=G.scrollHeight-G.scrollTop-G.clientHeight},pt=new ResizeObserver(()=>{G.clientHeight!==Te&&(Te=G.clientHeight,G.scrollTo({top:G.scrollHeight-G.clientHeight-be,behavior:"instant"}))}),un=new MutationObserver(ot);return ot(),G.addEventListener("scroll",ot,{passive:!0}),pt.observe(G),un.observe(G,{childList:!0,subtree:!0,characterData:!0}),()=>{pt.disconnect(),un.disconnect(),G.removeEventListener("scroll",ot)}},[Ne]);const Ce=v.find(G=>G.id===E),Ve=(Ce==null?void 0:Ce.type)==="channel",st=bH(e==="ready"?((Dn=v.find(G=>G.id===E&&G.type==="dm"))==null?void 0:Dn.botId)??void 0:void 0,DH(Le));if(e==="loading")return r.jsx("div",{className:"jarvy-loading",children:m("app.connecting")});if(e==="login")return r.jsx(L$,{onLogin:G=>void Ca(G).catch(gt)});const Ge=v.find(G=>G.id===E),nt=l.find(G=>G.id===((Ge==null?void 0:Ge.botId)??R))??l[0],Dt=!!(nt!=null&&nt.connectionId),Rt=Ve||Dt,Ze=(nt==null?void 0:nt.name)??"Jarvy",Je=nt?u[nt.id]:void 0,Nt=Je!=null&&Je.error?m("activity.error"):(Je==null?void 0:Je.status)==="running"?p6(Je.activity):"",Qe=(bi=[...Vo].reverse().find(G=>{var be;return((be=G.question)==null?void 0:be.state)==="pending"}))==null?void 0:bi.id,pn=(X==null?void 0:X.kind)==="thread"?X:null,Kt=(pn==null?void 0:pn.mode)==="full",ma=Ve?Ce:void 0,xn=l.find(G=>G.id===L),Jt=l.find(G=>G.id===(H==null?void 0:H.id)),no=new Set(Object.values(u).filter(G=>G.status==="running"&&G.activity!=="asking").map(G=>G.botId)),Yo=new Set(Object.values(u).filter(G=>G.activity==="asking").map(G=>G.botId));return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"ui-app","data-nav":he?"":void 0,"data-pane":X&&!Kt&&!ka?"":void 0,"data-view":Pa?"home":qa?"envs":void 0,style:{"--ui-pane":`${De}px`},children:[r.jsx(b$,{view:Pa?"home":qa?"envs":"chats",agent:Et,figure:Sa,call:ua.call,asleep:ff(sn).motion==="sleep",alerts:Na(cn==null?void 0:cn.id),username:i,onView:G=>{te(G),oe(G==="chats"&&window.matchMedia("(max-width: 620px)").matches),Z(!1)},accountMenu:V,onToggleAccount:G=>{Z(G),z(!1)},onSettings:()=>{Z(!1),Q("general")},onToggleTheme:()=>{Oh(document.documentElement.classList.contains("dark")?"light":"dark"),Z(!1)},onLogOut:()=>void pe()}),r.jsx(gF,{chats:v,sections:p,bots:l,members:b,followed:at,followedOpen:je&&!Kt,working:no,asking:Yo,selected:je?null:E,filter:D,creating:ie,createMenu:ue,onFilterChange:F,onOpenFollowed:()=>{Re(!0),ee(null),oe(!1)},onOpenChat:da,onOpenBot:G=>void gi(G.id),onOpenMenu:(G,be)=>On({target:G,at:be}),onEditSection:G=>N({kind:"section",section:G}),onCreate:G=>{if(G==="bot")return void yi();N({kind:G}),z(!1)},onFind:gr.openMessage,onOpenFound:xi,onError:gt,onToggleCreate:G=>{z(G),Z(!1)}}),r.jsx(fH,{chat:Ge,inChannel:Ve,bots:l,members:b,meId:mt,drafts:Be,composeReady:Rt,botName:Ze,activeBot:nt,status:Je,connections:Y,activity:Nt,history:Yt,divider:C[(Ge==null?void 0:Ge.id)??""]??(Ge==null?void 0:Ge.readSequence)??0,activeQuestion:Qe,pane:X,onPane:ee,onToggleInfo:$a,find:gr,onNav:()=>oe(!0),onBot:G=>I(G),hasBotDirects:st.length>0,onBotCard:P,onInvite:Nn,onQuote:eo,onReply:G=>void fa(G),onReact:(G,be,Te)=>void Ui(G,be,Te),onFold:(G,be)=>void xr(G,be),onJump:to,onSettled:G=>Pi(be=>be.map(Te=>Te.id===G.id?G:Te)),onPreview:(G,be)=>ct({files:G,index:be}),onSend:ln,notice:fn,onSaveNote:async G=>{try{Vn(await ae.setNote(Ge.id,G))}catch(be){throw gt(be),be}},createBot:()=>void yi(),creating:ie,updateBot:Ua,onManageModels:()=>Q("models"),error:gt,chatArea:_e,transcript:ye,composeWrap:We,hidden:Kt||je||ka,onOpenThread:G=>ee({kind:"thread",id:G,parentId:Ge.id,mode:"pane"})}),r.jsx(HH,{onBotCard:P,pane:X,followedView:je,threadEvents:Gt,followed:at,chats:v,sections:p,members:b,bots:l,statuses:u,meId:mt,drafts:Be,changes:Le,live:ft,memory:Cn,paneChannel:ma,activeBot:nt,botDirects:st,find:gr,onPane:ee,onNav:()=>oe(!0),onBackToChannel:Go,onAddMembers:G=>N({kind:"members",chat:G}),onOpenBot:I,onPin:G=>void ha(G,!G.pinned),onMute:G=>void Hi(G,!G.muted),onDeleteChannel:G=>Bn({kind:"chat",chat:G}),onChannelSaved:Vn,onThreadChanged:Va,onInvite:Nn,onPreview:(G,be)=>ct({files:G,index:be}),onNotice:fn,onError:gt,paneWidth:De,onResize:br}),Pa&&r.jsx(N$,{bot:Et,chat:cn,status:sn,figure:Sa,call:ua.call,onSeen:ua.seen,meId:mt,members:b,drafts:Be,live:ft,onOpenDm:()=>void gi(Et.id),onBotInfo:()=>I(Et.id),ensureDm:async()=>{const G=await ae.createChat(Et.id);return Vn(G),G},onRead:(G,be)=>gC(y,G.id,be,gt),onPreview:(G,be)=>ct({files:G,index:be}),onNotice:fn,onError:gt}),qa&&r.jsx(O$,{bots:l,statuses:u,adding:ce,onAdding:J,onSaved:Ua})]}),Jt&&H&&r.jsx(gH,{bot:Jt,status:u[Jt.id],connections:Y,anchor:H.anchor,onClose:U,onMessage:()=>void gi(Jt.id),onInfo:()=>I(Jt.id)}),q&&r.jsx(m$,{connections:Y,bots:l,initialTab:q,onChanged:Ha,onClose:()=>Q(null)}),r.jsx(lF,{dialog:S,entryMenu:on,confirm:yn,preview:tt,infoBot:xn,bots:l,statuses:u,chats:v,sections:p,members:b,connections:Y,meId:mt,onDialog:N,onEntryMenu:On,onConfirm:Bn,onPreview:ct,onInfoBot:I,onSettings:Q,onAddMachine:()=>{te("envs"),J(!0),oe(!1)},onChannelInfo:G=>{da(G),ee({kind:"info",page:"main"})},onOpenChatId:G=>{T(G),oe(!1)},chatSaved:Vn,openChat:da,onSectionSaved:G=>{w(be=>be.some(Te=>Te.id===G.id)?be.map(Te=>Te.id===G.id?G:Te):[...be,G]),N(null)},onSectionDeleted:G=>{N(null),w(be=>be.filter(Te=>Te.id!==G)),qi().catch(gt)},updateBot:Ua,openAnywhere:xi,removeChannel:Ea,deleteBot:mn,pinChat:ha,muteChat:Hi}),wn&&r.jsx("div",{className:"ui-toast",role:"status",children:wn}),H$]})}function U$(){const e=`https://${location.host}${location.pathname}${location.search}`;return r.jsxs("div",{className:"jv-insecure",role:"status",children:[r.jsx(K9,{"aria-hidden":"true"}),r.jsx("span",{children:m("connection.insecure")}),r.jsx("a",{href:e,children:m("connection.useHttps")})]})}function $$(){return $w(),window.isSecureContext?r.jsx(Iw,{}):r.jsxs("div",{className:"jv-insecure-shell",children:[r.jsx(U$,{}),r.jsx(Iw,{})]})}KI();sN.createRoot(document.getElementById("root")).render(r.jsx(j.StrictMode,{children:r.jsx($$,{})}));