import{r as S,bg as E,E as C,j as t,d as P}from"./index-BGoV7aa6.js";import{a as f,p as w}from"./searchAndFilter-D-1yh9aE.js";const v=["Container","VM","Image","Custom"],x="query",o="pool",c="volume-type",i="content-type",l="member",r=[x,o,c,i,l],T=["Block","Filesystem","ISO"],y=({volumes:s})=>{const[a,m]=E(),p=C(),h=[...new Set(s.map(e=>e.pool))],d=[...new Set(s.flatMap(e=>e.location).filter(e=>e.length>0&&e!=="none"))],u=[{id:1,heading:"Pool",chips:h.map(e=>({lead:o,value:e}))},{id:2,heading:"Volume type",chips:v.map(e=>({lead:c,value:e}))},{id:3,heading:"Content type",chips:T.map(e=>({lead:i,value:e}))},...p?[{id:4,heading:"Cluster member",chips:["Cluster-wide"].concat(d).map(e=>({lead:l,value:e}))}]:[]],g=e=>{const n=w(e,a,r);n.toString()!==a.toString()&&m(n)};return t.jsxs("div",{className:"search-wrapper margin-right",children:[t.jsx("h2",{className:"u-off-screen",children:"Search and filter"}),t.jsx(P.SearchAndFilter,{existingSearchData:f(a,r),filterPanelData:u,returnSearchData:g,onExpandChange:()=>{window.dispatchEvent(new CustomEvent("resize",{detail:"search-and-filter"}))},onPanelToggle:()=>{window.dispatchEvent(new CustomEvent("sfp-toggle"))}})]})},M=S.memo(y);export{l as C,o as P,x as Q,M as S,c as V,i as a};
