import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{X as t,c as n,f as r,l as i}from"./vendor-primevue-DxVRNMbC.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-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import{n as x,t as S}from"./types-DW97iHDr.js";import"./api-DQLKc1Xa.js";import"./vendor-markdown-Cola12Wc.js";import"./colorUtil-Cth7eqhK.js";import"./i18n-DjV_9lZM.js";import{a as C,n as w,t as T,u as E}from"./systemStatsStore-D9aNY5gT.js";import{t as D}from"./envUtil-CcEF5ALS.js";import{t as O}from"./useExternalLink-Cc30SNi3.js";import{t as k}from"./PanelTemplate-NIaSENoZ.js";var A={class:`grid grid-cols-2 gap-2`},j={class:`font-medium`},M=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`,A,[(g(),v(p,null,b(n,e=>(g(),v(p,{key:e.field},[u(`div`,j,m(e.header),1),u(`div`,null,m(formatValue(t.device[e.field],e.field)),1)],64))),64))]))}}),N={class:`system-stats`},P={class:`mb-6`},F={class:`mb-4 text-2xl font-semibold`},I={class:`grid grid-cols-2 gap-2`},L={class:`font-medium`},R={class:`mb-4 text-2xl font-semibold`},z=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`,N,[u(`div`,P,[u(`h2`,F,m(e.$t(`g.systemInfo`)),1),u(`div`,I,[(g(!0),v(p,null,b(x.value,e=>(g(),v(p,{key:e.field},[u(`div`,L,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`,R,m(e.$t(`g.devices`)),1),n.stats.devices.length>1?(g(),y(l(i),{key:0},{default:_(()=>[(g(!0),v(p,null,b(n.stats.devices,e=>(g(),y(l(r),{key:e.index,header:e.name,value:e.index},{default:_(()=>[c(M,{device:e},null,8,[`device`])]),_:2},1032,[`header`,`value`]))),128))]),_:1})):(g(),y(M,{key:1,device:n.stats.devices[0]},null,8,[`device`]))])],64)):a(``,!0)]))}});const B=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.39.16`,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 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=B();return(e,o)=>(g(),y(k,{value:`About`,class:`about-container`,"data-testid":`about-panel`},{default:_(()=>[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(z,{key:0,stats:l(r).systemStats},null,8,[`stats`])):a(``,!0)]),_:1}))}});export{W as default};
//# sourceMappingURL=AboutPanel-CTIdHiSm.js.map