text: /**
   * Minified by jsDelivr using Terser v3.14.1.
   * Original file: /npm/bootstrap@4.3.1/js/src/carousel.js
   * 
   * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
   */
  import $ from"jquery";import Util from"./util";const NAME="carousel",VERSION="4.3.1",DATA_KEY="bs.carousel",EVENT_KEY=`.${DATA_KEY}`,DATA_API_KEY=".data-api",JQUERY_NO_CONFLICT=$.fn[NAME],ARROW_LEFT_KEYCODE=37,ARROW_RIGHT_KEYCODE=39,TOUCHEVENT_COMPAT_WAIT=500,SWIPE_THRESHOLD=40,Default={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},DefaultType={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},Direction={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},Event={SLIDE:`slide${EVENT_KEY}`,SLID:`slid${EVENT_KEY}`,KEYDOWN:`keydown${EVENT_KEY}`,MOUSEENTER:`mouseenter${EVENT_KEY}`,MOUSELEAVE:`mouseleave${EVENT_KEY}`,TOUCHSTART:`touchstart${EVENT_KEY}`,TOUCHMOVE:`touchmove${EVENT_KEY}`,TOUCHEND:`touchend${EVENT_KEY}`,POINTERDOWN:`pointerdown${EVENT_KEY}`,POINTERUP:`pointerup${EVENT_KEY}`,DRAG_START:`dragstart${EVENT_KEY}`,LOAD_DATA_API:`load${EVENT_KEY}.data-api`,CLICK_DATA_API:`click${EVENT_KEY}.data-api`},ClassName={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item",POINTER_EVENT:"pointer-event"},Selector={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",ITEM_IMG:".carousel-item img",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},PointerType={TOUCH:"touch",PEN:"pen"};class Carousel{constructor(e,t){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(t),this._element=e,this._indicatorsElement=this._element.querySelector(Selector.INDICATORS),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}static get VERSION(){return VERSION}static get Default(){return Default}next(){this._isSliding||this._slide(Direction.NEXT)}nextWhenVisible(){!document.hidden&&$(this._element).is(":visible")&&"hidden"!==$(this._element).css("visibility")&&this.next()}prev(){this._isSliding||this._slide(Direction.PREV)}pause(e){e||(this._isPaused=!0),this._element.querySelector(Selector.NEXT_PREV)&&(Util.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(e){this._activeElement=this._element.querySelector(Selector.ACTIVE_ITEM);const t=this._getItemIndex(this._activeElement);if(e>this._items.length-1||e<0)return;if(this._isSliding)return void $(this._element).one(Event.SLID,()=>this.to(e));if(t===e)return this.pause(),void this.cycle();const i=e>t?Direction.NEXT:Direction.PREV;this._slide(i,this._items[e])}dispose(){$(this._element).off(EVENT_KEY),$.removeData(this._element,DATA_KEY),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}_getConfig(e){return e={...Default,...e},Util.typeCheckConfig(NAME,e,DefaultType),e}_handleSwipe(){const e=Math.abs(this.touchDeltaX);if(e<=SWIPE_THRESHOLD)return;const t=e/this.touchDeltaX;t>0&&this.prev(),t<0&&this.next()}_addEventListeners(){this._config.keyboard&&$(this._element).on(Event.KEYDOWN,e=>this._keydown(e)),"hover"===this._config.pause&&$(this._element).on(Event.MOUSEENTER,e=>this.pause(e)).on(Event.MOUSELEAVE,e=>this.cycle(e)),this._config.touch&&this._addTouchEventListeners()}_addTouchEventListeners(){if(!this._touchSupported)return;const e=e=>{this._pointerEvent&&PointerType[e.originalEvent.pointerType.toUpperCase()]?this.touchStartX=e.originalEvent.clientX:this._pointerEvent||(this.touchStartX=e.originalEvent.touches[0].clientX)},t=e=>{e.originalEvent.touches&&e.originalEvent.touches.length>1?this.touchDeltaX=0:this.touchDeltaX=e.originalEvent.touches[0].clientX-this.touchStartX},i=e=>{this._pointerEvent&&PointerType[e.originalEvent.pointerType.toUpperCase()]&&(this.touchDeltaX=e.originalEvent.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(e=>this.cycle(e),TOUCHEVENT_COMPAT_WAIT+this._config.interval))};$(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START,e=>e.preventDefault()),this._pointerEvent?($(this._element).on(Event.POINTERDOWN,t=>e(t)),$(this._element).on(Event.POINTERUP,e=>i(e)),this._element.classList.add(ClassName.POINTER_EVENT)):($(this._element).on(Event.TOUCHSTART,t=>e(t)),$(this._element).on(Event.TOUCHMOVE,e=>t(e)),$(this._element).on(Event.TOUCHEND,e=>i(e)))}_keydown(e){if(!/input|textarea/i.test(e.target.tagName))switch(e.which){case ARROW_LEFT_KEYCODE:e.preventDefault(),this.prev();break;case ARROW_RIGHT_KEYCODE:e.preventDefault(),this.next()}}_getItemIndex(e){return this._items=e&&e.parentNode?[].slice.call(e.parentNode.querySelectorAll(Selector.ITEM)):[],this._items.indexOf(e)}_getItemByDirection(e,t){const i=e===Direction.NEXT,s=e===Direction.PREV,n=this._getItemIndex(t),l=this._items.length-1;if((s&&0===n||i&&n===l)&&!this._config.wrap)return t;const a=(n+(e===Direction.PREV?-1:1))%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]}_triggerSlideEvent(e,t){const i=this._getItemIndex(e),s=this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM)),n=$.Event(Event.SLIDE,{relatedTarget:e,direction:t,from:s,to:i});return $(this._element).trigger(n),n}_setActiveIndicatorElement(e){if(this._indicatorsElement){const t=[].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));$(t).removeClass(ClassName.ACTIVE);const i=this._indicatorsElement.children[this._getItemIndex(e)];i&&$(i).addClass(ClassName.ACTIVE)}}_slide(e,t){const i=this._element.querySelector(Selector.ACTIVE_ITEM),s=this._getItemIndex(i),n=t||i&&this._getItemByDirection(e,i),l=this._getItemIndex(n),a=Boolean(this._interval);let o,r,E;if(e===Direction.NEXT?(o=ClassName.LEFT,r=ClassName.NEXT,E=Direction.LEFT):(o=ClassName.RIGHT,r=ClassName.PREV,E=Direction.RIGHT),n&&$(n).hasClass(ClassName.ACTIVE))return void(this._isSliding=!1);if(this._triggerSlideEvent(n,E).isDefaultPrevented())return;if(!i||!n)return;this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(n);const h=$.Event(Event.SLID,{relatedTarget:n,direction:E,from:s,to:l});if($(this._element).hasClass(ClassName.SLIDE)){$(n).addClass(r),Util.reflow(n),$(i).addClass(o),$(n).addClass(o);const e=parseInt(n.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval;const t=Util.getTransitionDurationFromElement(i);$(i).one(Util.TRANSITION_END,()=>{$(n).removeClass(`${o} ${r}`).addClass(ClassName.ACTIVE),$(i).removeClass(`${ClassName.ACTIVE} ${r} ${o}`),this._isSliding=!1,setTimeout(()=>$(this._element).trigger(h),0)}).emulateTransitionEnd(t)}else $(i).removeClass(ClassName.ACTIVE),$(n).addClass(ClassName.ACTIVE),this._isSliding=!1,$(this._element).trigger(h);a&&this.cycle()}static _jQueryInterface(e){return this.each(function(){let t=$(this).data(DATA_KEY),i={...Default,...$(this).data()};"object"==typeof e&&(i={...i,...e});const s="string"==typeof e?e:i.slide;if(t||(t=new Carousel(this,i),$(this).data(DATA_KEY,t)),"number"==typeof e)t.to(e);else if("string"==typeof s){if(void 0===t[s])throw new TypeError(`No method named "${s}"`);t[s]()}else i.interval&&i.ride&&(t.pause(),t.cycle())})}static _dataApiClickHandler(e){const t=Util.getSelectorFromElement(this);if(!t)return;const i=$(t)[0];if(!i||!$(i).hasClass(ClassName.CAROUSEL))return;const s={...$(i).data(),...$(this).data()},n=this.getAttribute("data-slide-to");n&&(s.interval=!1),Carousel._jQueryInterface.call($(i),s),n&&$(i).data(DATA_KEY).to(n),e.preventDefault()}}$(document).on(Event.CLICK_DATA_API,Selector.DATA_SLIDE,Carousel._dataApiClickHandler),$(window).on(Event.LOAD_DATA_API,()=>{const e=[].slice.call(document.querySelectorAll(Selector.DATA_RIDE));for(let t=0,i=e.length;t<i;t++){const i=$(e[t]);Carousel._jQueryInterface.call(i,i.data())}}),$.fn[NAME]=Carousel._jQueryInterface,$.fn[NAME].Constructor=Carousel,$.fn[NAME].noConflict=(()=>($.fn[NAME]=JQUERY_NO_CONFLICT,Carousel._jQueryInterface));export default Carousel;
  //# sourceMappingURL=/sm/c64abfbed9dcc42b0d3d9e1754ce0a5b74ad817b5992caeabc3d2d858e7acfab.map