import{j as S,o as c,b as r,C as u,d as I,l as L,m as w,z as M,Q as G,a as y,F as H,k as T,h as b,n as v,f as B,w as g,u as N,q as O,e as k,t as Y,c as p,i as j}from"./BTnWyqLY.js";import{u as z}from"./QavAs1Za.js";const V={},F={class:"h-card-grid-wrapper"};function W(e,h){return c(),r("div",F,[u(e.$slots,"card",{},void 0,!0)])}const E=S(V,[["render",W],["__scopeId","data-v-237a4ebf"]]),X=["id"],q={class:"h-card-grid-section-track__indicator-wrapper"},D=["onClick"],Q=I({__name:"HCardGridSectionTrack",props:{cards:{type:Object,default:null}},setup(e){const h=e,_=z(),s=L(0),m=w(()=>document.getElementById(`grid-track-${_}`)),d=(t,o,a,n)=>Math.abs(n-a)>Math.abs(70)||Math.abs(o-t)<Math.abs(35),C=t=>{var n,i,l;const o=((n=t.changedTouches[0])==null?void 0:n.clientX)||0,a=((i=t.changedTouches[0])==null?void 0:i.clientY)||0;(l=m.value)==null||l.addEventListener("touchend",f=>$(f,o,a),{once:!0,passive:!0})},$=(t,o,a)=>{var l,f;const n=((l=t.changedTouches[0])==null?void 0:l.clientX)||0,i=((f=t.changedTouches[0])==null?void 0:f.clientY)||0;d(o,n,a,i)||(o<n?s.value=s.value===0?h.cards.length-1:s.value-1:o>n&&(s.value=s.value===h.cards.length-1?0:s.value+1))};return M(()=>{var t;(t=m.value)==null||t.addEventListener("touchstart",C,{passive:!0})}),G(()=>{var t;(t=m.value)==null||t.removeEventListener("touchstart",C)}),(t,o)=>{const a=E;return c(),r("div",{id:`grid-track-${b(_)}`},[y("div",q,[(c(!0),r(H,null,T(e.cards,(n,i)=>(c(),r("span",{key:`${b(_)}-${i}`,class:v(["h-card-grid-section-track__indicator",{"h-card-grid-section-track__indicator--active":i===s.value}]),onClick:l=>s.value=i},null,10,D))),128))]),B(a,null,{card:g(()=>[u(t.$slots,"default",{item:e.cards[s.value]},void 0,!0)]),_:3})],8,X)}}}),U=S(Q,[["__scopeId","data-v-41f3432c"]]),x=["dir"],A={key:0,class:"h-card-grid-section__info"},J={key:1,class:"h-card-grid-section__info"},K=["innerHTML"],P={key:0,class:"h-card-grid-section__text"},R={key:2,class:"h-card-grid-section__cta"},Z=I({__name:"HCardGridSection",props:{data:{type:Object,default:null},customTitle:{type:String,default:""},numberOfCards:{type:Number,default:0},desktopColumns:{type:Number,default:3},tabletColumns:{type:Number,default:2},withTrack:{type:Boolean,default:!1},backgroundColor:{type:String,default:"neutral50"}},setup(e){const{direction:h}=N(),{t:_}=O(),s=e,m=w(()=>[`h-card-grid-section--bg-${s.backgroundColor}`,{"u-generic-color-section":s.backgroundColor==="light-blue50"}]);return(d,C)=>{const $=U,t=E,o=j;return c(),r("section",{class:v(["h-card-grid",{"h-card-grid-section--neutral800":e.backgroundColor==="neutral800"}]),dir:b(h)},[B(o,{class:v(m.value),"background-color":e.backgroundColor},{default:g(()=>[d.$slots.customHeader?(c(),r("div",A,[u(d.$slots,"customHeader",{},void 0,!0)])):k("",!0),e.data&&e.data.title?(c(),r("div",J,[y("h2",{innerHTML:e.data.title},null,8,K),e.data&&e.data.description?(c(),r("p",P,Y(b(_)(e.data.description)),1)):k("",!0)])):k("",!0),y("div",{class:v(`h-card-grid-section__container h-grid h-grid--cols-d-${e.desktopColumns} h-grid--cols-t-${e.tabletColumns} h-grid--cols-m-1`)},[e.withTrack?(c(),p($,{key:0,cards:e.data.cards,class:"u-spacing-1"},{default:g(a=>[u(d.$slots,"items",{item:a==null?void 0:a.item},void 0,!0)]),_:3},8,["cards"])):e.numberOfCards?(c(!0),r(H,{key:1},T(e.numberOfCards,a=>(c(),p(t,{key:a},{card:g(()=>[u(d.$slots,`card_${a}`,{},void 0,!0)]),_:2},1024))),128)):(c(!0),r(H,{key:2},T(e.data.cards,(a,n)=>(c(),p(t,{key:n},{card:g(()=>[u(d.$slots,"items",{item:a},void 0,!0)]),_:2},1024))),128))],2),d.$slots.cta?(c(),r("div",R,[u(d.$slots,"cta",{},void 0,!0)])):k("",!0)]),_:3},8,["class","background-color"])],10,x)}}}),ae=S(Z,[["__scopeId","data-v-5ccc2cda"]]);export{ae as _};