New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@egjs/flicking

Package Overview
Dependencies
Maintainers
8
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/flicking - npm Package Compare versions

Comparing version 4.2.0-beta.1 to 4.2.0-beta.2

declaration/cfc/getDefaultCameraTransform.d.ts

2

declaration/cfc/index.d.ts
import withFlickingMethods from "./withFlickingMethods";
import sync from "./sync";
import getRenderingPanels from "./getRenderingPanels";
import getCameraAlign from "./getCameraAlign";
import getCameraAlign from "./getDefaultCameraTransform";
export { withFlickingMethods, sync, getRenderingPanels, getCameraAlign };

@@ -7,5 +7,5 @@ /*

repository: https://github.com/naver/egjs-flicking
version: 4.2.0-beta.1
version: 4.2.0-beta.2
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes)}(this,function(c,o){"use strict";var i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}i(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var r=function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};function h(e,a,s,l){return new(s=s||Promise)(function(t,n){function i(e){try{o(l.next(e))}catch(e){n(e)}}function r(e){try{o(l.throw(e))}catch(e){n(e)}}function o(e){var n;e.done?t(e.value):((n=e.value)instanceof s?n:new s(function(e){e(n)})).then(i,r)}o((l=l.apply(e,a||[])).next())})}function f(t,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:n(0),throw:n(1),return:n(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function n(n){return function(e){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,(n=a?[2&n[0],a.value]:n)[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=i.call(t,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,e])}}}function d(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],i=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var i,r,o=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return a}function p(e,n){for(var t=0,i=n.length,r=e.length;t<i;t++,r++)e[r]=n[t];return e}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(n){Object.keys(n).forEach(function(e){t[e]=n[e]})}),t}function t(e,n,t){return Math.max(Math.min(e,t),n)}function _(e,n){if(!e)throw new T(x(n),A.NOT_ATTACHED_TO_FLICKING);return e}function s(e){return[].slice.call(e)}function l(e,n){var t;if(B(e))switch(e){case M.PREV:t=0;break;case M.CENTER:t=.5*n;break;case M.NEXT:t=n;break;default:if(null==(t=V(e,n)))throw new T(I("align",e),A.WRONG_OPTION)}else t=e;return t}function v(e,n){return e===n?G.NONE:e<n?G.NEXT:G.PREV}function u(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function(e){if(B(e)){var n=document.createElement("div");for(n.innerHTML=e,t.push.apply(t,p([],g(s(n.children))));n.firstChild;)n.removeChild(n.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new T(C(e,["HTMLElement","string"]),A.WRONG_TYPE);t.push(e)}}),t}function m(e,n){return t(e<0?e+n:e,0,n)}function b(e,n){var t,i;try{for(var r=d(e),o=r.next();!o.done;o=r.next())if(o.value===n)return 1}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}function E(e,n,t){return(e-n)/(t-n)}function P(e){return window.getComputedStyle(e)||e.currentStyle}var y,T=function(i){function r(e,n){var t=i.call(this,e)||this;return t.message=e,t.code=n,Object.setPrototypeOf(t,r.prototype),t.name="FlickingError",t}return a(r,i),r}(Error),A={WRONG_TYPE:0,ELEMENT_NOT_FOUND:1,VAL_MUST_NOT_NULL:2,NOT_ATTACHED_TO_FLICKING:3,WRONG_OPTION:4,INDEX_OUT_OF_RANGE:5,POSITION_NOT_REACHABLE:6,TRANSFORM_NOT_SUPPORTED:7,STOP_CALLED_BY_USER:8,ANIMATION_INTERRUPTED:9,ANIMATION_ALREADY_PLAYING:10,NOT_ALLOWED_IN_FRAMEWORK:11,NOT_INITIALIZED:12,NO_ACTIVE:13},C=function(e,n){return e+"("+typeof e+") is not a "+n.map(function(e){return'"'+e+'"'}).join(" or ")+"."},N=function(e){return'Element with selector "'+e+'" not found.'},O=function(e,n){return n+" should be provided. Given: "+e},x=function(e){return e+' is not attached to the Flicking instance. "init()" should be called first.'},I=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},w=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},R=function(e){return'Position "'+e+'" is not reachable.'},k="Browser does not support CSS transform.",D="Event stop() is called by user.",S="Animation is interrupted by user input.",j="Animation is already playing.",L="This behavior is not allowed in the frameworks like React, Vue, or Angular.",z="Flicking is not initialized yet, call init() first.",H={READY:"ready",BEFORE_RESIZE:"beforeResize",AFTER_RESIZE:"afterResize",HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",WILL_CHANGE:"willChange",CHANGED:"changed",WILL_RESTORE:"willRestore",RESTORED:"restored",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange",REACH_EDGE:"reachEdge",PANEL_CHANGE:"panelChange"},M={PREV:"prev",CENTER:"center",NEXT:"next"},G={PREV:"PREV",NEXT:"NEXT",NONE:null},F={SNAP:"snap",FREE_SCROLL:"freeScroll"},n={__proto__:null,EVENTS:H,ALIGN:M,DIRECTION:G,MOVE_TYPE:F,ERROR_CODE:A},V=function(e,n){var t=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return e;for(var i=0,r=0,o=t.exec(e);null!=o;){var a=o[1],s=o[2],l=o[3],s=parseFloat(s);if(!(a=i<=0?a||"+":a))return null;"%"===l&&(s=s/100*n),r+="+"===a?s:-s,++i,o=t.exec(e)}return 0===i?null:r},B=function(e){return"string"==typeof e},W=function(){function e(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(n,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),n.setSize=function(e){var n=e.width,t=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=n&&(B(n)?i.style.width=n:(n=e?n+r.left+r.right:n,i.style.width=n+"px")),null!=t&&(B(t)?i.style.height=t:(t=e?t+r.top+r.bottom:t,i.style.height=t+"px")),this.resize()},n.resize=function(){var e=this._el,n=P(e);this._width=e.offsetWidth,this._height=e.offsetHeight,this._padding={left:parseFloat(n.paddingLeft),right:parseFloat(n.paddingRight),top:parseFloat(n.paddingTop),bottom:parseFloat(n.paddingBottom)},this._isBorderBoxSizing="border-box"===n.boxSizing},e}(),X={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},U="flick";(ce=y=y||{})[ce.IDLE=0]="IDLE",ce[ce.HOLDING=1]="HOLDING",ce[ce.DRAGGING=2]="DRAGGING",ce[ce.ANIMATING=3]="ANIMATING",ce[ce.DISABLED=4]="DISABLED";var Y=function(){function e(){}var n=e.prototype;return n.onHold=function(e){},n.onChange=function(e){},n.onRelease=function(e){},n.onAnimationEnd=function(e){},n.onFinish=function(e){},e}(),K=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;n.renderer.panelCount<=0?e(y.DISABLED):(t=new c.ComponentEvent(H.HOLD_START,{axesEvent:t}),n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.HOLDING))},t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control.controller.animatingContext,t=new c.ComponentEvent(H.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(r.start,r.end),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.ANIMATING).onChange(e)},e}(Y),Z=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=t.inputEvent,r=n.horizontal?r.offsetX:r.offsetY,t=new c.ComponentEvent(H.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(0,-r),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.DRAGGING).onChange(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;if(n.trigger(new c.ComponentEvent(H.HOLD_END,{axesEvent:t})),0!==t.delta.flick)return t.setTo({flick:n.camera.position},0),void e(y.IDLE);this._releaseEvent=t},t.onFinish=function(e){var n=e.flicking;if((0,e.transitTo)(y.IDLE),this._releaseEvent){var t,i=this._releaseEvent.inputEvent.srcEvent;t="touchend"===i.type?(e=i.changedTouches[0],document.elementFromPoint(e.clientX,e.clientY)):i.target;var r,o,i=n.renderer.panels,a=null;try{for(var s=d(i),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.contains(t)){a=u;break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}a&&(r=n.camera.position,o=a.position,n.trigger(new c.ComponentEvent(H.SELECT,{index:a.index,panel:a,direction:v(r,o)})))}},e}(Y),q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta[U]&&(e=(n=t.camera).position,n.lookAt(i.pos[U]),i=new c.ComponentEvent(H.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta[U]),axesEvent:i}),t.trigger(i),i.isCanceled()&&(n.lookAt(e),r(y.DISABLED)))},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo;n.trigger(new c.ComponentEvent(H.HOLD_END,{axesEvent:t})),n.renderer.panelCount<=0?i(y.IDLE):(i(y.ANIMATING),e=n.control,i=t.destPos[U],n=Math.max(t.duration,n.duration),e.moveToPosition(i,n,t))},e}(Y),J=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo,t=new c.ComponentEvent(H.HOLD_START,{axesEvent:t});n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.DRAGGING)},t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta.flick&&(e=(n=t.camera).position,n.lookAt(i.pos.flick),i=new c.ComponentEvent(H.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta.flick),axesEvent:i}),t.trigger(i),i.isCanceled()&&(t.camera.lookAt(e),r(y.DISABLED)))},t.onFinish=function(e){var n=e.flicking,t=e.axesEvent;(0,e.transitTo)(y.IDLE);e=n.control.controller.animatingContext;n.trigger(new c.ComponentEvent(H.MOVE_END,{isTrusted:t.isTrusted,direction:v(e.start,e.end),axesEvent:t}))},e}(Y),Q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onAnimationEnd=function(e){(0,e.transitTo)(y.IDLE)},t.onChange=function(e){var n=e.axesEvent,e=e.transitTo;n.stop(),e(y.IDLE)},t.onRelease=function(e){var n=e.axesEvent,e=e.transitTo;0===n.delta.flick&&e(y.IDLE)},e}(Y),$=function(){function e(){var t=this;this.transitTo=function(e){var n;switch(e){case y.IDLE:n=new K;break;case y.HOLDING:n=new Z;break;case y.DRAGGING:n=new q;break;case y.ANIMATING:n=new J;break;case y.DISABLED:n=new Q}return t._state=n,t._state},this._state=new K}var n=e.prototype;return Object.defineProperty(n,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),n.fire=function(e,n){var t=this._state,i=r(r({},n),{transitTo:this.transitTo});switch(e){case X.HOLD:t.onHold(i);break;case X.CHANGE:t.onChange(i);break;case X.RELEASE:t.onRelease(i);break;case X.ANIMATION_END:t.onAnimationEnd(i);break;case X.FINISH:t.onFinish(i)}},e}(),ee=function(){function e(){var n=this;this._onAxesHold=function(){n._dragged=!1},this._onAxesChange=function(){n._dragged=!0},this._preventClickWhenDragged=function(e){n._dragged&&(e.preventDefault(),e.stopPropagation()),n._dragged=!1},this._resetInternalValues(),this._stateMachine=new $}var n=e.prototype;return Object.defineProperty(n,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(n,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(n,"enabled",{get:function(){var e;return null!==(e=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([U])[U])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[U].bounce},enumerable:!1,configurable:!0}),n.init=function(t){var e,i=this;this._flicking=t,this._axes=new o(((e={})[U]={range:[0,0],circular:!1,bounce:[0,0]},e),{deceleration:t.deceleration,interruptable:t.interruptable,easing:t.easing}),this._panInput=new o.PanInput(t.viewport.element,{inputType:t.inputType,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]});var r=this._axes;r.connect(t.horizontal?[U,""]:["",U],this._panInput);for(var n in X)!function(e){var n=X[e];r.on(n,function(e){i._stateMachine.fire(n,{flicking:t,axesEvent:e})})}(n);return this},n.destroy=function(){var e;this.removePreventClickHandler(),null!==(e=this._axes)&&void 0!==e&&e.destroy(),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},n.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},n.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},n.update=function(){var n,t,e=_(this._flicking,"Control"),i=e.camera,r=this._axes,o=i.controlParams,a=r.axis[U];return a.circular=[o.circular,o.circular],a.range=[o.range.min,o.range.max],a.bounce=(n=e.bounce,t=i.size,(Array.isArray(n)?n.map(function(e){return V(e,t)}):[i=V(n,t),i]).map(function(e){if(null==e)throw new T(I("bounce",n),A.WRONG_OPTION);return e})),r.axm.set(((r={})[U]=o.position,r)),this},n.addPreventClickHandler=function(){var e=_(this._flicking,"Control"),n=this._axes,e=e.element;n.on(X.HOLD,this._onAxesHold),n.on(X.CHANGE,this._onAxesChange),e.addEventListener("click",this._preventClickWhenDragged,!0)},n.removePreventClickHandler=function(){var e=_(this._flicking,"Control"),n=this._axes,e=e.element;n.off(X.HOLD,this._onAxesHold),n.off(X.CHANGE,this._onAxesChange),e.removeEventListener("click",this._preventClickWhenDragged,!0)},n.animateTo=function(n,t,i){var r=this,o=this._axes;if(!o)return Promise.reject(new T(x("Control"),A.NOT_ATTACHED_TO_FLICKING));var e=o.get([U])[U];if(e===n)return _(this._flicking,"Control").camera.lookAt(n);this._animatingContext={start:e,end:n,offset:0};function a(){var e;o.once(X.FINISH,function(){r._animatingContext={start:0,end:0,offset:0}}),i?i.setTo(((e={})[U]=n,e),t):o.setTo(((e={})[U]=n,e),t)}return 0===t?(a(),o.axm.set(((e={})[U]=n,e)),Promise.resolve()):new Promise(function(e,n){function t(){o.off(X.HOLD,i),e()}var i=function(){o.off(X.FINISH,t),n(new T(S,A.ANIMATION_INTERRUPTED))};o.once(X.FINISH,t),o.once(X.HOLD,i),a()})},n._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0},this._dragged=!1},e}(),ne=function(){function e(){var o=this;this._setActive=function(e,n,t){var i,r=_(o._flicking,"Control");o._activePanel=e,r.camera.updateAdaptiveHeight(),e!==n?r.trigger(new c.ComponentEvent(H.CHANGED,{index:e.index,panel:e,prevIndex:null!==(i=null==n?void 0:n.index)&&void 0!==i?i:-1,prevPanel:n,isTrusted:t,direction:n?v(n.position,e.position):G.NONE})):r.trigger(new c.ComponentEvent(H.RESTORED,{isTrusted:t}))},this._flicking=null,this._controller=new ee,this._activePanel=null}var n=e.prototype;return Object.defineProperty(n,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activeIndex",{get:function(){var e;return null!==(e=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._controller.init(e),this},n.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},n.enable=function(){return this._controller.enable(),this},n.disable=function(){return this._controller.disable(),this},n.updatePosition=function(e){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return t=_(this._flicking,"Control"),n=t.camera,(t=this._activePanel)?[4,n.lookAt(n.clampToReachablePosition(t.position))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.updateInput=function(){return this._controller.update(),this},n.resetActive=function(){return this._activePanel=null,this},n.moveToPanel=function(a,e){var s=e.duration,n=e.direction,l=void 0===n?G.NONE:n,u=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o;return f(this,function(e){return n=_(this._flicking,"Control"),o=n.camera,t=a.position,i=o.findNearestAnchor(t),a.removed||!i?[2,Promise.reject(new T(R(a.position),A.POSITION_NOT_REACHABLE))]:(o.canReach(a)?n.circularEnabled&&(r=this._controller.position,o=o.rangeDiff,t=[t,t+o,t-o].filter(function(e){return l===G.NONE||(l===G.PREV?e<=r:r<=e)}).reduce(function(e,n){return Math.abs(r-n)<Math.abs(r-e)?n:e},1/0)):(t=i.position,a=i.panel),this._triggerIndexChangeEvent(a,a.position,u),[2,this._animateToPosition({position:t,duration:s,newActivePanel:a,axesEvent:u})])})})},n._triggerIndexChangeEvent=function(e,n,t){var i=_(this._flicking,"Control"),r=e!==this._activePanel?H.WILL_CHANGE:H.WILL_RESTORE,o=i.camera,a=this._activePanel,n=new c.ComponentEvent(r,{index:e.index,panel:e,isTrusted:(null==t?void 0:t.isTrusted)||!1,direction:v(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,n)});if(i.trigger(n),n.isCanceled())throw new T(D,A.STOP_CALLED_BY_USER)},n._animateToPosition=function(e){var s=e.position,l=e.duration,u=e.newActivePanel,c=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){return n=_(this._flicking,"Control"),t=this._activePanel,i=function(){return a._controller.animateTo(s,l,c)},r=(null==c?void 0:c.isTrusted)||!1,l<=0?(o=i(),this._setActive(u,t,r),[2,o]):[2,i().then(function(){return h(a,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return this._setActive(u,t,r),[4,n.renderer.render()];case 1:return e.sent(),[2]}})})}).catch(function(e){if(!(c&&e instanceof T&&e.code===A.ANIMATION_INTERRUPTED))throw e})]})})},e}(),te=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.moveToPosition=function(l,u,c){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){return r=_(this._flicking,"Control"),n=r.camera,t=this._activePanel,o=n.clampToReachablePosition(l),(i=n.findNearestAnchor(o))&&t?(o=t.position,r=Math.abs(l-o)>=r.threshold,o=o<l?n.getNextAnchor(i):n.getPrevAnchor(i),r&&i.position!==t.position?(s=i.panel,a=i.position):r&&o?(s=o.panel,a=o.position):(a=n.clampToReachablePosition(t.position),s=t),this._triggerIndexChangeEvent(s,l,c),[2,this._animateToPosition({position:a,duration:u,newActivePanel:s,axesEvent:c})]):[2,Promise.reject(new T(R(l),A.POSITION_NOT_REACHABLE))]})})},n}(ne),ie=function(t){function e(e){var n=(void 0===e?{}:e).stopAtEdge,e=void 0===n||n,n=t.call(this)||this;return n._stopAtEdge=e,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),n.updatePosition=function(i){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return(t=_(this._flicking,"Control"),n=t.camera,t=this._activePanel)?(t=t.range,t=t.min+(t.max-t.min)*i,[4,n.lookAt(n.clampToReachablePosition(t))]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.moveToPosition=function(i,r,o){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Control"),t=n.camera,n=t.clampToReachablePosition(i),(t=t.findAnchorIncludePosition(n))?((t=t.panel)!==this._activePanel&&this._triggerIndexChangeEvent(t,i,o),[2,this._animateToPosition({position:this._stopAtEdge?n:i,duration:r,newActivePanel:t,axesEvent:o})]):[2,Promise.reject(new T(R(i),A.POSITION_NOT_REACHABLE))]})})},e}(ne),re={__proto__:null,Control:ne,SnapControl:te,FreeControl:ie,AxesController:ee,State:Y,IdleState:K,HoldingState:Z,DraggingState:q,AnimatingState:J,DisabledState:Q,StateMachine:$},oe=function(){function e(e){var n=e.index,t=e.position,e=e.panel;this._index=n,this._pos=t,this._panel=e}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),e}(),ae=function(){function e(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?M.CENTER:e;this._checkTranslateSupport=function(){var n,e,t=document.documentElement.style,i="";try{for(var r=d(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),o=r.next();!o.done;o=r.next()){var a=o.value;a in t&&(i=a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}if(!i)throw new T(k,A.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking,n=this._position+this._offset,t=this.findNearestAnchor(this._position);if(!e||!t)return NaN;var i=t.panel,r=i.position+i.offset,o=e.control.controller.bounce,a=this.range,t=a.min,e=a.max,a=this.rangeDiff;if(n===r)return i.index;if(n<r){var s=i.prev(),s=s?s.position+s.offset:t-o[0];return r<s&&(s-=a),i.index-1+E(n,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+E(n,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.init=function(e){e=(this._flicking=e).viewport.element;return function(e,n){if(null==e)throw new T(O(e,n),A.VAL_MUST_NOT_NULL)}(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},n.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},n.lookAt=function(t){return h(this,void 0,void 0,function(){var n;return f(this,function(e){switch(e.label){case 0:return n=this._position,this._position=t,[4,this._refreshVisiblePanels()];case 1:return e.sent(),this._checkNeedPanel(),this._checkReachEnd(n,t),this._applyTransform(),[2]}})})},n.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},n.getNextAnchor=function(e){return this._anchors[e.index+1]||null},n.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},n.findAnchorIncludePosition=function(t){return this._anchors.filter(function(e){return e.panel.includePosition(t,!0)}).reduce(function(e,n){return e&&Math.abs(e.position-t)<Math.abs(n.position-t)?e:n},null)},n.findNearestAnchor=function(e){var n=this._anchors;if(n.length<=0)return null;for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n.clampToReachablePosition=function(e){var n=this._range;return t(e,n.min,n.max)},n.canReach=function(e){var n=this._range;if(e.removed)return!1;e=e.position;return e>=n.min&&e<=n.max},n.canSee=function(e){var n=this.visibleRange;return e.includeRange(n.min,n.max,!1)},n.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=l(e,this.size),this},n.updateAnchors=function(){var e=_(this._flicking,"Camera").renderer.panels;return this._anchors=e.map(function(e,n){return new oe({index:n,position:e.position,panel:e})}),this},n.updateAdaptiveHeight=function(){var e=_(this._flicking,"Camera"),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},n.updateOffset=function(){var e=_(this._flicking,"Camera").panels.filter(function(e){return!e.rendered}),n=this._position;this._offset=e.filter(function(e){return e.position+e.offset<n}).reduce(function(e,n){return e+n.sizeIncludingMargin},0),this._applyTransform()},n.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},n._resetInternalValues=function(){this._position=0,this._alignPos=0,this._offset=0,this._range={min:0,max:0},this._visiblePanels=[],this._anchors=[],this._needPanelTriggered={prev:!1,next:!1}},n._refreshVisiblePanels=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),o=n.renderer.panels,t=o.filter(function(e){return a.canSee(e)}),i=this._visiblePanels,this._visiblePanels=t,r=t.filter(function(e){return!b(i,e)}),o=i.filter(function(e){return!b(t,e)}),0<r.length||0<o.length?[4,n.renderer.render()]:[3,2];case 1:e.sent(),n.trigger(new c.ComponentEvent(H.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:t})),e.label=2;case 2:return[2]}})})},n._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var n=_(this._flicking,"Camera"),t=n.renderer.panels;if(t.length<=0)return e.prev||(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.PREV})),e.prev=!0),void(e.next||(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.NEXT})),e.next=!0));var i=this._position,r=this.size,o=this._range,a=n.needPanelThreshold,s=i-this._alignPos,l=s+r,r=t[0],t=t[t.length-1];e.prev||(s<=r.range.min+a||i<=o.min+a)&&(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.PREV})),e.prev=!0),e.next||(t.range.max-a<=l||i>=o.max-a)&&(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.NEXT})),e.next=!0)}},n._checkReachEnd=function(e,n){var t=_(this._flicking,"Camera"),i=this._range,r=e>i.min&&e<i.max,e=n>i.min&&n<i.max;r&&!e&&(i=n<=i.min?G.PREV:G.NEXT,t.trigger(new c.ComponentEvent(H.REACH_EDGE,{direction:i})))},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},e}(),se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=e.getPanel(0),e=e.getPanel(e.panelCount-1);return this._range={min:null!==(n=null==n?void 0:n.position)&&void 0!==n?n:0,max:null!==(e=null==e?void 0:e.position)&&void 0!==e?e:0},this},n}(ae),le=function(s){function e(){var e=null!==s&&s.apply(this,arguments)||this;return e._circularOffset=0,e._circularEnabled=!1,e}a(e,s);var n=e.prototype;return Object.defineProperty(n,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),n.getPrevAnchor=function(e){if(!this._circularEnabled||0!==e.index)return s.prototype.getPrevAnchor.call(this,e);var n=this._anchors,e=this.rangeDiff,n=n[n.length-1];return new oe({index:n.index,position:n.position-e,panel:n.panel})},n.getNextAnchor=function(e){var n=this._anchors;if(!this._circularEnabled||e.index!==n.length-1)return s.prototype.getNextAnchor.call(this,e);e=this.rangeDiff,n=n[0];return new oe({index:n.index,position:n.position+e,panel:n.panel})},n.findAnchorIncludePosition=function(e){if(!this._circularEnabled)return s.prototype.findAnchorIncludePosition.call(this,e);var n,t,i=this._range,r=(o=e,n=i.min,t=i.max,r=t-n,o<n?o=t-(n-o)%r:t<o&&(o=n+(o-t)%r),o),o=s.prototype.findAnchorIncludePosition.call(this,r);if(!o)return null;var r=this.rangeDiff;if(e<i.min){var a=-Math.floor((i.min-e)/r)-1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}if(e>i.max){a=Math.floor((e-i.max)/r)+1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}return o},n.clampToReachablePosition=function(e){return this._circularEnabled?e:s.prototype.clampToReachablePosition.call(this,e)},n.canReach=function(e){return!e.removed&&(!!this._circularEnabled||s.prototype.canReach.call(this,e))},n.canSee=function(e){var n=this._range,t=this.rangeDiff,i=this.visibleRange,r=s.prototype.canSee.call(this,e);return this._circularEnabled?i.min<n.min?r||e.includeRange(i.min+t,i.max+t,!1):i.max>n.max?r||e.includeRange(i.min-t,i.max-t,!1):r:r},n.updateRange=function(){var e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._resetInternalValues(),this;var n=e[0],t=e[e.length-1],i=n.range.min-n.margin.prev,r=t.range.max+t.margin.next,o=this.size,a=r-i,s=e.every(function(e){return a-e.size>=o});return(this._circularEnabled=s)?(this._range={min:i,max:r},e.forEach(function(e){return e.updateCircularToggleDirection()})):this._range={min:n.position,max:t.position},this._updateCircularOffset(),this},n.lookAt=function(r){return h(this,void 0,void 0,function(){var n,t,i;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),t=this._position,r!==t?[3,2]:[4,s.prototype.lookAt.call(this,r)];case 1:return[2,e.sent()];case 2:return(i=n.renderer.panels,i=i.map(function(e){return e.toggle(t,r)}),this._position=r,i.some(function(e){return e}))?(this._updateCircularOffset(),[4,n.renderer.render()]):[3,4];case 3:e.sent(),e.label=4;case 4:return[4,s.prototype.lookAt.call(this,r)];case 5:return[2,e.sent()]}})})},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset+this._circularOffset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},n._resetInternalValues=function(){s.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},n._calcPanelAreaSum=function(e){return e.reduce(function(e,n){return e+n.sizeIncludingMargin},0)},n._updateCircularOffset=function(){var e,n,t;this._circularEnabled?(e=_(this._flicking,"Camera"),n=[],t=[],e.panels.filter(function(e){return e.toggled}).forEach(function(e){(e.toggleDirection===G.PREV?n:t).push(e)}),this._circularOffset=this._calcPanelAreaSum(n)-this._calcPanelAreaSum(t)):this._circularOffset=0},e}(ae),ue=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=this._alignPos,t=e.getPanel(0),i=e.getPanel(e.panelCount-1);if(!t||!i)return this._range={min:0,max:0},this;var r=this.size,o=t.range.min,e=i.range.max;return this._range=r<e-o?{min:o+n,max:e-r+n}:{min:t.position,max:i.position},this},t.updateAnchors=function(){var n=this,e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._anchors=[],this;var t,i,r,o,a=this._range,s=e.filter(function(e){return n.canReach(e)});return 0<s.length?(t=s[0].position!==a.min,i=s[s.length-1].position!==a.max,r=t?1:0,o=s.map(function(e,n){return new oe({index:n+r,position:e.position,panel:e})}),t&&o.splice(0,0,new oe({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new oe({index:o.length,position:a.max,panel:e[s[s.length-1].index+1]})),this._anchors=o):a.min!==a.max?(s=(o=(s=this._findNearestPanel(a.min,e)).index===e.length-1?s.prev():s).next(),this._anchors=[new oe({index:0,position:a.min,panel:o}),new oe({index:1,position:a.max,panel:s})]):this._anchors=[new oe({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},t._findNearestPanel=function(e,n){for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n}(ae),ce={__proto__:null,Camera:ae,LinearCamera:se,CircularCamera:le,BoundCamera:ue},he=function(){function e(){}return e.prototype.updateRenderingPanels=function(e){e.panels.forEach(function(e){return e.markForShow()})},e}(),ne=function(){function e(e){var n=void 0===e?{}:e,e=n.align,e=void 0===e?M.CENTER:e,n=n.strategy,n=void 0===n?new he:n;this._align=e,this._flicking=null,this._renderingStrategy=n,this._panels=[]}var n=e.prototype;return Object.defineProperty(n,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=this._getPanelAlign();this._panels.forEach(function(e){e.align=n})},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._collectPanels(),this},n.destroy=function(){this._flicking=null,this._panels=[]},n.getPanel=function(e){return this._panels[e]||null},n.updatePanelSize=function(){return this._panels.forEach(function(e){return e.resize()}),this},n.batchInsert=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,l=_(this._flicking,"Renderer"),t=l.control,u=this._getPanelAlign(),i=e.reduce(function(e,n){var t=m(n.index,s.length),i=s.slice(t),r=n.elements.map(function(e){return a._createPanel(e,{index:t,align:u,flicking:l})});s.splice.apply(s,p([t,0],g(r))),r.forEach(function(e){return e.resize()});var o=a._getPanelSizeSum(r);return i.forEach(function(e){e.increaseIndex(r.length),e.increasePosition(o)}),a._insertPanelElements(r,null!==(i=i[0])&&void 0!==i?i:null),p(p([],g(e)),g(r))},[]);return i.length<=0?[]:(this._updateCameraAndControl(),this.render(),0<i.length&&!t.animating&&t.moveToPanel(t.activePanel||i[0],{duration:0}).catch(function(){}),l.camera.updateOffset(),l.trigger(new c.ComponentEvent(H.PANEL_CHANGE,{added:i,removed:[]})),i)},n.batchRemove=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,t=_(this._flicking,"Renderer"),i=t.camera,l=t.control,u=l.activePanel,r=l.activeIndex,o=e.reduce(function(e,n){var t=n.index,i=n.deleteCount,n=m(t,s.length),t=s.slice(n+i),r=s.splice(n,i);if(r.length<=0)return[];var o=a._getPanelSizeSum(r);return t.forEach(function(e){e.decreaseIndex(r.length),e.decreasePosition(o)}),a._removePanelElements(r),r.forEach(function(e){return e.destroy()}),a._updateCameraAndControl(),b(r,u)&&l.resetActive(),p(p([],g(e)),g(r))},[]);return this.render(),0<o.length&&!l.animating&&((r=b(o,u)?s[r]||s[s.length-1]:u)?l.moveToPanel(r,{duration:0}).catch(function(){}):i.lookAt(0)),t.camera.updateOffset(),t.trigger(new c.ComponentEvent(H.PANEL_CHANGE,{added:[],removed:o})),o},n._getPanelAlign=function(){var e=this._align;return"object"==typeof e?e.panel:e},n._getPanelSizeSum=function(e){var n=e[0],t=e[e.length-1],e=t.margin.next-n.margin.prev;return t.range.max-n.range.min+e},n._updateCameraAndControl=function(){var e=_(this._flicking,"Renderer"),n=e.camera,e=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),e.updateInput()},e}(),Y=function(){function e(e){var n=e.index,t=e.align,e=e.flicking;this._index=n,this._flicking=e,this._align=t,this._removed=!1,this._resetInternalStates()}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(n,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){var e=this._toggleDirection,n=this._flicking.camera.rangeDiff;return e!==G.NONE&&this._toggled?e===G.PREV?-n:n:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(n,"outsetProgress",{get:function(){var e=this.position+this.offset,n=this._alignPos,t=this._flicking.camera,i=t.position;if(i===e)return 0;if(i<e){var r=e+(t.size-t.alignPosition)+n;return-E(i,e,r)}n=e-(t.alignPosition+this._size-n);return 1-E(i,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRatio",{get:function(){var e=this.range,n=this._size,t=this.offset,i=this._flicking.camera.visibleRange,r=e.min+t,e=e.max+t;if(e<=i.min||r>=i.max)return 0;t=n;return i.min>r&&(t-=i.min-r),i.max<e&&(t-=e-i.max),t/n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.resize=function(){var e=this.element,n=P(e),t=this._flicking,i=t.horizontal,t=t.renderer.panels[this._index-1];return this._size=i?e.offsetWidth:e.offsetHeight,this._margin=i?{prev:parseFloat(n.marginLeft||"0"),next:parseFloat(n.marginRight||"0")}:{prev:parseFloat(n.marginTop||"0"),next:parseFloat(n.marginBottom||"0")},this._pos=t?t.range.max+t.margin.next+this._margin.prev:this._margin.prev,this._height=i?e.offsetHeight:this._size,this._updateAlignPos(),this},n.contains=function(e){var n;return!(null===(n=this.element)||void 0===n||!n.contains(e))},n.destroy=function(){this._resetInternalStates(),this._removed=!0},n.includePosition=function(e,n){return this.includeRange(e,e,n=void 0===n?!1:n)},n.includeRange=function(e,n,t){var i=this._margin,r=this.range;return(t=void 0===t?!1:t)&&(r.min-=i.prev,r.max+=i.next),n>=r.min&&e<=r.max},n.focus=function(e){return this._flicking.moveTo(this._index,e)},n.prev=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(0===e?i-1:e-1):t.getPanel(e-1)},n.next=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(e===i-1?0:e+1):t.getPanel(e+1)},n.increaseIndex=function(e){return this._index+=Math.max(e,0),this},n.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},n.increasePosition=function(e){return this._moveBy(Math.max(e,0)),this},n.decreasePosition=function(e){return this._moveBy(-Math.max(e,0)),this},n.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===G.NONE||n===e)return!1;var r=this._toggled;return e<n?e<=i&&i<=n&&(this._toggled=t===G.NEXT):i<=e&&n<=i&&(this._toggled=t!==G.NEXT),r!==this._toggled},n.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=G.NONE,this._toggled=!1,this;var n=e.camera,t=n.range,i=n.alignPosition,r=n.visibleRange,o=r.max-r.min,e=t.min-i,r=t.max-i+o,r=this.includeRange(r-o,r,!1),e=this.includeRange(e,e+o,!1);return this._toggled=!1,r?(this._toggleDirection=G.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):e?(this._toggleDirection=G.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=G.NONE,this._togglePosition=0),this},n._moveBy=function(e){return this._pos+=e,this},n._updateAlignPos=function(){this._alignPos=l(this._align,this._size)},n._resetInternalStates=function(){this._size=0,this._pos=0,this._margin={prev:0,next:0},this._height=0,this._alignPos=0,this._toggled=!1,this._togglePosition=0,this._toggleDirection=G.NONE},e}(),fe=function(t){function e(e){var n=t.call(this,e)||this;return n._el=e.el,n._rendered=!0,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),n.markForShow=function(){this._rendered=!0},n.markForHide=function(){this._rendered=!1},e}(Y),de=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.render=function(){return h(this,void 0,void 0,function(){var n,t,i,r;return f(this,function(e){return n=this._renderingStrategy,r=_(this._flicking,"Renderer"),t=r.camera.element,i=this._panels.filter(function(e){return e.element.parentElement===t}),n.updateRenderingPanels(r),r=this._getRenderingPanelsByOrder(),this._removePanelElements(i.filter(function(e){return!e.rendered})),this._insertPanelElements(r.filter(function(e){return e.element.parentElement!==t}),null),this._resetPanelElementOrder(r),[2]})})},t.forceRenderAllPanels=function(){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Renderer"),n=n.camera,n=n.element,t=document.createDocumentFragment(),this._panels.forEach(function(e){return t.appendChild(e.element)}),this._removeAllChildsFromCamera(),n.appendChild(t),[2]})})},t._collectPanels=function(){var t=_(this._flicking,"Renderer"),n=t.camera.element;s(n.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&n.removeChild(e)});var i=this._getPanelAlign(),e=s(n.children);this._panels=e.map(function(e,n){return new fe({flicking:t,el:e,index:n,align:i})})},t._createPanel=function(e,n){return new fe(r({el:e},n))},t._insertPanelElements=function(e,n){var t=_(this._flicking,"Renderer").camera.element,n=(null==n?void 0:n.element)||null,i=document.createDocumentFragment();return e.forEach(function(e){return i.appendChild(e.element)}),t.insertBefore(i,n),this},t._removePanelElements=function(e){var n=_(this._flicking,"Renderer").camera.element;return e.forEach(function(e){n.removeChild(e.element)}),this},t._resetPanelElementOrder=function(e){var t=_(this._flicking,"Renderer").camera.element,i=p([],g(e)).reverse();i.forEach(function(e,n){n=i[n-1],n=n?n.element:null;e.element.nextElementSibling!==n&&t.insertBefore(e.element,n)})},t._removeAllChildsFromCamera=function(){for(var e=_(this._flicking,"Renderer").camera.element;e.firstChild;)e.removeChild(e.firstChild)},t._getRenderingPanelsByOrder=function(){return _(this._flicking,"Renderer").renderer.panels.filter(function(e){return e.rendered}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)})},n}(ne),ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t._insertPanelElements=function(e,n){},t._removePanelElements=function(e){},n}(ne),ge=function(){function e(){}return e.prototype.updateRenderingPanels=function(n){var e=n.renderer.panels,t=n.camera,i=t.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});e.forEach(function(e){e.index in i?e.markForShow():n.holding||e.markForHide()}),t.updateOffset()},e}(),ne={__proto__:null,Renderer:ne,VanillaRenderer:de,ExternalRenderer:ae,RawRenderingStrategy:he,VisibleRenderingStrategy:ge},ae=function(x){function e(e,n){var t=void 0===n?{}:n,i=t.align,r=void 0===i?M.CENTER:i,o=t.defaultIndex,a=void 0===o?0:o,s=t.horizontal,l=void 0===s||s,u=t.circular,c=void 0!==u&&u,h=t.bound,f=void 0!==h&&h,d=t.adaptive,g=void 0!==d&&d,p=t.needPanelThreshold,_=void 0===p?0:p,v=t.deceleration,m=void 0===v?.0075:v,b=t.duration,E=void 0===b?500:b,P=t.easing,y=void 0===P?function(e){return 1-Math.pow(1-e,3)}:P,O=t.inputType,n=void 0===O?["mouse","touch"]:O,i=t.moveType,o=void 0===i?"snap":i,s=t.threshold,u=void 0===s?40:s,h=t.interruptable,d=void 0===h||h,p=t.bounce,v=void 0===p?"20%":p,b=t.iOSEdgeSwipeThreshold,P=void 0===b?30:b,O=t.preventClickOnDrag,i=void 0===O||O,s=t.disableOnInit,h=void 0!==s&&s,p=t.renderOnlyVisible,b=void 0!==p&&p,O=t.autoInit,s=void 0===O||O,p=t.autoResize,O=void 0===p||p,p=t.renderExternal,t=void 0===p?null:p,p=x.call(this)||this;return p._initialized=!1,p._plugins=[],p._align=r,p._defaultIndex=a,p._horizontal=l,p._circular=c,p._bound=f,p._adaptive=g,p._needPanelThreshold=_,p._deceleration=m,p._duration=E,p._easing=y,p._inputType=n,p._moveType=o,p._threshold=u,p._interruptable=d,p._bounce=v,p._iOSEdgeSwipeThreshold=P,p._preventClickOnDrag=i,p._disableOnInit=h,p._renderOnlyVisible=b,p._autoResize=O,p._autoInit=s,p._renderExternal=t,p._viewport=new W(function(e,n){var t=null;if(B(e)){n=(n||document).querySelector(e);if(!n)throw new T(N(e),A.ELEMENT_NOT_FOUND);t=n}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new T(C(e,["HTMLElement","string"]),A.WRONG_TYPE);return t}(e)),p._renderer=p._createRenderer(),p._camera=p._createCamera(),p._control=p._createControl(),p.resize=p.resize.bind(p),p._autoInit&&p.init(),p}a(e,x);var n=e.prototype;return Object.defineProperty(n,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(n,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(n,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(n,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(n,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e,this._renderer.align=e,this._camera.align=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"needPanelThreshold",{get:function(){return this._needPanelThreshold},enumerable:!1,configurable:!0}),Object.defineProperty(n,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){var n;e!==this._preventClickOnDrag&&(n=this._control.controller,e?n.addPreventClickHandler():n.removePreventClickHandler(),this._preventClickOnDrag=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),n.init=function(){return h(this,void 0,void 0,function(){var n,t,i,r=this;return f(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,n.init(this),t.init(this),i.init(this),[4,this.resize()]);case 1:return e.sent(),this._moveToInitialPanel(),this._autoResize&&window.addEventListener("resize",this.resize),this._preventClickOnDrag&&i.controller.addPreventClickHandler(),this._disableOnInit&&this.disableInput(),this._plugins.forEach(function(e){return e.init(r)}),this._initialized=!0,this.trigger(new c.ComponentEvent(H.READY)),[2]}})})},n.destroy=function(){this._initialized&&(this.off(),window.removeEventListener("resize",this.resize),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach(function(e){return e.destroy()}),this._initialized=!1)},n.prev=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.prev())||void 0===n?void 0:n.index)&&void 0!==n?n:-1,e,G.PREV)},n.next=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.next())||void 0===n?void 0:n.index)&&void 0!==n?n:this._renderer.panelCount,e,G.NEXT)},n.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=G.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new T(j,A.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:n,direction:t}):Promise.reject(new T(w(e,0,r-1),A.INDEX_OUT_OF_RANGE))},n.getPanel=function(e){return this._renderer.getPanel(e)},n.enableInput=function(){return this._control.enable(),this},n.disableInput=function(){return this._control.disable(),this},n.getStatus=function(e){var n=void 0===e?{}:e,t=n.index,i=void 0===t||t,r=n.position,e=void 0===r||r,t=n.includePanelHTML,o=void 0!==t&&t,r=n.visiblePanelsOnly,t=void 0!==r&&r,n=this._camera,r={panels:(t?this.visiblePanels:this.panels).map(function(e){var n={index:e.index};return o&&(n.html=e.element.outerHTML),n})};return i&&(r.index=this.index),!e||(e=n.findNearestAnchor(n.position))&&(r.position={panel:e.panel.index,progressInPanel:n.getProgressInPanel(e.panel)}),t&&(t=this.visiblePanels,r.visibleOffset=null!==(t=null===(t=t[0])||void 0===t?void 0:t.index)&&void 0!==t?t:0),r},n.setStatus=function(e){if(!this._initialized)throw new T(z,A.NOT_INITIALIZED);var n=e.index,t=e.position,i=e.visibleOffset,r=e.panels,o=this._renderer,a=this._control;null!==(e=r[0])&&void 0!==e&&e.html&&!this._renderExternal&&(o.batchRemove({index:0,deleteCount:this.panels.length}),o.batchInsert({index:0,elements:u(r.map(function(e){return e.html}))})),n&&this.moveTo(i?n-i:n,0).catch(function(){}),t&&this._moveType===F.FREE_SCROLL&&(n=t.panel,t=t.progressInPanel,t=(n=o.panels[i?n-i:n].range).min+(n.max-n.min)*t,a.moveToPosition(t,0).catch(function(){}))},n.addPlugins=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return this._initialized&&t.forEach(function(e){return e.init(n)}),(e=this._plugins).push.apply(e,p([],g(t))),this},n.removePlugins=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.forEach(function(n){var e=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(t._plugins,function(e){return e===n});0<=e&&(n.destroy(),t._plugins.splice(e,1))}),this},n.resize=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){switch(e.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,s=this._control,a=s.activePanel,r=n.width,o=n.height,a=a?i.getProgressInPanel(a):0,this.trigger(new c.ComponentEvent(H.BEFORE_RESIZE,{width:r,height:o,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return e.sent(),t.updatePanelSize(),[4,t.render()];case 2:return e.sent(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),s.animating?[3,5]:[3,3];case 3:return[4,s.updatePosition(a)];case 4:e.sent(),s.updateInput(),e.label=5;case 5:return a=n.width,s=n.height,s=a!==r||s!==o,this.trigger(new c.ComponentEvent(H.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:r,height:o},sizeChanged:s,element:n.element})),[2]}})})},n.append=function(e){return this.insert(this._renderer.panelCount,e)},n.prepend=function(e){return this.insert(0,e)},n.insert=function(e,n){if(this._renderExternal)throw new T(L,A.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:u(n)})},n.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new T(L,A.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n})},n._createControl=function(){var e,n=this._moveType,t=Object.keys(F).map(function(e){return F[e]}),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!b(t,i))throw new T(I("moveType",JSON.stringify(n)),A.WRONG_OPTION);switch(i){case F.SNAP:return new te;case F.FREE_SCROLL:return new ie(r)}},n._createCamera=function(){var e={align:this._align};return this._circular?(this._bound&&console.warn('"circular" and "bound" option cannot be used together, ignoring bound.'),new le(e)):new(this._bound?ue:se)(e)},n._createRenderer=function(){var e=new(this._renderOnlyVisible?ge:he),n={align:this._align,strategy:e},e=this._renderExternal;return e?new e.renderer(r(r({},n),e.rendererOptions)):new de(n)},n._moveToInitialPanel=function(){var e=this._renderer,n=this._control,e=e.getPanel(this._defaultIndex)||e.getPanel(0);e&&n.moveToPanel(e,{duration:0})},e.VERSION="4.2.0-beta.1",e}(c);return e(ae,{__proto__:null,Viewport:W,FlickingError:T,AnchorPoint:oe,Panel:Y,ElementPanel:fe,ExternalPanel:function(t){function e(e){var n=t.call(this,e)||this;return n._externalComponent=e.externalComponent,n}return a(e,t),e}(Y)}),e(ae,ce),e(ae,re),e(ae,ne),e(ae,n),ae});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes)}(this,function(c,o){"use strict";var i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}i(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var r=function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};function h(e,a,s,l){return new(s=s||Promise)(function(t,n){function i(e){try{o(l.next(e))}catch(e){n(e)}}function r(e){try{o(l.throw(e))}catch(e){n(e)}}function o(e){var n;e.done?t(e.value):((n=e.value)instanceof s?n:new s(function(e){e(n)})).then(i,r)}o((l=l.apply(e,a||[])).next())})}function f(t,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:n(0),throw:n(1),return:n(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function n(n){return function(e){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,(n=a?[2&n[0],a.value]:n)[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=i.call(t,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,e])}}}function d(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],i=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var i,r,o=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return a}function p(e,n){for(var t=0,i=n.length,r=e.length;t<i;t++,r++)e[r]=n[t];return e}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(n){Object.keys(n).forEach(function(e){t[e]=n[e]})}),t}function t(e,n,t){return Math.max(Math.min(e,t),n)}function _(e,n){if(!e)throw new T(x(n),A.NOT_ATTACHED_TO_FLICKING);return e}function s(e){return[].slice.call(e)}function l(e,n){var t;if(B(e))switch(e){case M.PREV:t=0;break;case M.CENTER:t=.5*n;break;case M.NEXT:t=n;break;default:if(null==(t=V(e,n)))throw new T(I("align",e),A.WRONG_OPTION)}else t=e;return t}function v(e,n){return e===n?G.NONE:e<n?G.NEXT:G.PREV}function u(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function(e){if(B(e)){var n=document.createElement("div");for(n.innerHTML=e,t.push.apply(t,p([],g(s(n.children))));n.firstChild;)n.removeChild(n.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new T(C(e,["HTMLElement","string"]),A.WRONG_TYPE);t.push(e)}}),t}function m(e,n){return t(e<0?e+n:e,0,n)}function b(e,n){var t,i;try{for(var r=d(e),o=r.next();!o.done;o=r.next())if(o.value===n)return 1}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}function E(e,n,t){return(e-n)/(t-n)}function P(e){return window.getComputedStyle(e)||e.currentStyle}var y,T=function(i){function r(e,n){var t=i.call(this,e)||this;return t.message=e,t.code=n,Object.setPrototypeOf(t,r.prototype),t.name="FlickingError",t}return a(r,i),r}(Error),A={WRONG_TYPE:0,ELEMENT_NOT_FOUND:1,VAL_MUST_NOT_NULL:2,NOT_ATTACHED_TO_FLICKING:3,WRONG_OPTION:4,INDEX_OUT_OF_RANGE:5,POSITION_NOT_REACHABLE:6,TRANSFORM_NOT_SUPPORTED:7,STOP_CALLED_BY_USER:8,ANIMATION_INTERRUPTED:9,ANIMATION_ALREADY_PLAYING:10,NOT_ALLOWED_IN_FRAMEWORK:11,NOT_INITIALIZED:12,NO_ACTIVE:13},C=function(e,n){return e+"("+typeof e+") is not a "+n.map(function(e){return'"'+e+'"'}).join(" or ")+"."},N=function(e){return'Element with selector "'+e+'" not found.'},O=function(e,n){return n+" should be provided. Given: "+e},x=function(e){return e+' is not attached to the Flicking instance. "init()" should be called first.'},I=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},w=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},R=function(e){return'Position "'+e+'" is not reachable.'},k="Browser does not support CSS transform.",D="Event stop() is called by user.",S="Animation is interrupted by user input.",j="Animation is already playing.",L="This behavior is not allowed in the frameworks like React, Vue, or Angular.",z="Flicking is not initialized yet, call init() first.",H={READY:"ready",BEFORE_RESIZE:"beforeResize",AFTER_RESIZE:"afterResize",HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",WILL_CHANGE:"willChange",CHANGED:"changed",WILL_RESTORE:"willRestore",RESTORED:"restored",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange",REACH_EDGE:"reachEdge",PANEL_CHANGE:"panelChange"},M={PREV:"prev",CENTER:"center",NEXT:"next"},G={PREV:"PREV",NEXT:"NEXT",NONE:null},F={SNAP:"snap",FREE_SCROLL:"freeScroll"},n={__proto__:null,EVENTS:H,ALIGN:M,DIRECTION:G,MOVE_TYPE:F,ERROR_CODE:A},V=function(e,n){var t=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return e;for(var i=0,r=0,o=t.exec(e);null!=o;){var a=o[1],s=o[2],l=o[3],s=parseFloat(s);if(!(a=i<=0?a||"+":a))return null;"%"===l&&(s=s/100*n),r+="+"===a?s:-s,++i,o=t.exec(e)}return 0===i?null:r},B=function(e){return"string"==typeof e},W=function(){function e(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(n,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),n.setSize=function(e){var n=e.width,t=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=n&&(B(n)?i.style.width=n:(n=e?n+r.left+r.right:n,i.style.width=n+"px")),null!=t&&(B(t)?i.style.height=t:(t=e?t+r.top+r.bottom:t,i.style.height=t+"px")),this.resize()},n.resize=function(){var e=this._el,n=P(e);this._width=e.offsetWidth,this._height=e.offsetHeight,this._padding={left:parseFloat(n.paddingLeft),right:parseFloat(n.paddingRight),top:parseFloat(n.paddingTop),bottom:parseFloat(n.paddingBottom)},this._isBorderBoxSizing="border-box"===n.boxSizing},e}(),X={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},U="flick";(ce=y=y||{})[ce.IDLE=0]="IDLE",ce[ce.HOLDING=1]="HOLDING",ce[ce.DRAGGING=2]="DRAGGING",ce[ce.ANIMATING=3]="ANIMATING",ce[ce.DISABLED=4]="DISABLED";var Y=function(){function e(){}var n=e.prototype;return n.onHold=function(e){},n.onChange=function(e){},n.onRelease=function(e){},n.onAnimationEnd=function(e){},n.onFinish=function(e){},e}(),K=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;n.renderer.panelCount<=0?e(y.DISABLED):(t=new c.ComponentEvent(H.HOLD_START,{axesEvent:t}),n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.HOLDING))},t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control.controller.animatingContext,t=new c.ComponentEvent(H.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(r.start,r.end),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.ANIMATING).onChange(e)},e}(Y),Z=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=t.inputEvent,r=n.horizontal?r.offsetX:r.offsetY,t=new c.ComponentEvent(H.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(0,-r),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.DRAGGING).onChange(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;if(n.trigger(new c.ComponentEvent(H.HOLD_END,{axesEvent:t})),0!==t.delta.flick)return t.setTo({flick:n.camera.position},0),void e(y.IDLE);this._releaseEvent=t},t.onFinish=function(e){var n=e.flicking;if((0,e.transitTo)(y.IDLE),this._releaseEvent){var t,i=this._releaseEvent.inputEvent.srcEvent;t="touchend"===i.type?(e=i.changedTouches[0],document.elementFromPoint(e.clientX,e.clientY)):i.target;var r,o,i=n.renderer.panels,a=null;try{for(var s=d(i),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.contains(t)){a=u;break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}a&&(r=n.camera.position,o=a.position,n.trigger(new c.ComponentEvent(H.SELECT,{index:a.index,panel:a,direction:v(r,o)})))}},e}(Y),q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta[U]&&(e=(n=t.camera).position,n.lookAt(i.pos[U]),i=new c.ComponentEvent(H.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta[U]),axesEvent:i}),t.trigger(i),i.isCanceled()&&(n.lookAt(e),r(y.DISABLED)))},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo;n.trigger(new c.ComponentEvent(H.HOLD_END,{axesEvent:t})),n.renderer.panelCount<=0?i(y.IDLE):(i(y.ANIMATING),e=n.control,i=t.destPos[U],n=Math.max(t.duration,n.duration),e.moveToPosition(i,n,t))},e}(Y),J=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo,t=new c.ComponentEvent(H.HOLD_START,{axesEvent:t});n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.DRAGGING)},t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta.flick&&(e=(n=t.camera).position,n.lookAt(i.pos.flick),i=new c.ComponentEvent(H.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta.flick),axesEvent:i}),t.trigger(i),i.isCanceled()&&(t.camera.lookAt(e),r(y.DISABLED)))},t.onFinish=function(e){var n=e.flicking,t=e.axesEvent;(0,e.transitTo)(y.IDLE);e=n.control.controller.animatingContext;n.trigger(new c.ComponentEvent(H.MOVE_END,{isTrusted:t.isTrusted,direction:v(e.start,e.end),axesEvent:t}))},e}(Y),Q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onAnimationEnd=function(e){(0,e.transitTo)(y.IDLE)},t.onChange=function(e){var n=e.axesEvent,e=e.transitTo;n.stop(),e(y.IDLE)},t.onRelease=function(e){var n=e.axesEvent,e=e.transitTo;0===n.delta.flick&&e(y.IDLE)},e}(Y),$=function(){function e(){var t=this;this.transitTo=function(e){var n;switch(e){case y.IDLE:n=new K;break;case y.HOLDING:n=new Z;break;case y.DRAGGING:n=new q;break;case y.ANIMATING:n=new J;break;case y.DISABLED:n=new Q}return t._state=n,t._state},this._state=new K}var n=e.prototype;return Object.defineProperty(n,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),n.fire=function(e,n){var t=this._state,i=r(r({},n),{transitTo:this.transitTo});switch(e){case X.HOLD:t.onHold(i);break;case X.CHANGE:t.onChange(i);break;case X.RELEASE:t.onRelease(i);break;case X.ANIMATION_END:t.onAnimationEnd(i);break;case X.FINISH:t.onFinish(i)}},e}(),ee=function(){function e(){var n=this;this._onAxesHold=function(){n._dragged=!1},this._onAxesChange=function(){n._dragged=!0},this._preventClickWhenDragged=function(e){n._dragged&&(e.preventDefault(),e.stopPropagation()),n._dragged=!1},this._resetInternalValues(),this._stateMachine=new $}var n=e.prototype;return Object.defineProperty(n,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(n,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(n,"enabled",{get:function(){var e;return null!==(e=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([U])[U])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[U].bounce},enumerable:!1,configurable:!0}),n.init=function(t){var e,i=this;this._flicking=t,this._axes=new o(((e={})[U]={range:[0,0],circular:!1,bounce:[0,0]},e),{deceleration:t.deceleration,interruptable:t.interruptable,easing:t.easing}),this._panInput=new o.PanInput(t.viewport.element,{inputType:t.inputType,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]});var r=this._axes;r.connect(t.horizontal?[U,""]:["",U],this._panInput);for(var n in X)!function(e){var n=X[e];r.on(n,function(e){i._stateMachine.fire(n,{flicking:t,axesEvent:e})})}(n);return this},n.destroy=function(){var e;this.removePreventClickHandler(),null!==(e=this._axes)&&void 0!==e&&e.destroy(),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},n.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},n.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},n.update=function(){var n,t,e=_(this._flicking,"Control"),i=e.camera,r=this._axes,o=i.controlParams,a=r.axis[U];return a.circular=[o.circular,o.circular],a.range=[o.range.min,o.range.max],a.bounce=(n=e.bounce,t=i.size,(Array.isArray(n)?n.map(function(e){return V(e,t)}):[i=V(n,t),i]).map(function(e){if(null==e)throw new T(I("bounce",n),A.WRONG_OPTION);return e})),r.axm.set(((r={})[U]=o.position,r)),this},n.addPreventClickHandler=function(){var e=_(this._flicking,"Control"),n=this._axes,e=e.element;n.on(X.HOLD,this._onAxesHold),n.on(X.CHANGE,this._onAxesChange),e.addEventListener("click",this._preventClickWhenDragged,!0)},n.removePreventClickHandler=function(){var e=_(this._flicking,"Control"),n=this._axes,e=e.element;n.off(X.HOLD,this._onAxesHold),n.off(X.CHANGE,this._onAxesChange),e.removeEventListener("click",this._preventClickWhenDragged,!0)},n.animateTo=function(n,t,i){var r=this,o=this._axes;if(!o)return Promise.reject(new T(x("Control"),A.NOT_ATTACHED_TO_FLICKING));var e=o.get([U])[U];if(e===n)return _(this._flicking,"Control").camera.lookAt(n);this._animatingContext={start:e,end:n,offset:0};function a(){var e;o.once(X.FINISH,function(){r._animatingContext={start:0,end:0,offset:0}}),i?i.setTo(((e={})[U]=n,e),t):o.setTo(((e={})[U]=n,e),t)}return 0===t?(a(),o.axm.set(((e={})[U]=n,e)),Promise.resolve()):new Promise(function(e,n){function t(){o.off(X.HOLD,i),e()}var i=function(){o.off(X.FINISH,t),n(new T(S,A.ANIMATION_INTERRUPTED))};o.once(X.FINISH,t),o.once(X.HOLD,i),a()})},n._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0},this._dragged=!1},e}(),ne=function(){function e(){var o=this;this._setActive=function(e,n,t){var i,r=_(o._flicking,"Control");o._activePanel=e,r.camera.updateAdaptiveHeight(),e!==n?r.trigger(new c.ComponentEvent(H.CHANGED,{index:e.index,panel:e,prevIndex:null!==(i=null==n?void 0:n.index)&&void 0!==i?i:-1,prevPanel:n,isTrusted:t,direction:n?v(n.position,e.position):G.NONE})):r.trigger(new c.ComponentEvent(H.RESTORED,{isTrusted:t}))},this._flicking=null,this._controller=new ee,this._activePanel=null}var n=e.prototype;return Object.defineProperty(n,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activeIndex",{get:function(){var e;return null!==(e=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._controller.init(e),this},n.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},n.enable=function(){return this._controller.enable(),this},n.disable=function(){return this._controller.disable(),this},n.updatePosition=function(e){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return t=_(this._flicking,"Control"),n=t.camera,(t=this._activePanel)?[4,n.lookAt(n.clampToReachablePosition(t.position))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.updateInput=function(){return this._controller.update(),this},n.resetActive=function(){return this._activePanel=null,this},n.moveToPanel=function(a,e){var s=e.duration,n=e.direction,l=void 0===n?G.NONE:n,u=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o;return f(this,function(e){return n=_(this._flicking,"Control"),o=n.camera,t=a.position,i=o.findNearestAnchor(t),a.removed||!i?[2,Promise.reject(new T(R(a.position),A.POSITION_NOT_REACHABLE))]:(o.canReach(a)?n.circularEnabled&&(r=this._controller.position,o=o.rangeDiff,t=[t,t+o,t-o].filter(function(e){return l===G.NONE||(l===G.PREV?e<=r:r<=e)}).reduce(function(e,n){return Math.abs(r-n)<Math.abs(r-e)?n:e},1/0)):(t=i.position,a=i.panel),this._triggerIndexChangeEvent(a,a.position,u),[2,this._animateToPosition({position:t,duration:s,newActivePanel:a,axesEvent:u})])})})},n._triggerIndexChangeEvent=function(e,n,t){var i=_(this._flicking,"Control"),r=e!==this._activePanel?H.WILL_CHANGE:H.WILL_RESTORE,o=i.camera,a=this._activePanel,n=new c.ComponentEvent(r,{index:e.index,panel:e,isTrusted:(null==t?void 0:t.isTrusted)||!1,direction:v(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,n)});if(i.trigger(n),n.isCanceled())throw new T(D,A.STOP_CALLED_BY_USER)},n._animateToPosition=function(e){var s=e.position,l=e.duration,u=e.newActivePanel,c=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){return n=_(this._flicking,"Control"),t=this._activePanel,i=function(){return a._controller.animateTo(s,l,c)},r=(null==c?void 0:c.isTrusted)||!1,l<=0?(o=i(),this._setActive(u,t,r),[2,o]):[2,i().then(function(){return h(a,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return this._setActive(u,t,r),[4,n.renderer.render()];case 1:return e.sent(),[2]}})})}).catch(function(e){if(!(c&&e instanceof T&&e.code===A.ANIMATION_INTERRUPTED))throw e})]})})},e}(),te=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.moveToPosition=function(l,u,c){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){return r=_(this._flicking,"Control"),n=r.camera,t=this._activePanel,o=n.clampToReachablePosition(l),(i=n.findNearestAnchor(o))&&t?(o=t.position,r=Math.abs(l-o)>=r.threshold,o=o<l?n.getNextAnchor(i):n.getPrevAnchor(i),r&&i.position!==t.position?(s=i.panel,a=i.position):r&&o?(s=o.panel,a=o.position):(a=n.clampToReachablePosition(t.position),s=t),this._triggerIndexChangeEvent(s,l,c),[2,this._animateToPosition({position:a,duration:u,newActivePanel:s,axesEvent:c})]):[2,Promise.reject(new T(R(l),A.POSITION_NOT_REACHABLE))]})})},n}(ne),ie=function(t){function e(e){var n=(void 0===e?{}:e).stopAtEdge,e=void 0===n||n,n=t.call(this)||this;return n._stopAtEdge=e,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),n.updatePosition=function(i){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return(t=_(this._flicking,"Control"),n=t.camera,t=this._activePanel)?(t=t.range,t=t.min+(t.max-t.min)*i,[4,n.lookAt(n.clampToReachablePosition(t))]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.moveToPosition=function(i,r,o){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Control"),t=n.camera,n=t.clampToReachablePosition(i),(t=t.findAnchorIncludePosition(n))?((t=t.panel)!==this._activePanel&&this._triggerIndexChangeEvent(t,i,o),[2,this._animateToPosition({position:this._stopAtEdge?n:i,duration:r,newActivePanel:t,axesEvent:o})]):[2,Promise.reject(new T(R(i),A.POSITION_NOT_REACHABLE))]})})},e}(ne),re={__proto__:null,Control:ne,SnapControl:te,FreeControl:ie,AxesController:ee,State:Y,IdleState:K,HoldingState:Z,DraggingState:q,AnimatingState:J,DisabledState:Q,StateMachine:$},oe=function(){function e(e){var n=e.index,t=e.position,e=e.panel;this._index=n,this._pos=t,this._panel=e}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),e}(),ae=function(){function e(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?M.CENTER:e;this._checkTranslateSupport=function(){var n,e,t=document.documentElement.style,i="";try{for(var r=d(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),o=r.next();!o.done;o=r.next()){var a=o.value;a in t&&(i=a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}if(!i)throw new T(k,A.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking,n=this._position+this._offset,t=this.findNearestAnchor(this._position);if(!e||!t)return NaN;var i=t.panel,r=i.position+i.offset,o=e.control.controller.bounce,a=this.range,t=a.min,e=a.max,a=this.rangeDiff;if(n===r)return i.index;if(n<r){var s=i.prev(),s=s?s.position+s.offset:t-o[0];return r<s&&(s-=a),i.index-1+E(n,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+E(n,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.init=function(e){e=(this._flicking=e).viewport.element;return function(e,n){if(null==e)throw new T(O(e,n),A.VAL_MUST_NOT_NULL)}(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},n.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},n.lookAt=function(t){return h(this,void 0,void 0,function(){var n;return f(this,function(e){switch(e.label){case 0:return n=this._position,this._position=t,[4,this._refreshVisiblePanels()];case 1:return e.sent(),this._checkNeedPanel(),this._checkReachEnd(n,t),this._applyTransform(),[2]}})})},n.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},n.getNextAnchor=function(e){return this._anchors[e.index+1]||null},n.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},n.findAnchorIncludePosition=function(t){return this._anchors.filter(function(e){return e.panel.includePosition(t,!0)}).reduce(function(e,n){return e&&Math.abs(e.position-t)<Math.abs(n.position-t)?e:n},null)},n.findNearestAnchor=function(e){var n=this._anchors;if(n.length<=0)return null;for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n.clampToReachablePosition=function(e){var n=this._range;return t(e,n.min,n.max)},n.canReach=function(e){var n=this._range;if(e.removed)return!1;e=e.position;return e>=n.min&&e<=n.max},n.canSee=function(e){var n=this.visibleRange;return e.includeRange(n.min,n.max,!1)},n.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=l(e,this.size),this},n.updateAnchors=function(){var e=_(this._flicking,"Camera").renderer.panels;return this._anchors=e.map(function(e,n){return new oe({index:n,position:e.position,panel:e})}),this},n.updateAdaptiveHeight=function(){var e=_(this._flicking,"Camera"),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},n.updateOffset=function(){var e=_(this._flicking,"Camera").panels.filter(function(e){return!e.rendered}),n=this._position;this._offset=e.filter(function(e){return e.position+e.offset<n}).reduce(function(e,n){return e+n.sizeIncludingMargin},0),this._applyTransform()},n.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},n._resetInternalValues=function(){this._position=0,this._alignPos=0,this._offset=0,this._range={min:0,max:0},this._visiblePanels=[],this._anchors=[],this._needPanelTriggered={prev:!1,next:!1}},n._refreshVisiblePanels=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),o=n.renderer.panels,t=o.filter(function(e){return a.canSee(e)}),i=this._visiblePanels,this._visiblePanels=t,r=t.filter(function(e){return!b(i,e)}),o=i.filter(function(e){return!b(t,e)}),0<r.length||0<o.length?[4,n.renderer.render()]:[3,2];case 1:e.sent(),n.trigger(new c.ComponentEvent(H.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:t})),e.label=2;case 2:return[2]}})})},n._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var n=_(this._flicking,"Camera"),t=n.renderer.panels;if(t.length<=0)return e.prev||(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.PREV})),e.prev=!0),void(e.next||(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.NEXT})),e.next=!0));var i=this._position,r=this.size,o=this._range,a=n.needPanelThreshold,s=i-this._alignPos,l=s+r,r=t[0],t=t[t.length-1];e.prev||(s<=r.range.min+a||i<=o.min+a)&&(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.PREV})),e.prev=!0),e.next||(t.range.max-a<=l||i>=o.max-a)&&(n.trigger(new c.ComponentEvent(H.NEED_PANEL,{direction:G.NEXT})),e.next=!0)}},n._checkReachEnd=function(e,n){var t=_(this._flicking,"Camera"),i=this._range,r=e>i.min&&e<i.max,e=n>i.min&&n<i.max;r&&!e&&(i=n<=i.min?G.PREV:G.NEXT,t.trigger(new c.ComponentEvent(H.REACH_EDGE,{direction:i})))},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},e}(),se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=e.getPanel(0),e=e.getPanel(e.panelCount-1);return this._range={min:null!==(n=null==n?void 0:n.position)&&void 0!==n?n:0,max:null!==(e=null==e?void 0:e.position)&&void 0!==e?e:0},this},n}(ae),le=function(s){function e(){var e=null!==s&&s.apply(this,arguments)||this;return e._circularOffset=0,e._circularEnabled=!1,e}a(e,s);var n=e.prototype;return Object.defineProperty(n,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),n.getPrevAnchor=function(e){if(!this._circularEnabled||0!==e.index)return s.prototype.getPrevAnchor.call(this,e);var n=this._anchors,e=this.rangeDiff,n=n[n.length-1];return new oe({index:n.index,position:n.position-e,panel:n.panel})},n.getNextAnchor=function(e){var n=this._anchors;if(!this._circularEnabled||e.index!==n.length-1)return s.prototype.getNextAnchor.call(this,e);e=this.rangeDiff,n=n[0];return new oe({index:n.index,position:n.position+e,panel:n.panel})},n.findAnchorIncludePosition=function(e){if(!this._circularEnabled)return s.prototype.findAnchorIncludePosition.call(this,e);var n,t,i=this._range,r=(o=e,n=i.min,t=i.max,r=t-n,o<n?o=t-(n-o)%r:t<o&&(o=n+(o-t)%r),o),o=s.prototype.findAnchorIncludePosition.call(this,r);if(!o)return null;var r=this.rangeDiff;if(e<i.min){var a=-Math.floor((i.min-e)/r)-1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}if(e>i.max){a=Math.floor((e-i.max)/r)+1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}return o},n.clampToReachablePosition=function(e){return this._circularEnabled?e:s.prototype.clampToReachablePosition.call(this,e)},n.canReach=function(e){return!e.removed&&(!!this._circularEnabled||s.prototype.canReach.call(this,e))},n.canSee=function(e){var n=this._range,t=this.rangeDiff,i=this.visibleRange,r=s.prototype.canSee.call(this,e);return this._circularEnabled?i.min<n.min?r||e.includeRange(i.min+t,i.max+t,!1):i.max>n.max?r||e.includeRange(i.min-t,i.max-t,!1):r:r},n.updateRange=function(){var e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._resetInternalValues(),this;var n=e[0],t=e[e.length-1],i=n.range.min-n.margin.prev,r=t.range.max+t.margin.next,o=this.size,a=r-i,s=e.every(function(e){return a-e.size>=o});return(this._circularEnabled=s)?(this._range={min:i,max:r},e.forEach(function(e){return e.updateCircularToggleDirection()})):this._range={min:n.position,max:t.position},this._updateCircularOffset(),this},n.lookAt=function(r){return h(this,void 0,void 0,function(){var n,t,i;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),t=this._position,r!==t?[3,2]:[4,s.prototype.lookAt.call(this,r)];case 1:return[2,e.sent()];case 2:return(i=n.renderer.panels,i=i.map(function(e){return e.toggle(t,r)}),this._position=r,i.some(function(e){return e}))?(this._updateCircularOffset(),[4,n.renderer.render()]):[3,4];case 3:e.sent(),e.label=4;case 4:return[4,s.prototype.lookAt.call(this,r)];case 5:return[2,e.sent()]}})})},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset+this._circularOffset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},n._resetInternalValues=function(){s.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},n._calcPanelAreaSum=function(e){return e.reduce(function(e,n){return e+n.sizeIncludingMargin},0)},n._updateCircularOffset=function(){var e,n,t;this._circularEnabled?(e=_(this._flicking,"Camera"),n=[],t=[],e.panels.filter(function(e){return e.toggled}).forEach(function(e){(e.toggleDirection===G.PREV?n:t).push(e)}),this._circularOffset=this._calcPanelAreaSum(n)-this._calcPanelAreaSum(t)):this._circularOffset=0},e}(ae),ue=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=this._alignPos,t=e.getPanel(0),i=e.getPanel(e.panelCount-1);if(!t||!i)return this._range={min:0,max:0},this;var r=this.size,o=t.range.min,e=i.range.max;return this._range=r<e-o?{min:o+n,max:e-r+n}:{min:t.position,max:i.position},this},t.updateAnchors=function(){var n=this,e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._anchors=[],this;var t,i,r,o,a=this._range,s=e.filter(function(e){return n.canReach(e)});return 0<s.length?(t=s[0].position!==a.min,i=s[s.length-1].position!==a.max,r=t?1:0,o=s.map(function(e,n){return new oe({index:n+r,position:e.position,panel:e})}),t&&o.splice(0,0,new oe({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new oe({index:o.length,position:a.max,panel:e[s[s.length-1].index+1]})),this._anchors=o):a.min!==a.max?(s=(o=(s=this._findNearestPanel(a.min,e)).index===e.length-1?s.prev():s).next(),this._anchors=[new oe({index:0,position:a.min,panel:o}),new oe({index:1,position:a.max,panel:s})]):this._anchors=[new oe({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},t._findNearestPanel=function(e,n){for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n}(ae),ce={__proto__:null,Camera:ae,LinearCamera:se,CircularCamera:le,BoundCamera:ue},he=function(){function e(){}return e.prototype.updateRenderingPanels=function(e){e.panels.forEach(function(e){return e.markForShow()})},e}(),ne=function(){function e(e){var n=void 0===e?{}:e,e=n.align,e=void 0===e?M.CENTER:e,n=n.strategy,n=void 0===n?new he:n;this._align=e,this._flicking=null,this._renderingStrategy=n,this._panels=[]}var n=e.prototype;return Object.defineProperty(n,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=this._getPanelAlign();this._panels.forEach(function(e){e.align=n})},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._collectPanels(),this},n.destroy=function(){this._flicking=null,this._panels=[]},n.getPanel=function(e){return this._panels[e]||null},n.updatePanelSize=function(){return this._panels.forEach(function(e){return e.resize()}),this},n.batchInsert=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,l=_(this._flicking,"Renderer"),t=l.control,u=this._getPanelAlign(),i=e.reduce(function(e,n){var t=m(n.index,s.length),i=s.slice(t),r=n.elements.map(function(e){return a._createPanel(e,{index:t,align:u,flicking:l})});s.splice.apply(s,p([t,0],g(r))),r.forEach(function(e){return e.resize()});var o=a._getPanelSizeSum(r);return i.forEach(function(e){e.increaseIndex(r.length),e.increasePosition(o)}),a._insertPanelElements(r,null!==(i=i[0])&&void 0!==i?i:null),p(p([],g(e)),g(r))},[]);return i.length<=0?[]:(this._updateCameraAndControl(),this.render(),0<i.length&&!t.animating&&t.moveToPanel(t.activePanel||i[0],{duration:0}).catch(function(){}),l.camera.updateOffset(),l.trigger(new c.ComponentEvent(H.PANEL_CHANGE,{added:i,removed:[]})),i)},n.batchRemove=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,t=_(this._flicking,"Renderer"),i=t.camera,l=t.control,u=l.activePanel,r=l.activeIndex,o=e.reduce(function(e,n){var t=n.index,i=n.deleteCount,n=m(t,s.length),t=s.slice(n+i),r=s.splice(n,i);if(r.length<=0)return[];var o=a._getPanelSizeSum(r);return t.forEach(function(e){e.decreaseIndex(r.length),e.decreasePosition(o)}),a._removePanelElements(r),r.forEach(function(e){return e.destroy()}),a._updateCameraAndControl(),b(r,u)&&l.resetActive(),p(p([],g(e)),g(r))},[]);return this.render(),0<o.length&&!l.animating&&((r=b(o,u)?s[r]||s[s.length-1]:u)?l.moveToPanel(r,{duration:0}).catch(function(){}):i.lookAt(0)),t.camera.updateOffset(),t.trigger(new c.ComponentEvent(H.PANEL_CHANGE,{added:[],removed:o})),o},n._getPanelAlign=function(){var e=this._align;return"object"==typeof e?e.panel:e},n._getPanelSizeSum=function(e){var n=e[0],t=e[e.length-1],e=t.margin.next-n.margin.prev;return t.range.max-n.range.min+e},n._updateCameraAndControl=function(){var e=_(this._flicking,"Renderer"),n=e.camera,e=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),e.updateInput()},e}(),Y=function(){function e(e){var n=e.index,t=e.align,e=e.flicking;this._index=n,this._flicking=e,this._align=t,this._removed=!1,this._resetInternalStates()}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(n,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){var e=this._toggleDirection,n=this._flicking.camera.rangeDiff;return e!==G.NONE&&this._toggled?e===G.PREV?-n:n:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(n,"outsetProgress",{get:function(){var e=this.position+this.offset,n=this._alignPos,t=this._flicking.camera,i=t.position;if(i===e)return 0;if(i<e){var r=e+(t.size-t.alignPosition)+n;return-E(i,e,r)}n=e-(t.alignPosition+this._size-n);return 1-E(i,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRatio",{get:function(){var e=this.range,n=this._size,t=this.offset,i=this._flicking.camera.visibleRange,r=e.min+t,e=e.max+t;if(e<=i.min||r>=i.max)return 0;t=n;return i.min>r&&(t-=i.min-r),i.max<e&&(t-=e-i.max),t/n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.resize=function(){var e=this.element,n=P(e),t=this._flicking,i=t.horizontal,t=t.renderer.panels[this._index-1];return this._size=i?e.offsetWidth:e.offsetHeight,this._margin=i?{prev:parseFloat(n.marginLeft||"0"),next:parseFloat(n.marginRight||"0")}:{prev:parseFloat(n.marginTop||"0"),next:parseFloat(n.marginBottom||"0")},this._pos=t?t.range.max+t.margin.next+this._margin.prev:this._margin.prev,this._height=i?e.offsetHeight:this._size,this._updateAlignPos(),this},n.contains=function(e){var n;return!(null===(n=this.element)||void 0===n||!n.contains(e))},n.destroy=function(){this._resetInternalStates(),this._removed=!0},n.includePosition=function(e,n){return this.includeRange(e,e,n=void 0===n?!1:n)},n.includeRange=function(e,n,t){var i=this._margin,r=this.range;return(t=void 0===t?!1:t)&&(r.min-=i.prev,r.max+=i.next),n>=r.min&&e<=r.max},n.focus=function(e){return this._flicking.moveTo(this._index,e)},n.prev=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(0===e?i-1:e-1):t.getPanel(e-1)},n.next=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(e===i-1?0:e+1):t.getPanel(e+1)},n.increaseIndex=function(e){return this._index+=Math.max(e,0),this},n.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},n.increasePosition=function(e){return this._moveBy(Math.max(e,0)),this},n.decreasePosition=function(e){return this._moveBy(-Math.max(e,0)),this},n.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===G.NONE||n===e)return!1;var r=this._toggled;return e<n?e<=i&&i<=n&&(this._toggled=t===G.NEXT):i<=e&&n<=i&&(this._toggled=t!==G.NEXT),r!==this._toggled},n.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=G.NONE,this._toggled=!1,this;var n=e.camera,t=n.range,i=n.alignPosition,r=n.visibleRange,o=r.max-r.min,e=t.min-i,r=t.max-i+o,r=this.includeRange(r-o,r,!1),e=this.includeRange(e,e+o,!1);return this._toggled=!1,r?(this._toggleDirection=G.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):e?(this._toggleDirection=G.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=G.NONE,this._togglePosition=0),this},n._moveBy=function(e){return this._pos+=e,this},n._updateAlignPos=function(){this._alignPos=l(this._align,this._size)},n._resetInternalStates=function(){this._size=0,this._pos=0,this._margin={prev:0,next:0},this._height=0,this._alignPos=0,this._toggled=!1,this._togglePosition=0,this._toggleDirection=G.NONE},e}(),fe=function(t){function e(e){var n=t.call(this,e)||this;return n._el=e.el,n._rendered=!0,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),n.markForShow=function(){this._rendered=!0},n.markForHide=function(){this._rendered=!1},e}(Y),de=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.render=function(){return h(this,void 0,void 0,function(){var n,t,i,r;return f(this,function(e){return n=this._renderingStrategy,r=_(this._flicking,"Renderer"),t=r.camera.element,i=this._panels.filter(function(e){return e.element.parentElement===t}),n.updateRenderingPanels(r),r=this._getRenderingPanelsByOrder(),this._removePanelElements(i.filter(function(e){return!e.rendered})),this._insertPanelElements(r.filter(function(e){return e.element.parentElement!==t}),null),this._resetPanelElementOrder(r),[2]})})},t.forceRenderAllPanels=function(){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Renderer"),n=n.camera,n=n.element,t=document.createDocumentFragment(),this._panels.forEach(function(e){return t.appendChild(e.element)}),this._removeAllChildsFromCamera(),n.appendChild(t),[2]})})},t._collectPanels=function(){var t=_(this._flicking,"Renderer"),n=t.camera.element;s(n.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&n.removeChild(e)});var i=this._getPanelAlign(),e=s(n.children);this._panels=e.map(function(e,n){return new fe({flicking:t,el:e,index:n,align:i})})},t._createPanel=function(e,n){return new fe(r({el:e},n))},t._insertPanelElements=function(e,n){var t=_(this._flicking,"Renderer").camera.element,n=(null==n?void 0:n.element)||null,i=document.createDocumentFragment();return e.forEach(function(e){return i.appendChild(e.element)}),t.insertBefore(i,n),this},t._removePanelElements=function(e){var n=_(this._flicking,"Renderer").camera.element;return e.forEach(function(e){n.removeChild(e.element)}),this},t._resetPanelElementOrder=function(e){var t=_(this._flicking,"Renderer").camera.element,i=p([],g(e)).reverse();i.forEach(function(e,n){n=i[n-1],n=n?n.element:null;e.element.nextElementSibling!==n&&t.insertBefore(e.element,n)})},t._removeAllChildsFromCamera=function(){for(var e=_(this._flicking,"Renderer").camera.element;e.firstChild;)e.removeChild(e.firstChild)},t._getRenderingPanelsByOrder=function(){return _(this._flicking,"Renderer").renderer.panels.filter(function(e){return e.rendered}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)})},n}(ne),ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t._insertPanelElements=function(e,n){},t._removePanelElements=function(e){},n}(ne),ge=function(){function e(){}return e.prototype.updateRenderingPanels=function(n){var e=n.renderer.panels,t=n.camera,i=t.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});e.forEach(function(e){e.index in i?e.markForShow():n.holding||e.markForHide()}),t.updateOffset()},e}(),ne={__proto__:null,Renderer:ne,VanillaRenderer:de,ExternalRenderer:ae,RawRenderingStrategy:he,VisibleRenderingStrategy:ge},ae=function(x){function e(e,n){var t=void 0===n?{}:n,i=t.align,r=void 0===i?M.CENTER:i,o=t.defaultIndex,a=void 0===o?0:o,s=t.horizontal,l=void 0===s||s,u=t.circular,c=void 0!==u&&u,h=t.bound,f=void 0!==h&&h,d=t.adaptive,g=void 0!==d&&d,p=t.needPanelThreshold,_=void 0===p?0:p,v=t.deceleration,m=void 0===v?.0075:v,b=t.duration,E=void 0===b?500:b,P=t.easing,y=void 0===P?function(e){return 1-Math.pow(1-e,3)}:P,O=t.inputType,n=void 0===O?["mouse","touch"]:O,i=t.moveType,o=void 0===i?"snap":i,s=t.threshold,u=void 0===s?40:s,h=t.interruptable,d=void 0===h||h,p=t.bounce,v=void 0===p?"20%":p,b=t.iOSEdgeSwipeThreshold,P=void 0===b?30:b,O=t.preventClickOnDrag,i=void 0===O||O,s=t.disableOnInit,h=void 0!==s&&s,p=t.renderOnlyVisible,b=void 0!==p&&p,O=t.autoInit,s=void 0===O||O,p=t.autoResize,O=void 0===p||p,p=t.renderExternal,t=void 0===p?null:p,p=x.call(this)||this;return p._initialized=!1,p._plugins=[],p._align=r,p._defaultIndex=a,p._horizontal=l,p._circular=c,p._bound=f,p._adaptive=g,p._needPanelThreshold=_,p._deceleration=m,p._duration=E,p._easing=y,p._inputType=n,p._moveType=o,p._threshold=u,p._interruptable=d,p._bounce=v,p._iOSEdgeSwipeThreshold=P,p._preventClickOnDrag=i,p._disableOnInit=h,p._renderOnlyVisible=b,p._autoResize=O,p._autoInit=s,p._renderExternal=t,p._viewport=new W(function(e,n){var t=null;if(B(e)){n=(n||document).querySelector(e);if(!n)throw new T(N(e),A.ELEMENT_NOT_FOUND);t=n}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new T(C(e,["HTMLElement","string"]),A.WRONG_TYPE);return t}(e)),p._renderer=p._createRenderer(),p._camera=p._createCamera(),p._control=p._createControl(),p.resize=p.resize.bind(p),p._autoInit&&p.init(),p}a(e,x);var n=e.prototype;return Object.defineProperty(n,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(n,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(n,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(n,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(n,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e,this._renderer.align=e,this._camera.align=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"needPanelThreshold",{get:function(){return this._needPanelThreshold},enumerable:!1,configurable:!0}),Object.defineProperty(n,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){var n;e!==this._preventClickOnDrag&&(n=this._control.controller,e?n.addPreventClickHandler():n.removePreventClickHandler(),this._preventClickOnDrag=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),n.init=function(){return h(this,void 0,void 0,function(){var n,t,i,r=this;return f(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,n.init(this),t.init(this),i.init(this),[4,this.resize()]);case 1:return e.sent(),this._moveToInitialPanel(),this._autoResize&&window.addEventListener("resize",this.resize),this._preventClickOnDrag&&i.controller.addPreventClickHandler(),this._disableOnInit&&this.disableInput(),this._plugins.forEach(function(e){return e.init(r)}),this._initialized=!0,this.trigger(new c.ComponentEvent(H.READY)),[2]}})})},n.destroy=function(){this._initialized&&(this.off(),window.removeEventListener("resize",this.resize),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach(function(e){return e.destroy()}),this._initialized=!1)},n.prev=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.prev())||void 0===n?void 0:n.index)&&void 0!==n?n:-1,e,G.PREV)},n.next=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.next())||void 0===n?void 0:n.index)&&void 0!==n?n:this._renderer.panelCount,e,G.NEXT)},n.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=G.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new T(j,A.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:n,direction:t}):Promise.reject(new T(w(e,0,r-1),A.INDEX_OUT_OF_RANGE))},n.getPanel=function(e){return this._renderer.getPanel(e)},n.enableInput=function(){return this._control.enable(),this},n.disableInput=function(){return this._control.disable(),this},n.getStatus=function(e){var n=void 0===e?{}:e,t=n.index,i=void 0===t||t,r=n.position,e=void 0===r||r,t=n.includePanelHTML,o=void 0!==t&&t,r=n.visiblePanelsOnly,t=void 0!==r&&r,n=this._camera,r={panels:(t?this.visiblePanels:this.panels).map(function(e){var n={index:e.index};return o&&(n.html=e.element.outerHTML),n})};return i&&(r.index=this.index),!e||(e=n.findNearestAnchor(n.position))&&(r.position={panel:e.panel.index,progressInPanel:n.getProgressInPanel(e.panel)}),t&&(t=this.visiblePanels,r.visibleOffset=null!==(t=null===(t=t[0])||void 0===t?void 0:t.index)&&void 0!==t?t:0),r},n.setStatus=function(e){if(!this._initialized)throw new T(z,A.NOT_INITIALIZED);var n=e.index,t=e.position,i=e.visibleOffset,r=e.panels,o=this._renderer,a=this._control;null!==(e=r[0])&&void 0!==e&&e.html&&!this._renderExternal&&(o.batchRemove({index:0,deleteCount:this.panels.length}),o.batchInsert({index:0,elements:u(r.map(function(e){return e.html}))})),n&&this.moveTo(i?n-i:n,0).catch(function(){}),t&&this._moveType===F.FREE_SCROLL&&(n=t.panel,t=t.progressInPanel,t=(n=o.panels[i?n-i:n].range).min+(n.max-n.min)*t,a.moveToPosition(t,0).catch(function(){}))},n.addPlugins=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return this._initialized&&t.forEach(function(e){return e.init(n)}),(e=this._plugins).push.apply(e,p([],g(t))),this},n.removePlugins=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.forEach(function(n){var e=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(t._plugins,function(e){return e===n});0<=e&&(n.destroy(),t._plugins.splice(e,1))}),this},n.resize=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){switch(e.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,s=this._control,a=s.activePanel,r=n.width,o=n.height,a=a?i.getProgressInPanel(a):0,this.trigger(new c.ComponentEvent(H.BEFORE_RESIZE,{width:r,height:o,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return e.sent(),t.updatePanelSize(),[4,t.render()];case 2:return e.sent(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),s.animating?[3,5]:[3,3];case 3:return[4,s.updatePosition(a)];case 4:e.sent(),s.updateInput(),e.label=5;case 5:return a=n.width,s=n.height,s=a!==r||s!==o,this.trigger(new c.ComponentEvent(H.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:r,height:o},sizeChanged:s,element:n.element})),[2]}})})},n.append=function(e){return this.insert(this._renderer.panelCount,e)},n.prepend=function(e){return this.insert(0,e)},n.insert=function(e,n){if(this._renderExternal)throw new T(L,A.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:u(n)})},n.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new T(L,A.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n})},n._createControl=function(){var e,n=this._moveType,t=Object.keys(F).map(function(e){return F[e]}),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!b(t,i))throw new T(I("moveType",JSON.stringify(n)),A.WRONG_OPTION);switch(i){case F.SNAP:return new te;case F.FREE_SCROLL:return new ie(r)}},n._createCamera=function(){var e={align:this._align};return this._circular?(this._bound&&console.warn('"circular" and "bound" option cannot be used together, ignoring bound.'),new le(e)):new(this._bound?ue:se)(e)},n._createRenderer=function(){var e=new(this._renderOnlyVisible?ge:he),n={align:this._align,strategy:e},e=this._renderExternal;return e?new e.renderer(r(r({},n),e.rendererOptions)):new de(n)},n._moveToInitialPanel=function(){var e=this._renderer,n=this._control,e=e.getPanel(this._defaultIndex)||e.getPanel(0);e&&n.moveToPanel(e,{duration:0})},e.VERSION="4.2.0-beta.2",e}(c);return e(ae,{__proto__:null,Viewport:W,FlickingError:T,AnchorPoint:oe,Panel:Y,ElementPanel:fe,ExternalPanel:function(t){function e(e){var n=t.call(this,e)||this;return n._externalComponent=e.externalComponent,n}return a(e,t),e}(Y)}),e(ae,ce),e(ae,re),e(ae,ne),e(ae,n),ae});
//# sourceMappingURL=flicking.min.js.map
{
"name": "@egjs/flicking",
"version": "4.2.0-beta.1",
"version": "4.2.0-beta.2",
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.",

@@ -5,0 +5,0 @@ "main": "dist/flicking.js",

import withFlickingMethods from "./withFlickingMethods";
import sync from "./sync";
import getRenderingPanels from "./getRenderingPanels";
import getCameraAlign from "./getCameraAlign";
import getCameraAlign from "./getDefaultCameraTransform";

@@ -6,0 +6,0 @@ export {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc