!function(){function t(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,r,u,o=[],l=!0,c=!1;try{if(r=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;l=!1}else for(;!(l=(n=r.call(a)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(v){c=!0,i=v}finally{try{if(!l&&null!=a.return&&(u=a.return(),Object(u)!==u))return}finally{if(c)throw i}}return o}}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a1&&void 0!==arguments[1]?arguments[1]:0,n=e*W.value;t.loop||(n=Math.min(n,-q.value));var i=a-n;return t.loop||(i=T(i,q.value,0)),i},K=function(e){var a=e.pace,n=void 0===a?0:a,r=e.offset,u=void 0===r?0:r,o=e.emitChange;if(!(B.value<=1)){var l=j.active,c=function(e){var a=j.active;return e?t.loop?T(a+e,-1,B.value):T(a+e,0,F.value):a}(n),v=G(c,u);if(t.loop){if(k[0]&&v!==q.value){var f=v0;k[B.value-1].setOffset(s?-H.value:0)}}j.active=c,j.offset=v,o&&c!==l&&i("change",J.value)}},N=function(){j.swiping=!0,j.active<=-1?K({pace:B.value}):j.active>=B.value&&K({pace:-B.value})},Q=function(){N(),D.reset(),z((function(){j.swiping=!1,K({pace:1,emitChange:!0})}))},V=function(){return clearTimeout(a)},Z=function e(){V(),+t.autoplay>0&&B.value>1&&(a=setTimeout((function(){Q(),e()}),+t.autoplay))},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:+t.initialSwipe;if(u.value){var a=function(){var a,n;if(!M(u)){var i={width:u.value.offsetWidth,height:u.value.offsetHeight};j.rect=i,j.width=+(null!=(a=t.width)?a:i.width),j.height=+(null!=(n=t.height)?n:i.height)}B.value&&-1===(e=Math.min(B.value-1,e))&&(e=B.value-1),j.active=e,j.swiping=!0,j.offset=G(e),k.forEach((function(t){t.setOffset(0)})),Z()};M(u)?O().then(a):a()}},tt=function(){return _(j.active)},et=function(e){!t.touchable||e.touches.length>1||(D.start(e),E=!1,n=Date.now(),V(),N())},at=function(){if(t.touchable&&j.swiping){var e=Date.now()-n,a=$.value/e;if((Math.abs(a)>.25||Math.abs($.value)>W.value/2)&&L.value){var r=t.vertical?D.offsetY.value:D.offsetX.value,u=0;u=t.loop?r>0?$.value>0?-1:1:0:-Math[$.value>0?"ceil":"floor"]($.value/W.value),K({pace:u,emitChange:!0})}else $.value&&K({pace:0});E=!1,j.swiping=!1,i("dragEnd",{index:J.value}),Z()}},nt=function(e,a){var n=a===J.value,i=n?{backgroundColor:t.indicatorColor}:void 0;return I("i",{style:i,class:X("indicator",{active:n})},null)};return h({prev:function(){N(),D.reset(),z((function(){j.swiping=!1,K({pace:-1,emitChange:!0})}))},next:Q,state:j,resize:tt,swipeTo:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};N(),D.reset(),z((function(){var n;n=t.loop&&e===B.value?0===j.active?0:e:e%B.value,a.immediate?z((function(){j.swiping=!1})):j.swiping=!1,K({pace:n-j.active,emitChange:!0})}))}}),R({size:W,props:t,count:B,activeIndicator:J}),d((function(){return t.initialSwipe}),(function(t){return _(+t)})),d(B,(function(){return _(j.active)})),d((function(){return t.autoplay}),Z),d([p,g,function(){return t.width},function(){return t.height}],tt),d(w(),(function(t){"visible"===t?Z():V()})),m(_),y((function(){return _(j.active)})),b((function(){return _(j.active)})),S(V),x(V),C("touchmove",(function(e){t.touchable&&j.swiping&&(D.move(e),L.value&&(!t.loop&&(0===j.active&&$.value>0||j.active===B.value-1&&$.value<0)||(A(e,t.stopPropagation),K({offset:$.value}),E||(i("dragStart",{index:J.value}),E=!0))))}),{target:o}),function(){var e;return I("div",{ref:u,class:X()},[I("div",{ref:o,style:U.value,class:X("track",{vertical:t.vertical}),onTouchstartPassive:et,onTouchend:at,onTouchcancel:at},[null==(e=r.default)?void 0:e.call(r)]),r.indicator?r.indicator({active:J.value,total:B.value}):t.showIndicators&&B.value>1?I("div",{class:X("indicators",{vertical:t.vertical})},[Array(B.value).fill("").map(nt)]):void 0])}}}),R=(e("S",j(k)),t(n("swipe-item"),2)),B=R[0],W=R[1],$=o({name:B,setup:function(t,e){var a,n=e.slots,i=c({offset:0,inited:!1,mounted:!1}),r=E(Y),u=r.parent,o=r.index;if(u){var l=s((function(){var t={},e=u.props.vertical;return u.size.value&&(t[e?"height":"width"]="".concat(u.size.value,"px")),i.offset&&(t.transform="translate".concat(e?"Y":"X","(").concat(i.offset,"px)")),t})),v=s((function(){var t=u.props,e=t.loop;if(!t.lazyRender||a)return!0;if(!i.mounted)return!1;var n=u.activeIndicator.value,r=u.count.value-1,l=0===n&&e?r:n-1,c=n===r&&e?0:n+1;return a=o.value===n||o.value===l||o.value===c}));return m((function(){O((function(){i.mounted=!0}))})),h({setOffset:function(t){i.offset=t}}),function(){var t;return I("div",{class:W(),style:l.value},[v.value?null==(t=n.default)?void 0:t.call(n):null])}}}});e("a",j($))}}}))}();