import{j as s,Q as a,al as S,H as C,dK as k,be as I,x as h,u as f,a as w,r as b,c as T,b as g,dE as B,o as m,cs as H,b1 as M,dL as N,dM as v,dN as D}from"./index-ea7817a2.js";import{D as E,u as A}from"./Deprecated-9bfe2e44.js";import{F}from"./FeatureGroupTypeBadge-0e65ce60.js";const G={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"}}}})},z=({children:e,highlights:o,isSelected:t=!1,isLocked:r=!1,onClick:n})=>s.jsxs(a,{flexDirection:"column",sx:G.wrapper(t,r),onClick:n,children:[e,o&&!S(o)&&s.jsx(a,{flexDirection:"column",sx:d.container,children:Object.entries(o).map(([p,l])=>{const i=C(y,k(l),W);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}}),P=({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(h,{children:[t,":"]}),s.jsx(a,{sx:d.highlights,dangerouslySetInnerHTML:{__html:r}})]},t)))}),W={String:y,Array:P},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"}}},_=({value:{data:e,hasMatchText:o}})=>{const{id:t}=f(),{data:r}=w(),n=r==null?void 0:r.map(({projectId:i})=>i),p=b.useMemo(()=>T(g.featureGroup.overview,g.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})]})},R=({value:e})=>s.jsx(a,{pl:"5px",children:s.jsx(F,{type:e.type,onlineEnabled:e.onlineEnabled})}),U=({value:e})=>s.jsx(m,{width:"32px",children:s.jsx(H,{firstName:e.firstName,lastName:e.lastName})}),$=({value:e})=>s.jsx(h,{bold:e.bold,gray:e.gray,children:e.title}),q=({value:e,boxProps:o})=>{const{id:t}=f(),r=M(),{isActiveFg:n,handleBasket:p}=A(),[l,i]=b.useState(void 0),j=async()=>{var u;const c=await r(D.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(N,{handleClick:j,mode:v.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,_ as N,R as T,U,z as W,$ as a,G as s};
