import{c2 as U,ex as R,j as s}from"./app-BgLa5dit.js";import{D as W}from"./C4BcftDO.chunk.js";import{C as N}from"./CiR1qo7K.chunk.js";const G=R.Libraries.TWIG,L=R.Libraries.TIGTAG,a=[{value:"-"}];function D(u){var x,j,P,f,C,w,_,T,y,I;const{cftData:e,cftDisplayName:t,enabledPresentations:o=[],enabledCurriculums:d=[],enabledProducts:S=[],enabledLibraries:v=[],isUs:A,isEu:E,controlExchangeTv:k}=u,F=((x=e==null?void 0:e.subjectPresentations)==null?void 0:x.filter(l=>o.includes(l.id.toString())&&l.optional).map(l=>({value:l.name,badge:l.enabled?void 0:"custom"})))??[],g=[...((j=e==null?void 0:e.subjectPresentations)==null?void 0:j.filter(l=>!l.optional).map(l=>({value:l.name})))??[],...F],V=((P=e==null?void 0:e.curriculumPresentations)==null?void 0:P.filter(l=>d.includes(l.id.toString())&&l.optional).map(l=>({value:l.name,badge:"custom"})))??[],n=[...((f=e==null?void 0:e.curriculumPresentations)==null?void 0:f.filter(l=>!l.optional).map(l=>({value:l.name})))??[],...V],Y=((C=e==null?void 0:e.products)==null?void 0:C.filter(l=>S.includes(l.id.toString())&&l.optional).map(l=>{const $=l.id.toLowerCase()===U.Exchange&&!k;return{value:l.name,badge:$?void 0:"custom"}}))??[],h=[...((w=e==null?void 0:e.products)==null?void 0:w.filter(l=>!l.optional).map(l=>({value:l.name})))??[],...Y],B=v.includes(G),O=v.includes(L),c=(_=e==null?void 0:e.libraries)==null?void 0:_.find(l=>l.id.toString()===G),m=(T=e==null?void 0:e.libraries)==null?void 0:T.find(l=>l.id.toString()===L),p=[...B?[{value:"Twig",badge:c!=null&&c.optional?"custom":void 0}]:[],...O?[{value:"TigTag",badge:m!=null&&m.optional?"custom":void 0}]:[]],i=((y=e==null?void 0:e.yearGroups)==null?void 0:y.map(l=>({value:l.name})))??[],r=[{label:"CFT",value:{value:t||"-"}},{label:"Products",value:h.length?h:a},{label:"Presentations",value:g.length?g:a}];return(I=e==null?void 0:e.sharedLibraries)!=null&&I.length&&r.push({label:"Shared libraries",value:e.sharedLibraries.map(l=>({value:l.name}))}),A?r.push({label:"Grade level",value:i.length?i:a},{label:"Standard",value:n.length?n:a}):E?r.push({label:"Year group",value:i.length?i:a},{label:"Curriculum",value:n.length?n:a}):r.push({label:"Curriculum",value:n.length?n:a},{label:"Year level",value:i.length?i:a}),p.length&&r.push({label:"Features",value:p}),r}const H="_label_1c7dk_1",M="_value_1c7dk_4",q="_listValue_1c7dk_7",b={label:H,value:M,listValue:q};function ee(u){return u.items.length?s.jsx(W,{heading:u.heading,children:s.jsx("div",{className:`p-3 ${b.value}`,children:u.items.map((e,t)=>s.jsxs("div",{className:"mb-2 d-flex flex-nowrap align-items-center",children:[s.jsx("span",{className:`${b.label} d-inline-block fw-semibold me-3 flex-shrink-0 align-self-start`,children:e.label}),Array.isArray(e.value)?s.jsx("div",{className:"w-100",children:e.value.map((o,d)=>s.jsxs("div",{className:`d-flex justify-content-space-between align-items-center w-100 mb-1 ${b.listValue}`,children:[s.jsx("div",{className:"mb-2 flex-grow-1",children:o.value}),s.jsx("div",{className:"flex-grow-0",children:o.badge&&s.jsx(N,{type:o.badge})})]},d))}):s.jsxs("div",{className:"d-flex justify-content-space-between align-items-center w-100",children:[s.jsx("div",{className:"mb-2",children:e.value.value??"-"}),s.jsx("div",{children:e.value.badge&&s.jsx(N,{type:e.value.badge})})]})]},t))})}):s.jsx(s.Fragment,{})}export{ee as C,D as b};
//# sourceMappingURL=OEx2ZWBS.chunk.js.map
