import{l as s,b_ as e,M as l,_ as a}from"./utils-lib.js?v=20260328163632";import{k as o,i as t,r,o as n,J as i,V as u,W as p,Z as c,Y as m}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const v=a(o({__name:"websoket-install",setup(a,{expose:o}){const v=t("popupClose",(()=>{})),_=r();let d=null;const b=r(""),f=async(s,e)=>{var a;if("token error"===e.data)return l.error("token error"),void(null==d||d.close());const o=JSON.parse(e.data);o.title&&(b.value=(b.value?b.value+"\n":"")+o.msg,(null==(a=_.value)?void 0:a.scrollHeight)>200&&(_.value.scrollTop=_.value.scrollHeight)),o.msg.includes("安装完成")&&(null==d||d.close(),setTimeout((()=>{v()}),500))},g=()=>{null==d||d.close()};return n((()=>{d=e({route:"/ws/install_plugin",onMessage:f})})),i(g),o({close:g}),(e,l)=>(u(),p("span",{ref_key:"installShow",ref:_,class:"install-show !h-full p-10px text-[12px] min-h-[220px]"},c(m(b)||m(s)("正在准备安装...")),513))}}),[["__scopeId","data-v-27e7ebc4"]]);export{v as default};
