import{j as s,$ as a,h as C,B as S,em as k,b8 as I,c as g,u as b,a as w,r as f,o as T,q as h,s as B,L as m,cB as D,bH as H,en as v,eo as M,ep as N}from"./index-46ma1THH.js";import{D as E,u as F}from"./Deprecated-CcWZugSq.js";import{F as L}from"./FeatureGroupTypeBadge-DK0B-B3q.js";const P={wrapper:(e,o,t)=>({transition:"all 0.2s linear",color:"primary",cursor:"pointer",...o&&{cursor:"default"},...e&&{boxShadow:"0px 0px 2px 2px"},"&:hover":{boxShadow:"0px 0px 0 2px"},...t&&{bg:"primaryShade1",border:"1px solid",borderColor:"var(--quartz-colors-labels-orange-_light)",div:{bg:"grayShade2",color:"gray",button:{color:"grayShade1"}}}})},$=({children:e,highlights:o,isSelected:t=!1,isLocked:r=!1,onClick:n})=>s.jsxs(a,{flexDirection:"column",sx:P.wrapper(t,r),onClick:n,children:[e,o&&!C(o)&&s.jsx(a,{flexDirection:"column",sx:d.container,children:Object.entries(o).map(([p,l])=>{const i=S(y,k(l),A);return s.jsxs(a,{sx:{gap:"10px"},children:[s.jsx(I,{sx:d.title,value:p}),s.jsx(i,{value:l})]})})})]}),y=({value:e})=>s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:e}}),W=({value:e})=>s.jsx(a,{flexDirection:"column",sx:{gap:"5px"},children:e.map(o=>Object.entries(o).map(([t,r])=>s.jsxs(a,{children:[s.jsxs(g,{children:[t,":"]}),s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:r}})]},t)))}),A={String:y,Array:W},d={container:{bg:"white",borderTopWidth:"2px",borderTopStyle:"solid",borderTopColor:"labels.yellow",gap:"10px",p:"7px",fontFamily:"Inter"},title:{borderWidth:"1px",borderStyle:"solid",borderColor:"labels.yellow",backgroundColor:"labels.yellowShade2"},highlights:{color:"black",fontSize:"12px","> em":{color:"#272727",fontWeight:600,px:"2px",mx:"2px",fontStyle:"normal",backgroundColor:"labels.yellow"}}},z=({value:{data:e,hasMatchText:o}})=>{const{id:t}=b(),{data:r}=w(),n=r==null?void 0:r.map(({projectId:i})=>i),p=f.useMemo(()=>T(h.project.featureGroup.overview,h.project.value,{id:t,fgId:e.id,fsId:e.featurestoreId}),[e.featurestoreId,e.id,t]),l=i=>i.stopPropagation();return s.jsxs(a,{children:[e.deprecated&&s.jsx(E,{mr:"5px"}),s.jsx(B,{onClick:l,href:p,fontSize:"12px",fontWeight:"bold",color:n!=null&&n.includes(e.parentProjectId)&&o?"gray":"black",sx:{textDecoration:"none"},children:e.name})]})},q=({value:e})=>s.jsx(a,{pl:"5px",children:s.jsx(L,{type:e.type,onlineEnabled:e.onlineEnabled})}),R=({value:e})=>s.jsx(m,{width:"32px",children:s.jsx(D,{firstName:e.firstName,lastName:e.lastName})}),U=({value:e})=>s.jsx(g,{bold:e.bold,gray:e.gray,children:e.title}),Q=({value:e,boxProps:o})=>{const{id:t}=b(),r=H(),{isActiveFg:n,handleBasket:p}=F(),[l,i]=f.useState(void 0),j=async()=>{var u;const c=await r(N.getFeatureGroupById.initiate({pId:+t,fsId:e.featurestoreId,fgId:e.id}));i(c.data),p(((u=c.data)==null?void 0:u.features)??[],c.data)()},x=n(e.id);return s.jsx(m,{onClick:c=>c.stopPropagation(),...o,children:s.jsx(v,{handleClick:j,mode:M.bulk,possible:!0,tooltipMainText:x?"Remove all features from basket":"Add all features to basket",tooltipSecondaryText:l?`${l.features.length} features`:"",inBasket:!!x})})};export{Q as B,z as N,q as T,R as U,$ as W,U as a,P as s};
