diff --git a/pyproject.toml b/pyproject.toml index 4f9055cc..532c1660 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [project] name = "parallax" -version = "0.0.1" +version = "0.1.0" description = "Decentralised pipeline-parallel LLM serving with Sglang + MLX-LM + Lattica" readme = "README.md" requires-python = ">=3.11,<3.14" diff --git a/src/backend/server/scheduler_manage.py b/src/backend/server/scheduler_manage.py index 99784f4d..8098f5b6 100644 --- a/src/backend/server/scheduler_manage.py +++ b/src/backend/server/scheduler_manage.py @@ -91,6 +91,9 @@ def get_peer_id(self): return None return self.lattica.peer_id() + def need_more_nodes(self): + return self.scheduler.need_more_nodes() if self.scheduler else False + def get_cluster_status(self): return { "type": "cluster_status", @@ -102,6 +105,7 @@ def get_cluster_status(self): self.get_peer_id(), self.is_local_network ), "node_list": self.get_node_list(), + "need_more_nodes": self.need_more_nodes(), }, } diff --git a/src/backend/server/static_config.py b/src/backend/server/static_config.py index 941f0e70..fad7f435 100644 --- a/src/backend/server/static_config.py +++ b/src/backend/server/static_config.py @@ -1,9 +1,13 @@ +import concurrent.futures import json -import logging +import math from pathlib import Path +from parallax_utils.logging_config import get_logger from scheduling.model_info import ModelInfo +logger = get_logger(__name__) + # Supported model list - key: model name, value: MLX model name (same as key if no MLX variant) MODELS = { "Qwen/Qwen3-0.6B": "Qwen/Qwen3-0.6B", @@ -57,7 +61,6 @@ "zai-org/GLM-4.6": "mlx-community/GLM-4.6-4bit", } -logger = logging.getLogger(__name__) NODE_JOIN_COMMAND_LOCAL_NETWORK = """parallax join""" NODE_JOIN_COMMAND_PUBLIC_NETWORK = """parallax join -s {scheduler_addr} """ @@ -80,9 +83,6 @@ def _load_config_only(name: str) -> dict: config = _load_config_only(model_name) - # get quant method - # logger.info(f"Loading model config from {model_name}") - quant_method = config.get("quant_method", None) quantization_config = config.get("quantization_config", None) if quant_method is None and quantization_config is not None: @@ -92,8 +92,13 @@ def _load_config_only(name: str) -> dict: param_bytes_per_element = 2 elif quant_method == "fp8": param_bytes_per_element = 1 - elif quant_method in ("mxfp4", "int4", "awq", "gptq"): + elif quant_method in ("mxfp4", "int4", "awq", "gptq", "compressed-tensors"): param_bytes_per_element = 0.5 + else: + param_bytes_per_element = 1 + logger.warning( + f"model_name:{model_name} quant_method {quant_method} not supported in get_model_info method" + ) mlx_param_bytes_per_element = param_bytes_per_element mlx_model_name = MODELS.get(model_name, model_name) @@ -135,8 +140,42 @@ def _load_config_only(name: str) -> dict: return model_info +def get_model_info_list(): + model_name_list = list(MODELS.keys()) + with concurrent.futures.ThreadPoolExecutor() as executor: + model_info_list = list(executor.map(get_model_info, model_name_list)) + return model_info_list + + +model_info_list_cache = get_model_info_list() + + def get_model_list(): - return list(MODELS.keys()) + model_info_list = model_info_list_cache + + def build_single_model(model_info): + return { + "name": model_info.model_name, + "vram_gb": math.ceil(estimate_vram_gb_required(model_info)), + } + + results = [build_single_model(model_info) for model_info in model_info_list] + return results + + +def estimate_vram_gb_required(model_info): + if model_info is None: + return 0 + return ( + ( + model_info.embedding_io_bytes + + model_info.num_layers * model_info.decoder_layer_io_bytes(roofline=False) + ) + * 1.0 + / 1024 + / 1024 + / 1024 + ) def get_node_join_command(scheduler_addr, is_local_network): diff --git a/src/frontend/dist/assets/App-BwG-l8Xs.js b/src/frontend/dist/assets/App-Ba9WPx9O.js similarity index 69% rename from src/frontend/dist/assets/App-BwG-l8Xs.js rename to src/frontend/dist/assets/App-Ba9WPx9O.js index b82846cb..b2539fd2 100644 --- a/src/frontend/dist/assets/App-BwG-l8Xs.js +++ b/src/frontend/dist/assets/App-Ba9WPx9O.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-CYeFrJeL.js","assets/main-layout-C9FQ4SXh.js","assets/main-layout-DVneG3Rq.css","assets/join-BWhers2Y.js","assets/chat-DSga-3Xw.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-eQlkglW5.js","assets/main-layout-DhzCWI3u.js","assets/main-layout-DVneG3Rq.css","assets/join-BzV0zEA8.js","assets/chat-D4M-59Zb.js"])))=>i.map(i=>d[i]); function N2(n,r){for(var l=0;lo[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function l(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(u){if(u.ep)return;u.ep=!0;const c=l(u);fetch(u.href,c)}})();function Ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Of={exports:{}},vl={};/** * @license React * react-jsx-runtime.production.js @@ -7,7 +7,7 @@ function N2(n,r){for(var l=0;l>>1,w=A[le];if(0>>1;leu(ie,X))oeu(fe,ie)?(A[le]=fe,A[oe]=X,le=oe):(A[le]=ie,A[re]=X,le=re);else if(oeu(fe,X))A[le]=fe,A[oe]=X,le=oe;else break e}}return U}function u(A,U){var X=A.sortIndex-U.sortIndex;return X!==0?X:A.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var p=[],m=[],y=1,b=null,E=3,O=!1,C=!1,T=!1,M=!1,D=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function B(A){for(var U=l(m);U!==null;){if(U.callback===null)o(m);else if(U.startTime<=A)o(m),U.sortIndex=U.expirationTime,r(p,U);else break;U=l(m)}}function _(A){if(T=!1,B(A),!C)if(l(p)!==null)C=!0,N||(N=!0,S());else{var U=l(m);U!==null&&Z(_,U.startTime-A)}}var N=!1,V=-1,F=5,Q=-1;function I(){return M?!0:!(n.unstable_now()-QA&&I());){var le=b.callback;if(typeof le=="function"){b.callback=null,E=b.priorityLevel;var w=le(b.expirationTime<=A);if(A=n.unstable_now(),typeof w=="function"){b.callback=w,B(A),U=!0;break t}b===l(p)&&o(p),B(A)}else o(p);b=l(p)}if(b!==null)U=!0;else{var Y=l(m);Y!==null&&Z(_,Y.startTime-A),U=!1}}break e}finally{b=null,E=X,O=!1}U=void 0}}finally{U?S():N=!1}}}var S;if(typeof $=="function")S=function(){$(K)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=K,S=function(){G.postMessage(null)}}else S=function(){D(K,0)};function Z(A,U){V=D(function(){A(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125le?(A.sortIndex=X,r(m,A),l(p)===null&&A===l(m)&&(T?(k(V),V=-1):T=!0,Z(_,X-le))):(A.sortIndex=w,r(p,A),C||O||(C=!0,N||(N=!0,S()))),A},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(A){var U=E;return function(){var X=E;E=U;try{return A.apply(this,arguments)}finally{E=X}}}})(_f)),_f}var ig;function U2(){return ig||(ig=1,Df.exports=j2()),Df.exports}var kf={exports:{}},ye={};/** + */var rg;function j2(){return rg||(rg=1,(function(n){function r(O,U){var V=O.length;O.push(U);e:for(;0>>1,w=O[le];if(0>>1;leu(ie,V))oeu(fe,ie)?(O[le]=fe,O[oe]=V,le=oe):(O[le]=ie,O[re]=V,le=re);else if(oeu(fe,V))O[le]=fe,O[oe]=V,le=oe;else break e}}return U}function u(O,U){var V=O.sortIndex-U.sortIndex;return V!==0?V:O.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var p=[],m=[],y=1,b=null,E=3,A=!1,C=!1,T=!1,M=!1,D=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function B(O){for(var U=l(m);U!==null;){if(U.callback===null)o(m);else if(U.startTime<=O)o(m),U.sortIndex=U.expirationTime,r(p,U);else break;U=l(m)}}function _(O){if(T=!1,B(O),!C)if(l(p)!==null)C=!0,N||(N=!0,S());else{var U=l(m);U!==null&&Z(_,U.startTime-O)}}var N=!1,P=-1,W=5,I=-1;function Q(){return M?!0:!(n.unstable_now()-IO&&Q());){var le=b.callback;if(typeof le=="function"){b.callback=null,E=b.priorityLevel;var w=le(b.expirationTime<=O);if(O=n.unstable_now(),typeof w=="function"){b.callback=w,B(O),U=!0;break t}b===l(p)&&o(p),B(O)}else o(p);b=l(p)}if(b!==null)U=!0;else{var q=l(m);q!==null&&Z(_,q.startTime-O),U=!1}}break e}finally{b=null,E=V,A=!1}U=void 0}}finally{U?S():N=!1}}}var S;if(typeof $=="function")S=function(){$(K)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,H=ee.port2;ee.port1.onmessage=K,S=function(){H.postMessage(null)}}else S=function(){D(K,0)};function Z(O,U){P=D(function(){O(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125le?(O.sortIndex=V,r(m,O),l(p)===null&&O===l(m)&&(T?(k(P),P=-1):T=!0,Z(_,V-le))):(O.sortIndex=w,r(p,O),C||A||(C=!0,N||(N=!0,S()))),O},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(O){var U=E;return function(){var V=E;E=U;try{return O.apply(this,arguments)}finally{E=V}}}})(_f)),_f}var ig;function U2(){return ig||(ig=1,Df.exports=j2()),Df.exports}var kf={exports:{}},ye={};/** * @license React * react.production.js * @@ -23,7 +23,7 @@ function N2(n,r){for(var l=0;l"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),zf.exports=Y2(),zf.exports}/** + */var sg;function Y2(){if(sg)return zt;sg=1;var n=_d();function r(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),zf.exports=Y2(),zf.exports}/** * @license React * react-dom-client.production.js * @@ -39,15 +39,15 @@ function N2(n,r){for(var l=0;lw||(e.current=le[w],le[w]=null,w--)}function ie(e,t){w++,le[w]=e.current,e.current=t}var oe=Y(null),fe=Y(null),ue=Y(null),Oe=Y(null);function Se(e,t){switch(ie(ue,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D0(t),e=_0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(oe),ie(oe,e)}function Ie(){re(oe),re(fe),re(ue)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=_0(t,e.type);t!==a&&(ie(fe,e),ie(oe,a))}function lt(e){fe.current===e&&(re(oe),re(fe)),Oe.current===e&&(re(Oe),hl._currentValue=X)}var bt=Object.prototype.hasOwnProperty,wt=n.unstable_scheduleCallback,Nt=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,ft=n.unstable_ImmediatePriority,vn=n.unstable_UserBlockingPriority,wn=n.unstable_NormalPriority,pe=n.unstable_LowPriority,Kl=n.unstable_IdlePriority,Wl=n.log,Fl=n.unstable_setDisableYieldValue,St=null,Ee=null;function ot(e){if(typeof Wl=="function"&&Fl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(St,e)}catch{}}var Qe=Math.clz32?Math.clz32:x1,xi=Math.log,pu=Math.LN2;function x1(e){return e>>>=0,e===0?32:31-(xi(e)/pu|0)|0}var Jl=256,eo=4194304;function Ua(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function to(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var s=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~f,i!==0?s=Ua(i):(g&=v,g!==0?s=Ua(g):a||(a=v&~e,a!==0&&(s=Ua(a))))):(v=i&~f,v!==0?s=Ua(v):g!==0?s=Ua(g):a||(a=i&~e,a!==0&&(s=Ua(a)))),s===0?0:t!==0&&t!==s&&(t&f)===0&&(f=s&-s,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:s}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hh(){var e=Jl;return Jl<<=1,(Jl&4194048)===0&&(Jl=256),e}function mh(){var e=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),e}function gu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E1(e,t,a,i,s,f){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(a=g&~a;0w||(e.current=le[w],le[w]=null,w--)}function ie(e,t){w++,le[w]=e.current,e.current=t}var oe=q(null),fe=q(null),ue=q(null),Oe=q(null);function Se(e,t){switch(ie(ue,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D0(t),e=_0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(oe),ie(oe,e)}function Ie(){re(oe),re(fe),re(ue)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=_0(t,e.type);t!==a&&(ie(fe,e),ie(oe,a))}function lt(e){fe.current===e&&(re(oe),re(fe)),Oe.current===e&&(re(Oe),hl._currentValue=V)}var bt=Object.prototype.hasOwnProperty,wt=n.unstable_scheduleCallback,Nt=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,ft=n.unstable_ImmediatePriority,vn=n.unstable_UserBlockingPriority,wn=n.unstable_NormalPriority,pe=n.unstable_LowPriority,Kl=n.unstable_IdlePriority,Wl=n.log,Fl=n.unstable_setDisableYieldValue,St=null,Ee=null;function ot(e){if(typeof Wl=="function"&&Fl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(St,e)}catch{}}var Qe=Math.clz32?Math.clz32:x1,xi=Math.log,pu=Math.LN2;function x1(e){return e>>>=0,e===0?32:31-(xi(e)/pu|0)|0}var Jl=256,eo=4194304;function Ua(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function to(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var s=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~f,i!==0?s=Ua(i):(g&=v,g!==0?s=Ua(g):a||(a=v&~e,a!==0&&(s=Ua(a))))):(v=i&~f,v!==0?s=Ua(v):g!==0?s=Ua(g):a||(a=i&~e,a!==0&&(s=Ua(a)))),s===0?0:t!==0&&t!==s&&(t&f)===0&&(f=s&-s,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:s}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hh(){var e=Jl;return Jl<<=1,(Jl&4194048)===0&&(Jl=256),e}function mh(){var e=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),e}function gu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E1(e,t,a,i,s,f){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,R=e.expirationTimes,Y=e.hiddenUpdates;for(a=g&~a;0)":-1s||R[i]!==H[s]){var te=` +`+xu+e+Eh}var Cu=!1;function Eu(e,t){if(!e||Cu)return"";Cu=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(X){var G=X}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(X){G=X}e.call(ae.prototype)}}else{try{throw Error()}catch(X){G=X}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(X){if(X&&G&&typeof X.stack=="string")return[X.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),g=f[0],v=f[1];if(g&&v){var R=g.split(` +`),Y=v.split(` +`);for(s=i=0;is||R[i]!==Y[s]){var te=` `+R[i].replace(" at new "," at ");return e.displayName&&te.includes("")&&(te=te.replace("",e.displayName)),te}while(1<=i&&0<=s);break}}}finally{Cu=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Cr(a):""}function R1(e){switch(e.tag){case 26:case 27:case 5:return Cr(e.type);case 16:return Cr("Lazy");case 13:return Cr("Suspense");case 19:return Cr("SuspenseList");case 0:case 15:return Eu(e.type,!1);case 11:return Eu(e.type.render,!1);case 1:return Eu(e.type,!0);case 31:return Cr("Activity");default:return""}}function Th(e){try{var t="";do t+=R1(e),e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}function an(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D1(e){var t=Mh(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(g){i=""+g,f.call(this,g)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ro(e){e._valueTracker||(e._valueTracker=D1(e))}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Mh(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function io(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _1=/[\n"\\]/g;function rn(e){return e.replace(_1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tu(e,t,a,i,s,f,g,v){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Mu(e,g,an(t)):a!=null?Mu(e,g,an(a)):i!=null&&e.removeAttribute("value"),s==null&&f!=null&&(e.defaultChecked=!!f),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+an(v):e.removeAttribute("name")}function Ah(e,t,a,i,s,f,g,v){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;a=a!=null?""+an(a):"",t=t!=null?""+an(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=v?e.checked:!!i,e.defaultChecked=!!i,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g)}function Mu(e,t,a){t==="number"&&io(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Er(e,t,a,i){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(Yn)try{var Ai={};Object.defineProperty(Ai,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Du=!1}var fa=null,_u=null,oo=null;function $h(){if(oo)return oo;var e,t=_u,a=t.length,i,s="value"in fa?fa.value:fa.textContent,f=s.length;for(e=0;e=Di),Hh=" ",Yh=!1;function qh(e,t){switch(e){case"keyup":return ib.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function ob(e,t){switch(e){case"compositionend":return Gh(t);case"keypress":return t.which!==32?null:(Yh=!0,Hh);case"textInput":return e=t.data,e===Hh&&Yh?null:e;default:return null}}function sb(e,t){if(Ar)return e==="compositionend"||!Lu&&qh(e,t)?(e=$h(),oo=_u=fa=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wh(a)}}function Jh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function em(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=io(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=io(e.document)}return t}function Uu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var gb=Yn&&"documentMode"in document&&11>=document.documentMode,Or=null,Hu=null,$i=null,Yu=!1;function tm(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yu||Or==null||Or!==io(i)||(i=Or,"selectionStart"in i&&Uu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$i&&zi($i,i)||($i=i,i=Fo(Hu,"onSelect"),0>=g,s-=g,Gn=1<<32-Qe(t)+s|a<f?f:8;var g=A.T,v={};A.T=v,wc(e,!1,t,a);try{var R=s(),H=A.S;if(H!==null&&H(v,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var te=Mb(R,i);Qi(e,t,te,Wt(e))}else Qi(e,t,i,Wt(e))}catch(ae){Qi(e,t,{then:function(){},status:"rejected",reason:ae},Wt())}finally{U.p=f,A.T=g}}function Db(){}function Tc(e,t,a,i){if(e.tag!==5)throw Error(o(476));var s=np(e).queue;tp(e,s,t,X,a===null?Db:function(){return ap(e),a(i)})}function np(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:X},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ap(e){var t=np(e).next.queue;Qi(e,t,{},Wt())}function Mc(){return kt(hl)}function rp(){return ht().memoizedState}function ip(){return ht().memoizedState}function _b(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=ma(a);var i=pa(t,e,a);i!==null&&(Ft(i,t,a),Gi(i,t,a)),t={cache:tc()},e.payload=t;return}t=t.return}}function kb(e,t,a){var i=Wt();a={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},ko(e)?op(t,a):(a=Pu(e,t,a,i),a!==null&&(Ft(a,e,i),sp(a,t,i)))}function lp(e,t,a){var i=Wt();Qi(e,t,a,i)}function Qi(e,t,a,i){var s={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(ko(e))op(t,s);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,v=f(g,a);if(s.hasEagerState=!0,s.eagerState=v,Xt(v,g))return po(e,t,s,0),Pe===null&&mo(),!1}catch{}finally{}if(a=Pu(e,t,s,i),a!==null)return Ft(a,e,i),sp(a,t,i),!0}return!1}function wc(e,t,a,i){if(i={lane:2,revertLane:rf(),action:i,hasEagerState:!1,eagerState:null,next:null},ko(e)){if(t)throw Error(o(479))}else t=Pu(e,a,i,2),t!==null&&Ft(t,e,2)}function ko(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function op(e,t){jr=wo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sp(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,gh(e,a)}}var zo={readContext:kt,use:Oo,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st},up={readContext:kt,use:Oo,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Xm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,_o(4194308,4,Km.bind(null,t,e),a)},useLayoutEffect:function(e,t){return _o(4194308,4,e,t)},useInsertionEffect:function(e,t){_o(4,2,e,t)},useMemo:function(e,t){var a=Yt();t=t===void 0?null:t;var i=e();if(Fa){ot(!0);try{e()}finally{ot(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=Yt();if(a!==void 0){var s=a(t);if(Fa){ot(!0);try{a(t)}finally{ot(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=kb.bind(null,ve,e),[i.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Sc(e);var t=e.queue,a=lp.bind(null,ve,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Cc,useDeferredValue:function(e,t){var a=Yt();return Ec(a,e,t)},useTransition:function(){var e=Sc(!1);return e=tp.bind(null,ve,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ve,s=Yt();if(De){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Pe===null)throw Error(o(349));(Te&124)!==0||Dm(i,t,a)}s.memoizedState=a;var f={value:a,getSnapshot:t};return s.queue=f,Xm(km.bind(null,i,f,e),[e]),i.flags|=2048,Hr(9,Do(),_m.bind(null,i,f,a,t),null),a},useId:function(){var e=Yt(),t=Pe.identifierPrefix;if(De){var a=Vn,i=Gn;a=(i&~(1<<32-Qe(i)-1)).toString(32)+a,t="«"+t+"R"+a,a=Ao++,0he?(Tt=ce,ce=null):Tt=ce.sibling;var Re=q(L,ce,j[he],ne);if(Re===null){ce===null&&(ce=Tt);break}e&&ce&&Re.alternate===null&&t(L,ce),z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re,ce=Tt}if(he===j.length)return a(L,ce),De&&Xa(L,he),se;if(ce===null){for(;hehe?(Tt=ce,ce=null):Tt=ce.sibling;var ka=q(L,ce,Re.value,ne);if(ka===null){ce===null&&(ce=Tt);break}e&&ce&&ka.alternate===null&&t(L,ce),z=f(ka,z,he),be===null?se=ka:be.sibling=ka,be=ka,ce=Tt}if(Re.done)return a(L,ce),De&&Xa(L,he),se;if(ce===null){for(;!Re.done;he++,Re=j.next())Re=ae(L,Re.value,ne),Re!==null&&(z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re);return De&&Xa(L,he),se}for(ce=i(ce);!Re.done;he++,Re=j.next())Re=P(ce,L,he,Re.value,ne),Re!==null&&(e&&Re.alternate!==null&&ce.delete(Re.key===null?he:Re.key),z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re);return e&&ce.forEach(function($2){return t(L,$2)}),De&&Xa(L,he),se}function Ye(L,z,j,ne){if(typeof j=="object"&&j!==null&&j.type===C&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case E:e:{for(var se=j.key;z!==null;){if(z.key===se){if(se=j.type,se===C){if(z.tag===7){a(L,z.sibling),ne=s(z,j.props.children),ne.return=L,L=ne;break e}}else if(z.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===F&&fp(se)===z.type){a(L,z.sibling),ne=s(z,j.props),Wi(ne,j),ne.return=L,L=ne;break e}a(L,z);break}else t(L,z);z=z.sibling}j.type===C?(ne=Va(j.props.children,L.mode,ne,j.key),ne.return=L,L=ne):(ne=yo(j.type,j.key,j.props,null,L.mode,ne),Wi(ne,j),ne.return=L,L=ne)}return g(L);case O:e:{for(se=j.key;z!==null;){if(z.key===se)if(z.tag===4&&z.stateNode.containerInfo===j.containerInfo&&z.stateNode.implementation===j.implementation){a(L,z.sibling),ne=s(z,j.children||[]),ne.return=L,L=ne;break e}else{a(L,z);break}else t(L,z);z=z.sibling}ne=Iu(j,L.mode,ne),ne.return=L,L=ne}return g(L);case F:return se=j._init,j=se(j._payload),Ye(L,z,j,ne)}if(Z(j))return me(L,z,j,ne);if(S(j)){if(se=S(j),typeof se!="function")throw Error(o(150));return j=se.call(j),de(L,z,j,ne)}if(typeof j.then=="function")return Ye(L,z,$o(j),ne);if(j.$$typeof===$)return Ye(L,z,xo(L,j),ne);No(L,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,z!==null&&z.tag===6?(a(L,z.sibling),ne=s(z,j),ne.return=L,L=ne):(a(L,z),ne=Zu(j,L.mode,ne),ne.return=L,L=ne),g(L)):a(L,z)}return function(L,z,j,ne){try{Ki=0;var se=Ye(L,z,j,ne);return Yr=null,se}catch(ce){if(ce===Yi||ce===Eo)throw ce;var be=Zt(29,ce,null,L.mode);return be.lanes=ne,be.return=L,be}finally{}}}var qr=dp(!0),hp=dp(!1),cn=Y(null),On=null;function ya(e){var t=e.alternate;ie(gt,gt.current&1),ie(cn,e),On===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(On=e)}function mp(e){if(e.tag===22){if(ie(gt,gt.current),ie(cn,e),On===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(On=e)}}else va()}function va(){ie(gt,gt.current),ie(cn,cn.current)}function In(e){re(cn),On===e&&(On=null),re(gt)}var gt=Y(0);function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||yf(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ac(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Oc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Wt(),s=ma(i);s.payload=t,a!=null&&(s.callback=a),t=pa(e,s,i),t!==null&&(Ft(t,e,i),Gi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Wt(),s=ma(i);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=pa(e,s,i),t!==null&&(Ft(t,e,i),Gi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),i=ma(a);i.tag=2,t!=null&&(i.callback=t),t=pa(e,i,a),t!==null&&(Ft(t,e,a),Gi(t,e,a))}};function pp(e,t,a,i,s,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,g):t.prototype&&t.prototype.isPureReactComponent?!zi(a,i)||!zi(s,f):!0}function gp(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&Oc.enqueueReplaceState(t,t.state,null)}function Ja(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}var Bo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function yp(e){Bo(e)}function vp(e){console.error(e)}function bp(e){Bo(e)}function jo(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Sp(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Rc(e,t,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){jo(e,t)},a}function xp(e){return e=ma(e),e.tag=3,e}function Cp(e,t,a,i){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var f=i.value;e.payload=function(){return s(f)},e.callback=function(){Sp(t,a,i)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Sp(t,a,i),typeof s!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var v=i.stack;this.componentDidCatch(i.value,{componentStack:v!==null?v:""})})}function $b(e,t,a,i,s){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&ji(t,a,s,!0),a=cn.current,a!==null){switch(a.tag){case 13:return On===null?Jc():a.alternate===null&&tt===0&&(tt=3),a.flags&=-257,a.flags|=65536,a.lanes=s,i===rc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),tf(e,i,s)),!1;case 22:return a.flags|=65536,i===rc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),tf(e,i,s)),!1}throw Error(o(435,a.tag))}return tf(e,i,s),Jc(),!1}if(De)return t=cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Wu&&(e=Error(o(422),{cause:i}),Bi(ln(e,a)))):(i!==Wu&&(t=Error(o(423),{cause:i}),Bi(ln(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=ln(i,a),s=Rc(e.stateNode,i,s),oc(e,s),tt!==4&&(tt=2)),!1;var f=Error(o(520),{cause:i});if(f=ln(f,a),rl===null?rl=[f]:rl.push(f),tt!==4&&(tt=2),t===null)return!0;i=ln(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Rc(a.stateNode,i,e),oc(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ta===null||!Ta.has(f))))return a.flags|=65536,s&=-s,a.lanes|=s,s=xp(s),Cp(s,e,a,i),oc(a,s),!1}a=a.return}while(a!==null);return!1}var Ep=Error(o(461)),Ct=!1;function At(e,t,a,i){t.child=e===null?hp(t,null,a,i):qr(t,e.child,a,i)}function Tp(e,t,a,i,s){a=a.render;var f=t.ref;if("ref"in i){var g={};for(var v in i)v!=="ref"&&(g[v]=i[v])}else g=i;return Ka(t),i=dc(e,t,a,g,f,s),v=hc(),e!==null&&!Ct?(mc(e,t,s),Qn(e,t,s)):(De&&v&&Qu(t),t.flags|=1,At(e,t,i,s),t.child)}function Mp(e,t,a,i,s){if(e===null){var f=a.type;return typeof f=="function"&&!Xu(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,wp(e,t,f,i,s)):(e=yo(a.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bc(e,s)){var g=f.memoizedProps;if(a=a.compare,a=a!==null?a:zi,a(g,i)&&e.ref===t.ref)return Qn(e,t,s)}return t.flags|=1,e=qn(f,i),e.ref=t.ref,e.return=t,t.child=e}function wp(e,t,a,i,s){if(e!==null){var f=e.memoizedProps;if(zi(f,i)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=i=f,Bc(e,s))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Qn(e,t,s)}return Dc(e,t,a,i,s)}function Ap(e,t,a){var i=t.pendingProps,s=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if((t.flags&128)!==0){if(i=f!==null?f.baseLanes|a:a,e!==null){for(s=t.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;t.childLanes=f&~i}else t.childLanes=0,t.child=null;return Op(e,t,i,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Co(t,f!==null?f.cachePool:null),f!==null?wm(t,f):uc(),mp(t);else return t.lanes=t.childLanes=536870912,Op(e,t,f!==null?f.baseLanes|a:a,a)}else f!==null?(Co(t,f.cachePool),wm(t,f),va(),t.memoizedState=null):(e!==null&&Co(t,null),uc(),va());return At(e,t,s,a),t.child}function Op(e,t,a,i){var s=ac();return s=s===null?null:{parent:pt._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&Co(t,null),uc(),mp(t),e!==null&&ji(e,t,i,!0),null}function Uo(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Dc(e,t,a,i,s){return Ka(t),a=dc(e,t,a,i,void 0,s),i=hc(),e!==null&&!Ct?(mc(e,t,s),Qn(e,t,s)):(De&&i&&Qu(t),t.flags|=1,At(e,t,a,s),t.child)}function Rp(e,t,a,i,s,f){return Ka(t),t.updateQueue=null,a=Om(t,i,a,s),Am(e),i=hc(),e!==null&&!Ct?(mc(e,t,f),Qn(e,t,f)):(De&&i&&Qu(t),t.flags|=1,At(e,t,a,f),t.child)}function Dp(e,t,a,i,s){if(Ka(t),t.stateNode===null){var f=kr,g=a.contextType;typeof g=="object"&&g!==null&&(f=kt(g)),f=new a(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Oc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},ic(t),g=a.contextType,f.context=typeof g=="object"&&g!==null?kt(g):kr,f.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(Ac(t,a,g,i),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&Oc.enqueueReplaceState(f,f.state,null),Pi(t,i,f,s),Vi(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var v=t.memoizedProps,R=Ja(a,v);f.props=R;var H=f.context,te=a.contextType;g=kr,typeof te=="object"&&te!==null&&(g=kt(te));var ae=a.getDerivedStateFromProps;te=typeof ae=="function"||typeof f.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,te||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v||H!==g)&&gp(t,f,i,g),ha=!1;var q=t.memoizedState;f.state=q,Pi(t,i,f,s),Vi(),H=t.memoizedState,v||q!==H||ha?(typeof ae=="function"&&(Ac(t,a,ae,i),H=t.memoizedState),(R=ha||pp(t,a,R,i,q,H,g))?(te||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),f.props=i,f.state=H,f.context=g,i=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,lc(e,t),g=t.memoizedProps,te=Ja(a,g),f.props=te,ae=t.pendingProps,q=f.context,H=a.contextType,R=kr,typeof H=="object"&&H!==null&&(R=kt(H)),v=a.getDerivedStateFromProps,(H=typeof v=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==ae||q!==R)&&gp(t,f,i,R),ha=!1,q=t.memoizedState,f.state=q,Pi(t,i,f,s),Vi();var P=t.memoizedState;g!==ae||q!==P||ha||e!==null&&e.dependencies!==null&&So(e.dependencies)?(typeof v=="function"&&(Ac(t,a,v,i),P=t.memoizedState),(te=ha||pp(t,a,te,i,q,P,R)||e!==null&&e.dependencies!==null&&So(e.dependencies))?(H||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,P,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,P,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=P),f.props=i,f.state=P,f.context=R,i=te):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Uo(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=qr(t,e.child,null,s),t.child=qr(t,null,a,s)):At(e,t,a,s),t.memoizedState=f.state,e=t.child):e=Qn(e,t,s),e}function _p(e,t,a,i){return Li(),t.flags|=256,At(e,t,a,i),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kc(e){return{baseLanes:e,cachePool:vm()}}function zc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=fn),e}function kp(e,t,a){var i=t.pendingProps,s=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),g&&(s=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(s?ya(t):va(),De){var v=et,R;if(R=v){e:{for(R=v,v=An;R.nodeType!==8;){if(!v){v=null;break e}if(R=xn(R.nextSibling),R===null){v=null;break e}}v=R}v!==null?(t.memoizedState={dehydrated:v,treeContext:Pa!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},R=Zt(18,null,null,0),R.stateNode=v,R.return=t,t.child=R,Bt=t,et=null,R=!0):R=!1}R||Ia(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return yf(v)?t.lanes=32:t.lanes=536870912,null;In(t)}return v=i.children,i=i.fallback,s?(va(),s=t.mode,v=Ho({mode:"hidden",children:v},s),i=Va(i,s,a,null),v.return=t,i.return=t,v.sibling=i,t.child=v,s=t.child,s.memoizedState=kc(a),s.childLanes=zc(e,g,a),t.memoizedState=_c,i):(ya(t),$c(t,v))}if(R=e.memoizedState,R!==null&&(v=R.dehydrated,v!==null)){if(f)t.flags&256?(ya(t),t.flags&=-257,t=Nc(e,t,a)):t.memoizedState!==null?(va(),t.child=e.child,t.flags|=128,t=null):(va(),s=i.fallback,v=t.mode,i=Ho({mode:"visible",children:i.children},v),s=Va(s,v,a,null),s.flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,qr(t,e.child,null,a),i=t.child,i.memoizedState=kc(a),i.childLanes=zc(e,g,a),t.memoizedState=_c,t=s);else if(ya(t),yf(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var H=g.dgst;g=H,i=Error(o(419)),i.stack="",i.digest=g,Bi({value:i,source:null,stack:null}),t=Nc(e,t,a)}else if(Ct||ji(e,t,a,!1),g=(a&e.childLanes)!==0,Ct||g){if(g=Pe,g!==null&&(i=a&-a,i=(i&42)!==0?1:yu(i),i=(i&(g.suspendedLanes|a))!==0?0:i,i!==0&&i!==R.retryLane))throw R.retryLane=i,_r(e,i),Ft(g,e,i),Ep;v.data==="$?"||Jc(),t=Nc(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,et=xn(v.nextSibling),Bt=t,De=!0,Za=null,An=!1,e!==null&&(sn[un++]=Gn,sn[un++]=Vn,sn[un++]=Pa,Gn=e.id,Vn=e.overflow,Pa=t),t=$c(t,i.children),t.flags|=4096);return t}return s?(va(),s=i.fallback,v=t.mode,R=e.child,H=R.sibling,i=qn(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&65011712,H!==null?s=qn(H,s):(s=Va(s,v,a,null),s.flags|=2),s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,v=e.child.memoizedState,v===null?v=kc(a):(R=v.cachePool,R!==null?(H=pt._currentValue,R=R.parent!==H?{parent:H,pool:H}:R):R=vm(),v={baseLanes:v.baseLanes|a,cachePool:R}),s.memoizedState=v,s.childLanes=zc(e,g,a),t.memoizedState=_c,i):(ya(t),a=e.child,e=a.sibling,a=qn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function $c(e,t){return t=Ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ho(e,t){return e=Zt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Nc(e,t,a){return qr(t,e.child,null,a),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zp(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ju(e.return,t,a)}function Lc(e,t,a,i,s){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:s}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=a,f.tailMode=s)}function $p(e,t,a){var i=t.pendingProps,s=i.revealOrder,f=i.tail;if(At(e,t,i.children,a),i=gt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zp(e,a,t);else if(e.tag===19)zp(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(ie(gt,i),s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&Lo(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),Lc(t,!1,s,a,f);break;case"backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Lo(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}Lc(t,!0,a,null,f);break;case"together":Lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ea|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ji(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=qn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=qn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Bc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&So(e)))}function Nb(e,t,a){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),da(t,pt,e.memoizedState.cache),Li();break;case 27:case 5:Xe(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ya(t),t.flags|=128,null):(a&t.child.childLanes)!==0?kp(e,t,a):(ya(t),e=Qn(e,t,a),e!==null?e.sibling:null);ya(t);break;case 19:var s=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(ji(e,t,a,!1),i=(a&t.childLanes)!==0),s){if(i)return $p(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ie(gt,gt.current),i)break;return null;case 22:case 23:return t.lanes=0,Ap(e,t,a);case 24:da(t,pt,e.memoizedState.cache)}return Qn(e,t,a)}function Np(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Bc(e,a)&&(t.flags&128)===0)return Ct=!1,Nb(e,t,a);Ct=(e.flags&131072)!==0}else Ct=!1,De&&(t.flags&1048576)!==0&&fm(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,s=i._init;if(i=s(i._payload),t.type=i,typeof i=="function")Xu(i)?(e=Ja(i,e),t.tag=1,t=Dp(null,t,i,e,a)):(t.tag=0,t=Dc(null,t,i,e,a));else{if(i!=null){if(s=i.$$typeof,s===B){t.tag=11,t=Tp(null,t,i,e,a);break e}else if(s===V){t.tag=14,t=Mp(null,t,i,e,a);break e}}throw t=G(i)||i,Error(o(306,t,""))}}return t;case 0:return Dc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,s=Ja(i,t.pendingProps),Dp(e,t,i,s,a);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;s=f.element,lc(e,t),Pi(t,i,null,a);var g=t.memoizedState;if(i=g.cache,da(t,pt,i),i!==f.cache&&ec(t,[pt],a,!0),Vi(),i=g.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=_p(e,t,i,a);break e}else if(i!==s){s=ln(Error(o(424)),t),Bi(s),t=_p(e,t,i,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=xn(e.firstChild),Bt=t,De=!0,Za=null,An=!0,a=hp(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Li(),i===s){t=Qn(e,t,a);break e}At(e,t,i,a)}t=t.child}return t;case 26:return Uo(e,t),e===null?(a=U0(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,i=es(ue.current).createElement(a),i[_t]=t,i[Ut]=e,Rt(i,a,e),xt(i),t.stateNode=i):t.memoizedState=U0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xe(t),e===null&&De&&(i=t.stateNode=L0(t.type,t.pendingProps,ue.current),Bt=t,An=!0,s=et,Aa(t.type)?(vf=s,et=xn(i.firstChild)):et=s),At(e,t,t.pendingProps.children,a),Uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((s=i=et)&&(i=u2(i,t.type,t.pendingProps,An),i!==null?(t.stateNode=i,Bt=t,et=xn(i.firstChild),An=!1,s=!0):s=!1),s||Ia(t)),Xe(t),s=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,i=f.children,mf(s,f)?i=null:g!==null&&mf(s,g)&&(t.flags|=32),t.memoizedState!==null&&(s=dc(e,t,Ab,null,null,a),hl._currentValue=s),Uo(e,t),At(e,t,i,a),t.child;case 6:return e===null&&De&&((e=a=et)&&(a=c2(a,t.pendingProps,An),a!==null?(t.stateNode=a,Bt=t,et=null,e=!0):e=!1),e||Ia(t)),null;case 13:return kp(e,t,a);case 4:return Se(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qr(t,null,i,a):At(e,t,i,a),t.child;case 11:return Tp(e,t,t.type,t.pendingProps,a);case 7:return At(e,t,t.pendingProps,a),t.child;case 8:return At(e,t,t.pendingProps.children,a),t.child;case 12:return At(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,da(t,t.type,i.value),At(e,t,i.children,a),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,Ka(t),s=kt(s),i=i(s),t.flags|=1,At(e,t,i,a),t.child;case 14:return Mp(e,t,t.type,t.pendingProps,a);case 15:return wp(e,t,t.type,t.pendingProps,a);case 19:return $p(e,t,a);case 31:return i=t.pendingProps,a=t.mode,i={mode:i.mode,children:i.children},e===null?(a=Ho(i,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=qn(e.child,i),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Ap(e,t,a);case 24:return Ka(t),i=kt(pt),e===null?(s=ac(),s===null&&(s=Pe,f=tc(),s.pooledCache=f,f.refCount++,f!==null&&(s.pooledCacheLanes|=a),s=f),t.memoizedState={parent:i,cache:s},ic(t),da(t,pt,s)):((e.lanes&a)!==0&&(lc(e,t),Pi(t,null,null,a),Vi()),s=e.memoizedState,f=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),da(t,pt,i)):(i=f.cache,da(t,pt,i),i!==s.cache&&ec(t,[pt],a,!0))),At(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kn(e){e.flags|=4}function Lp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!V0(t)){if(t=cn.current,t!==null&&((Te&4194048)===Te?On!==null:(Te&62914560)!==Te&&(Te&536870912)===0||t!==On))throw qi=rc,bm;e.flags|=8192}}function Yo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mh():536870912,e.lanes|=t,Xr|=t)}function Fi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function Lb(e,t,a){var i=t.pendingProps;switch(Ku(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xn(pt),Ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Kn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mm())),Fe(t),null;case 26:return a=t.memoizedState,e===null?(Kn(t),a!==null?(Fe(t),Lp(t,a)):(Fe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Kn(t),Fe(t),Lp(t,a)):(Fe(t),t.flags&=-16777217):(e.memoizedProps!==i&&Kn(t),Fe(t),t.flags&=-16777217),null;case 27:lt(t),a=ue.current;var s=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Kn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}e=oe.current,Ni(t)?dm(t):(e=L0(s,i,a),t.stateNode=e,Kn(t))}return Fe(t),null;case 5:if(lt(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Kn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}if(e=oe.current,Ni(t))dm(t);else{switch(s=es(ue.current),e){case 1:e=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=s.createElement("div"),e.innerHTML=" - + + diff --git a/src/frontend/dist/index.html b/src/frontend/dist/index.html index 81b6366b..66a093bf 100644 --- a/src/frontend/dist/index.html +++ b/src/frontend/dist/index.html @@ -5,8 +5,8 @@ Parallax by Gradient - - + + diff --git a/src/frontend/src/components/common/drawer-layout.tsx b/src/frontend/src/components/common/drawer-layout.tsx index 6222df6d..6f26cac5 100644 --- a/src/frontend/src/components/common/drawer-layout.tsx +++ b/src/frontend/src/components/common/drawer-layout.tsx @@ -89,8 +89,8 @@ export const DrawerLayout: FC = ({ children }) => { const [ { - modelName, - clusterInfo: { status: clusterStatus }, + modelInfo, + clusterInfo: { status: clusterStatus, needMoreNodes }, }, ] = useCluster(); @@ -144,6 +144,31 @@ export const DrawerLayout: FC = ({ children }) => { } }, [clusterStatus, openRebalancing]); + const [dialogNeedMoreNodes, { open: openDialogNeedMoreNodes }] = useAlertDialog({ + color: 'primary', + title: '', + content: ( + <> + + Your selected model requires more nodes. + {(!!modelInfo + && modelInfo.vram > 0 && [ + `You’ll need a `, + {`minimum of ${modelInfo.vram} GB of total VRAM`}, + ` to host this model.`, + ]) + || ''} + + + ), + confirmLabel: 'Finish', + }); + useEffect(() => { + if (needMoreNodes) { + openDialogNeedMoreNodes(); + } + }, [needMoreNodes, openDialogNeedMoreNodes]); + const [dialogFailed, { open: openFailed }] = useAlertDialog({ color: 'primary', title: '', @@ -334,6 +359,7 @@ export const DrawerLayout: FC = ({ children }) => { {dialogWaiting} {dialogRebalancing} {dialogFailed} + {dialogNeedMoreNodes} ); }; diff --git a/src/frontend/src/pages/join.tsx b/src/frontend/src/pages/join.tsx index 99554e5c..a1ebdf38 100644 --- a/src/frontend/src/pages/join.tsx +++ b/src/frontend/src/pages/join.tsx @@ -31,10 +31,10 @@ const Stack = styled(MuiStack)(({ theme }) => { export default function PageJoin() { const [ { - clusterInfo: { status: clusterStatus, initNodesNumber }, + modelInfo, + clusterInfo: { status: clusterStatus, initNodesNumber, needMoreNodes }, nodeInfoList, }, - { setNetworkType, setInitNodesNumber, setModelName }, ] = useCluster(); const isError = useMemo(() => { @@ -95,6 +95,19 @@ export default function PageJoin() { )} + {!!modelInfo && modelInfo.vram > 0 && needMoreNodes && ( + + + {[ + `Your selected model requires more nodes.`, + `You’ll need a `, + {`minimum of ${modelInfo.vram} GB of total VRAM`}, + ` to host this model.`, + ]} + + + )} + diff --git a/src/frontend/src/pages/setup.tsx b/src/frontend/src/pages/setup.tsx index cfd0a81b..4b6decef 100644 --- a/src/frontend/src/pages/setup.tsx +++ b/src/frontend/src/pages/setup.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { Link as RouterLink, useNavigate } from 'react-router-dom'; import { + Alert, Button, ButtonGroup, FormControl, @@ -22,8 +23,13 @@ import { useRefCallback } from '../hooks'; export default function PageSetup() { const [ - { networkType, initNodesNumber, modelName, modelInfoList }, - { setNetworkType, setInitNodesNumber, setModelName, init }, + { + networkType, + initNodesNumber, + modelInfo, + clusterInfo: { status: clusterStatus }, + }, + { setNetworkType, setInitNodesNumber, init }, ] = useCluster(); const navigate = useNavigate(); @@ -31,12 +37,17 @@ export default function PageSetup() { const [loading, setLoading] = useState(false); const onContinue = useRefCallback(async () => { - setLoading(true); - Promise.resolve() - .then(() => init()) - .then(() => navigate('/join')) - .catch((e) => console.error(e)) - .finally(() => setLoading(false)); + if (clusterStatus === 'idle' || clusterStatus === 'failed') { + setLoading(true); + Promise.resolve() + .then(() => init()) + .then(() => navigate('/join')) + .catch((e) => console.error(e)) + .finally(() => setLoading(false)); + return; + } else { + navigate('/join'); + } }); return ( @@ -107,6 +118,18 @@ export default function PageSetup() { + + {!!modelInfo && modelInfo.vram > 0 && ( + + + {[ + `You’ll need a `, + {`minimum of ${modelInfo.vram} GB of total VRAM`}, + ` to host this model.`, + ]} + + + )} diff --git a/src/frontend/src/services/api.ts b/src/frontend/src/services/api.ts index c215739c..f266f8ee 100644 --- a/src/frontend/src/services/api.ts +++ b/src/frontend/src/services/api.ts @@ -2,7 +2,7 @@ import { createHttpStreamFactory } from './http-stream'; export const API_BASE_URL = import.meta.env.DEV ? '/proxy-api' : ''; -export const getModelList = async (): Promise => { +export const getModelList = async (): Promise => { const response = await fetch(`${API_BASE_URL}/model/list`, { method: 'GET' }); const message = await response.json(); if (message.type !== 'model_list') { diff --git a/src/frontend/src/services/cluster.tsx b/src/frontend/src/services/cluster.tsx index 2d9ec00d..eedffec6 100644 --- a/src/frontend/src/services/cluster.tsx +++ b/src/frontend/src/services/cluster.tsx @@ -37,6 +37,11 @@ export interface ModelInfo { readonly name: string; readonly displayName: string; readonly logoUrl: string; + + /** + * The VRAM required for the model in GB. + */ + readonly vram: number; } export type ClusterStatus = 'idle' | 'waiting' | 'available' | 'rebalancing' | 'failed'; @@ -47,6 +52,7 @@ export interface ClusterInfo { readonly modelName: string; readonly nodeJoinCommand: Readonly>; readonly initNodesNumber: number; + readonly needMoreNodes: boolean; } const INITIAL_CLUSTER_INFO: ClusterInfo = { @@ -55,6 +61,7 @@ const INITIAL_CLUSTER_INFO: ClusterInfo = { modelName: '', nodeJoinCommand: {}, initNodesNumber: 4, + needMoreNodes: false, }; export type NodeStatus = 'waiting' | 'available' | 'failed'; @@ -74,6 +81,7 @@ export interface ClusterStates { readonly networkType: NetworkType; readonly initNodesNumber: number; readonly modelName: string; + readonly modelInfo: ModelInfo | undefined; readonly modelInfoList: readonly ModelInfo[]; readonly clusterInfo: ClusterInfo; @@ -114,11 +122,16 @@ export const ClusterProvider: FC = ({ children }) => { try { const rawList = await getModelList(); setModelInfoList((prev) => { - const next = rawList.map((name) => ({ - name, - displayName: name, - logoUrl: getLogoUrl(name), - })); + const next = rawList.map(({ name, vram_gb }) => { + name = name || ''; + vram_gb = vram_gb || 0; + return { + name, + displayName: name, + logoUrl: getLogoUrl(name), + vram: vram_gb, + }; + }); if (JSON.stringify(next) !== JSON.stringify(prev)) { debugLog('setModelInfoList', next); return next; @@ -157,7 +170,14 @@ export const ClusterProvider: FC = ({ children }) => { const onMessage = (message: any) => { if (message.type === 'cluster_status') { const { - data: { status, init_nodes_num, model_name, node_join_command, node_list }, + data: { + status, + init_nodes_num, + model_name, + node_join_command, + node_list, + need_more_nodes, + }, } = message; setModelName((prev) => model_name || prev); setClusterInfo((prev) => { @@ -167,6 +187,7 @@ export const ClusterProvider: FC = ({ children }) => { initNodesNumber: init_nodes_num || 0, modelName: model_name || '', nodeJoinCommand: node_join_command || {}, + needMoreNodes: need_more_nodes || false, }; if (JSON.stringify(next) !== JSON.stringify(prev)) { debugLog('setClusterInfo', next); @@ -255,6 +276,7 @@ export const ClusterProvider: FC = ({ children }) => { networkType, initNodesNumber, modelName, + modelInfo: modelInfoList.find((model) => model.name === modelName), modelInfoList, clusterInfo, nodeInfoList, diff --git a/src/scheduling/scheduler.py b/src/scheduling/scheduler.py index 8d9ab237..c6d0b081 100644 --- a/src/scheduling/scheduler.py +++ b/src/scheduling/scheduler.py @@ -576,3 +576,6 @@ def stop(self) -> None: self._wake_event.set() with self._node_count_cv: self._node_count_cv.notify_all() + + def need_more_nodes(self): + return not self._bootstrapped and len(self.nodes) >= self.min_nodes_bootstrapping