import{aw as g,j as a,bE as b}from"./app-BgLa5dit.js";import{D as f}from"./C4BcftDO.chunk.js";function S(s){const e=g();function l(){e.values.hasCustomisations||e.setFieldValue("hasCustomisations",!0)}function o(n,r){l();const i=s.data.subjectPresentations.find(t=>t.id===n);i&&(r===!0?e.setFieldValue("enabledPresentations",[...e.values.enabledPresentations||[],i.id.toString()]):e.setFieldValue("enabledPresentations",(e.values.enabledPresentations||[]).filter(t=>t.toString()!==n.toString())))}function u(n,r){l();const i=s.data.curriculumPresentations.find(t=>t.id===n);i&&(r===!0?e.setFieldValue("enabledCurriculums",[...e.values.enabledCurriculums||[],i.id.toString()]):e.setFieldValue("enabledCurriculums",(e.values.enabledCurriculums||[]).filter(t=>t.toString()!==n.toString())))}function d(n,r){l();const i=s.data.products.find(t=>t.id===n);i&&(r===!0?e.setFieldValue("enabledProducts",[...e.values.enabledProducts||[],i.id.toString()]):e.setFieldValue("enabledProducts",(e.values.enabledProducts||[]).filter(t=>t.toString()!==n.toString())))}function c(n,r){l();const i=s.data.libraries.find(t=>t.id.toString()===n.toString());i&&(r===!0?e.setFieldValue("enabledLibraries",[...e.values.enabledLibraries||[],i.id.toString()]):e.setFieldValue("enabledLibraries",(e.values.enabledLibraries||[]).filter(t=>t.toString()!==n.toString())))}return{onTogglePresentation:o,onToggleCurriculum:u,onToggleProduct:d,onToggleFeature:c}}function v(s){return s.items.length?a.jsx(f,{heading:s.heading,children:s.items.map((e,l)=>a.jsxs("div",{className:"d-flex justify-content-between p-3",children:[a.jsx("div",{children:e.name}),a.jsx("div",{children:a.jsx(b,{disabled:e.disabled,tooltipText:e.disabledTooltip,on:e.value,onClick:()=>s.onChange(e.id,!e.value)})})]},l))}):a.jsx(a.Fragment,{})}export{v as C,S as u};
//# sourceMappingURL=C5-i-ZL0.chunk.js.map
