diff --git a/README.md b/README.md index 43767706..e959bf4c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ - + # Parallax -A fully decentralized inference engine developed by [Gradient Network](https://gradient.network). Parallax reimagines model inference as a global, collaborative process—one where large language models are no longer chained to centralized infrastructure, but are instead decomposed, executed, and verified across a distributed machine mesh. +A fully decentralized inference engine developed by [Gradient](https://gradient.network). Parallax lets you build your own AI cluster for model inference onto a set of distributed nodes despite their varying configuration and physical location. + -

+| [**Gradient**](https://gradient.network) +| [**Blog**](https://gradient.network/blog/parallax-world-inference-engine) +| [**X(Twitter)**](https://x.com/Gradient_HQ) +| [**Discord**](https://discord.gg/gradientnetwork) -[Gradient Network](https://gradient.network) | [Blog](https://gradient.network/blog/parallax-world-inference-engine) | [X(Twitter)](https://x.com/Gradient_HQ) | [Discord](https://discord.gg/gradientnetwork) +🔥 **NEW: Parallax version 0.0.1 has been released!** -

+ ## Features * Run LLM at home with personal devices. @@ -89,10 +97,15 @@ docker run -it --gpus all --network host gradientservice/parallax:latest-hopper ``` The container starts under parallax workspace and you should be able to run parallax directly. -## Usage on Distributed Devices -### Use frontend +## Getting started + +We will walk through you the easiest way to quickly set up your own AI cluster + +### With Frontend + #### Step 1: Launch scheduler -First launch our scheduler on the main node. + +First launch our scheduler on the main node, we recommend you to use your most convenient computer for this. - For Linux/macOS: ```sh parallax run @@ -104,12 +117,17 @@ parallax run ``` #### Step 2: Select model config -Open http://localhost:3001 + +Open http://localhost:3001 and you should see the setup interface. + ![Model select](docs/images/model-selection.png) -Select model config and click continue. + +Select your desired node and model config and click continue. + #### Step 3: Join each distributed nodes -![Node join](docs/images/node-join.png) -This page will show the join command like blow. + +Copy the generated join command line to your node and run. + ```sh # local area network env parallax join @@ -118,10 +136,15 @@ parallax join -s {scheduler-address} # example parallax join -s /ip4/192.168.1.2/tcp/5001/p2p/xxxxxxxxxxxx ``` -Run join command on each distributed nodes. -Wait until all nodes are ready. + +![Node join](docs/images/node-join.png) + +You should see your nodes start to show up with their status. Wait until all nodes are successfully connected, and you will automatically be directed to the chat interface. + #### Step 4: Chat -Test chat as shown below + +Done! You have your own AI cluster now. + ![Chat](docs/images/chat.png) ### Without frontend diff --git a/docs/images/chat_interface.png b/docs/images/chat_interface.png new file mode 100644 index 00000000..a05cf4db Binary files /dev/null and b/docs/images/chat_interface.png differ diff --git a/docs/images/node_config.png b/docs/images/node_config.png new file mode 100644 index 00000000..1999fd14 Binary files /dev/null and b/docs/images/node_config.png differ diff --git a/docs/images/node_join.png b/docs/images/node_join.png new file mode 100644 index 00000000..f0e8190b Binary files /dev/null and b/docs/images/node_join.png differ diff --git a/docs/images/parallax.jpg b/docs/images/parallax.jpg new file mode 100644 index 00000000..e3b2db44 Binary files /dev/null and b/docs/images/parallax.jpg differ diff --git a/src/frontend/dist/assets/chat-QK3nMaK5.js b/src/frontend/dist/assets/chat-B2WH5BM1.js similarity index 93% rename from src/frontend/dist/assets/chat-QK3nMaK5.js rename to src/frontend/dist/assets/chat-B2WH5BM1.js index 9118f7aa..075a3d7e 100644 --- a/src/frontend/dist/assets/chat-QK3nMaK5.js +++ b/src/frontend/dist/assets/chat-B2WH5BM1.js @@ -1,4 +1,4 @@ -import{a as A,g as N,r as x,u as H,j as a,s as T,c as W,b as z,d as U,m as V,h as Te,q as ze,v as Le,w as I,i as ee,n as Me,x as Re,l as je,S as ne,p as le}from"./index-2agzu340.js";import{i as Z,b as qe,c as ie,F as $e,u as re,f as te,O as Ae,d as Ne,e as He,S as We,D as Ue,g as Ee,C as De}from"./main-layout-BwvpTOaC.js";function Oe(e){return A("MuiFormControl",e)}N("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Be=e=>{const{classes:r,margin:t,fullWidth:o}=e,s={root:["root",t!=="none"&&`margin${z(t)}`,o&&"fullWidth"]};return U(s,Oe,r)},_e=T("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,r[`margin${z(t.margin)}`],t.fullWidth&&r.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Ke=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormControl"}),{children:s,className:l,color:i="primary",component:p="div",disabled:n=!1,error:d=!1,focused:m,fullWidth:b=!1,hiddenLabel:h=!1,margin:g="none",required:f=!1,size:u="medium",variant:c="outlined",...y}=o,P={...o,color:i,component:p,disabled:n,error:d,fullWidth:b,hiddenLabel:h,margin:g,required:f,size:u,variant:c},G=Be(P),[F,J]=x.useState(()=>{let C=!1;return s&&x.Children.forEach(s,v=>{if(!Z(v,["Input","Select"]))return;const j=Z(v,["Select"])?v.props.input:v;j&&qe(j.props)&&(C=!0)}),C}),[E,L]=x.useState(()=>{let C=!1;return s&&x.Children.forEach(s,v=>{Z(v,["Input","Select"])&&(ie(v.props,!0)||ie(v.props.inputProps,!0))&&(C=!0)}),C}),[D,M]=x.useState(!1);n&&D&&M(!1);const O=m!==void 0&&!n?m:D;let B;x.useRef(!1);const _=x.useCallback(()=>{L(!0)},[]),R=x.useCallback(()=>{L(!1)},[]),Q=x.useMemo(()=>({adornedStart:F,setAdornedStart:J,color:i,disabled:n,error:d,filled:E,focused:O,fullWidth:b,hiddenLabel:h,size:u,onBlur:()=>{M(!1)},onFocus:()=>{M(!0)},onEmpty:R,onFilled:_,registerEffect:B,required:f,variant:c}),[F,i,n,d,E,O,b,h,B,R,_,f,u,c]);return a.jsx($e.Provider,{value:Q,children:a.jsx(_e,{as:p,ownerState:P,className:W(G.root,l),ref:t,...y,children:s})})});function Ve(e){return A("MuiFormHelperText",e)}const de=N("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var ce;const Ge=e=>{const{classes:r,contained:t,size:o,disabled:s,error:l,filled:i,focused:p,required:n}=e,d={root:["root",s&&"disabled",l&&"error",o&&`size${z(o)}`,t&&"contained",p&&"focused",i&&"filled",n&&"required"]};return U(d,Ve,r)},Je=T("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.size&&r[`size${z(t.size)}`],t.contained&&r.contained,t.filled&&r.filled]}})(V(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${de.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${de.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:r})=>r.contained,style:{marginLeft:14,marginRight:14}}]}))),Qe=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormHelperText"}),{children:s,className:l,component:i="p",disabled:p,error:n,filled:d,focused:m,margin:b,required:h,variant:g,...f}=o,u=re(),c=te({props:o,muiFormControl:u,states:["variant","size","disabled","error","filled","focused","required"]}),y={...o,component:i,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required};delete y.ownerState;const P=Ge(y);return a.jsx(Je,{as:i,className:W(P.root,l),ref:t,...f,ownerState:y,children:s===" "?ce||(ce=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):s})});function Xe(e){return A("MuiFormLabel",e)}const $=N("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Ye=e=>{const{classes:r,color:t,focused:o,disabled:s,error:l,filled:i,required:p}=e,n={root:["root",`color${z(t)}`,s&&"disabled",l&&"error",i&&"filled",o&&"focused",p&&"required"],asterisk:["asterisk",l&&"error"]};return U(n,Xe,r)},Ze=T("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color==="secondary"&&r.colorSecondary,t.filled&&r.filled]}})(V(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Te()).map(([r])=>({props:{color:r},style:{[`&.${$.focused}`]:{color:(e.vars||e).palette[r].main}}})),{props:{},style:{[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${$.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),er=T("span",{name:"MuiFormLabel",slot:"Asterisk"})(V(({theme:e})=>({[`&.${$.error}`]:{color:(e.vars||e).palette.error.main}}))),rr=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormLabel"}),{children:s,className:l,color:i,component:p="label",disabled:n,error:d,filled:m,focused:b,required:h,...g}=o,f=re(),u=te({props:o,muiFormControl:f,states:["color","required","focused","disabled","error","filled"]}),c={...o,color:u.color||"primary",component:p,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required},y=Ye(c);return a.jsxs(Ze,{as:p,ownerState:c,className:W(y.root,l),ref:t,...g,children:[s,u.required&&a.jsxs(er,{ownerState:c,"aria-hidden":!0,className:y.asterisk,children:[" ","*"]})]})});function tr(e){return A("MuiInputLabel",e)}N("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const or=e=>{const{classes:r,formControl:t,size:o,shrink:s,disableAnimation:l,variant:i,required:p}=e,n={root:["root",t&&"formControl",!l&&"animated",s&&"shrink",o&&o!=="medium"&&`size${z(o)}`,i],asterisk:[p&&"asterisk"]},d=U(n,tr,r);return{...r,...d}},sr=T(rr,{shouldForwardProp:e=>ze(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[{[`& .${$.asterisk}`]:r.asterisk},r.root,t.formControl&&r.formControl,t.size==="small"&&r.sizeSmall,t.shrink&&r.shrink,!t.disableAnimation&&r.animated,t.focused&&r.focused,r[t.variant]]}})(V(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:r})=>r.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:r})=>r.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:r})=>!r.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:r,ownerState:t})=>r==="filled"&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:r,ownerState:t,size:o})=>r==="filled"&&t.shrink&&o==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:r,ownerState:t})=>r==="outlined"&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),ar=x.forwardRef(function(r,t){const o=H({name:"MuiInputLabel",props:r}),{disableAnimation:s=!1,margin:l,shrink:i,variant:p,className:n,...d}=o,m=re();let b=i;typeof b>"u"&&m&&(b=m.filled||m.focused||m.adornedStart);const h=te({props:o,muiFormControl:m,states:["size","variant","required","focused"]}),g={...o,disableAnimation:s,formControl:m,shrink:b,size:h.size,variant:h.variant,required:h.required,focused:h.focused},f=or(g);return a.jsx(sr,{"data-shrink":b,ref:t,className:W(f.root,n),...d,ownerState:g,classes:f})});function nr(e){return A("MuiTextField",e)}N("MuiTextField",["root"]);const lr={standard:He,filled:Ne,outlined:Ae},ir=e=>{const{classes:r}=e;return U({root:["root"]},nr,r)},dr=T(Ke,{name:"MuiTextField",slot:"Root"})({}),cr=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiTextField"}),{autoComplete:s,autoFocus:l=!1,children:i,className:p,color:n="primary",defaultValue:d,disabled:m=!1,error:b=!1,FormHelperTextProps:h,fullWidth:g=!1,helperText:f,id:u,InputLabelProps:c,inputProps:y,InputProps:P,inputRef:G,label:F,maxRows:J,minRows:E,multiline:L=!1,name:D,onBlur:M,onChange:O,onFocus:B,placeholder:_,required:R=!1,rows:Q,select:C=!1,SelectProps:v,slots:j={},slotProps:pe={},type:ue,value:oe,variant:K="outlined",...me}=o,S={...o,autoFocus:l,color:n,disabled:m,error:b,fullWidth:g,multiline:L,required:R,select:C,variant:K},fe=ir(S),k=Le(u),X=f&&k?`${k}-helper-text`:void 0,se=F&&k?`${k}-label`:void 0,xe=lr[K],w={slots:j,slotProps:{input:P,inputLabel:c,htmlInput:y,formHelperText:h,select:v,...pe}},q={},Y=w.slotProps.inputLabel;K==="outlined"&&(Y&&typeof Y.shrink<"u"&&(q.notched=Y.shrink),q.label=F),C&&((!v||!v.native)&&(q.id=void 0),q["aria-describedby"]=void 0);const[be,he]=I("root",{elementType:dr,shouldForwardComponentProp:!0,externalForwardedProps:{...w,...me},ownerState:S,className:W(fe.root,p),ref:t,additionalProps:{disabled:m,error:b,fullWidth:g,required:R,color:n,variant:K}}),[ve,ge]=I("input",{elementType:xe,externalForwardedProps:w,additionalProps:q,ownerState:S}),[ye,Ce]=I("inputLabel",{elementType:ar,externalForwardedProps:w,ownerState:S}),[Fe,Se]=I("htmlInput",{elementType:"input",externalForwardedProps:w,ownerState:S}),[ke,we]=I("formHelperText",{elementType:Qe,externalForwardedProps:w,ownerState:S}),[Pe,Ie]=I("select",{elementType:We,externalForwardedProps:w,ownerState:S}),ae=a.jsx(ve,{"aria-describedby":X,autoComplete:s,autoFocus:l,defaultValue:d,fullWidth:g,multiline:L,name:D,rows:Q,maxRows:J,minRows:E,type:ue,value:oe,id:k,inputRef:G,onBlur:M,onChange:O,onFocus:B,placeholder:_,inputProps:Se,slots:{input:j.htmlInput?Fe:void 0},...ge});return a.jsxs(be,{...he,children:[F!=null&&F!==""&&a.jsx(ye,{htmlFor:k,id:se,...Ce,children:F}),C?a.jsx(Pe,{"aria-describedby":X,id:k,labelId:se,value:oe,input:ae,...Ie,children:i}):ae,f&&a.jsx(ke,{id:X,...we,children:f})]})});/** +import{a as A,g as N,r as x,u as H,j as a,s as T,c as W,b as z,d as U,m as V,h as Te,q as ze,v as Le,w as I,i as ee,n as Me,x as Re,l as je,S as ne,p as le}from"./index-LpWXPQo4.js";import{i as Z,b as qe,c as ie,F as $e,u as re,f as te,O as Ae,d as Ne,e as He,S as We,D as Ue,g as Ee,C as De}from"./main-layout-HR9QJcmZ.js";function Oe(e){return A("MuiFormControl",e)}N("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Be=e=>{const{classes:r,margin:t,fullWidth:o}=e,s={root:["root",t!=="none"&&`margin${z(t)}`,o&&"fullWidth"]};return U(s,Oe,r)},_e=T("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,r[`margin${z(t.margin)}`],t.fullWidth&&r.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Ke=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormControl"}),{children:s,className:l,color:i="primary",component:p="div",disabled:n=!1,error:d=!1,focused:m,fullWidth:b=!1,hiddenLabel:h=!1,margin:g="none",required:f=!1,size:u="medium",variant:c="outlined",...y}=o,P={...o,color:i,component:p,disabled:n,error:d,fullWidth:b,hiddenLabel:h,margin:g,required:f,size:u,variant:c},G=Be(P),[F,J]=x.useState(()=>{let C=!1;return s&&x.Children.forEach(s,v=>{if(!Z(v,["Input","Select"]))return;const j=Z(v,["Select"])?v.props.input:v;j&&qe(j.props)&&(C=!0)}),C}),[E,L]=x.useState(()=>{let C=!1;return s&&x.Children.forEach(s,v=>{Z(v,["Input","Select"])&&(ie(v.props,!0)||ie(v.props.inputProps,!0))&&(C=!0)}),C}),[D,M]=x.useState(!1);n&&D&&M(!1);const O=m!==void 0&&!n?m:D;let B;x.useRef(!1);const _=x.useCallback(()=>{L(!0)},[]),R=x.useCallback(()=>{L(!1)},[]),Q=x.useMemo(()=>({adornedStart:F,setAdornedStart:J,color:i,disabled:n,error:d,filled:E,focused:O,fullWidth:b,hiddenLabel:h,size:u,onBlur:()=>{M(!1)},onFocus:()=>{M(!0)},onEmpty:R,onFilled:_,registerEffect:B,required:f,variant:c}),[F,i,n,d,E,O,b,h,B,R,_,f,u,c]);return a.jsx($e.Provider,{value:Q,children:a.jsx(_e,{as:p,ownerState:P,className:W(G.root,l),ref:t,...y,children:s})})});function Ve(e){return A("MuiFormHelperText",e)}const de=N("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var ce;const Ge=e=>{const{classes:r,contained:t,size:o,disabled:s,error:l,filled:i,focused:p,required:n}=e,d={root:["root",s&&"disabled",l&&"error",o&&`size${z(o)}`,t&&"contained",p&&"focused",i&&"filled",n&&"required"]};return U(d,Ve,r)},Je=T("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.size&&r[`size${z(t.size)}`],t.contained&&r.contained,t.filled&&r.filled]}})(V(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${de.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${de.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:r})=>r.contained,style:{marginLeft:14,marginRight:14}}]}))),Qe=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormHelperText"}),{children:s,className:l,component:i="p",disabled:p,error:n,filled:d,focused:m,margin:b,required:h,variant:g,...f}=o,u=re(),c=te({props:o,muiFormControl:u,states:["variant","size","disabled","error","filled","focused","required"]}),y={...o,component:i,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required};delete y.ownerState;const P=Ge(y);return a.jsx(Je,{as:i,className:W(P.root,l),ref:t,...f,ownerState:y,children:s===" "?ce||(ce=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):s})});function Xe(e){return A("MuiFormLabel",e)}const $=N("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Ye=e=>{const{classes:r,color:t,focused:o,disabled:s,error:l,filled:i,required:p}=e,n={root:["root",`color${z(t)}`,s&&"disabled",l&&"error",i&&"filled",o&&"focused",p&&"required"],asterisk:["asterisk",l&&"error"]};return U(n,Xe,r)},Ze=T("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color==="secondary"&&r.colorSecondary,t.filled&&r.filled]}})(V(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Te()).map(([r])=>({props:{color:r},style:{[`&.${$.focused}`]:{color:(e.vars||e).palette[r].main}}})),{props:{},style:{[`&.${$.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${$.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),er=T("span",{name:"MuiFormLabel",slot:"Asterisk"})(V(({theme:e})=>({[`&.${$.error}`]:{color:(e.vars||e).palette.error.main}}))),rr=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiFormLabel"}),{children:s,className:l,color:i,component:p="label",disabled:n,error:d,filled:m,focused:b,required:h,...g}=o,f=re(),u=te({props:o,muiFormControl:f,states:["color","required","focused","disabled","error","filled"]}),c={...o,color:u.color||"primary",component:p,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required},y=Ye(c);return a.jsxs(Ze,{as:p,ownerState:c,className:W(y.root,l),ref:t,...g,children:[s,u.required&&a.jsxs(er,{ownerState:c,"aria-hidden":!0,className:y.asterisk,children:[" ","*"]})]})});function tr(e){return A("MuiInputLabel",e)}N("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const or=e=>{const{classes:r,formControl:t,size:o,shrink:s,disableAnimation:l,variant:i,required:p}=e,n={root:["root",t&&"formControl",!l&&"animated",s&&"shrink",o&&o!=="medium"&&`size${z(o)}`,i],asterisk:[p&&"asterisk"]},d=U(n,tr,r);return{...r,...d}},sr=T(rr,{shouldForwardProp:e=>ze(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[{[`& .${$.asterisk}`]:r.asterisk},r.root,t.formControl&&r.formControl,t.size==="small"&&r.sizeSmall,t.shrink&&r.shrink,!t.disableAnimation&&r.animated,t.focused&&r.focused,r[t.variant]]}})(V(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:r})=>r.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:r})=>r.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:r})=>!r.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:r,ownerState:t})=>r==="filled"&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:r,ownerState:t,size:o})=>r==="filled"&&t.shrink&&o==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:r,ownerState:t})=>r==="outlined"&&t.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),ar=x.forwardRef(function(r,t){const o=H({name:"MuiInputLabel",props:r}),{disableAnimation:s=!1,margin:l,shrink:i,variant:p,className:n,...d}=o,m=re();let b=i;typeof b>"u"&&m&&(b=m.filled||m.focused||m.adornedStart);const h=te({props:o,muiFormControl:m,states:["size","variant","required","focused"]}),g={...o,disableAnimation:s,formControl:m,shrink:b,size:h.size,variant:h.variant,required:h.required,focused:h.focused},f=or(g);return a.jsx(sr,{"data-shrink":b,ref:t,className:W(f.root,n),...d,ownerState:g,classes:f})});function nr(e){return A("MuiTextField",e)}N("MuiTextField",["root"]);const lr={standard:He,filled:Ne,outlined:Ae},ir=e=>{const{classes:r}=e;return U({root:["root"]},nr,r)},dr=T(Ke,{name:"MuiTextField",slot:"Root"})({}),cr=x.forwardRef(function(r,t){const o=H({props:r,name:"MuiTextField"}),{autoComplete:s,autoFocus:l=!1,children:i,className:p,color:n="primary",defaultValue:d,disabled:m=!1,error:b=!1,FormHelperTextProps:h,fullWidth:g=!1,helperText:f,id:u,InputLabelProps:c,inputProps:y,InputProps:P,inputRef:G,label:F,maxRows:J,minRows:E,multiline:L=!1,name:D,onBlur:M,onChange:O,onFocus:B,placeholder:_,required:R=!1,rows:Q,select:C=!1,SelectProps:v,slots:j={},slotProps:pe={},type:ue,value:oe,variant:K="outlined",...me}=o,S={...o,autoFocus:l,color:n,disabled:m,error:b,fullWidth:g,multiline:L,required:R,select:C,variant:K},fe=ir(S),k=Le(u),X=f&&k?`${k}-helper-text`:void 0,se=F&&k?`${k}-label`:void 0,xe=lr[K],w={slots:j,slotProps:{input:P,inputLabel:c,htmlInput:y,formHelperText:h,select:v,...pe}},q={},Y=w.slotProps.inputLabel;K==="outlined"&&(Y&&typeof Y.shrink<"u"&&(q.notched=Y.shrink),q.label=F),C&&((!v||!v.native)&&(q.id=void 0),q["aria-describedby"]=void 0);const[be,he]=I("root",{elementType:dr,shouldForwardComponentProp:!0,externalForwardedProps:{...w,...me},ownerState:S,className:W(fe.root,p),ref:t,additionalProps:{disabled:m,error:b,fullWidth:g,required:R,color:n,variant:K}}),[ve,ge]=I("input",{elementType:xe,externalForwardedProps:w,additionalProps:q,ownerState:S}),[ye,Ce]=I("inputLabel",{elementType:ar,externalForwardedProps:w,ownerState:S}),[Fe,Se]=I("htmlInput",{elementType:"input",externalForwardedProps:w,ownerState:S}),[ke,we]=I("formHelperText",{elementType:Qe,externalForwardedProps:w,ownerState:S}),[Pe,Ie]=I("select",{elementType:We,externalForwardedProps:w,ownerState:S}),ae=a.jsx(ve,{"aria-describedby":X,autoComplete:s,autoFocus:l,defaultValue:d,fullWidth:g,multiline:L,name:D,rows:Q,maxRows:J,minRows:E,type:ue,value:oe,id:k,inputRef:G,onBlur:M,onChange:O,onFocus:B,placeholder:_,inputProps:Se,slots:{input:j.htmlInput?Fe:void 0},...ge});return a.jsxs(be,{...he,children:[F!=null&&F!==""&&a.jsx(ye,{htmlFor:k,id:se,...Ce,children:F}),C?a.jsx(Pe,{"aria-describedby":X,id:k,labelId:se,value:oe,input:ae,...Ie,children:i}):ae,f&&a.jsx(ke,{id:X,...we,children:f})]})});/** * @license @tabler/icons-react v3.35.0 - MIT * * This source code is licensed under the MIT license. @@ -13,4 +13,4 @@ import{a as A,g as N,r as x,u as H,j as a,s as T,c as W,b as z,d as U,m as V,h a * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */const xr=[["path",{d:"M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3z",key:"svg-0"}]],br=ee("filled","square-filled","SquareFilled",xr),hr=()=>{const[{modelName:e,clusterInfo:{status:r}}]=Me(),[{input:t,status:o},{setInput:s,generate:l,stop:i,clear:p}]=Re(),n=je(d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),l())});return a.jsx(ne,{"data-status":o,children:a.jsx(cr,{value:t,onChange:d=>s(d.target.value),multiline:!0,maxRows:4,placeholder:"Ask anything",fullWidth:!0,onKeyDown:n,slotProps:{input:{sx:{border:"1px solid",borderColor:"grey.300",borderRadius:2,fontSize:"0.95rem",boxShadow:"2px 2px 4px rgba(0,0,0,0.05)",flexDirection:"column","& textarea":{fontSize:"0.95rem",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}}},endAdornment:a.jsxs(ne,{direction:"row",sx:{alignSelf:"flex-end",alignItems:"center",gap:2},children:[a.jsx(le,{variant:"text",sx:{color:"text.secondary"},startIcon:a.jsx(ur,{}),disabled:o==="opened"||o==="generating",onClick:p,children:"Clear"}),a.jsx(le,{size:"small",color:"primary",disabled:r!=="available",loading:o==="opened",onClick:()=>{o==="opened"?i():o==="closed"&&l()},children:o==="opened"?a.jsx(Ue,{size:"medium"}):o==="generating"?a.jsx(br,{size:"1.25rem"}):a.jsx(fr,{size:"1.25rem"})})]})}}})})};function yr(){return a.jsxs(Ee,{children:[a.jsx(De,{}),a.jsx(hr,{})]})}export{yr as default}; + */const xr=[["path",{d:"M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3z",key:"svg-0"}]],br=ee("filled","square-filled","SquareFilled",xr),hr=()=>{const[{modelName:e,clusterInfo:{status:r}}]=Me(),[{input:t,status:o},{setInput:s,generate:l,stop:i,clear:p}]=Re(),n=je(d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),l())});return a.jsx(ne,{"data-status":o,children:a.jsx(cr,{value:t,onChange:d=>s(d.target.value),multiline:!0,maxRows:4,placeholder:"Ask anything",fullWidth:!0,onKeyDown:n,slotProps:{input:{sx:{border:"1px solid",borderColor:"grey.300",borderRadius:2,fontSize:"0.95rem",boxShadow:"2px 2px 4px rgba(0,0,0,0.05)",flexDirection:"column","& textarea":{fontSize:"0.875rem",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}}},endAdornment:a.jsxs(ne,{direction:"row",sx:{alignSelf:"flex-end",alignItems:"center",gap:2},children:[a.jsx(le,{variant:"text",sx:{color:"text.secondary"},startIcon:a.jsx(ur,{}),disabled:o==="opened"||o==="generating",onClick:p,children:"Clear"}),a.jsx(le,{size:"small",color:"primary",disabled:r!=="available",loading:o==="opened",onClick:()=>{o==="opened"?i():o==="closed"&&l()},children:o==="opened"?a.jsx(Ue,{size:"medium"}):o==="generating"?a.jsx(br,{size:"1.25rem"}):a.jsx(fr,{size:"1.25rem"})})]})}}})})};function yr(){return a.jsxs(Ee,{children:[a.jsx(De,{}),a.jsx(hr,{})]})}export{yr as default}; diff --git a/src/frontend/dist/assets/index-2agzu340.js b/src/frontend/dist/assets/index-LpWXPQo4.js similarity index 69% rename from src/frontend/dist/assets/index-2agzu340.js rename to src/frontend/dist/assets/index-LpWXPQo4.js index 791efad1..9a3a4bc7 100644 --- a/src/frontend/dist/assets/index-2agzu340.js +++ b/src/frontend/dist/assets/index-LpWXPQo4.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-Ner6L8JU.js","assets/main-layout-BwvpTOaC.js","assets/main-layout-DVneG3Rq.css","assets/join-COUGJOTN.js","assets/chat-QK3nMaK5.js"])))=>i.map(i=>d[i]); -function _2(n,r){for(var l=0;lo[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const c of s)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(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(s){if(s.ep)return;s.ep=!0;const c=l(s);fetch(s.href,c)}})();function La(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf={exports:{}},yl={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-CrOHSNZf.js","assets/main-layout-HR9QJcmZ.js","assets/main-layout-DVneG3Rq.css","assets/join-BfPac9eY.js","assets/chat-B2WH5BM1.js"])))=>i.map(i=>d[i]); +function _2(n,r){for(var l=0;lo[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const c of s)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(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(s){if(s.ep)return;s.ep=!0;const c=l(s);fetch(s.href,c)}})();function La(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Af={exports:{}},vl={};/** * @license React * react-jsx-runtime.production.js * @@ -7,7 +7,7 @@ function _2(n,r){for(var l=0;l>>1,w=O[le];if(0>>1;les(ie,Q))oes(fe,ie)?(O[le]=fe,O[oe]=Q,le=oe):(O[le]=ie,O[re]=Q,le=re);else if(oes(fe,Q))O[le]=fe,O[oe]=Q,le=oe;else break e}}return Y}function s(O,Y){var Q=O.sortIndex-Y.sortIndex;return Q!==0?Q:O.id-Y.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,T=!1,C=!1,M=!1,D=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function B(O){for(var Y=l(m);Y!==null;){if(Y.callback===null)o(m);else if(Y.startTime<=O)o(m),Y.sortIndex=Y.expirationTime,r(p,Y);else break;Y=l(m)}}function k(O){if(C=!1,B(O),!T)if(l(p)!==null)T=!0,L||(L=!0,S());else{var Y=l(m);Y!==null&&X(k,Y.startTime-O)}}var L=!1,q=-1,F=5,K=-1;function G(){return M?!0:!(n.unstable_now()-KO&&G());){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),Y=!0;break t}b===l(p)&&o(p),B(O)}else o(p);b=l(p)}if(b!==null)Y=!0;else{var V=l(m);V!==null&&X(k,V.startTime-O),Y=!1}}break e}finally{b=null,E=Q,A=!1}Y=void 0}}finally{Y?S():L=!1}}}var S;if(typeof $=="function")S=function(){$(I)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,H=ne.port2;ne.port1.onmessage=I,S=function(){H.postMessage(null)}}else S=function(){D(I,0)};function X(O,Y){q=D(function(){O(n.unstable_now())},Y)}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=Q,r(m,O),l(p)===null&&O===l(m)&&(C?(_(q),q=-1):C=!0,X(k,Q-le))):(O.sortIndex=w,r(p,O),T||A||(T=!0,L||(L=!0,S()))),O},n.unstable_shouldYield=G,n.unstable_wrapCallback=function(O){var Y=E;return function(){var Q=E;E=Y;try{return O.apply(this,arguments)}finally{E=Q}}}})(Rf)),Rf}var ig;function L2(){return ig||(ig=1,Of.exports=N2()),Of.exports}var Df={exports:{}},kt={};/** + */var rg;function N2(){return rg||(rg=1,(function(n){function r(O,Y){var Z=O.length;O.push(Y);e:for(;0>>1,w=O[le];if(0>>1;les(ie,Z))oes(fe,ie)?(O[le]=fe,O[oe]=Z,le=oe):(O[le]=ie,O[re]=Z,le=re);else if(oes(fe,Z))O[le]=fe,O[oe]=Z,le=oe;else break e}}return Y}function s(O,Y){var Z=O.sortIndex-Y.sortIndex;return Z!==0?Z:O.id-Y.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,T=!1,C=!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 Y=l(m);Y!==null;){if(Y.callback===null)o(m);else if(Y.startTime<=O)o(m),Y.sortIndex=Y.expirationTime,r(p,Y);else break;Y=l(m)}}function _(O){if(C=!1,B(O),!T)if(l(p)!==null)T=!0,N||(N=!0,S());else{var Y=l(m);Y!==null&&P(_,Y.startTime-O)}}var N=!1,H=-1,F=5,K=-1;function I(){return M?!0:!(n.unstable_now()-KO&&I());){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),Y=!0;break t}b===l(p)&&o(p),B(O)}else o(p);b=l(p)}if(b!==null)Y=!0;else{var q=l(m);q!==null&&P(_,q.startTime-O),Y=!1}}break e}finally{b=null,E=Z,A=!1}Y=void 0}}finally{Y?S():N=!1}}}var S;if(typeof $=="function")S=function(){$(Q)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,V=ne.port2;ne.port1.onmessage=Q,S=function(){V.postMessage(null)}}else S=function(){D(Q,0)};function P(O,Y){H=D(function(){O(n.unstable_now())},Y)}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=Z,r(m,O),l(p)===null&&O===l(m)&&(C?(k(H),H=-1):C=!0,P(_,Z-le))):(O.sortIndex=w,r(p,O),T||A||(T=!0,N||(N=!0,S()))),O},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(O){var Y=E;return function(){var Z=E;E=Y;try{return O.apply(this,arguments)}finally{E=Z}}}})(_f)),_f}var ig;function L2(){return ig||(ig=1,Df.exports=N2()),Df.exports}var kf={exports:{}},kt={};/** * @license React * react-dom.production.js * @@ -31,7 +31,7 @@ function _2(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(),Df.exports=B2(),Df.exports}/** + */var lg;function B2(){if(lg)return kt;lg=1;var n=Rd();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(),kf.exports=B2(),kf.exports}/** * @license React * react-dom-client.production.js * @@ -39,15 +39,15 @@ function _2(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=V(null),fe=V(null),se=V(null),Oe=V(null);function Se(e,t){switch(ie(se,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?O0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=O0(t),e=R0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(oe),ie(oe,e)}function Qe(){re(oe),re(fe),re(se)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=R0(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),dl._currentValue=Q)}var vt=Object.prototype.hasOwnProperty,Mt=n.unstable_scheduleCallback,$t=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Nt=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,bt=null,Ee=null;function ot(e){if(typeof Wl=="function"&&Fl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(bt,e)}catch{}}var Ie=Math.clz32?Math.clz32:y1,Si=Math.log,ds=Math.LN2;function y1(e){return e>>>=0,e===0?32:31-(Si(e)/ds|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 u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~f,i!==0?u=Ua(i):(g&=v,g!==0?u=Ua(g):a||(a=v&~e,a!==0&&(u=Ua(a))))):(v=i&~f,v!==0?u=Ua(v):g!==0?u=Ua(g):a||(a=i&~e,a!==0&&(u=Ua(a)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:u}function xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function v1(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 fh(){var e=Jl;return Jl<<=1,(Jl&4194048)===0&&(Jl=256),e}function dh(){var e=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),e}function hs(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ci(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function b1(e,t,a,i,u,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,U=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),se=q(null),Oe=q(null);function Se(e,t){switch(ie(se,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?O0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=O0(t),e=R0(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(se)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=R0(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=Z)}var vt=Object.prototype.hasOwnProperty,Mt=n.unstable_scheduleCallback,$t=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Nt=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,bt=null,Ee=null;function ot(e){if(typeof Wl=="function"&&Fl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(bt,e)}catch{}}var Qe=Math.clz32?Math.clz32:y1,xi=Math.log,ms=Math.LN2;function y1(e){return e>>>=0,e===0?32:31-(xi(e)/ms|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 u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~f,i!==0?u=Ua(i):(g&=v,g!==0?u=Ua(g):a||(a=v&~e,a!==0&&(u=Ua(a))))):(v=i&~f,v!==0?u=Ua(v):g!==0?u=Ua(g):a||(a=i&~e,a!==0&&(u=Ua(a)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:u}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function v1(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 fh(){var e=Jl;return Jl<<=1,(Jl&4194048)===0&&(Jl=256),e}function dh(){var e=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),e}function ps(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 b1(e,t,a,i,u,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,U=e.hiddenUpdates;for(a=g&~a;0)":-1u||R[i]!==U[u]){var J=` -`+R[i].replace(" at new "," at ");return e.displayName&&J.includes("")&&(J=J.replace("",e.displayName)),J}while(1<=i&&0<=u);break}}}finally{bs=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?xr(a):""}function M1(e){switch(e.tag){case 26:case 27:case 5:return xr(e.type);case 16:return xr("Lazy");case 13:return xr("Suspense");case 19:return xr("SuspenseList");case 0:case 15:return Ss(e.type,!1);case 11:return Ss(e.type.render,!1);case 1:return Ss(e.type,!0);case 31:return xr("Activity");default:return""}}function Ch(e){try{var t="";do t+=M1(e),e=e.return;while(e);return t}catch(a){return` +`+R[i].replace(" at new "," at ");return e.displayName&&J.includes("")&&(J=J.replace("",e.displayName)),J}while(1<=i&&0<=u);break}}}finally{xs=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?xr(a):""}function M1(e){switch(e.tag){case 26:case 27:case 5:return xr(e.type);case 16:return xr("Lazy");case 13:return xr("Suspense");case 19:return xr("SuspenseList");case 0:case 15:return Cs(e.type,!1);case 11:return Cs(e.type.render,!1);case 1:return Cs(e.type,!0);case 31:return xr("Activity");default:return""}}function Ch(e){try{var t="";do t+=M1(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 Eh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function w1(e){var t=Eh(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 u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.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=w1(e))}function Th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Eh(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 A1=/[\n"\\]/g;function rn(e){return e.replace(A1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xs(e,t,a,i,u,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?Cs(e,g,an(t)):a!=null?Cs(e,g,an(a)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+an(v):e.removeAttribute("name")}function Mh(e,t,a,i,u,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??u,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 Cs(e,t,a){t==="number"&&io(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Cr(e,t,a,i){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),As=!1;if(Yn)try{var wi={};Object.defineProperty(wi,"passive",{get:function(){As=!0}}),window.addEventListener("test",wi,wi),window.removeEventListener("test",wi,wi)}catch{As=!1}var ca=null,Os=null,oo=null;function kh(){if(oo)return oo;var e,t=Os,a=t.length,i,u="value"in ca?ca.value:ca.textContent,f=u.length;for(e=0;e=Ri),jh=" ",Uh=!1;function Hh(e,t){switch(e){case"keyup":return tb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wr=!1;function ab(e,t){switch(e){case"compositionend":return Yh(t);case"keypress":return t.which!==32?null:(Uh=!0,jh);case"textInput":return e=t.data,e===jh&&Uh?null:e;default:return null}}function rb(e,t){if(wr)return e==="compositionend"||!zs&&Hh(e,t)?(e=kh(),oo=Os=ca=null,wr=!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=Ih(a)}}function Wh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fh(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 Ls(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 db=Yn&&"documentMode"in document&&11>=document.documentMode,Ar=null,Bs=null,zi=null,js=!1;function Jh(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;js||Ar==null||Ar!==io(i)||(i=Ar,"selectionStart"in i&&Ls(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}),zi&&ki(zi,i)||(zi=i,i=Fo(Bs,"onSelect"),0>=g,u-=g,Gn=1<<32-Ie(t)+u|a<f?f:8;var g=O.T,v={};O.T=v,Ec(e,!1,t,a);try{var R=u(),U=O.S;if(U!==null&&U(v,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var J=xb(R,i);Qi(e,t,J,Wt(e))}else Qi(e,t,i,Wt(e))}catch(ae){Qi(e,t,{then:function(){},status:"rejected",reason:ae},Wt())}finally{Y.p=f,O.T=g}}function wb(){}function xc(e,t,a,i){if(e.tag!==5)throw Error(o(476));var u=ep(e).queue;Jm(e,u,t,Q,a===null?wb:function(){return tp(e),a(i)})}function ep(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:Q},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 tp(e){var t=ep(e).next.queue;Qi(e,t,{},Wt())}function Cc(){return _t(dl)}function np(){return ht().memoizedState}function ap(){return ht().memoizedState}function Ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=ha(a);var i=ma(t,e,a);i!==null&&(Ft(i,t,a),qi(i,t,a)),t={cache:Fs()},e.payload=t;return}t=t.return}}function Ob(e,t,a){var i=Wt();a={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},ko(e)?ip(t,a):(a=qs(e,t,a,i),a!==null&&(Ft(a,e,i),lp(a,t,i)))}function rp(e,t,a){var i=Wt();Qi(e,t,a,i)}function Qi(e,t,a,i){var u={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(ko(e))ip(t,u);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(u.hasEagerState=!0,u.eagerState=v,Xt(v,g))return po(e,t,u,0),Pe===null&&mo(),!1}catch{}finally{}if(a=qs(e,t,u,i),a!==null)return Ft(a,e,i),lp(a,t,i),!0}return!1}function Ec(e,t,a,i){if(i={lane:2,revertLane:tf(),action:i,hasEagerState:!1,eagerState:null,next:null},ko(e)){if(t)throw Error(o(479))}else t=qs(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 ip(e,t){Br=wo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function lp(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,mh(e,a)}}var zo={readContext:_t,use:Oo,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut},op={readContext:_t,use:Oo,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Vm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,_o(4194308,4,Qm.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 u=a(t);if(Fa){ot(!0);try{a(t)}finally{ot(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=Ob.bind(null,ve,e),[i.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,a=rp.bind(null,ve,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:bc,useDeferredValue:function(e,t){var a=Yt();return Sc(a,e,t)},useTransition:function(){var e=yc(!1);return e=Jm.bind(null,ve,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ve,u=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||Om(i,t,a)}u.memoizedState=a;var f={value:a,getSnapshot:t};return u.queue=f,Vm(Dm.bind(null,i,f,e),[e]),i.flags|=2048,Ur(9,Do(),Rm.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-Ie(i)-1)).toString(32)+a,t="«"+t+"R"+a,a=Ao++,0he?(Et=ce,ce=null):Et=ce.sibling;var Re=P(N,ce,j[he],te);if(Re===null){ce===null&&(ce=Et);break}e&&ce&&Re.alternate===null&&t(N,ce),z=f(Re,z,he),be===null?ue=Re:be.sibling=Re,be=Re,ce=Et}if(he===j.length)return a(N,ce),De&&Xa(N,he),ue;if(ce===null){for(;hehe?(Et=ce,ce=null):Et=ce.sibling;var _a=P(N,ce,Re.value,te);if(_a===null){ce===null&&(ce=Et);break}e&&ce&&_a.alternate===null&&t(N,ce),z=f(_a,z,he),be===null?ue=_a:be.sibling=_a,be=_a,ce=Et}if(Re.done)return a(N,ce),De&&Xa(N,he),ue;if(ce===null){for(;!Re.done;he++,Re=j.next())Re=ae(N,Re.value,te),Re!==null&&(z=f(Re,z,he),be===null?ue=Re:be.sibling=Re,be=Re);return De&&Xa(N,he),ue}for(ce=i(ce);!Re.done;he++,Re=j.next())Re=Z(ce,N,he,Re.value,te),Re!==null&&(e&&Re.alternate!==null&&ce.delete(Re.key===null?he:Re.key),z=f(Re,z,he),be===null?ue=Re:be.sibling=Re,be=Re);return e&&ce.forEach(function(D2){return t(N,D2)}),De&&Xa(N,he),ue}function Ye(N,z,j,te){if(typeof j=="object"&&j!==null&&j.type===T&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case E:e:{for(var ue=j.key;z!==null;){if(z.key===ue){if(ue=j.type,ue===T){if(z.tag===7){a(N,z.sibling),te=u(z,j.props.children),te.return=N,N=te;break e}}else if(z.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===F&&sp(ue)===z.type){a(N,z.sibling),te=u(z,j.props),Ki(te,j),te.return=N,N=te;break e}a(N,z);break}else t(N,z);z=z.sibling}j.type===T?(te=Va(j.props.children,N.mode,te,j.key),te.return=N,N=te):(te=yo(j.type,j.key,j.props,null,N.mode,te),Ki(te,j),te.return=N,N=te)}return g(N);case A:e:{for(ue=j.key;z!==null;){if(z.key===ue)if(z.tag===4&&z.stateNode.containerInfo===j.containerInfo&&z.stateNode.implementation===j.implementation){a(N,z.sibling),te=u(z,j.children||[]),te.return=N,N=te;break e}else{a(N,z);break}else t(N,z);z=z.sibling}te=Ps(j,N.mode,te),te.return=N,N=te}return g(N);case F:return ue=j._init,j=ue(j._payload),Ye(N,z,j,te)}if(X(j))return me(N,z,j,te);if(S(j)){if(ue=S(j),typeof ue!="function")throw Error(o(150));return j=ue.call(j),de(N,z,j,te)}if(typeof j.then=="function")return Ye(N,z,$o(j),te);if(j.$$typeof===$)return Ye(N,z,xo(N,j),te);No(N,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,z!==null&&z.tag===6?(a(N,z.sibling),te=u(z,j),te.return=N,N=te):(a(N,z),te=Vs(j,N.mode,te),te.return=N,N=te),g(N)):a(N,z)}return function(N,z,j,te){try{Ii=0;var ue=Ye(N,z,j,te);return Hr=null,ue}catch(ce){if(ce===Hi||ce===Eo)throw ce;var be=Zt(29,ce,null,N.mode);return be.lanes=te,be.return=N,be}finally{}}}var Yr=cp(!0),fp=cp(!1),cn=V(null),On=null;function ga(e){var t=e.alternate;ie(gt,gt.current&1),ie(cn,e),On===null&&(t===null||Lr.current!==null||t.memoizedState!==null)&&(On=e)}function dp(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 ya()}function ya(){ie(gt,gt.current),ie(cn,cn.current)}function Qn(e){re(cn),On===e&&(On=null),re(gt)}var gt=V(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==="$?"||mf(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 Tc(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 Mc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Wt(),u=ha(i);u.payload=t,a!=null&&(u.callback=a),t=ma(e,u,i),t!==null&&(Ft(t,e,i),qi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Wt(),u=ha(i);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=ma(e,u,i),t!==null&&(Ft(t,e,i),qi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),i=ha(a);i.tag=2,t!=null&&(i.callback=t),t=ma(e,i,a),t!==null&&(Ft(t,e,a),qi(t,e,a))}};function hp(e,t,a,i,u,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,g):t.prototype&&t.prototype.isPureReactComponent?!ki(a,i)||!ki(u,f):!0}function mp(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&&Mc.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 u in e)a[u]===void 0&&(a[u]=e[u])}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 pp(e){Bo(e)}function gp(e){console.error(e)}function yp(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 vp(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function wc(e,t,a){return a=ha(a),a.tag=3,a.payload={element:null},a.callback=function(){jo(e,t)},a}function bp(e){return e=ha(e),e.tag=3,e}function Sp(e,t,a,i){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){vp(t,a,i)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){vp(t,a,i),typeof u!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var v=i.stack;this.componentDidCatch(i.value,{componentStack:v!==null?v:""})})}function Db(e,t,a,i,u){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&Bi(t,a,u,!0),a=cn.current,a!==null){switch(a.tag){case 13:return On===null?Kc():a.alternate===null&&tt===0&&(tt=3),a.flags&=-257,a.flags|=65536,a.lanes=u,i===tc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),Fc(e,i,u)),!1;case 22:return a.flags|=65536,i===tc?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)),Fc(e,i,u)),!1}throw Error(o(435,a.tag))}return Fc(e,i,u),Kc(),!1}if(De)return t=cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Qs&&(e=Error(o(422),{cause:i}),Li(ln(e,a)))):(i!==Qs&&(t=Error(o(423),{cause:i}),Li(ln(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=ln(i,a),u=wc(e.stateNode,i,u),rc(e,u),tt!==4&&(tt=2)),!1;var f=Error(o(520),{cause:i});if(f=ln(f,a),al===null?al=[f]:al.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=u&-u,a.lanes|=e,e=wc(a.stateNode,i,e),rc(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"&&(Ea===null||!Ea.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=bp(u),Sp(u,e,a,i),rc(a,u),!1}a=a.return}while(a!==null);return!1}var xp=Error(o(461)),xt=!1;function wt(e,t,a,i){t.child=e===null?fp(t,null,a,i):Yr(t,e.child,a,i)}function Cp(e,t,a,i,u){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=sc(e,t,a,g,f,u),v=cc(),e!==null&&!xt?(fc(e,t,u),In(e,t,u)):(De&&v&&Xs(t),t.flags|=1,wt(e,t,i,u),t.child)}function Ep(e,t,a,i,u){if(e===null){var f=a.type;return typeof f=="function"&&!Gs(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,Tp(e,t,f,i,u)):(e=yo(a.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!$c(e,u)){var g=f.memoizedProps;if(a=a.compare,a=a!==null?a:ki,a(g,i)&&e.ref===t.ref)return In(e,t,u)}return t.flags|=1,e=qn(f,i),e.ref=t.ref,e.return=t,t.child=e}function Tp(e,t,a,i,u){if(e!==null){var f=e.memoizedProps;if(ki(f,i)&&e.ref===t.ref)if(xt=!1,t.pendingProps=i=f,$c(e,u))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,In(e,t,u)}return Ac(e,t,a,i,u)}function Mp(e,t,a){var i=t.pendingProps,u=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(u=t.child=e.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;t.childLanes=f&~i}else t.childLanes=0,t.child=null;return wp(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?Tm(t,f):lc(),dp(t);else return t.lanes=t.childLanes=536870912,wp(e,t,f!==null?f.baseLanes|a:a,a)}else f!==null?(Co(t,f.cachePool),Tm(t,f),ya(),t.memoizedState=null):(e!==null&&Co(t,null),lc(),ya());return wt(e,t,u,a),t.child}function wp(e,t,a,i){var u=ec();return u=u===null?null:{parent:pt._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&Co(t,null),lc(),dp(t),e!==null&&Bi(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 Ac(e,t,a,i,u){return Ka(t),a=sc(e,t,a,i,void 0,u),i=cc(),e!==null&&!xt?(fc(e,t,u),In(e,t,u)):(De&&i&&Xs(t),t.flags|=1,wt(e,t,a,u),t.child)}function Ap(e,t,a,i,u,f){return Ka(t),t.updateQueue=null,a=wm(t,i,a,u),Mm(e),i=cc(),e!==null&&!xt?(fc(e,t,f),In(e,t,f)):(De&&i&&Xs(t),t.flags|=1,wt(e,t,a,f),t.child)}function Op(e,t,a,i,u){if(Ka(t),t.stateNode===null){var f=_r,g=a.contextType;typeof g=="object"&&g!==null&&(f=_t(g)),f=new a(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Mc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},nc(t),g=a.contextType,f.context=typeof g=="object"&&g!==null?_t(g):_r,f.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(Tc(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&&Mc.enqueueReplaceState(f,f.state,null),Vi(t,i,f,u),Gi(),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 U=f.context,J=a.contextType;g=_r,typeof J=="object"&&J!==null&&(g=_t(J));var ae=a.getDerivedStateFromProps;J=typeof ae=="function"||typeof f.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,J||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v||U!==g)&&mp(t,f,i,g),da=!1;var P=t.memoizedState;f.state=P,Vi(t,i,f,u),Gi(),U=t.memoizedState,v||P!==U||da?(typeof ae=="function"&&(Tc(t,a,ae,i),U=t.memoizedState),(R=da||hp(t,a,R,i,P,U,g))?(J||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=U),f.props=i,f.state=U,f.context=g,i=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,ac(e,t),g=t.memoizedProps,J=Ja(a,g),f.props=J,ae=t.pendingProps,P=f.context,U=a.contextType,R=_r,typeof U=="object"&&U!==null&&(R=_t(U)),v=a.getDerivedStateFromProps,(U=typeof v=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==ae||P!==R)&&mp(t,f,i,R),da=!1,P=t.memoizedState,f.state=P,Vi(t,i,f,u),Gi();var Z=t.memoizedState;g!==ae||P!==Z||da||e!==null&&e.dependencies!==null&&So(e.dependencies)?(typeof v=="function"&&(Tc(t,a,v,i),Z=t.memoizedState),(J=da||hp(t,a,J,i,P,Z,R)||e!==null&&e.dependencies!==null&&So(e.dependencies))?(U||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,Z,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,Z,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Z),f.props=i,f.state=Z,f.context=R,i=J):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&P===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=Yr(t,e.child,null,u),t.child=Yr(t,null,a,u)):wt(e,t,a,u),t.memoizedState=f.state,e=t.child):e=In(e,t,u),e}function Rp(e,t,a,i){return Ni(),t.flags|=256,wt(e,t,a,i),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rc(e){return{baseLanes:e,cachePool:gm()}}function Dc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=fn),e}function Dp(e,t,a){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?ga(t):ya(),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,Lt=t,et=null,R=!0):R=!1}R||Qa(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return mf(v)?t.lanes=32:t.lanes=536870912,null;Qn(t)}return v=i.children,i=i.fallback,u?(ya(),u=t.mode,v=Ho({mode:"hidden",children:v},u),i=Va(i,u,a,null),v.return=t,i.return=t,v.sibling=i,t.child=v,u=t.child,u.memoizedState=Rc(a),u.childLanes=Dc(e,g,a),t.memoizedState=Oc,i):(ga(t),_c(t,v))}if(R=e.memoizedState,R!==null&&(v=R.dehydrated,v!==null)){if(f)t.flags&256?(ga(t),t.flags&=-257,t=kc(e,t,a)):t.memoizedState!==null?(ya(),t.child=e.child,t.flags|=128,t=null):(ya(),u=i.fallback,v=t.mode,i=Ho({mode:"visible",children:i.children},v),u=Va(u,v,a,null),u.flags|=2,i.return=t,u.return=t,i.sibling=u,t.child=i,Yr(t,e.child,null,a),i=t.child,i.memoizedState=Rc(a),i.childLanes=Dc(e,g,a),t.memoizedState=Oc,t=u);else if(ga(t),mf(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var U=g.dgst;g=U,i=Error(o(419)),i.stack="",i.digest=g,Li({value:i,source:null,stack:null}),t=kc(e,t,a)}else if(xt||Bi(e,t,a,!1),g=(a&e.childLanes)!==0,xt||g){if(g=Pe,g!==null&&(i=a&-a,i=(i&42)!==0?1:ms(i),i=(i&(g.suspendedLanes|a))!==0?0:i,i!==0&&i!==R.retryLane))throw R.retryLane=i,Dr(e,i),Ft(g,e,i),xp;v.data==="$?"||Kc(),t=kc(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,et=xn(v.nextSibling),Lt=t,De=!0,Za=null,An=!1,e!==null&&(un[sn++]=Gn,un[sn++]=Vn,un[sn++]=Pa,Gn=e.id,Vn=e.overflow,Pa=t),t=_c(t,i.children),t.flags|=4096);return t}return u?(ya(),u=i.fallback,v=t.mode,R=e.child,U=R.sibling,i=qn(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&65011712,U!==null?u=qn(U,u):(u=Va(u,v,a,null),u.flags|=2),u.return=t,i.return=t,i.sibling=u,t.child=i,i=u,u=t.child,v=e.child.memoizedState,v===null?v=Rc(a):(R=v.cachePool,R!==null?(U=pt._currentValue,R=R.parent!==U?{parent:U,pool:U}:R):R=gm(),v={baseLanes:v.baseLanes|a,cachePool:R}),u.memoizedState=v,u.childLanes=Dc(e,g,a),t.memoizedState=Oc,i):(ga(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 kc(e,t,a){return Yr(t,e.child,null,a),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _p(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ks(e.return,t,a)}function zc(e,t,a,i,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=a,f.tailMode=u)}function kp(e,t,a){var i=t.pendingProps,u=i.revealOrder,f=i.tail;if(wt(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&&_p(e,a,t);else if(e.tag===19)_p(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),u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&Lo(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),zc(t,!1,u,a,f);break;case"backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Lo(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}zc(t,!0,a,null,f);break;case"together":zc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function In(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Bi(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 $c(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&So(e)))}function _b(e,t,a){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),fa(t,pt,e.memoizedState.cache),Ni();break;case 27:case 5:Xe(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ga(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Dp(e,t,a):(ga(t),e=In(e,t,a),e!==null?e.sibling:null);ga(t);break;case 19:var u=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(Bi(e,t,a,!1),i=(a&t.childLanes)!==0),u){if(i)return kp(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ie(gt,gt.current),i)break;return null;case 22:case 23:return t.lanes=0,Mp(e,t,a);case 24:fa(t,pt,e.memoizedState.cache)}return In(e,t,a)}function zp(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!$c(e,a)&&(t.flags&128)===0)return xt=!1,_b(e,t,a);xt=(e.flags&131072)!==0}else xt=!1,De&&(t.flags&1048576)!==0&&sm(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,u=i._init;if(i=u(i._payload),t.type=i,typeof i=="function")Gs(i)?(e=Ja(i,e),t.tag=1,t=Op(null,t,i,e,a)):(t.tag=0,t=Ac(null,t,i,e,a));else{if(i!=null){if(u=i.$$typeof,u===B){t.tag=11,t=Cp(null,t,i,e,a);break e}else if(u===q){t.tag=14,t=Ep(null,t,i,e,a);break e}}throw t=H(i)||i,Error(o(306,t,""))}}return t;case 0:return Ac(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,u=Ja(i,t.pendingProps),Op(e,t,i,u,a);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,ac(e,t),Vi(t,i,null,a);var g=t.memoizedState;if(i=g.cache,fa(t,pt,i),i!==f.cache&&Ws(t,[pt],a,!0),Gi(),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=Rp(e,t,i,a);break e}else if(i!==u){u=ln(Error(o(424)),t),Li(u),t=Rp(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),Lt=t,De=!0,Za=null,An=!0,a=fp(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ni(),i===u){t=In(e,t,a);break e}wt(e,t,i,a)}t=t.child}return t;case 26:return Uo(e,t),e===null?(a=B0(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,i=eu(se.current).createElement(a),i[Dt]=t,i[Ut]=e,Ot(i,a,e),St(i),t.stateNode=i):t.memoizedState=B0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xe(t),e===null&&De&&(i=t.stateNode=$0(t.type,t.pendingProps,se.current),Lt=t,An=!0,u=et,wa(t.type)?(pf=u,et=xn(i.firstChild)):et=u),wt(e,t,t.pendingProps.children,a),Uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=i=et)&&(i=i2(i,t.type,t.pendingProps,An),i!==null?(t.stateNode=i,Lt=t,et=xn(i.firstChild),An=!1,u=!0):u=!1),u||Qa(t)),Xe(t),u=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,i=f.children,ff(u,f)?i=null:g!==null&&ff(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=sc(e,t,Eb,null,null,a),dl._currentValue=u),Uo(e,t),wt(e,t,i,a),t.child;case 6:return e===null&&De&&((e=a=et)&&(a=l2(a,t.pendingProps,An),a!==null?(t.stateNode=a,Lt=t,et=null,e=!0):e=!1),e||Qa(t)),null;case 13:return Dp(e,t,a);case 4:return Se(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Yr(t,null,i,a):wt(e,t,i,a),t.child;case 11:return Cp(e,t,t.type,t.pendingProps,a);case 7:return wt(e,t,t.pendingProps,a),t.child;case 8:return wt(e,t,t.pendingProps.children,a),t.child;case 12:return wt(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,fa(t,t.type,i.value),wt(e,t,i.children,a),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ka(t),u=_t(u),i=i(u),t.flags|=1,wt(e,t,i,a),t.child;case 14:return Ep(e,t,t.type,t.pendingProps,a);case 15:return Tp(e,t,t.type,t.pendingProps,a);case 19:return kp(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 Mp(e,t,a);case 24:return Ka(t),i=_t(pt),e===null?(u=ec(),u===null&&(u=Pe,f=Fs(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),t.memoizedState={parent:i,cache:u},nc(t),fa(t,pt,u)):((e.lanes&a)!==0&&(ac(e,t),Vi(t,null,null,a),Gi()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),fa(t,pt,i)):(i=f.cache,fa(t,pt,i),i!==u.cache&&Ws(t,[pt],a,!0))),wt(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 $p(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!q0(t)){if(t=cn.current,t!==null&&((Te&4194048)===Te?On!==null:(Te&62914560)!==Te&&(Te&536870912)===0||t!==On))throw Yi=tc,ym;e.flags|=8192}}function Yo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?dh():536870912,e.lanes|=t,Pr|=t)}function Wi(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 u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function kb(e,t,a){var i=t.pendingProps;switch(Zs(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),Qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&($i(t)?Kn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,dm())),Fe(t),null;case 26:return a=t.memoizedState,e===null?(Kn(t),a!==null?(Fe(t),$p(t,a)):(Fe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Kn(t),Fe(t),$p(t,a)):(Fe(t),t.flags&=-16777217):(e.memoizedProps!==i&&Kn(t),Fe(t),t.flags&=-16777217),null;case 27:lt(t),a=se.current;var u=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,$i(t)?cm(t):(e=$0(u,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,$i(t))cm(t);else{switch(u=eu(se.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=u.createElement("div"),e.innerHTML=" + diff --git a/src/frontend/src/components/common/drawer-layout.tsx b/src/frontend/src/components/common/drawer-layout.tsx index d9ac3855..4c8a3f60 100644 --- a/src/frontend/src/components/common/drawer-layout.tsx +++ b/src/frontend/src/components/common/drawer-layout.tsx @@ -22,7 +22,7 @@ import { IconPlus, IconTopologyStar3, } from '@tabler/icons-react'; -import { JoinCommand, NodeList } from '../inputs'; +import { JoinCommand, ModelSelect, NodeList } from '../inputs'; const DrawerLayoutRoot = styled(Stack)(({ theme }) => { const { spacing } = theme; @@ -39,7 +39,7 @@ const DrawerLayoutSide = styled(Stack)(({ theme }) => { const { palette, spacing } = theme; return { height: '100%', - paddingBlock: spacing(3), + paddingBlock: spacing(2), paddingInline: spacing(2), gap: spacing(3), overflow: 'hidden', @@ -55,7 +55,7 @@ const DrawerLayoutHeader = styled(Stack)(({ theme }) => { height: '2.5rem', flex: 'none', marginTop: spacing(1), - paddingBlock: spacing(2), + paddingBlock: spacing(1), paddingInline: spacing(4), overflow: 'hidden', }; @@ -78,7 +78,8 @@ const DrawerLayoutContent = styled(Stack)(({ theme }) => { maxWidth: '100%', height: '100%', gap: spacing(2), - padding: spacing(4), + paddingBlock: spacing(1), + paddingInline: spacing(4), overflow: 'hidden', }; }); @@ -146,11 +147,11 @@ export const DrawerLayout: FC = ({ children }) => { const [dialogJoinCommand, { open: openJoinCommand }] = useAlertDialog({ color: 'primary', titleIcon: , - title: 'Add Nodes', + title: 'Add New Nodes', content: ( - + - Run join command on your new Node + Run join command on all nodes @@ -167,12 +168,7 @@ export const DrawerLayout: FC = ({ children }) => { }); const IconCluster = () => ( - + = ({ children }) => { @@ -282,13 +278,17 @@ export const DrawerLayout: FC = ({ children }) => { {/* */} - + Cluster topology - - } onClick={openJoinCommand} sx={{ mt: '30px' }}> + } + onClick={openJoinCommand} + sx={{ mt: '30px' }} + > Add Nodes @@ -296,9 +296,7 @@ export const DrawerLayout: FC = ({ children }) => { - - {modelName} - + {children} diff --git a/src/frontend/src/components/inputs/chat-input.tsx b/src/frontend/src/components/inputs/chat-input.tsx index 5541e300..2674a53d 100644 --- a/src/frontend/src/components/inputs/chat-input.tsx +++ b/src/frontend/src/components/inputs/chat-input.tsx @@ -44,7 +44,7 @@ export const ChatInput: FC = () => { boxShadow: '2px 2px 4px rgba(0,0,0,0.05)', flexDirection: 'column', '& textarea': { - fontSize: '0.95rem', + fontSize: '0.875rem', scrollbarWidth: 'none', // Firefox msOverflowStyle: 'none', // IE, Edge '&::-webkit-scrollbar': { diff --git a/src/frontend/src/components/inputs/chat-markdown.tsx b/src/frontend/src/components/inputs/chat-markdown.tsx index 51ca9666..5ce4bed7 100644 --- a/src/frontend/src/components/inputs/chat-markdown.tsx +++ b/src/frontend/src/components/inputs/chat-markdown.tsx @@ -34,7 +34,6 @@ const ChatMarkdownRoot = styled('article', { ...typography.body1, overflowWrap: 'break-word', maxWidth: '100%', - fontSize: '0.95rem', display: 'flex', flexFlow: 'column nowrap', diff --git a/src/frontend/src/components/inputs/chat-messages.tsx b/src/frontend/src/components/inputs/chat-messages.tsx index db7f4c8f..0dd49cf0 100644 --- a/src/frontend/src/components/inputs/chat-messages.tsx +++ b/src/frontend/src/components/inputs/chat-messages.tsx @@ -49,18 +49,21 @@ export const ChatMessages: FC = () => { }); const scrollToBottom = () => { + const el = refContainer.current; + if (!el) return; userScrolledUpRef.current = false; autoScrollingRef.current = true; - refBottom.current?.scrollIntoView({ behavior: 'smooth' }); + el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' }); setTimeout(() => { autoScrollingRef.current = false; - }, 200); + }, 250); }; return ( { - {!isBottom && ( - - - - )} + + + ); }; @@ -142,7 +145,7 @@ const ChatMessage: FC<{ message: ChatMessage; isLast?: boolean }> = memo(({ mess py: 1.5, borderRadius: '0.5rem', backgroundColor: 'background.default', - fontSize: '0.95rem', + fontSize: '0.875rem', }} > {content} @@ -153,7 +156,6 @@ const ChatMessage: FC<{ message: ChatMessage; isLast?: boolean }> = memo(({ mess ; const assistantDone = messageStatus === 'done'; - const showCopy = role === 'user' || (role === 'assistant' && assistantDone); const showRegenerate = role === 'assistant' && assistantDone; @@ -169,7 +171,14 @@ const ChatMessage: FC<{ message: ChatMessage; isLast?: boolean }> = memo(({ mess return ( - + {nodeContent} {(showCopy || showRegenerate) && ( diff --git a/src/frontend/src/components/inputs/join-command.tsx b/src/frontend/src/components/inputs/join-command.tsx index c44590ed..00c678d3 100644 --- a/src/frontend/src/components/inputs/join-command.tsx +++ b/src/frontend/src/components/inputs/join-command.tsx @@ -52,15 +52,19 @@ export const JoinCommand: FC = () => { return ( - {Object.entries(nodeJoinCommand).map(([key, value]) => ( + {Object.entries(nodeJoinCommand).map(([key, value], index, entries) => ( - For {LABEL_MAP[key] || key}: - + {entries.length > 1 && ( + + For {LABEL_MAP[key] || key}: + + )} + {value} copy(key)} > diff --git a/src/frontend/src/components/inputs/model-select.tsx b/src/frontend/src/components/inputs/model-select.tsx index 22bc021a..01c7e7ca 100644 --- a/src/frontend/src/components/inputs/model-select.tsx +++ b/src/frontend/src/components/inputs/model-select.tsx @@ -1,53 +1,90 @@ -import type { ReactNode } from 'react'; -import { MenuItem, Select, Stack, styled, Typography } from '@mui/material'; - +import type { FC, ReactNode } from 'react'; +import { + InputBase, + MenuItem, + OutlinedInput, + Select, + selectClasses, + Stack, + styled, + Typography, +} from '@mui/material'; import { useCluster, type ModelInfo } from '../../services'; +import { useRefCallback } from '../../hooks'; +import { useAlertDialog } from '../mui'; +import { IconRestore } from '@tabler/icons-react'; -const ModelSelectRoot = styled(Select)(({ theme }) => { - const { spacing } = theme; - return { - height: '4rem', - }; -}); -const ModelSelectOption = styled(MenuItem)(({ theme }) => { - const { spacing } = theme; - return { - height: '3.25rem', - gap: '0.5rem', - }; -}); +const ModelSelectRoot = styled(Select)<{ ownerState: ModelSelectProps }>(({ theme, ownerState }) => { + const { spacing, typography, palette } = theme; + const { variant = 'outlined' } = ownerState; -const ModelLogo = styled('img')(({ theme }) => { - const { palette } = theme; return { - width: '2.25rem', - height: '2.25rem', - borderRadius: '0.5rem', - border: `1px solid ${palette.divider}`, - objectFit: 'cover', - }; -}); + height: variant === 'outlined' ? '4rem' : '1lh', + paddingInline: spacing(0.5), + borderRadius: 12, + '&:hover': { + backgroundColor: 'action.hover', + }, -const ModelDisplayName = styled('span')(({ theme }) => { - const { palette, typography } = theme; - return { - ...typography.subtitle2, - fontWeight: typography.fontWeightLight, - color: palette.text.primary, - }; -}); + [`.${selectClasses.select}:hover`]: { + backgroundColor: 'transparent', + }, -const ModelName = styled('span')(({ theme }) => { - const { palette, typography } = theme; - return { - ...typography.body2, - fontWeight: typography.fontWeightLight, - color: palette.text.secondary, + ...(variant === 'text' && { + ...typography.h3, + fontWeight: typography.fontWeightMedium, + [`.${selectClasses.select}`]: { + fontSize: 'inherit', + fontWeight: 'inherit', + lineHeight: 'inherit', + padding: 0, + }, + '&:hover': { backgroundColor: 'transparent' }, + }), }; }); -const renderOption = (model: ModelInfo, selected?: boolean): ReactNode => ( +const ModelSelectOption = styled(MenuItem)(({ theme }) => ({ + height: '3.25rem', + gap: theme.spacing(1), + borderRadius: 10, +})); + +const ValueRow = styled(Stack)(({ theme }) => ({ + flexDirection: 'row', + alignItems: 'center', + gap: theme.spacing(1), + padding: theme.spacing(1), + '&:hover': { backgroundColor: 'transparent' }, + pointerEvents: 'none', +})); + +const ModelLogo = styled('img')(({ theme }) => ({ + width: '2.25rem', + height: '2.25rem', + borderRadius: '0.5rem', + border: `1px solid ${theme.palette.divider}`, + objectFit: 'cover', +})); + +const ModelDisplayName = styled('span')(({ theme }) => ({ + ...theme.typography.subtitle2, + fontSize: '0.875rem', + lineHeight: '1.125rem', + fontWeight: theme.typography.fontWeightLight, + color: theme.palette.text.primary, +})); + +const ModelName = styled('span')(({ theme }) => ({ + ...theme.typography.body2, + fontSize: '0.75rem', + lineHeight: '1rem', + fontWeight: theme.typography.fontWeightLight, + color: theme.palette.text.secondary, +})); + +const renderOption = (model: ModelInfo): ReactNode => ( @@ -57,19 +94,69 @@ const renderOption = (model: ModelInfo, selected?: boolean): ReactNode => ( ); -export const ModelSelect = () => { - const [{ modelName, modelInfoList }, { setModelName }] = useCluster(); +export interface ModelSelectProps { + variant?: 'outlined' | 'text'; +} + +export const ModelSelect: FC = ({ variant = 'outlined' }) => { + const [ + { + modelName, + modelInfoList, + clusterInfo: { status: clusterStatus }, + }, + { setModelName }, + ] = useCluster(); + + const [nodeDialog, { open: openDialog }] = useAlertDialog({ + titleIcon: , + title: 'Switch model', + content: ( + + The current version of parallax only supports hosting one model at once. Switching the model + will terminate your existing chat service. You can restart the current scheduler in your + terminal. We will add node rebalancing and dynamic model allocation soon. + + ), + confirmLabel: 'Continue', + }); + + const onChange = useRefCallback((e) => { + if (clusterStatus !== 'idle') { + openDialog(); + return; + } + setModelName(String(e.target.value)); + }); return ( - setModelName(String(e.target.value))} - renderValue={(value) => { - const model = modelInfoList.find((model) => model.name === value); - return (model && renderOption(model)) || undefined; - }} - > - {modelInfoList.map((model) => renderOption(model, model.name === modelName))} - + <> + : } + value={modelName} + onChange={onChange} + renderValue={(value) => { + const model = modelInfoList.find((m) => m.name === value); + if (!model) return undefined; + + return variant === 'outlined' ? ( + + + + {model.displayName} + {model.name} + + + ) : ( + model.name + ); + }} + > + {modelInfoList.map((model) => renderOption(model))} + + + {nodeDialog} + ); }; diff --git a/src/frontend/src/components/inputs/node-list.tsx b/src/frontend/src/components/inputs/node-list.tsx index 37e08901..f95b82f5 100644 --- a/src/frontend/src/components/inputs/node-list.tsx +++ b/src/frontend/src/components/inputs/node-list.tsx @@ -40,7 +40,7 @@ const NodeListRoot = styled(Stack)(({ theme }) => { const List = styled(MuiList)<{ variant: NodeListVariant }>(({ theme, variant }) => { const { spacing } = theme; return { - gap: spacing(variant === 'list' ? 1.5 : 5.5), + gap: spacing(variant === 'list' ? 1.5 : 3.5), overflowY: 'auto', }; }); @@ -149,8 +149,8 @@ const Node: FC<{ variant: NodeListVariant; node?: NodeInfo }> = ({ variant, node })} variant={variant} > - {variant === 'list' && } - {variant === 'menu' && } + {variant === 'list' && } + {variant === 'menu' && } )} @@ -182,9 +182,9 @@ export const NodeList: FC = ({ variant = 'list' }) => { position: 'absolute', top: '1.375rem', bottom: '1.375rem', - left: '1.375rem', - borderLeft: '2px dashed', - borderColor: 'divider', + left: '0.75rem', + borderLeft: '1px dashed', + borderColor: '#9B9B9BFF', }} /> )} diff --git a/src/frontend/src/components/inputs/number-input.tsx b/src/frontend/src/components/inputs/number-input.tsx index b2e832fa..836e7cfc 100644 --- a/src/frontend/src/components/inputs/number-input.tsx +++ b/src/frontend/src/components/inputs/number-input.tsx @@ -27,7 +27,7 @@ export const NumberInput: FC = ({ const onChange = useRefCallback>( (event) => { - event.target.value = `${Math.max(0, parseInt(event.target.value) || 0)}`; + event.target.value = `${Math.max(1, parseInt(event.target.value) || 1)}`; onChangeProp?.(event); }, ); @@ -55,7 +55,7 @@ export const NumberInput: FC = ({ return; } const prev = Number(input.value); - const next = Math.max(0, prev - 1); + const next = Math.max(1, prev - 1); input.value = next.toString(); triggerChange(next); }); @@ -66,7 +66,7 @@ export const NumberInput: FC = ({ return; } const prev = Number(input.value); - const next = Math.max(0, prev + 1); + const next = Math.max(1, prev + 1); input.value = next.toString(); triggerChange(next); }); @@ -75,6 +75,12 @@ export const NumberInput: FC = ({ // @@ -109,7 +115,7 @@ export const NumberInput: FC = ({ input: { step: 1, sx: { textAlign: 'center', ...slotProps?.input?.sx }, - min: 0, + min: 1, ...slotProps?.input, }, ...slotProps, diff --git a/src/frontend/src/components/mui/dialog/alert-dialog.tsx b/src/frontend/src/components/mui/dialog/alert-dialog.tsx index 1fe243d9..5e34c1d8 100644 --- a/src/frontend/src/components/mui/dialog/alert-dialog.tsx +++ b/src/frontend/src/components/mui/dialog/alert-dialog.tsx @@ -337,6 +337,13 @@ export const AlertDialog: FC = (props) => { {...rest} component={(formProps && 'form') || undefined} {...(formProps as any)} + slotProps={{ + paper: { + sx: { + p: 1.5, + }, + }, + }} > {(titleIcon === 'form' && ) @@ -360,7 +367,7 @@ export const AlertDialog: FC = (props) => { {titleIcon && ( - + {title} )} @@ -370,7 +377,7 @@ export const AlertDialog: FC = (props) => { {actionButtonPropsList.length > 0 && ( - {secondaryAction} + {secondaryAction} {actionButtonPropsList.map((props) => ( - + ); diff --git a/src/frontend/src/router/index.tsx b/src/frontend/src/router/index.tsx index f8d03ce0..668be889 100644 --- a/src/frontend/src/router/index.tsx +++ b/src/frontend/src/router/index.tsx @@ -26,8 +26,12 @@ export const Router = () => { ] = useCluster(); useEffect(() => { + if (pathname === '/') { + navigate(PATH_SETUP); + return; + } debugLog('pathname', pathname, 'cluster status', status); - if (status === 'idle' && !pathname.startsWith(PATH_SETUP)) { + if (status === 'idle' && pathname.startsWith(PATH_CHAT)) { debugLog('navigate to /setup'); navigate(PATH_SETUP); return; diff --git a/src/frontend/src/services/api.ts b/src/frontend/src/services/api.ts index c9ce7dfe..c215739c 100644 --- a/src/frontend/src/services/api.ts +++ b/src/frontend/src/services/api.ts @@ -3,19 +3,12 @@ import { createHttpStreamFactory } from './http-stream'; export const API_BASE_URL = import.meta.env.DEV ? '/proxy-api' : ''; export const getModelList = async (): Promise => { - while (true) { - try { - const response = await fetch(`${API_BASE_URL}/model/list`, { method: 'GET' }); - const message = await response.json(); - if (message.type !== 'model_list') { - throw new Error(`Invalid message type: ${message.type}.`); - } - return message.data; - } catch (error) { - console.error('getModelList error', error); - await new Promise((resolve) => setTimeout(resolve, 2000)); - } + const response = await fetch(`${API_BASE_URL}/model/list`, { method: 'GET' }); + const message = await response.json(); + if (message.type !== 'model_list') { + throw new Error(`Invalid message type: ${message.type}.`); } + return message.data; }; export const initScheduler = async (params: { diff --git a/src/frontend/src/services/cluster.tsx b/src/frontend/src/services/cluster.tsx index 695a0050..54205a4d 100644 --- a/src/frontend/src/services/cluster.tsx +++ b/src/frontend/src/services/cluster.tsx @@ -92,17 +92,36 @@ export const ClusterProvider: FC = ({ children }) => { // Model List const [modelInfoList, setModelInfoList] = useState([]); + + const updateModelList = useRefCallback(async () => { + let succeed = false; + while (!succeed) { + try { + const rawList = await getModelList(); + setModelInfoList((prev) => { + const next = rawList.map((name) => ({ + name, + displayName: name, + logoUrl: getLogoUrl(name), + })); + if (JSON.stringify(next) !== JSON.stringify(prev)) { + debugLog('setModelInfoList', next); + return next; + } + return prev; + }); + succeed = true; + } catch (error) { + console.error('getModelList error', error); + await new Promise((resolve) => setTimeout(resolve, 2000)); + } + } + }); + useEffect(() => { - getModelList().then((modelList) => { - setModelInfoList( - modelList.map((name) => ({ - name, - displayName: name, - logoUrl: getLogoUrl(name), - })), - ); - }); + updateModelList(); }, []); + useEffect(() => { if (modelInfoList.length) { setModelName(modelInfoList[0].name); diff --git a/src/frontend/src/themes/components/feedback/dialog.ts b/src/frontend/src/themes/components/feedback/dialog.ts index cb8b96c4..7130c422 100644 --- a/src/frontend/src/themes/components/feedback/dialog.ts +++ b/src/frontend/src/themes/components/feedback/dialog.ts @@ -13,7 +13,7 @@ export const MuiDialogActions = (theme: Theme): Components['MuiDialogActi { props: ({ ownerState }) => !ownerState.disableSpacing, style: { - gap: '0.75rem', + // gap: '0.75rem', '& > :not(style) ~ :not(style)': { marginLeft: 0, },