import{j as s,q as r,h as C,E as S,el as T,b9 as k,c as h,u,b as I,r as b,t as w,x as m,y as M,an as v,ao as P,v as B,F as f,cP as D,bW as F,em as E,en as H,eo as N}from"./index-C6OVXshM.js";import{D as W,u as A}from"./Deprecated-C2s2xtW5.js";import{F as G}from"./FeatureGroupTypeBadge-gC-XAV-_.js";const z={wrapper:(e,t,o)=>({transition:"all 0.2s linear",color:"primary",cursor:"pointer",...t&&{cursor:"default"},...e&&{boxShadow:"0px 0px 2px 2px"},"&:hover":{boxShadow:"0px 0px 0 2px"},...o&&{bg:"primaryShade1",border:"1px solid",borderColor:"var(--quartz-colors-labels-orange-_light)",div:{bg:"grayShade2",color:"gray",button:{color:"grayShade1"}}}})},$=({children:e,highlights:t,isSelected:o=!1,isLocked:a=!1,onClick:l})=>s.jsxs(r,{flexDirection:"column",sx:z.wrapper(o,a),onClick:l,children:[e,t&&!C(t)&&s.jsx(r,{flexDirection:"column",sx:d.container,children:Object.entries(t).map(([c,i])=>{const n=S(y,T(i),O);return s.jsxs(r,{sx:{gap:"10px"},children:[s.jsx(k,{sx:d.title,value:c}),s.jsx(n,{value:i})]})})})]}),y=({value:e})=>s.jsx(r,{sx:d.highlights,dangerouslySetInnerHTML:{__html:e}}),L=({value:e})=>s.jsx(r,{flexDirection:"column",sx:{gap:"5px"},children:e.map(t=>Object.entries(t).map(([o,a])=>s.jsxs(r,{children:[s.jsxs(h,{children:[o,":"]}),s.jsx(r,{sx:d.highlights,dangerouslySetInnerHTML:{__html:a}})]},o)))}),O={String:y,Array:L},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:700,px:"2px",mx:"2px",fontStyle:"normal",backgroundColor:"labels.yellow"}}},U=({value:{data:e,hasMatchText:t}})=>{const{id:o}=u(),{data:a}=I(),l=a==null?void 0:a.map(({projectId:n})=>n),c=b.useMemo(()=>w(m.project.featureGroup.overview,m.project.value,{id:o,fgId:e.id,fsId:e.featurestoreId}),[e.featurestoreId,e.id,o]),i=n=>n.stopPropagation();return s.jsxs(r,{alignItems:"center",children:[e.deprecated&&s.jsx(W,{mr:"5px"}),s.jsx(M,{onClick:i,href:c,fontSize:"12px",fontWeight:"bold",color:l!=null&&l.includes(e.parentProjectId)&&t?"gray":"black",sx:{textDecoration:"none"},children:e.name}),e.missingMandatoryTags&&e.missingMandatoryTags.length>0&&s.jsx(v,{mainText:`Missing mandatory tags: ${e.missingMandatoryTags.map(n=>n.name).join(", ")}`,position:"right",children:s.jsx(r,{alignItems:"center",ml:"6px",children:s.jsx(P,{icon:B.warning,size:"sm",color:"labels.red"})})})]})},Q=({value:e})=>s.jsx(r,{pl:"5px",children:s.jsx(G,{type:e.type,onlineEnabled:e.onlineEnabled})}),Z=({value:e})=>s.jsx(f,{width:"32px",children:s.jsx(D,{firstName:e.firstName,lastName:e.lastName})}),J=({value:e})=>s.jsx(h,{bold:e.bold,gray:e.gray,children:e.title}),K=({value:e,boxProps:t})=>{const{id:o}=u(),a=F(),{isActiveFg:l,handleBasket:c}=A(),[i,n]=b.useState(void 0),j=async()=>{var g;const p=await a(N.getFeatureGroupById.initiate({pId:+o,fsId:e.featurestoreId,fgId:e.id}));n(p.data),c(((g=p.data)==null?void 0:g.features)??[],p.data)()},x=l(e.id);return s.jsx(f,{onClick:p=>p.stopPropagation(),...t,children:s.jsx(E,{handleClick:j,mode:H.bulk,possible:!0,tooltipMainText:x?"Remove all features from basket":"Add all features to basket",tooltipSecondaryText:i?`${i.features.length} features`:"",inBasket:!!x})})};export{K as B,U as N,Q as T,Z as U,$ as W,J as a,z as s};
