var he=Object.defineProperty,ye=Object.defineProperties;var ge=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable;var O=(p,r,o)=>r in p?he(p,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):p[r]=o,M=(p,r)=>{for(var o in r||(r={}))fe.call(r,o)&&O(p,o,r[o]);if(G)for(var o of G(r))we.call(r,o)&&O(p,o,r[o]);return p},K=(p,r)=>ye(p,ge(r));import{m as l,a as w,c as v,b as R,d as X,G as N,o as d,f as y,J as C,j as Y,g as b,h as z,a4 as V,n as I,H as j,I as Z,L as x,M as B,q as ee,aq as U,r as A,ad as Ce,ba as Pe,w as $e,e as ke,bm as k,bf as Ie,F as h,ao as S,bg as be,bn as Ve,l as _e,P as Se,k as Ne,an as J,bo as Q,bp as je}from"./index-q8TQmcfk.js";const Te=K(M({},R),{current:w(0),direction:l("horizontal"),minShowNum:w(2),indicatorPosition:l("bottom"),showControls:v(!1),total:w(0),type:l("dots")}),Me=X({__name:"wd-swiper-nav",props:Te,emits:["change"],setup(p,{emit:r}){const o=r;function g(a){o("change",{dir:a,source:"nav"})}return(a,n)=>{const m=Y;return d(),N(j,null,[a.showControls?(d(),y(m,{key:0,class:"wd-swiper-nav__btn"},{default:b(()=>[z(m,{class:"wd-swiper-nav__btn--prev",onClick:n[0]||(n[0]=P=>g("prev"))}),z(m,{class:"wd-swiper-nav__btn--next",onClick:n[1]||(n[1]=P=>g("next"))})]),_:1})):C("",!0),a.total>=a.minShowNum?(d(),y(m,{key:1,style:I(a.customStyle),class:V(`wd-swiper-nav wd-swiper-nav--${a.direction} wd-swiper-nav--${a.type} wd-swiper-nav--${a.indicatorPosition} ${a.customClass}`)},{default:b(()=>[a.type==="dots"||a.type==="dots-bar"?(d(!0),N(j,{key:0},Z(a.total,(P,_)=>(d(),y(m,{key:_,class:V(`wd-swiper-nav__item--${a.type} ${a.current===_?"is-active":""} is-${a.direction}`)},null,8,["class"]))),128)):C("",!0),a.type==="fraction"?(d(),N(j,{key:1},[x(B(a.current+1)+"/"+B(a.total),1)],64)):C("",!0)]),_:1},8,["style","class"])):C("",!0)],64)}}}),Ke=ee(Me,[["__scopeId","data-v-30cb510a"]]),Ae=K(M({},R),{autoplay:v(!0),current:w(0),direction:l("horizontal"),displayMultipleItems:w(1),duration:w(300),easingFunction:l("default"),height:U("192"),interval:w(5e3),list:{type:Array,default:()=>[]},loop:v(!0),videoLoop:v(!0),muted:v(!0),nextMargin:U("0"),indicatorPosition:l("bottom"),previousMargin:U("0"),snapToEdge:v(!1),indicator:{type:[Boolean,Object],default:!0},imageMode:l("aspectFill"),valueKey:l("value"),textKey:l("text"),autoplayVideo:v(!0),stopPreviousVideo:v(!0),stopAutoplayWhenVideoPlay:v(!1),adjustHeight:l("highest"),adjustVerticalHeight:v(!1),customIndicatorClass:l(""),customImageClass:l(""),customPrevImageClass:l(""),customNextImageClass:l(""),customItemClass:l(""),customPrevClass:l(""),customNextClass:l(""),customTextClass:l(""),customTextStyle:l("")}),Fe={name:"wd-swiper",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}},He=X(K(M({},Fe),{props:Ae,emits:["click","change","animationfinish","update:current"],setup(p,{emit:r}){const o=p,g=r,a=A(o.current),n=A(o.current),m=(e,t=!1)=>{n.value=e,t&&(a.value=e),g("update:current",e)},P=A(!1),{proxy:_}=Ce(),F=A(Pe());$e(()=>o.current,e=>{e<0?o.loop?L():E():e>=o.list.length?o.loop?E():L():T(e)});const f=ke(()=>{const{list:e,direction:t,indicatorPosition:s,indicator:i}=o,u={current:n.value||0,total:e.length||0,direction:t||"horizontal",indicatorPosition:s||"bottom"};return k(i)&&(u.type=i.type||"dots",u.minShowNum=i.minShowNum||2,u.showControls=i.showControls||!1),u}),te=(e,t)=>{const s=i=>je(i);return k(e)?e.type&&["video","image"].includes(e.type)?e.type===t:s(e[o.valueKey]):s(e)},H=e=>te(e,"video");function T(e){e!==n.value&&m(e,!0)}function E(){T(0)}function L(){T(o.list.length-1)}function oe(){o.stopAutoplayWhenVideoPlay&&(P.value=!0)}function q(){P.value=!1}function se(e,t,s){return(e-1+s.length)%s.length===t}function ae(e,t,s){return(e+1+s.length)%s.length===t}function W(e,t,s){let i="";return se(e,t,s)&&(i=o.customPrevClass||o.customPrevImageClass),ae(e,t,s)&&(i=o.customNextClass||o.customNextImageClass),i}function ne(e){const{current:t,source:s}=e.detail,i=n.value;g("change",{current:t,source:s}),t!==n.value&&m(t,s==="autoplay"||s==="touch"),ie(i,t)}function ie(e,t){re(e),le(t)}function le(e){if(o.autoplayVideo){const t=o.list[e];J(t)&&H(t)&&Q(`video-${e}-${F.value}`,_).play()}}function re(e){if(o.stopPreviousVideo){const t=o.list[e];J(t)&&H(t)&&Q(`video-${e}-${F.value}`,_).pause()}else o.stopAutoplayWhenVideoPlay&&q()}function ue(e){const{current:t,source:s}=e.detail;t!==n.value&&m(t,s==="autoplay"||s==="touch"),g("animationfinish",{current:t,source:s})}function D(e,t){g("click",{index:e,item:t})}function ce({dir:e}){const{list:t,loop:s}=o,i=t.length;let u=e==="next"?n.value+1:n.value-1;s?u=e==="next"?(n.value+1)%i:(n.value-1+i)%i:u=u<0||u>=i?n.value:u,u!==n.value&&T(u)}return(e,t)=>{const s=Ve,i=_e,u=Se,de=be,pe=Ie,ve=Y;return d(),y(ve,{class:V(`wd-swiper ${e.customClass}`),style:I(e.customStyle)},{default:b(()=>[z(pe,{"adjust-height":e.adjustHeight,"adjust-vertical-height":e.adjustVerticalHeight,class:"wd-swiper__track",autoplay:e.autoplay&&!P.value,current:a.value,interval:e.interval,duration:e.duration,circular:e.loop,vertical:e.direction=="vertical","easing-function":e.easingFunction,"previous-margin":h(S)(e.previousMargin),"next-margin":h(S)(e.nextMargin),"snap-to-edge":e.snapToEdge,"display-multiple-items":e.displayMultipleItems,style:I({height:h(S)(e.height)}),onChange:ne,onAnimationfinish:ue},{default:b(()=>[(d(!0),N(j,null,Z(e.list,(c,$)=>(d(),y(de,{key:$,class:"wd-swiper__item"},{default:b(()=>[H(c)?(d(),y(s,{key:0,id:`video-${$}-${F.value}`,style:I({height:h(S)(e.height)}),src:h(k)(c)?c[e.valueKey]:c,poster:h(k)(c)?c.poster:"",class:V(`wd-swiper__video ${e.customItemClass} ${W(n.value,$,e.list)}`),onPlay:oe,onPause:q,"enable-progress-gesture":!1,loop:e.videoLoop,muted:e.muted,autoplay:e.autoplayVideo,objectFit:"cover",onClick:me=>D($,c)},null,8,["id","style","src","poster","class","loop","muted","autoplay","onClick"])):(d(),y(i,{key:1,src:h(k)(c)?c[e.valueKey]:c,class:V(`wd-swiper__image ${e.customImageClass} ${e.customItemClass} ${W(n.value,$,e.list)}`),style:I({height:h(S)(e.height)}),mode:e.imageMode,onClick:me=>D($,c)},null,8,["src","class","style","mode","onClick"])),h(k)(c)&&c[e.textKey]?(d(),y(u,{key:2,class:V(`wd-swiper__text ${e.customTextClass}`),style:I(e.customTextStyle)},{default:b(()=>[x(B(c[e.textKey]),1)]),_:2},1032,["class","style"])):C("",!0)]),_:2},1024))),128))]),_:1},8,["adjust-height","adjust-vertical-height","autoplay","current","interval","duration","circular","vertical","easing-function","previous-margin","next-margin","snap-to-edge","display-multiple-items","style"]),e.indicator?(d(),N(j,{key:0},[Ne(e.$slots,"indicator",{current:n.value,total:e.list.length},void 0,!0),e.$slots.indicator?C("",!0):(d(),y(Ke,{key:0,"custom-class":e.customIndicatorClass,type:f.value.type,current:f.value.current,total:f.value.total,direction:f.value.direction,"indicator-position":f.value.indicatorPosition,"min-show-num":f.value.minShowNum,"show-controls":f.value.showControls,onChange:ce},null,8,["custom-class","type","current","total","direction","indicator-position","min-show-num","show-controls"]))],64)):C("",!0)]),_:3},8,["class","style"])}}})),Be=ee(He,[["__scopeId","data-v-3e5c0fb1"]]);export{Be as _};