import{d as D,aJ as q,a1 as y,ak as z,a0 as K,o as s,b as l,t as J,F as x,e as w,f as R,a as v,w as m,K as i,aK as Y,aL as Q,n as P,_ as j,aM as U,a9 as X,i as Z,l as f,I as T,u as G,q as o,p as n,R as ee,A,ax as se,ap as le,aN as ie,G as ae,aO as te}from"./main-DtyiNRRn.js";const re=D({__name:"SliderFi",props:{clippedRight:{type:Boolean}},emits:["before-change","after-change"],setup(F,{expose:h,emit:k}){const S=q(),t=y(null),p=k,g=y(!1);z(()=>{g.value=!0});const u=K(()=>Object.keys(S).map(_=>Number.parseInt(_)).filter(_=>_||_===0).sort()),c=()=>{var e;(e=t.value)==null||e.go("<")},M=()=>{var e;(e=t.value)==null||e.go(">")},b=()=>{var e;(e=t.value)==null||e.pause()},C=()=>{var e;(e=t.value)==null||e.play()},r=()=>{p("before-change")},a=()=>{p("after-change")};return h({prev:c,next:M,pause:b,play:C}),(e,_)=>(s(),l("div",{class:P({"slider-fi":!0,"slider-fi--clipped-right":e.clippedRight})},[g.value?(s(),v(i(Q),{key:1,ref_key:"splide",ref:t,options:{drag:"free",snap:!0,arrows:!1,type:u.value.length>2?"loop":"slide",autoWidth:!0},"onSplide:move":r,"onSplide:moved":a,"onSplide:drag":r,"onSplide:dragged":a},{default:m(()=>[(s(!0),l(x,null,w(u.value,d=>(s(),v(i(Y),{key:d,class:"slider-fi__slide"},{default:m(()=>[R(e.$slots,d,{},void 0,!0)]),_:2},1024))),128))]),_:3},8,["options"])):(s(),l("div",{key:0,class:"slider-fi__ssr-slide",style:J(`width: ${Math.max(100,u.value.length*40)}%;`)},[(s(!0),l(x,null,w(u.value,d=>(s(),l("div",{key:d,class:"slider-fi__slide"},[R(e.$slots,d,{},void 0,!0)]))),128))],4))],2))}}),de=j(re,[["__scopeId","data-v-9e59dd68"]]),oe={key:0,class:"gallery-slider-fi__exp-info"},ne={class:"fi-col-span-full"},ue={class:"gallery-slider-fi__header"},ce={class:"gallery-slider-fi__item"},_e={key:0,class:"gallery-slider-fi__item__editable"},fe={key:0,class:"video-player-fi__overlay"},pe={class:"video-player-fi__play-button"},ve={key:1,class:"gallery-slider-fi__item__editable__image"},ge=["src"],ye={key:1,class:"gallery-slider-fi__item__image"},me={class:"gallery-slider-fi__item__text"},he=["innerHTML"],ke=["innerHTML"],Se={key:1,class:"fi-my-42 fi-flex fi-items-center"},Me={name:"GallerySliderFi"},be=D({...Me,props:{fields:{default:()=>({})}},setup(F){const{isVideo:h}=te(),{isMD:k}=U(),S=F,t=y(null),p=y(!1),g=[{mediaWidth:366,imageWidth:480},{mediaWidth:1023,imageWidth:782},{mediaWidth:1439,imageWidth:532},{mediaWidth:1440,imageWidth:724}],u=y(!1);z(()=>{u.value=!0});const c=K(()=>S.fields.galleryItems||[]),M={dots:!1,arrows:!0,swipeToSlide:!0,autoplay:!1,autoplaySpeed:9e3,adaptiveHeight:!1,slidesToShow:2,slidesToScroll:1,speed:1e3,mobileFirst:!0,infinite:!0,responsive:[{breakpoint:X.sm,settings:{arrows:!1,slidesToShow:1}}]},b=()=>{p.value=!0},C=()=>{p.value=!1};return(r,a)=>(s(),v(Z,null,{default:m(()=>[f(ae,{class:P({"gallery-slider-fi":!0,"gallery-slider-fi--exp":r.isEditMode,"gallery-slider-fi--ssr":!u.value})},{default:m(()=>[r.isEditMode?(s(),l("div",oe,[f(i(T),{icon:"alert-triangle"}),a[2]||(a[2]=G(" COMPONENT ONLY EDITABLE IN CONTENT EDITOR "))])):o("",!0),n("div",ne,[n("div",ue,[f(i(ee),{class:"gallery-slider-fi__text","html-content":r.fields.text},null,8,["html-content"]),c.value.length>2||c.value.length===2&&!i(k)?(s(),l(x,{key:0},[n("div",{class:"gallery-slider-fi__arrow",onClick:a[0]||(a[0]=e=>t.value.prev())},[f(i(A),{class:"backwards"})]),n("div",{class:"gallery-slider-fi__arrow",onClick:a[1]||(a[1]=e=>t.value.next())},[f(i(A))])],64)):o("",!0)]),c.value.length?(s(),v(i(de),{key:0,ref_key:"slider",ref:t,class:"gallery-slider-fi__slider","clipped-right":!0,settings:M,onBeforeChange:b,onAfterChange:C},se({_:2},[w(c.value,(e,_)=>({name:_,fn:m(()=>{var d,I,N,E,W,B,L,$,O,V,H;return[n("div",ce,[r.isEditMode?(s(),l("div",_e,[i(h)(e.fields)?(s(),l("div",fe,[n("div",pe,[f(i(T),{icon:"play"})])])):o("",!0),(d=e.fields.image)!=null&&d.value?(s(),l("div",ve,[n("img",{src:e.fields.image.value.src},null,8,ge)])):o("",!0)])):(s(),l("div",ye,[i(h)(e.fields)?(s(),v(ie,{key:1,fields:e.fields,"pause-video":p.value,"aspect-ratio":16/9,unlimited:724,"overlay-breakpoints":g},null,8,["fields","pause-video"])):(s(),v(i(le),{key:0,src:(N=(I=e.fields.image)==null?void 0:I.value)==null?void 0:N.src,alt:(W=(E=e.fields.image)==null?void 0:E.value)==null?void 0:W.alt,title:(L=(B=e.fields.image)==null?void 0:B.value)==null?void 0:L.title,"aspect-ratio":16/9,unlimited:724,breakpoints:g},null,8,["src","alt","title"]))])),n("div",me,[(O=($=e.fields)==null?void 0:$.headline)!=null&&O.value?(s(),l("p",{key:0,class:"gallery-slider-fi__item__headline",innerHTML:e.fields.headline.value},null,8,he)):o("",!0),(H=(V=e.fields)==null?void 0:V.text)!=null&&H.value?(s(),l("p",{key:1,class:"gallery-slider-fi__item__text",innerHTML:e.fields.text.value},null,8,ke)):o("",!0)])])]})}))]),1536)):o("",!0),r.isEditMode&&!c.value.length?(s(),l("div",Se,[f(i(T),{icon:"alert-triangle"}),a[3]||(a[3]=G(" no active gallery item "))])):o("",!0)])]),_:1},8,["class"])]),_:1}))}}),Te=j(be,[["__scopeId","data-v-9903b607"]]);export{Te as default};