"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),s=require("../../src/modules/ThreeItemsPlainCarousel/threeItemsPlainCarousel.module.css"),j=require("../../utils/cn/cn.cjs.js"),a=require("../../components/Typography/Typography.cjs.js"),g=require("../../components/ProgressButton/ProgressButton.cjs.js"),p=3,x=({title:b,cards:d})=>{const[l,u]=c.useState(0),i=c.useMemo(()=>d.slice(0,p),[d]),y=c.useMemo(()=>i.length===0?[]:[...i,...i].slice(l,l+p),[i,l]),o=i.length,n=o>1,m=()=>{n&&u(t=>t===0?o-1:t-1)},h=()=>{n&&u(t=>t===o-1?0:t+1)};return e.jsxs("section",{className:s.root,children:[e.jsxs("div",{className:s.topContainer,children:[e.jsx(a.Typography,{defaultVariant:"displayMd",mobileVariant:"headingXl",className:s.title,children:b}),e.jsx("div",{className:s.topButton,children:e.jsx(g.ProgressButton,{left:{disabled:!n,onClick:m},right:{disabled:!n,onClick:h}})})]}),e.jsx("div",{className:s.bottomContainer,children:e.jsx(e.Fragment,{children:y.map((t,r)=>e.jsxs("div",{className:j.cn({[s.mainCard]:r===0,[s.minorCard]:r!==0}),children:[e.jsx("img",{src:t.image,alt:t.title}),e.jsxs("div",{className:s.cardContent,children:[e.jsx(a.Typography,{defaultVariant:"headingMd",mobileVariant:"headingXs",children:t.title}),t.subtitle&&e.jsx(a.Typography,{defaultVariant:"labelLg",mobileVariant:"labelSm",className:s.subtitle,children:t.subtitle})]}),t.description&&r===0&&e.jsx(a.Typography,{defaultVariant:"bodyLg",mobileVariant:"bodySm",className:s.descriptionText,children:t.description})]},`${t.title}-${r}`))})}),e.jsx("div",{className:s.bottomButton,children:e.jsx(g.ProgressButton,{left:{disabled:!n,onClick:m},right:{disabled:!n,onClick:h}})})]})};exports.ThreeItemsPlainCarousel=x;
