import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{$ as t,Q as n,c as r,u as i}from"./vendor-primevue-BHB_Hohg.js";import{A as a,D as o,F as s,I as c,It as l,O as u,R as d,Rt as f,S as p,Vt as m,c as h,et as g,gt as _,j as v,k as y,nt as b}from"./vendor-vue-core-CvBSzfTV.js";import"./vendor-other-D5NZnOmc.js";import{n as x,t as S}from"./types-Bc3W4AWd.js";import"./api-C1SMJ7fh.js";import"./vendor-markdown-U30xfsVK.js";import"./colorUtil-DSsa6gcB.js";import"./i18n-Bq6rCqd1.js";import{a as C,n as w,t as T,u as E}from"./systemStatsStore-TQf8k8as.js";import{t as D}from"./envUtil-c_x69BfZ.js";import{t as O}from"./useExternalLink-CmysxC91.js";var k={class:`grid grid-cols-2 gap-2`},A={class:`font-medium`},j=d({__name:`DeviceInfo`,props:{device:{}},setup(e){let t=e,n=[{field:`name`,header:`Name`},{field:`type`,header:`Type`},{field:`vram_total`,header:`VRAM Total`},{field:`vram_free`,header:`VRAM Free`},{field:`torch_vram_total`,header:`Torch VRAM Total`},{field:`torch_vram_free`,header:`Torch VRAM Free`}],formatValue=(e,t)=>{if([`vram_total`,`vram_free`,`torch_vram_total`,`torch_vram_free`].includes(t)){let t=Number(e);return Number.isFinite(t)?E(t):e}return e};return(e,r)=>(g(),v(`div`,k,[(g(),v(p,null,b(n,e=>(g(),v(p,{key:e.field},[u(`div`,A,m(e.header),1),u(`div`,null,m(formatValue(t.device[e.field],e.field)),1)],64))),64))]))}}),M={class:`system-stats`},N={class:`mb-6`},P={class:`mb-4 text-2xl font-semibold`},F={class:`grid grid-cols-2 gap-2`},I={class:`font-medium`},L={class:`mb-4 text-2xl font-semibold`},R=d({__name:`SystemStatsPanel`,props:{stats:{}},setup(e){let n=e,s=o(()=>({...n.stats.system,argv:n.stats.system.argv.join(` `)})),d=o(()=>n.stats.devices.length>0),f=[{field:`os`,header:`OS`},{field:`python_version`,header:`Python Version`},{field:`embedded_python`,header:`Embedded Python`},{field:`pytorch_version`,header:`Pytorch Version`},{field:`argv`,header:`Arguments`},{field:`ram_total`,header:`RAM Total`,formatNumber:E},{field:`ram_free`,header:`RAM Free`,formatNumber:E}],h=[{field:`cloud_version`,header:`Cloud Version`},{field:`comfyui_version`,header:`ComfyUI Version`,format:C},{field:`comfyui_frontend_version`,header:`Frontend Version`,format:C},{field:`workflow_templates_version`,header:`Templates Version`}],x=o(()=>S?h:f),getDisplayValue=e=>{let t=s.value[e.field];return e.formatNumber&&typeof t==`number`?e.formatNumber(t):e.format&&typeof t==`string`?e.format(t):t};return(e,o)=>(g(),v(`div`,M,[u(`div`,N,[u(`h2`,P,m(e.$t(`g.systemInfo`)),1),u(`div`,F,[(g(!0),v(p,null,b(x.value,e=>(g(),v(p,{key:e.field},[u(`div`,I,m(e.header),1),u(`div`,null,m(getDisplayValue(e)),1)],64))),128))])]),d.value?(g(),v(p,{key:0},[c(l(t)),u(`div`,null,[u(`h2`,L,m(e.$t(`g.devices`)),1),n.stats.devices.length>1?(g(),y(l(r),{key:0},{default:_(()=>[(g(!0),v(p,null,b(n.stats.devices,e=>(g(),y(l(i),{key:e.index,header:e.name,value:e.index},{default:_(()=>[c(j,{device:e},null,8,[`device`])]),_:2},1032,[`header`,`value`]))),128))]),_:1})):(g(),y(j,{key:1,device:n.stats.devices[0]},null,8,[`device`]))])],64)):a(``,!0)]))}});const z=h(`aboutPanel`,()=>{let e=w(),t=T(),{staticUrls:n}=O(),r=o(()=>t?.systemStats?.system?.comfyui_version??``),i=o(()=>[{label:`ComfyUI ${x?`v`+D().getComfyUIVersion():C(r.value)}`,url:S?n.comfyOrg:n.github,icon:S?`pi pi-cloud`:`pi pi-github`},{label:`ComfyUI_frontend v1.40.8`,url:n.githubFrontend,icon:`pi pi-github`},{label:`Discord`,url:n.discord,icon:`pi pi-discord`},{label:`ComfyOrg`,url:n.comfyOrg,icon:`pi pi-globe`}]);return{badges:o(()=>[...i.value,...e.extensions.flatMap(e=>e.aboutPageBadges??[])])}});var B={class:`about-container flex flex-col gap-2`,"data-testid":`about-panel`},V={class:`mb-2 text-2xl font-bold`},H={class:`space-y-2`},U=[`href`,`title`],W=d({__name:`AboutPanel`,setup(e){let r=T(),i=z();return(e,o)=>(g(),v(`div`,B,[u(`h2`,V,m(e.$t(`g.about`)),1),u(`div`,H,[(g(!0),v(p,null,b(l(i).badges,e=>(g(),v(`a`,{key:e.url,href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`about-badge inline-flex items-center no-underline`,title:e.url},[c(l(n),{class:`mr-2`},{icon:_(()=>[u(`i`,{class:f([e.icon,`mr-2 text-xl`])},null,2)]),default:_(()=>[s(` `+m(e.label),1)]),_:2},1024)],8,U))),128))]),c(l(t)),l(r).systemStats?(g(),y(R,{key:0,stats:l(r).systemStats},null,8,[`stats`])):a(``,!0)]))}});export{W as default};
//# sourceMappingURL=AboutPanel-PmrNZh8W.js.map