import{o as C,w as Q,O as f,L as t,J as a,N as o,F as u,G as n,P as q,R as m,S as g,r as v,b as B,T as D,I as i,X as P,U as N,M as l,K as b,Q as y}from"./index-iCRehgtD.js";import{u as O,Q as _}from"./useSetupWs-P74ozpSr.js";import{u as V}from"./setup-B2WhYkmc.js";const M={key:0,class:"row items-center q-gutter-sm q-mb-lg"},R={class:"row q-gutter-md"},T={class:"col"},E={class:"text-body1"},L={class:"col"},U={class:"text-body1"},j={class:"col"},z={class:"text-body1"},A={class:"col"},F={class:"text-body1"},G={class:"row justify-between"},Y={__name:"OsDetectionPage",setup(J){const p=D(),s=V(),{send:x,messages:w}=O(),d=v(!0),c=v(""),k=["ubuntu","debian","centos","rhel","almalinux","alma","rocky","openela","ol","oracle","fedora","opensuse","sles"],I=B(()=>s.osInfo?k.some(r=>{var e;return(e=s.osInfo.distro)==null?void 0:e.toLowerCase().includes(r)}):!1);C(()=>{x({action:"detect_os"}),Q(w,r=>{const e=r[r.length-1];e&&(e.type==="os_info"?(s.osInfo=e,d.value=!1):e.type==="error"&&(c.value=e.message,d.value=!1))},{deep:!0})});function S(){s.prevStep(),p.push("/welcome")}function h(){s.nextStep(),p.push("/repo")}return(r,e)=>(i(),f("div",null,[e[6]||(e[6]=t("div",{class:"step-header"},"OS Detection",-1)),e[7]||(e[7]=t("p",{class:"text-body2 q-mb-md"}," Detecting your operating system and package manager. ",-1)),d.value?(i(),f("div",M,[a(P,{color:"primary",size:"24px"}),e[0]||(e[0]=t("span",null,"Detecting…",-1))])):o(s).osInfo?(i(),u(q,{key:1,flat:"",bordered:"",class:"q-mb-lg"},{default:n(()=>[a(N,null,{default:n(()=>[t("div",R,[t("div",T,[e[1]||(e[1]=t("div",{class:"text-caption text-grey"},"Distribution",-1)),t("div",E,l(o(s).osInfo.pretty_name||o(s).osInfo.distro),1)]),t("div",L,[e[2]||(e[2]=t("div",{class:"text-caption text-grey"},"Version",-1)),t("div",U,l(o(s).osInfo.version),1)]),t("div",j,[e[3]||(e[3]=t("div",{class:"text-caption text-grey"},"Architecture",-1)),t("div",z,l(o(s).osInfo.arch),1)]),t("div",A,[e[4]||(e[4]=t("div",{class:"text-caption text-grey"},"Package Manager",-1)),t("div",F,l(o(s).osInfo.pkg_mgr),1)])])]),_:1})]),_:1})):c.value?(i(),u(_,{key:2,class:"bg-negative text-white q-mb-lg",rounded:""},{avatar:n(()=>[a(y,{name:"error"})]),default:n(()=>[b(" "+l(c.value),1)]),_:1})):m("",!0),o(s).osInfo&&!I.value?(i(),u(_,{key:3,class:"bg-warning text-white q-mb-lg",rounded:""},{avatar:n(()=>[a(y,{name:"warning"})]),default:n(()=>[e[5]||(e[5]=b(" Your OS may not be fully supported. Proceed with caution. ",-1))]),_:1})):m("",!0),t("div",G,[a(g,{flat:"",label:"Back",icon:"arrow_back",onClick:S}),a(g,{label:"Continue",color:"primary","icon-right":"arrow_forward",disable:!o(s).osInfo,onClick:h},null,8,["disable"])])]))}};export{Y as default};
