define(["exports","jquery","./util"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}function f(){return f=Object.assign||function(a){for(var b=1;bthis._items.length-1||b<0)){if(this._isSliding)return void a(this._element).one(t.SLID,function(){return c.to(b)});if(d===b)return this.pause(),void this.cycle();var e=b>d?s.NEXT:s.PREV;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(h),a.removeData(this._element,d),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_getConfig",value:function(a){return a=f({},q,a),k["default"].typeCheckConfig(b,a,r),a}},{key:"_addEventListeners",value:function(){var b=this;this._config.keyboard&&a(this._element).on(t.KEYDOWN,function(a){return b._keydown(a)}),"hover"===this._config.pause&&(a(this._element).on(t.MOUSEENTER,function(a){return b.pause(a)}).on(t.MOUSELEAVE,function(a){return b.cycle(a)}),"ontouchstart"in document.documentElement&&a(this._element).on(t.TOUCHEND,function(){b.pause(),b.touchTimeout&&clearTimeout(b.touchTimeout),b.touchTimeout=setTimeout(function(a){return b.cycle(a)},p+b._config.interval)}))}},{key:"_keydown",value:function(a){if(!/input|textarea/i.test(a.target.tagName))switch(a.which){case n:a.preventDefault(),this.prev();break;case o:a.preventDefault(),this.next()}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(v.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===s.NEXT,d=a===s.PREV,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e===f;if(g&&!this._config.wrap)return b;var h=a===s.PREV?-1:1,i=(e+h)%this._items.length;return i===-1?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=this._getItemIndex(b),e=this._getItemIndex(a(this._element).find(v.ACTIVE_ITEM)[0]),f=a.Event(t.SLIDE,{relatedTarget:b,direction:c,from:e,to:d});return a(this._element).trigger(f),f}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(v.ACTIVE).removeClass(u.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(u.ACTIVE)}}},{key:"_slide",value:function(b,c){var d,e,f,g=this,h=a(this._element).find(v.ACTIVE_ITEM)[0],i=this._getItemIndex(h),j=c||h&&this._getItemByDirection(b,h),l=this._getItemIndex(j),n=Boolean(this._interval);if(b===s.NEXT?(d=u.LEFT,e=u.NEXT,f=s.LEFT):(d=u.RIGHT,e=u.PREV,f=s.RIGHT),j&&a(j).hasClass(u.ACTIVE))return void(this._isSliding=!1);var o=this._triggerSlideEvent(j,f);if(!o.isDefaultPrevented()&&h&&j){this._isSliding=!0,n&&this.pause(),this._setActiveIndicatorElement(j);var p=a.Event(t.SLID,{relatedTarget:j,direction:f,from:i,to:l});k["default"].supportsTransitionEnd()&&a(this._element).hasClass(u.SLIDE)?(a(j).addClass(e),k["default"].reflow(j),a(h).addClass(d),a(j).addClass(d),a(h).one(k["default"].TRANSITION_END,function(){a(j).removeClass("".concat(d," ").concat(e)).addClass(u.ACTIVE),a(h).removeClass("".concat(u.ACTIVE," ").concat(e," ").concat(d)),g._isSliding=!1,setTimeout(function(){return a(g._element).trigger(p)},0)}).emulateTransitionEnd(m)):(a(h).removeClass(u.ACTIVE),a(j).addClass(u.ACTIVE),this._isSliding=!1,a(this._element).trigger(p)),n&&this.cycle()}}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(d),g=f({},q,a(this).data());"object"===e(b)&&(g=f({},g,b));var h="string"==typeof b?b:g.slide;if(c||(c=new j(this,g),a(this).data(d,c)),"number"==typeof b)c.to(b);else if("string"==typeof h){if("undefined"==typeof c[h])throw new TypeError('No method named "'.concat(h,'"'));c[h]()}else g.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=k["default"].getSelectorFromElement(this);if(c){var e=a(c)[0];if(e&&a(e).hasClass(u.CAROUSEL)){var g=f({},a(e).data(),a(this).data()),h=this.getAttribute("data-slide-to");h&&(g.interval=!1),j._jQueryInterface.call(a(e),g),h&&a(e).data(d).to(h),b.preventDefault()}}}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return q}}]),j}();return a(document).on(t.CLICK_DATA_API,v.DATA_SLIDE,w._dataApiClickHandler),a(window).on(t.LOAD_DATA_API,function(){a(v.DATA_RIDE).each(function(){var b=a(this);w._jQueryInterface.call(b,b.data())})}),a.fn[b]=w._jQueryInterface,a.fn[b].Constructor=w,a.fn[b].noConflict=function(){return a.fn[b]=l,w._jQueryInterface},w}(j["default"]);a["default"]=l});