import{bn as c,Y as l}from"./index-3c1b2661.js";const d=(r,i,s,o)=>{if(Object.prototype.hasOwnProperty.call(r,"profiles")){const n=[...r.profiles].reverse();for(const e of n){const t=s.find(p=>p.name===e);if(t!=null&&t.config[i])return[t.config[i],`${e} profile`]}}return i==="limits.cpu"&&r.type==="instance"?r.instanceType==="container"?["-","LXD (container)"]:["1","LXD (VM)"]:i==="limits.memory"&&r.type==="instance"?r.instanceType==="container"?["-","LXD (container)"]:["1GB","LXD (VM)"]:[o&&o.length>0?o:"-","LXD"]},u=(r,i)=>{if(Object.prototype.hasOwnProperty.call(r,"profiles")){const s=[...r.profiles].reverse();for(const o of s){const f=i.find(e=>e.name===o);if(!f)continue;const n=Object.values(f.devices).filter(c).find(e=>e.path==="/");if(n)return[n,`${o} profile`]}}return[null,"LXD"]},m=(r,i)=>{const s=[];if(Object.prototype.hasOwnProperty.call(r,"profiles")){const o=[...r.profiles].reverse();for(const f of o){const n=i.find(e=>e.name===f);n&&Object.entries(n.devices).filter(([e,t])=>c(t)&&e!=="root").map(([e,t])=>{s.push({key:e,disk:t,source:`${f} profile`})})}}return s},h=(r,i)=>{const s=[];if(Object.prototype.hasOwnProperty.call(r,"profiles")){const o=[...r.profiles].reverse();for(const f of o){const n=i.find(e=>e.name===f);n&&Object.entries(n.devices).filter(([e,t])=>l(t)).map(([e,t])=>{s.push({key:e,network:t,source:`${f} profile`})})}}return s};export{m as a,h as b,d as c,u as f};
