@egjs/flicking 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declaration/Flicking.d.ts +5 -2
- package/declaration/core/panel/index.d.ts +2 -3
- package/declaration/core/panel/provider/ElementProvider.d.ts +1 -0
- package/declaration/core/panel/provider/VanillaElementProvider.d.ts +2 -0
- package/declaration/core/panel/provider/VirtualElementProvider.d.ts +2 -0
- package/declaration/core/panel/provider/index.d.ts +1 -2
- package/declaration/renderer/ExternalRenderer.d.ts +0 -1
- package/declaration/renderer/strategy/NormalRenderingStrategy.d.ts +1 -3
- package/dist/flicking.esm.js +4061 -4003
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +4181 -4124
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +4703 -5028
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +9 -22
- package/src/Flicking.ts +31 -18
- package/src/core/Viewport.ts +4 -4
- package/src/core/VirtualManager.ts +1 -1
- package/src/core/panel/index.ts +1 -4
- package/src/core/panel/provider/ElementProvider.ts +1 -0
- package/src/core/panel/provider/VanillaElementProvider.ts +5 -0
- package/src/core/panel/provider/VirtualElementProvider.ts +5 -2
- package/src/core/panel/provider/index.ts +1 -3
- package/src/renderer/ExternalRenderer.ts +1 -33
- package/src/renderer/strategy/NormalRenderingStrategy.ts +3 -6
- package/declaration/core/panel/ExternalPanel.d.ts +0 -13
- package/declaration/core/panel/provider/ExternalElementProvider.d.ts +0 -8
- package/src/core/panel/ExternalPanel.ts +0 -40
- package/src/core/panel/provider/ExternalElementProvider.ts +0 -15
package/dist/flicking.min.js
CHANGED
|
@@ -4,7 +4,7 @@ name: @egjs/flicking
|
|
|
4
4
|
license: MIT
|
|
5
5
|
author: NAVER Corp.
|
|
6
6
|
repository: https://github.com/naver/egjs-flicking
|
|
7
|
-
version: 4.4.
|
|
7
|
+
version: 4.4.1
|
|
8
8
|
*/
|
|
9
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes"),require("@egjs/imready")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes","@egjs/imready"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes,e.eg.ImReady)}(this,function(h,o,n){"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 f(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 v(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 c(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 d(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 g(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 N(e,n){var t=null;if(O(e)){n=(n||document).querySelector(e);if(!n)throw new oe(M(e),z.ELEMENT_NOT_FOUND);t=n}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new oe(L(e,["HTMLElement","string"]),z.WRONG_TYPE);return t}function t(e,n){if(null==e)throw new oe(H(e,n),z.VAL_MUST_NOT_NULL)}function m(e,n,t){return Math.max(Math.min(e,t),n)}function b(e){if(!e)throw new oe(V,z.NOT_ATTACHED_TO_FLICKING);return e}function s(e){return[].slice.call(e)}function l(e,n){var t;if(O(e))switch(e){case J.PREV:t=0;break;case J.CENTER:t=.5*n;break;case J.NEXT:t=n;break;default:if(null==(t=p(e,n)))throw new oe(F("align",e),z.WRONG_OPTION)}else t=e;return t}function u(n,t){var e;return(Array.isArray(n)?n.map(function(e){return p(e,t)}):[e=p(n,t),e]).map(function(e){if(null==e)throw new oe(F("bounce",n),z.WRONG_OPTION);return e})}function p(e,n){return null==(e=te(e))?null:e.percentage*n+e.absolute}function _(e){return"object"==typeof e?e.panel:e}function P(e,n){return e===n?Q.NONE:e<n?Q.NEXT:Q.PREV}function E(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function(e){if(O(e)){var n=document.createElement("div");for(n.innerHTML=e,t.push.apply(t,g([],d(s(n.children))));n.firstChild;)n.removeChild(n.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new oe(L(e,["HTMLElement","string"]),z.WRONG_TYPE);t.push(e)}}),t}function y(e,n){return m(e<0?e+n:e,0,n)}function x(e,n){var t,i;try{for(var r=c(e),o=r.next();!o.done;o=r.next())if(o.value===n)return!0}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return!1}function O(e){return"string"==typeof e}function T(e,n,t){var i=t-n;return e<n?e=t-(n-e)%i:t<e&&(e=n+(e-t)%i),e}function I(e,n){var t,i;try{for(var r=c(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(n(a))return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return null}function R(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}function A(e,n,t){return(e-n)/(t-n)}function w(e){return window.getComputedStyle(e)||e.currentStyle}function C(e,n){var t=n.width,n=n.height;null!=t&&(O(t)?e.style.width=t:e.style.width=t+"px"),null!=n&&(O(n)?e.style.height=n:e.style.height=n+"px")}function k(e,n,t){return n<=e&&e<=t}function S(e,n){return n<=e?e%n:e<0?y((e+1)%n-1,n):e}function j(e){for(var n=new Array(e),t=0;t<e;t++)n[t]=t;return n}var D,z={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,NOT_ALLOWED_IN_VIRTUAL:14},L=function(e,n){return e+"("+typeof e+") is not a "+n.map(function(e){return'"'+e+'"'}).join(" or ")+"."},M=function(e){return'Element with selector "'+e+'" not found.'},H=function(e,n){return n+" should be provided. Given: "+e},V='This module is not attached to the Flicking instance. "init()" should be called first.',F=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},G=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},B=function(e){return'Position "'+e+'" is not reachable.'},W="Browser does not support CSS transform.",X="Event stop() is called by user.",U="Animation is interrupted by user input.",Y="Animation is already playing.",K="This behavior is not allowed in the frameworks like React, Vue, or Angular.",Z="Flicking is not initialized yet, call init() first.",q={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"},J={PREV:"prev",CENTER:"center",NEXT:"next"},Q={PREV:"PREV",NEXT:"NEXT",NONE:null},$={SNAP:"snap",FREE_SCROLL:"freeScroll",STRICT:"strict"},ee={VERTICAL:"vertical",HIDDEN:"flicking-hidden",DEFAULT_VIRTUAL:"flicking-panel"},ne={__proto__:null,EVENTS:q,ALIGN:J,DIRECTION:Q,MOVE_TYPE:$,CLASS:ee,ERROR_CODE:z},te=function(e){var n=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return{percentage:0,absolute:e};for(var t={percentage:0,absolute:0},i=0,r=n.exec(e);null!=r;){var o=r[1],a=r[2],s=r[3],a=parseFloat(a);if(!(o=i<=0?o||"+":o))return null;o="+"===o?1:-1;"%"===s?t.percentage+=a/100*o:t.absolute+=o*a,++i,r=n.exec(e)}return 0===i?null:t},ie=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},re={__proto__:null,merge:e,getElement:N,checkExistence:t,clamp:m,getFlickingAttached:b,toArray:s,parseAlign:l,parseBounce:u,parseArithmeticSize:p,parseArithmeticExpression:te,parseCSSSizeValue:function(e){return O(e)?e:e+"px"},parsePanelAlign:_,getDirection:P,parseElement:E,getMinusCompensatedIndex:y,includes:x,isString:O,circulatePosition:T,find:I,findRight:function(e,n){for(var t=e.length-1;0<=t;t--){var i=e[t];if(n(i))return i}return null},findIndex:R,getProgress:A,getStyle:w,setSize:C,isBetween:k,circulateIndex:S,range:j,setPrototypeOf:ie},oe=(a(ae,D=Error),ae);function ae(e,n){e=D.call(this,e)||this;return ie(e,ae.prototype),e.name="FlickingError",e.code=n,e}var se=(Ge=le.prototype,Object.defineProperty(Ge,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),Ge.setSize=function(e){var n=e.width,t=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=n&&(O(n)?i.style.width=n:(n=e?n+r.left+r.right:n,i.style.width=n+"px")),null!=t&&(O(t)?i.style.height=t:(t=e?t+r.top+r.bottom:t,i.style.height=t+"px")),this.resize()},Ge.resize=function(){var e=this._el,n=w(e);this._width=e.clientWidth,this._height=e.clientHeight,this._padding={left:parseFloat(n.paddingLeft),right:parseFloat(n.paddingRight),top:parseFloat(n.paddingTop),bottom:parseFloat(n.paddingBottom)},this._isBorderBoxSizing="border-box"===n.boxSizing},le);function le(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}var ue=(qe=ce.prototype,Object.defineProperty(qe,"enabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),qe.enable=function(){var e=this._flicking,n=e.viewport;return this._enabled&&this.disable(),e.useResizeObserver&&window.ResizeObserver?((n=0!==n.width||0!==n.height?new ResizeObserver(this._skipFirstResize):new ResizeObserver(this._onResize)).observe(e.viewport.element),this._resizeObserver=n):window.addEventListener("resize",this._onResize),this._enabled=!0,this},qe.disable=function(){if(!this._enabled)return this;var e=this._resizeObserver;return e?(e.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onResize),this._enabled=!1,this},ce);function ce(e){var n,t=this;this._onResize=function(){t._flicking.resize()},this._skipFirstResize=(n=!0,function(){n?n=!1:t._onResize()}),this._flicking=e,this._enabled=!1,this._resizeObserver=null}var he=(De=fe.prototype,Object.defineProperty(De,"element",{get:function(){return this._elProvider.element},enumerable:!1,configurable:!0}),Object.defineProperty(De,"elementProvider",{get:function(){return this._elProvider},enumerable:!1,configurable:!0}),Object.defineProperty(De,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(De,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(De,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(De,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(De,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(De,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(De,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(De,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(De,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),Object.defineProperty(De,"loading",{get:function(){return this._loading},set:function(e){this._loading=e},enumerable:!1,configurable:!0}),Object.defineProperty(De,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(De,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(De,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(De,"offset",{get:function(){var e=this._toggleDirection,n=this._flicking.camera.rangeDiff;return e!==Q.NONE&&this._toggled?e===Q.PREV?-n:n:0},enumerable:!1,configurable:!0}),Object.defineProperty(De,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(De,"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-A(i,e,r)}n=e-(t.alignPosition+this._size-n);return 1-A(i,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(De,"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(De,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),De.markForShow=function(){this._rendered=!0,this._elProvider.show(this._flicking)},De.markForHide=function(){this._rendered=!1,this._elProvider.hide(this._flicking)},De.resize=function(e){var n=this.element,t=this._flicking.horizontal;return e?(this._size=e.size,this._margin=r({},e.margin),this._height=e.height):(e=w(n),this._size=t?n.offsetWidth:n.offsetHeight,this._margin=t?{prev:parseFloat(e.marginLeft||"0"),next:parseFloat(e.marginRight||"0")}:{prev:parseFloat(e.marginTop||"0"),next:parseFloat(e.marginBottom||"0")},this._height=t?n.offsetHeight:this._size),this.updatePosition(),this._updateAlignPos(),this},De.setSize=function(e){return C(this.element,e),this},De.contains=function(e){var n;return!(null===(n=this.element)||void 0===n||!n.contains(e))},De.destroy=function(){this._resetInternalStates(),this._removed=!0},De.includePosition=function(e,n){return this.includeRange(e,e,n=void 0===n?!1:n)},De.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},De.isVisibleOnRange=function(e,n){var t=this.range;return n>t.min&&e<t.max},De.focus=function(e){return this._flicking.moveTo(this._index,e)},De.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)},De.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)},De.increaseIndex=function(e){return this._index+=Math.max(e,0),this},De.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},De.updatePosition=function(){var e=this._flicking.renderer.panels[this._index-1];return this._pos=e?e.range.max+e.margin.next+this._margin.prev:this._margin.prev,this},De.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===Q.NONE||n===e)return!1;var r=this._toggled;return e<n?e<=i&&i<=n&&(this._toggled=t===Q.NEXT):i<=e&&n<=i&&(this._toggled=t!==Q.NEXT),r!==this._toggled},De.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=Q.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=Q.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):e?(this._toggleDirection=Q.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=Q.NONE,this._togglePosition=0),this},De._updateAlignPos=function(){this._alignPos=l(this._align,this._size)},De._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=Q.NONE},fe);function fe(e){var n=e.index,t=e.align,i=e.flicking,e=e.elementProvider;this._index=n,this._flicking=i,this._elProvider=e,this._align=t,this._removed=!1,this._rendered=!0,this._loading=!1,this._resetInternalStates()}var de=function(t){function e(e){var n=t.call(this,e)||this;return n._elProvider=e.elementProvider,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"rendered",{get:function(){return this._elProvider.rendered},enumerable:!1,configurable:!0}),n.markForShow=function(){return this._elProvider.show(this._flicking),t.prototype.markForShow.call(this)},n.markForHide=function(){return this._elProvider.hide(this._flicking),t.prototype.markForHide.call(this)},e}(he),ge=function(t){function e(e){var n=t.call(this,e)||this;return e.elementProvider.init(n),n._elProvider=e.elementProvider,n._cachedInnerHTML=null,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._elProvider.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cachedInnerHTML",{get:function(){return this._cachedInnerHTML},enumerable:!1,configurable:!0}),Object.defineProperty(n,"elementIndex",{get:function(){var e=this._flicking,n=e.panelsPerView+1,t=e.panelCount,e=this._index;return this._toggled&&(e=this._toggleDirection===Q.NEXT?e+t:e-t),S(e,n)},enumerable:!1,configurable:!0}),n.cacheRenderResult=function(e){this._cachedInnerHTML=e},n.uncacheRenderResult=function(){this._cachedInnerHTML=null},n.render=function(){var e=this._flicking.virtual,n=e.renderPanel,t=e.cache,e=this._elProvider.element,n=this._cachedInnerHTML||n(this,this._index);n!==e.innerHTML&&(e.innerHTML=n,t&&this.cacheRenderResult(n))},n.increaseIndex=function(e){return this.uncacheRenderResult(),t.prototype.increaseIndex.call(this,e)},n.decreaseIndex=function(e){return this.uncacheRenderResult(),t.prototype.decreaseIndex.call(this,e)},e}(he),pe=(Oe=_e.prototype,Object.defineProperty(Oe,"element",{get:function(){return this._element},enumerable:!1,configurable:!0}),Oe.show=function(e){var n=this.element,e=e.camera.element;n.parentElement!==e&&e.appendChild(n)},Oe.hide=function(e){var n=this.element,e=e.camera.element;n.parentElement===e&&e.removeChild(n)},_e);function _e(e){this._element=e}var ve=(Be=me.prototype,Object.defineProperty(Be,"element",{get:function(){var e=this._flicking,n=this._panel.elementIndex;return e.virtual.elements[n].nativeElement},enumerable:!1,configurable:!0}),Be.init=function(e){this._panel=e},Be.show=function(){},Be.hide=function(){},me);function me(e){this._flicking=e}var be=(Ge=Pe.prototype,Object.defineProperty(Ge,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"renderPanel",{get:function(){return this._renderPanel},set:function(e){this._renderPanel=e,this._flicking.renderer.panels.forEach(function(e){return e.uncacheRenderResult()})},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"initialPanelCount",{get:function(){return this._initialPanelCount},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"cache",{get:function(){return this._cache},set:function(e){this._cache=e},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"panelClass",{get:function(){return this._panelClass},set:function(e){this._panelClass=e},enumerable:!1,configurable:!0}),Ge.init=function(){var e=this._flicking;e.virtualEnabled&&(e.renderExternal||this._initVirtualElements(),e=e.camera.children,this._elements=e.map(function(e){return{nativeElement:e,visible:!0}}))},Ge.show=function(e){var n=this._elements[e],e=n.nativeElement;n.visible=!0,e.style.display&&(e.style.display="")},Ge.hide=function(e){var n=this._elements[e],e=n.nativeElement;n.visible=!1,e.style.display="none"},Ge.append=function(e){var n=this._flicking;return this.insert(n.panels.length,e=void 0===e?1:e)},Ge.prepend=function(e){return this.insert(0,e=void 0===e?1:e)},Ge.insert=function(e,n){return(n=void 0===n?1:n)<=0?[]:this._flicking.renderer.batchInsert({index:e,elements:j(n),hasDOMInElements:!1})},Ge.remove=function(e,n){return n<=0?[]:this._flicking.renderer.batchRemove({index:e,deleteCount:n,hasDOMInElements:!1})},Ge._initVirtualElements=function(){var t=this,e=this._flicking,n=e.camera.element,e=e.panelsPerView,i=document.createDocumentFragment();j(e+1).map(function(e){var n=document.createElement("div");return n.className=t._panelClass,n.dataset.elementIndex=e.toString(),n}).forEach(function(e){i.appendChild(e)}),n.appendChild(i)},Pe);function Pe(e,n){this._flicking=e,this._renderPanel=null!==(e=null==n?void 0:n.renderPanel)&&void 0!==e?e:function(){return""},this._initialPanelCount=null!==(e=null==n?void 0:n.initialPanelCount)&&void 0!==e?e:-1,this._cache=null!==(e=null==n?void 0:n.cache)&&void 0!==e&&e,this._panelClass=null!==(n=null==n?void 0:n.panelClass)&&void 0!==n?n:ee.DEFAULT_VIRTUAL,this._elements=[]}var Ee,ye={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},xe="flick";(qe=Ee=Ee||{})[qe.IDLE=0]="IDLE",qe[qe.HOLDING=1]="HOLDING",qe[qe.DRAGGING=2]="DRAGGING",qe[qe.ANIMATING=3]="ANIMATING",qe[qe.DISABLED=4]="DISABLED";var Oe=(De=Te.prototype,Object.defineProperty(De,"delta",{get:function(){return this._delta},enumerable:!1,configurable:!0}),Object.defineProperty(De,"targetPanel",{get:function(){return this._targetPanel},set:function(e){this._targetPanel=e},enumerable:!1,configurable:!0}),De.onEnter=function(e){this._delta=e._delta,this._targetPanel=e._targetPanel},De.onHold=function(e){},De.onChange=function(e){},De.onRelease=function(e){},De.onAnimationEnd=function(e){},De.onFinish=function(e){},De._moveToChangedPosition=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo,o=i.delta[xe];o&&(this._delta+=o,e=(n=t.camera).position,o=i.pos[xe],o=t.circularEnabled?T(o,n.range.min,n.range.max):o,n.lookAt(o),i=new h.ComponentEvent(q.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:P(0,i.delta[xe]),axesEvent:i}),t.trigger(i),i.isCanceled()&&(n.lookAt(e),r(Ee.DISABLED)))},Te);function Te(){this._delta=0,this._targetPanel=null}var Ie=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.onEnter=function(){this._delta=0,this._targetPanel=null},t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;n.renderer.panelCount<=0?e(Ee.DISABLED):(t=new h.ComponentEvent(q.HOLD_START,{axesEvent:t}),n.trigger(t),t.isCanceled()?e(Ee.DISABLED):e(Ee.HOLDING))},t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control.controller.animatingContext,t=new h.ComponentEvent(q.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:P(r.start,r.end),axesEvent:t});n.trigger(t),t.isCanceled()?i(Ee.DISABLED):i(Ee.ANIMATING).onChange(e)},e}(Oe),Re=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 h.ComponentEvent(q.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:P(0,-r),axesEvent:t});n.trigger(t),t.isCanceled()?i(Ee.DISABLED):i(Ee.DRAGGING).onChange(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;if(n.trigger(new h.ComponentEvent(q.HOLD_END,{axesEvent:t})),0!==t.delta.flick)return t.setTo({flick:n.camera.position},0),void e(Ee.IDLE);this._releaseEvent=t},t.onFinish=function(e){var n=e.flicking;if((0,e.transitTo)(Ee.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=c(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 h.ComponentEvent(q.SELECT,{index:a.index,panel:a,direction:P(r,o)})))}},e}(Oe),Ae=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){this._moveToChangedPosition(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo;n.trigger(new h.ComponentEvent(q.HOLD_END,{axesEvent:t})),n.renderer.panelCount<=0?i(Ee.IDLE):(i(Ee.ANIMATING),e=n.control,i=t.destPos[xe],n=Math.max(t.duration,n.duration),e.moveToPosition(i,n,t))},e}(Oe),we=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;this._delta=0,n.control.updateInput();t=new h.ComponentEvent(q.HOLD_START,{axesEvent:t});n.trigger(t),t.isCanceled()?e(Ee.DISABLED):e(Ee.DRAGGING)},t.onChange=function(e){this._moveToChangedPosition(e)},t.onFinish=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control,e=r.controller.animatingContext;i(Ee.IDLE),n.trigger(new h.ComponentEvent(q.MOVE_END,{isTrusted:t.isTrusted,direction:P(e.start,e.end),axesEvent:t})),r.setActive(this._targetPanel,r.activePanel,t.isTrusted)},e}(Oe),Ce=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)(Ee.IDLE)},t.onChange=function(e){var n=e.axesEvent,e=e.transitTo;n.stop(),e(Ee.IDLE)},t.onRelease=function(e){var n=e.axesEvent,e=e.transitTo;0===n.delta.flick&&e(Ee.IDLE)},e}(Oe),Ne=(Be=ke.prototype,Object.defineProperty(Be,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Be.fire=function(e,n){var t=this._state,i=r(r({},n),{transitTo:this.transitTo});switch(e){case ye.HOLD:t.onHold(i);break;case ye.CHANGE:t.onChange(i);break;case ye.RELEASE:t.onRelease(i);break;case ye.ANIMATION_END:t.onAnimationEnd(i);break;case ye.FINISH:t.onFinish(i)}},ke);function ke(){var t=this;this.transitTo=function(e){var n;switch(e){case Ee.IDLE:n=new Ie;break;case Ee.HOLDING:n=new Re;break;case Ee.DRAGGING:n=new Ae;break;case Ee.ANIMATING:n=new we;break;case Ee.DISABLED:n=new Ce}return n.onEnter(t._state),t._state=n,t._state},this._state=new Ie}var Se=(Ge=je.prototype,Object.defineProperty(Ge,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"stateMachine",{get:function(){return this._stateMachine},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"controlParams",{get:function(){var e=this._axes;if(!e)return{range:{min:0,max:0},position:0,circular:!1};e=e.axis[xe];return{range:{min:e.range[0],max:e.range[1]},circular:e.circular[0],position:this.position}},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"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(Ge,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([xe])[xe])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"range",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.axis[xe].range)&&void 0!==e?e:[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(Ge,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[xe].bounce},enumerable:!1,configurable:!0}),Ge.init=function(t){var e,i=this;this._flicking=t,this._axes=new o(((e={})[xe]={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],releaseOnScroll:!0});var r=this._axes;r.connect(t.horizontal?[xe,""]:["",xe],this._panInput);for(var n in ye)!function(e){var n=ye[e];r.on(n,function(e){i._stateMachine.fire(n,{flicking:t,axesEvent:e})})}(n);return this},Ge.destroy=function(){var e;this._axes&&(this.removePreventClickHandler(),this._axes.destroy()),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},Ge.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},Ge.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},Ge.update=function(e){var n=b(this._flicking),t=n.camera,i=this._axes,r=i.axis[xe];return r.circular=[e.circular,e.circular],r.range=[e.range.min,e.range.max],r.bounce=u(n.bounce,t.size),i.axm.set(((i={})[xe]=e.position,i)),this},Ge.addPreventClickHandler=function(){var e=b(this._flicking),n=this._axes,e=e.camera.element;return n.on(ye.HOLD,this._onAxesHold),n.on(ye.CHANGE,this._onAxesChange),e.addEventListener("click",this._preventClickWhenDragged,!0),this},Ge.removePreventClickHandler=function(){var e=b(this._flicking),n=this._axes,e=e.camera.element;return n.off(ye.HOLD,this._onAxesHold),n.off(ye.CHANGE,this._onAxesChange),e.removeEventListener("click",this._preventClickWhenDragged,!0),this},Ge.animateTo=function(n,t,i){var r=this,o=this._axes,e=this._stateMachine.state;if(!o)return Promise.reject(new oe(V,z.NOT_ATTACHED_TO_FLICKING));var a=o.get([xe])[xe];if(a===n)return(l=b(this._flicking)).camera.lookAt(n),e.targetPanel&&l.control.setActive(e.targetPanel,l.control.activePanel,null!==(e=null==i?void 0:i.isTrusted)&&void 0!==e&&e),Promise.resolve();this._animatingContext={start:a,end:n,offset:0};function s(){var e;o.once(ye.FINISH,function(){r._animatingContext={start:0,end:0,offset:0}}),i?i.setTo(((e={})[xe]=n,e),t):o.setTo(((e={})[xe]=n,e),t)}if(0!==t)return new Promise(function(e,n){function t(){o.off(ye.FINISH,i),n(new oe(U,z.ANIMATION_INTERRUPTED))}var i=function(){o.off(ye.HOLD,t),e()};o.once(ye.FINISH,i),o.once(ye.HOLD,t),s()});var a=(l=b(this._flicking)).camera;s();var l=l.circularEnabled?T(n,a.range.min,a.range.max):n;return o.axm.set(((a={})[xe]=l,a)),Promise.resolve()},Ge._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0},this._dragged=!1},je);function je(){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 Ne}var De=(qe=ze.prototype,Object.defineProperty(qe,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"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(qe,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),qe.init=function(e){return this._flicking=e,this._controller.init(e),this},qe.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},qe.enable=function(){return this._controller.enable(),this},qe.disable=function(){return this._controller.disable(),this},qe.updatePosition=function(e){var n=b(this._flicking).camera,t=this._activePanel;t&&n.lookAt(n.clampToReachablePosition(t.position))},qe.updateInput=function(){var e=b(this._flicking).camera;return this._controller.update(e.controlParams),this},qe.resetActive=function(){return this._activePanel=null,this},qe.moveToPanel=function(a,e){var s=e.duration,n=e.direction,l=void 0===n?Q.NONE:n,u=e.axesEvent;return f(this,void 0,void 0,function(){var n,t,i,r,o;return v(this,function(e){return n=b(this._flicking),o=n.camera,t=a.position,i=o.findNearestAnchor(t),a.removed||!i?[2,Promise.reject(new oe(B(a.position),z.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===Q.NONE||(l===Q.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})])})})},qe.setActive=function(e,n,t){var i,r=b(this._flicking);this._activePanel=e,r.camera.updateAdaptiveHeight(),e!==n?r.trigger(new h.ComponentEvent(q.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?P(n.position,e.position):Q.NONE})):r.trigger(new h.ComponentEvent(q.RESTORED,{isTrusted:t}))},qe._triggerIndexChangeEvent=function(e,n,t){var i=b(this._flicking),r=e!==this._activePanel?q.WILL_CHANGE:q.WILL_RESTORE,o=i.camera,a=this._activePanel,n=new h.ComponentEvent(r,{index:e.index,panel:e,isTrusted:(null==t?void 0:t.isTrusted)||!1,direction:P(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,n)});if(i.trigger(n),n.isCanceled())throw new oe(X,z.STOP_CALLED_BY_USER)},qe._animateToPosition=function(e){var r=e.position,o=e.duration,a=e.newActivePanel,s=e.axesEvent;return f(this,void 0,void 0,function(){var n,t,i=this;return v(this,function(e){return n=b(this._flicking),t=function(){return i._controller.animateTo(r,o,s)},this._controller.state.targetPanel=a,o<=0?[2,t()]:[2,t().then(function(){return f(i,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return[4,n.renderer.render()];case 1:return e.sent(),[2]}})})}).catch(function(e){if(!(s&&e instanceof oe&&e.code===z.ANIMATION_INTERRUPTED))throw e})]})})},ze);function ze(){this._flicking=null,this._controller=new Se,this._activePanel=null}var Le=(Be=Me.prototype,Object.defineProperty(Be,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(Be,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(Be,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),Me);function Me(e){var n=e.index,t=e.position,e=e.panel;this._index=n,this._pos=t,this._panel=e}var He=function(t){function e(e){var n=(void 0===e?{}:e).count,e=void 0===n?1/0:n,n=t.call(this)||this;return n._count=e,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),n.moveToPosition=function(l,u,c){return f(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return v(this,function(e){return n=b(this._flicking),t=n.camera,o=t.findActiveAnchor(),s=t.findNearestAnchor(t.position),a=n.control.controller.state,o&&s?(i=this._calcSnapThreshold(l,o),r=n.animating?a.delta:l-t.position,o=Math.abs(r),a=c&&0!==c.delta[xe]?Math.abs(c.delta[xe]):o,s=i<=a&&0<a?this._findSnappedAnchor(l,s):o>=n.threshold&&0<o?this._findAdjacentAnchor(r,s):s,this._triggerIndexChangeEvent(s.panel,l,c),[2,this._animateToPosition({position:t.clampToReachablePosition(s.position),duration:u,newActivePanel:s.panel,axesEvent:c})]):[2,Promise.reject(new oe(B(l),z.POSITION_NOT_REACHABLE))]})})},n._findSnappedAnchor=function(e,n){var t=b(this._flicking),i=t.camera,r=this._count,o=i.position,a=i.clampToReachablePosition(e),s=i.findAnchorIncludePosition(a);if(!n||!s)throw new oe(B(e),z.POSITION_NOT_REACHABLE);if(!isFinite(r))return s;var l=t.panelCount,u=i.anchorPoints,c=Math.sign(e-o)*Math.floor(Math.abs(e-o)/i.rangeDiff);o<e&&s.index<n.index||s.position>n.position&&s.index===n.index?c+=1:(e<o&&s.index>n.index||s.position<n.position&&s.index===n.index)&&--c;a=s.index+c*l;if(Math.abs(a-n.index)<=r){s=u[s.index];return new Le({index:s.index,position:s.position+c*i.rangeDiff,panel:s.panel})}if(t.circularEnabled){t=u[S(n.index+Math.sign(e-o)*r,l)],l=Math.floor(r/l);return o<e&&t.index<n.index?l+=1:e<o&&t.index>n.index&&--l,new Le({index:t.index,position:t.position+l*i.rangeDiff,panel:t.panel})}return u[m(n.index+Math.sign(e-o)*r,0,u.length-1)]},n._findAdjacentAnchor=function(e,n){var t=b(this._flicking).camera;return null!==(t=0<e?t.getNextAnchor(n):t.getPrevAnchor(n))&&void 0!==t?t:n},n._calcSnapThreshold=function(e,n){var t=e>n.position,i=n.panel,e=i.size,n=i.alignPosition;return t?e-n+i.margin.next:n+i.margin.prev},e}(De),Ve=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(e){var n=b(this._flicking).camera,t=this._activePanel;t&&(e=(t=t.range).min+(t.max-t.min)*e,n.lookAt(n.clampToReachablePosition(e)))},n.moveToPosition=function(i,r,o){return f(this,void 0,void 0,function(){var n,t;return v(this,function(e){return n=b(this._flicking),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 oe(B(i),z.POSITION_NOT_REACHABLE))]})})},e}(De),Fe=function(r){function e(e){var e=(void 0===e?{}:e).count,e=void 0===e?1:e,i=r.call(this)||this;return i.setActive=function(e,n,t){r.prototype.setActive.call(i,e,n,t),i.updateInput()},i._count=e,i._resetIndexRange(),i}a(e,r);var n=e.prototype;return Object.defineProperty(n,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),n.destroy=function(){r.prototype.destroy.call(this),this._resetIndexRange()},n.updateInput=function(){var e=b(this._flicking),n=e.camera,t=e.renderer,i=this._controller,r=n.controlParams,o=this._count,a=i.state.animating?null===(c=n.findNearestAnchor(n.position))||void 0===c?void 0:c.panel:this._activePanel;if(!a)return i.update(r),this._resetIndexRange(),this;var s=r.range,l=a.position,u=a.index,c=t.panelCount,a=u-o,o=u+o;a<0&&(a=e.circularEnabled?y((a+1)%c-1,c):m(a,0,c-1)),c<=o&&(o=e.circularEnabled?o%c:m(o,0,c-1));a=t.panels[a],t=t.panels[o],o=Math.max(a.position,s.min),s=Math.min(t.position,s.max);return l<o&&(o-=n.rangeDiff),s<l&&(s+=n.rangeDiff),r.range={min:o,max:s},r.circular&&(r.position<o&&(r.position+=n.rangeDiff),r.position>s&&(r.position-=n.rangeDiff)),r.circular=!1,i.update(r),this._indexRange={min:a.index,max:t.index},this},n.moveToPosition=function(g,p,_){return f(this,void 0,void 0,function(){var n,t,i,r,o,a,s,l,u,c,h,f,d;return v(this,function(e){return c=b(this._flicking),n=c.camera,t=this._activePanel,f=this._controller.range,i=this._indexRange,r=n.range,u=m(n.clampToReachablePosition(g),f[0],f[1]),(o=n.findAnchorIncludePosition(u))&&t?(h=t.position,a=Math.abs(g-h)>=c.threshold,s=h<g?n.getNextAnchor(o):n.getPrevAnchor(o),f=n.anchorPoints,u=f[0],c=f[f.length-1],h=g<=r.min&&k(u.panel.index,i.min,i.max),f=g>=r.max&&k(c.panel.index,i.min,i.max),h||f?(d=g<r.min?u:c,l=d.panel,d=d.position):a&&o.position!==t.position?(l=o.panel,d=o.position):a&&s&&k(s.index,i.min,i.max)?(l=s.panel,d=s.position):(d=n.clampToReachablePosition(t.position),l=t),this._triggerIndexChangeEvent(l,g,_),[2,this._animateToPosition({position:d,duration:p,newActivePanel:l,axesEvent:_})]):[2,Promise.reject(new oe(B(g),z.POSITION_NOT_REACHABLE))]})})},n._resetIndexRange=function(){this._indexRange={min:0,max:0}},e}(De),Ge={__proto__:null,Control:De,SnapControl:He,FreeControl:Ve,StrictControl:Fe,AxesController:Se,State:Oe,IdleState:Ie,HoldingState:Re,DraggingState:Ae,AnimatingState:we,DisabledState:Ce,StateMachine:Ne},Be=(qe=We.prototype,Object.defineProperty(qe,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"children",{get:function(){return s(this._el.children)},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"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+A(n,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+A(n,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(qe,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),qe.init=function(e){e=(this._flicking=e).viewport.element;return t(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},qe.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},qe.lookAt=function(e){var n=this._position;this._position=e,this._refreshVisiblePanels(),this._checkNeedPanel(),this._checkReachEnd(n,e),this.applyTransform()},qe.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},qe.getNextAnchor=function(e){return this._anchors[e.index+1]||null},qe.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},qe.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)},qe.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]},qe.findActiveAnchor=function(){var n=b(this._flicking).control.activeIndex;return I(this._anchors,function(e){return e.panel.index===n})},qe.clampToReachablePosition=function(e){var n=this._range;return m(e,n.min,n.max)},qe.canReach=function(e){var n=this._range;if(e.removed)return!1;e=e.position;return e>=n.min&&e<=n.max},qe.canSee=function(e){var n=this.visibleRange;return e.isVisibleOnRange(n.min,n.max)},qe.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=l(e,this.size),this},qe.updateAnchors=function(){var e=b(this._flicking).renderer.panels;return this._anchors=e.map(function(e,n){return new Le({index:n,position:e.position,panel:e})}),this},qe.updateAdaptiveHeight=function(){var e=b(this._flicking),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},qe.updateOffset=function(){var e=b(this._flicking),n=this._position,e=e.panels.filter(function(e){return!e.rendered});return this._offset=e.filter(function(e){return e.position+e.offset<n}).reduce(function(e,n){return e+n.sizeIncludingMargin},0),this.applyTransform(),this},qe.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},qe.applyTransform=function(){var e=this._el,n=b(this._flicking),t=this._position-this._alignPos-this._offset;return e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)",this},qe._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}},qe._refreshVisiblePanels=function(){var n=this,e=b(this._flicking),t=e.renderer.panels.filter(function(e){return n.canSee(e)}),i=this._visiblePanels,r=(this._visiblePanels=t).filter(function(e){return!x(i,e)}),o=i.filter(function(e){return!x(t,e)});(0<r.length||0<o.length)&&e.renderer.render().then(function(){e.trigger(new h.ComponentEvent(q.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:t}))})},qe._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var n=b(this._flicking),t=n.renderer.panels;if(t.length<=0)return e.prev||(n.trigger(new h.ComponentEvent(q.NEED_PANEL,{direction:Q.PREV})),e.prev=!0),void(e.next||(n.trigger(new h.ComponentEvent(q.NEED_PANEL,{direction:Q.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 h.ComponentEvent(q.NEED_PANEL,{direction:Q.PREV})),e.prev=!0),e.next||(t.range.max-a<=l||i>=o.max-a)&&(n.trigger(new h.ComponentEvent(q.NEED_PANEL,{direction:Q.NEXT})),e.next=!0)}},qe._checkReachEnd=function(e,n){var t=b(this._flicking),i=this._range,r=e>i.min&&e<i.max,e=n>i.min&&n<i.max;r&&!e&&(i=n<=i.min?Q.PREV:Q.NEXT,t.trigger(new h.ComponentEvent(q.REACH_EDGE,{direction:i})))},We);function We(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?J.CENTER:e;this._checkTranslateSupport=function(){var n,e,t=document.documentElement.style,i="";try{for(var r=c(["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 oe(W,z.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var Xe,Ue=(a(Ye,Xe=Be),Ye.prototype.updateRange=function(){var e=b(this._flicking).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},Ye);function Ye(){return null!==Xe&&Xe.apply(this,arguments)||this}var Ke=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 Le({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 Le({index:n.index,position:n.position+e,panel:n.panel})},n.findAnchorIncludePosition=function(t){if(!this._circularEnabled)return s.prototype.findAnchorIncludePosition.call(this,t);var e=this._range,n=this._anchors,i=this.rangeDiff,r=n.length,o=T(t,e.min,e.max),o=s.prototype.findAnchorIncludePosition.call(this,o);if(!(o=0<r&&(t===e.min||t===e.max)?[o,new Le({index:0,position:n[0].position+i,panel:n[0].panel}),new Le({index:r-1,position:n[r-1].position-i,panel:n[r-1].panel})].filter(function(e){return!!e}).reduce(function(e,n){return e&&Math.abs(e.position-t)<Math.abs(n.position-t)?e:n},null):o))return null;if(t<e.min){var a=-Math.floor((e.min-t)/i)-1;return new Le({index:o.index,position:o.position+i*a,panel:o.panel})}if(t>e.max){a=Math.floor((t-e.max)/i)+1;return new Le({index:o.index,position:o.position+i*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.isVisibleOnRange(i.min+t,i.max+t):i.max>n.max?r||e.isVisibleOnRange(i.min-t,i.max-t):r:r},n.updateRange=function(){var e=b(this._flicking).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.updateOffset(),this},n.updateOffset=function(){return this._updateCircularOffset(),s.prototype.updateOffset.call(this)},n.lookAt=function(n){var e=this,t=b(this._flicking),i=this._position;if(n===i)return s.prototype.lookAt.call(this,n);var r=t.renderer.panels.map(function(e){return e.toggle(i,n)});this._position=n,s.prototype.lookAt.call(this,n),r.some(function(e){return e})&&t.renderer.render().then(function(){e.updateOffset()})},n.applyTransform=function(){var e=this._el,n=b(this._flicking),t=this._position-this._alignPos-this._offset+this._circularOffset;return e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)",this},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;this._circularEnabled?(e=(n=b(this._flicking).panels.filter(function(e){return e.toggled})).filter(function(e){return e.toggleDirection===Q.PREV}),n=n.filter(function(e){return e.toggleDirection===Q.NEXT}),this._circularOffset=this._calcPanelAreaSum(e)-this._calcPanelAreaSum(n)):this._circularOffset=0},e}(Be),Ze=function(i){function e(){return null!==i&&i.apply(this,arguments)||this}a(e,i);var n=e.prototype;return n.updateRange=function(){var e=b(this._flicking).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,e=t.range.min,t=i.range.max,i=e+n,n=t-r+n;return r<t-e?this._range={min:i,max:n}:(e="object"==typeof(e=this._align)?e.camera:e,i=i+l(e,n-i),this._range={min:i,max:i}),this},n.updateAnchors=function(){var n=this,e=b(this._flicking).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 Le({index:n+r,position:e.position,panel:e})}),t&&o.splice(0,0,new Le({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new Le({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 Le({index:0,position:a.min,panel:o}),new Le({index:1,position:a.max,panel:s})]):this._anchors=[new Le({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},n.findAnchorIncludePosition=function(e){var n=this._range,t=this._anchors;return t.length<=0?null:e<=n.min?t[0]:e>=n.max?t[t.length-1]:i.prototype.findAnchorIncludePosition.call(this,e)},n._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]},e}(Be),De={__proto__:null,Camera:Be,LinearCamera:Ue,CircularCamera:Ke,BoundCamera:Ze},qe=(Oe=Je.prototype,Object.defineProperty(Oe,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(Oe,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(Oe,"strategy",{get:function(){return this._strategy},enumerable:!1,configurable:!0}),Object.defineProperty(Oe,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=_(e);this._panels.forEach(function(e){e.align=n})},enumerable:!1,configurable:!0}),Oe.init=function(e){return this._flicking=e,this._collectPanels(),this},Oe.destroy=function(){this._flicking=null,this._panels=[]},Oe.getPanel=function(e){return this._panels[e]||null},Oe.forceRenderAllPanels=function(){return this._panels.forEach(function(e){return e.markForShow()}),Promise.resolve()},Oe.updatePanelSize=function(){var e,n=b(this._flicking),t=this._panels;return t.length<=0||(0<n.panelsPerView?((e=t[0]).resize(),this._updatePanelSizeByGrid(e,t)):n.panels.forEach(function(e){return e.resize()})),this},Oe.batchInsert=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,l=b(this._flicking),t=l.control,u=s[0],c=_(this._align),i=e.reduce(function(e,n){var t,i=y(n.index,s.length),r=s.slice(i),o=n.elements.map(function(e,n){return a._createPanel(e,{index:i+n,align:c,flicking:l})});return s.splice.apply(s,g([i,0],d(o))),n.hasDOMInElements&&a._insertPanelElements(o,null!==(t=r[0])&&void 0!==t?t:null),0<l.panelsPerView?(t=u||o[0].resize(),a._updatePanelSizeByGrid(t,o)):o.forEach(function(e){return e.resize()}),r.forEach(function(e){e.increaseIndex(o.length),e.updatePosition()}),g(g([],d(e)),d(o))},[]);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 h.ComponentEvent(q.PANEL_CHANGE,{added:i,removed:[]})),this.checkPanelContentsReady(i),i)},Oe.batchRemove=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,t=b(this._flicking),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,r=y(t,s.length),t=s.slice(r+i),o=s.splice(r,i);return o.length<=0?[]:(t.forEach(function(e){e.decreaseIndex(o.length),e.updatePosition()}),n.hasDOMInElements&&a._removePanelElements(o),o.forEach(function(e){return e.destroy()}),x(o,u)&&l.resetActive(),g(g([],d(e)),d(o)))},[]);return this._updateCameraAndControl(),this.render(),0<o.length&&!l.animating&&((r=x(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 h.ComponentEvent(q.PANEL_CHANGE,{added:[],removed:o})),o},Oe.checkPanelContentsReady=function(r){var o,a=this,s=b(this._flicking),e=s.resizeOnContentsReady,l=this._panels;e&&!s.virtualEnabled&&((r=r.filter(function(e){return!!e.element.querySelector("img, video")})).length<=0||(o=new n,r.forEach(function(e){e.loading=!0}),o.on("readyElement",function(e){var n,t,i;a._flicking?(n=r[e.index],t=s.camera,e=(i=s.control).activePanel?t.getProgressInPanel(i.activePanel):0,n.loading=!1,n.resize(),l.slice(n.index+1).forEach(function(e){return e.updatePosition()}),s.initialized&&(t.updateRange(),t.updateAnchors(),i.animating||(i.updatePosition(e),i.updateInput()))):o.destroy()}),o.on("preReady",function(e){a._flicking&&a.render(),e.readyCount===e.totalCount&&o.destroy()}),o.on("ready",function(){a._flicking&&a.render(),o.destroy()}),o.check(r.map(function(e){return e.element}))))},Oe._updateCameraAndControl=function(){var e=b(this._flicking),n=e.camera,e=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),e.updateInput()},Oe._showOnlyVisiblePanels=function(n){var e=n.renderer.panels,t=n.camera.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});e.forEach(function(e){e.index in t||e.loading?e.markForShow():n.holding||e.markForHide()})},Oe._updatePanelSizeByGrid=function(e,n){var t,i=b(this._flicking),r=i.panelsPerView;if(r<=0)throw new oe(F("panelsPerView",r),z.WRONG_OPTION);n.length<=0||(n=(i.camera.size-(e.margin.prev+e.margin.next)*(r-1))/r,r=i.horizontal?{width:n}:{height:n},t={size:n,height:e.height,margin:e.margin},i.noPanelStyleOverride||this._strategy.updatePanelSizes(i,r),i.panels.forEach(function(e){return e.resize(t)}))},Oe._removeAllChildsFromCamera=function(){for(var e=b(this._flicking).camera.element;e.firstChild;)e.removeChild(e.firstChild)},Oe._insertPanelElements=function(e,n){void 0===n&&(n=null);var t=b(this._flicking).camera.element,n=(null==n?void 0:n.element)||null,i=document.createDocumentFragment();e.forEach(function(e){return i.appendChild(e.element)}),t.insertBefore(i,n)},Oe._removePanelElements=function(e){var n=b(this._flicking).camera.element;e.forEach(function(e){n.removeChild(e.element)})},Je);function Je(e){var n=e.align,n=void 0===n?J.CENTER:n,e=e.strategy;this._flicking=null,this._panels=[],this._align=n,this._strategy=e}var Qe=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.render=function(){return f(this,void 0,void 0,function(){var n,t;return v(this,function(e){return n=b(this._flicking),(t=this._strategy).updateRenderingPanels(n),t.renderPanels(n),this._resetPanelElementOrder(),[2]})})},t._collectPanels=function(){var e=b(this._flicking),n=e.camera;this._removeAllTextNodes(),this._panels=this._strategy.collectPanels(e,n.children)},t._createPanel=function(e,n){return this._strategy.createPanel(e,n)},t._resetPanelElementOrder=function(){var e=b(this._flicking),t=e.camera.element,i=this._strategy.getRenderingElementsByOrder(e).reverse();i.forEach(function(e,n){n=i[n-1]||null;e.nextElementSibling!==n&&t.insertBefore(e,n)})},t._removeAllTextNodes=function(){var n=b(this._flicking).camera.element;s(n.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&n.removeChild(e)})},n}(qe),Be=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){},t._removeAllChildsFromCamera=function(){},n}(qe),$e=((Oe=en.prototype).renderPanels=function(){},Oe.getRenderingIndexesByOrder=function(e){var n=e.renderer.panels.filter(function(e){return e.rendered}),t=n.filter(function(e){return e.toggled&&e.toggleDirection===Q.PREV}),e=n.filter(function(e){return e.toggled&&e.toggleDirection===Q.NEXT}),n=n.filter(function(e){return!e.toggled});return g(g(g([],d(t)),d(n)),d(e)).map(function(e){return e.index})},Oe.getRenderingElementsByOrder=function(e){var n=e.panels;return this.getRenderingIndexesByOrder(e).map(function(e){return n[e].element})},Oe.updateRenderingPanels=function(e){e.renderOnlyVisible?this._showOnlyVisiblePanels(e):e.panels.forEach(function(e){return e.markForShow()})},Oe.collectPanels=function(t,e){var i=this,r=_(t.renderer.align);return e.map(function(e,n){return new i._panelCtor({index:n,elementProvider:new i._providerCtor(e),align:r,flicking:t})})},Oe.createPanel=function(e,n){return new this._panelCtor(r(r({},n),{elementProvider:new this._providerCtor(e)}))},Oe.updatePanelSizes=function(e,n){e.panels.forEach(function(e){return e.setSize(n)})},Oe._showOnlyVisiblePanels=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.loading?e.markForShow():n.holding||e.markForHide()}),t.updateOffset()},en);function en(e){var n=e.providerCtor,e=e.panelCtor;this._providerCtor=n,this._panelCtor=e}var nn=((Oe=tn.prototype).renderPanels=function(e){var t=e.virtual,n=e.visiblePanels,i=j(e.panelsPerView+1);n.forEach(function(e){var n=e.elementIndex;e.render(),t.show(n),i[n]=-1}),i.filter(function(e){return 0<=e}).forEach(function(e){t.hide(e)})},Oe.getRenderingIndexesByOrder=function(e){var n=e.virtual,e=g([],d(e.visiblePanels)).filter(function(e){return e.rendered}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)});if(e.length<=0)return n.elements.map(function(e,n){return n});e=e.map(function(e){return e.elementIndex}),n=n.elements.map(function(e,n){return r(r({},e),{idx:n})}).filter(function(e){return!e.visible}).map(function(e){return e.idx});return g(g([],d(e)),d(n))},Oe.getRenderingElementsByOrder=function(e){var n=e.virtual.elements;return this.getRenderingIndexesByOrder(e).map(function(e){return n[e].nativeElement})},Oe.updateRenderingPanels=function(e){var n=e.renderer.panels,e=e.camera,t=e.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});n.forEach(function(e){e.index in t||e.loading?e.markForShow():e.markForHide()}),e.updateOffset()},Oe.collectPanels=function(n){var t=_(n.renderer.align);return j(n.virtual.initialPanelCount).map(function(e){return new ge({index:e,elementProvider:new ve(n),align:t,flicking:n})})},Oe.createPanel=function(e,n){return new ge(r(r({},n),{elementProvider:new ve(n.flicking)}))},Oe.updatePanelSizes=function(e,n){e.virtual.elements.forEach(function(e){C(e.nativeElement,n)}),e.panels.forEach(function(e){return e.setSize(n)})},tn);function tn(){}function rn(e,t,i,n,r){e.batchInsert.apply(e,g([],d(t.added.slice(n,r).map(function(e,n){return{index:e,elements:[i[n+t.prevList.length]],hasDOMInElements:!1}}))))}function on(e,n,t){t=e.panels.slice(n,t),e.batchRemove({index:n,deleteCount:t.length,hasDOMInElements:!1})}var qe={__proto__:null,Renderer:qe,VanillaRenderer:Qe,ExternalRenderer:Be,NormalRenderingStrategy:$e,VirtualRenderingStrategy:nn},an=function(C){function e(e,n){var t=void 0===n?{}:n,i=t.align,r=void 0===i?J.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.panelsPerView,_=void 0===p?-1:p,v=t.noPanelStyleOverride,m=void 0!==v&&v,b=t.resizeOnContentsReady,P=void 0!==b&&b,E=t.needPanelThreshold,y=void 0===E?0:E,x=t.preventEventsBeforeInit,O=void 0===x||x,T=t.deceleration,I=void 0===T?.0075:T,R=t.duration,A=void 0===R?500:R,w=t.easing,n=void 0===w?function(e){return 1-Math.pow(1-e,3)}:w,i=t.inputType,o=void 0===i?["mouse","touch"]:i,s=t.moveType,u=void 0===s?"snap":s,h=t.threshold,d=void 0===h?40:h,p=t.interruptable,v=void 0===p||p,b=t.bounce,E=void 0===b?"20%":b,x=t.iOSEdgeSwipeThreshold,T=void 0===x?30:x,R=t.preventClickOnDrag,w=void 0===R||R,i=t.disableOnInit,s=void 0!==i&&i,h=t.renderOnlyVisible,p=void 0!==h&&h,b=t.virtual,x=void 0===b?null:b,R=t.autoInit,i=void 0===R||R,h=t.autoResize,b=void 0===h||h,R=t.useResizeObserver,h=void 0===R||R,R=t.renderExternal,t=void 0===R?null:R,R=C.call(this)||this;return R._initialized=!1,R._plugins=[],R._align=r,R._defaultIndex=a,R._horizontal=l,R._circular=c,R._bound=f,R._adaptive=g,R._panelsPerView=_,R._noPanelStyleOverride=m,R._resizeOnContentsReady=P,R._virtual=x,R._needPanelThreshold=y,R._preventEventsBeforeInit=O,R._deceleration=I,R._duration=A,R._easing=n,R._inputType=o,R._moveType=u,R._threshold=d,R._interruptable=v,R._bounce=E,R._iOSEdgeSwipeThreshold=T,R._preventClickOnDrag=w,R._disableOnInit=s,R._renderOnlyVisible=p,R._autoInit=i,R._autoResize=b,R._useResizeObserver=h,R._renderExternal=t,R._viewport=new se(N(e)),R._autoResizer=new ue(R),R._renderer=R._createRenderer(),R._camera=R._createCamera(),R._control=R._createControl(),R._virtualManager=new be(R,x),R._autoInit&&R.init(),R}a(e,C);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,"virtualEnabled",{get:function(){return 0<this._panelsPerView&&null!=this._virtual},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,"panelsPerView",{get:function(){return this._panelsPerView},set:function(e){this._panelsPerView=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"noPanelStyleOverride",{get:function(){return this._noPanelStyleOverride},set:function(e){this._noPanelStyleOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"resizeOnContentsReady",{get:function(){return this._resizeOnContentsReady},set:function(e){this._resizeOnContentsReady=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"needPanelThreshold",{get:function(){return this._needPanelThreshold},set:function(e){this._needPanelThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"preventEventsBeforeInit",{get:function(){return this._preventEventsBeforeInit},set:function(e){this._preventEventsBeforeInit=e},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,"virtual",{get:function(){return this._virtualManager},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)?this._autoResizer.enable():this._autoResizer.disable()},enumerable:!1,configurable:!0}),Object.defineProperty(n,"useResizeObserver",{get:function(){return this._useResizeObserver},set:function(e){this._useResizeObserver=e,this._autoResize&&this._autoResizer.enable()},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),n.init=function(){return f(this,void 0,void 0,function(){var n,t,i,r,o,a,s=this;return v(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,r=this._virtualManager,o=this.trigger,a=this._preventEventsBeforeInit,n.init(this),r.init(),t.init(this),i.init(this),a&&(this.trigger=function(){return s}),[4,this.resize()]);case 1:return e.sent(),[4,this._moveToInitialPanel()];case 2:return e.sent(),this._autoResize&&this._autoResizer.enable(),this._preventClickOnDrag&&i.controller.addPreventClickHandler(),this._disableOnInit&&this.disableInput(),t.checkPanelContentsReady(t.panels),this._plugins.forEach(function(e){return e.init(s)}),this._initialized=!0,a&&(this.trigger=o),this.trigger(new h.ComponentEvent(q.READY)),[2]}})})},n.destroy=function(){this.off(),this._autoResizer.disable(),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,Q.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,Q.NEXT)},n.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=Q.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new oe(Y,z.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:n,direction:t}):Promise.reject(new oe(G(e,0,r-1),z.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 oe(Z,z.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,hasDOMInElements:!0}),o.batchInsert({index:0,elements:E(r.map(function(e){return e.html})),hasDOMInElements:!0})),n&&this.moveTo(i?n-i:n,0).catch(function(){}),t&&this._moveType===$.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,g([],d(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=R(t._plugins,function(e){return e===n});0<=e&&(n.destroy(),t._plugins.splice(e,1))}),this},n.resize=function(){return f(this,void 0,void 0,function(){var n,t,i,r,o,a,s,l,u;return v(this,function(e){switch(e.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,r=this._control,u=r.activePanel,o=n.width,a=n.height,s=u?i.getProgressInPanel(u):0,this.trigger(new h.ComponentEvent(q.BEFORE_RESIZE,{width:o,height:a,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return e.sent(),t.updatePanelSize(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),[4,t.render()];case 2:return e.sent(),r.animating||(r.updatePosition(s),r.updateInput()),l=n.width,u=n.height,u=l!==o||u!==a,this.trigger(new h.ComponentEvent(q.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:o,height:a},sizeChanged:u,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 oe(K,z.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:E(n),hasDOMInElements:!0})},n.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new oe(K,z.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n,hasDOMInElements:!0})},n._createControl=function(){var e,n=this._moveType,t=Object.keys($).map(function(e){return $[e]}),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!x(t,i))throw new oe(F("moveType",JSON.stringify(n)),z.WRONG_OPTION);switch(i){case $.SNAP:return new He(r);case $.FREE_SCROLL:return new Ve(r);case $.STRICT:return new Fe(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 Ke(e)):new(this._bound?Ze:Ue)(e)},n._createRenderer=function(){var e=this._renderExternal;return this._virtual&&this._panelsPerView<=0&&console.warn('"virtual" and "panelsPerView" option should be used together, ignoring virtual.'),e?this._createExternalRenderer():this._createVanillaRenderer()},n._createVanillaRenderer=function(){var e=this.virtualEnabled;return new Qe({align:this._align,strategy:e?new nn:new $e({providerCtor:pe,panelCtor:he})})},n._createExternalRenderer=function(){var e=this._renderExternal,n=e.renderer,e=e.rendererOptions;return new n(r({align:this._align},e))},n._moveToInitialPanel=function(){return f(this,void 0,void 0,function(){var n,t;return v(this,function(e){return t=this._renderer,n=this._control,(t=t.getPanel(this._defaultIndex)||t.getPanel(0))?(n.setActive(t,null,!1),[2,n.moveToPanel(t,{duration:0})]):[2]})})},e.VERSION="4.4.0",e}(h),sn=function(e){if("number"==typeof e)return e+"px";switch(e){case J.CENTER:return"50%";case J.NEXT:return"100%";case J.PREV:return"0%";default:return e}},Be={__proto__:null,withFlickingMethods:function(r,o){[h.prototype,an.prototype].forEach(function(t){Object.getOwnPropertyNames(t).filter(function(e){return!r[e]&&!e.startsWith("_")&&"constructor"!==e}).forEach(function(e){var n,i=Object.getOwnPropertyDescriptor(t,e);i.value?Object.defineProperty(r,e,{value:function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(e=i.value).call.apply(e,g([this[o]],d(n)))}}):(n={},i.get&&(n.get=function(){var e;return null===(e=i.get)||void 0===e?void 0:e.call(this[o])}),i.set&&(n.set=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return null===(e=i.set)||void 0===e?void 0:e.call.apply(e,g([this[o]],d(n)))}),Object.defineProperty(r,e,n))})})},sync:function(e,t,i){var n,r,o,a,s=e.renderer,l=s.panels;0<t.removed.length&&(r=n=-1,t.removed.forEach(function(e){n<0&&(n=e),r=0<=r&&e!==r-1?(on(s,r,n+1),n=e):e}),on(s,r,n+1)),t.ordered.forEach(function(e){var n,t=d(e,2),i=t[0],r=t[1],e=l[i],t=r-i;0<t?(n=l.slice(i+1,r+1),e.increaseIndex(t),n.forEach(function(e){return e.decreaseIndex(1)})):(n=l.slice(r,i),e.decreaseIndex(-t),n.forEach(function(e){return e.increaseIndex(1)})),e.resize()}),0<t.ordered.length&&l.sort(function(e,n){return e.index-n.index}),0<t.added.length&&(a=o=-1,t.added.forEach(function(e,n){o<0&&(o=n),a=0<=a&&e!==a+1?(rn(s,t,i,o,n+1),o=-1):e}),0<=o&&rn(s,t,i,o))},getRenderingPanels:function(e,n){var t=n.removed.reduce(function(e,n){return e[n]=!0,e},{}),i=n.maintained.reduce(function(e,n){var t=d(n,2),n=t[0],t=t[1];return e[n]=t,e},{});return g(g([],d(e.panels.filter(function(e){return!t[e.index]}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)}).map(function(e){return n.list[i[e.index]]}))),d(n.added.map(function(e){return n.list[e]})))},getDefaultCameraTransform:function(e,n,t){void 0===n&&(n=!0);var i,i=(i="object"==typeof(i=e=void 0===e?J.CENTER:e)?i.camera:i,sn(i)),e=(e="object"==typeof(e=e)?e.panel:e,te(sn(e)));if(null==e)return"";e="calc("+i+" - ("+(t||"0px")+" * "+e.percentage+") - "+e.absolute+"px)";return n?"translate("+e+")":"translate(0, "+e+")"}};return e(an,{__proto__:null,Viewport:se,FlickingError:oe,AnchorPoint:Le,VirtualManager:be,VanillaElementProvider:pe,VirtualElementProvider:ve,Panel:he,ExternalPanel:de,VirtualPanel:ge}),e(an,De),e(an,Ge),e(an,qe),e(an,ne),e(an,Be),e(an,re),an});
|
|
9
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes"),require("@egjs/imready")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes","@egjs/imready"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes,e.eg.ImReady)}(this,(function(e,n,t){"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])},i(e,n)};function r(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 o=function(){return o=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},o.apply(this,arguments)};function a(e,n,t,i){return new(t||(t=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}))}function s(e,n){var t,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e],i=0}finally{t=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function l(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 e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(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||n-- >0)&&!(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 c(e,n){for(var t=0,i=n.length,r=e.length;t<i;t++,r++)e[r]=n[t];return e}var f,h={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,NOT_ALLOWED_IN_VIRTUAL:14},d=function(e,n){return e+"("+typeof e+") is not a "+n.map((function(e){return'"'+e+'"'})).join(" or ")+"."},g=function(e){return'Element with selector "'+e+'" not found.'},p=function(e,n){return n+" should be provided. Given: "+e},_='This module is not attached to the Flicking instance. "init()" should be called first.',v=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},m=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},b=function(e){return'Position "'+e+'" is not reachable.'},P="Browser does not support CSS transform.",E="Event stop() is called by user.",y="Animation is interrupted by user input.",x="Animation is already playing.",O="This behavior is not allowed in the frameworks like React, Vue, or Angular.",T="Flicking is not initialized yet, call init() first.",I={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"},R={PREV:"prev",CENTER:"center",NEXT:"next"},A={PREV:"PREV",NEXT:"NEXT",NONE:null},w={SNAP:"snap",FREE_SCROLL:"freeScroll",STRICT:"strict"},N={VERTICAL:"vertical",HIDDEN:"flicking-hidden",DEFAULT_VIRTUAL:"flicking-panel"},C={__proto__:null,EVENTS:I,ALIGN:R,DIRECTION:A,MOVE_TYPE:w,CLASS:N,ERROR_CODE:h},k=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return n.forEach((function(n){Object.keys(n).forEach((function(t){e[t]=n[t]}))})),e},j=function(e,n){var t=null;if(Y(e)){var i=(n||document).querySelector(e);if(!i)throw new oe(g(e),h.ELEMENT_NOT_FOUND);t=i}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new oe(d(e,["HTMLElement","string"]),h.WRONG_TYPE);return t},S=function(e,n){if(null==e)throw new oe(p(e,n),h.VAL_MUST_NOT_NULL)},D=function(e,n,t){return Math.max(Math.min(e,t),n)},z=function(e){if(!e)throw new oe(_,h.NOT_ATTACHED_TO_FLICKING);return e},L=function(e){return[].slice.call(e)},M=function(e,n){var t;if(Y(e))switch(e){case R.PREV:t=0;break;case R.CENTER:t=.5*n;break;case R.NEXT:t=n;break;default:if(null==(t=H(e,n)))throw new oe(v("align",e),h.WRONG_OPTION)}else t=e;return t},V=function(e,n){var t;if(Array.isArray(e))t=e.map((function(e){return H(e,n)}));else{var i=H(e,n);t=[i,i]}return t.map((function(n){if(null==n)throw new oe(v("bounce",e),h.WRONG_OPTION);return n}))},H=function(e,n){var t=F(e);return null==t?null:t.percentage*n+t.absolute},F=function(e){var n=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return{percentage:0,absolute:e};for(var t={percentage:0,absolute:0},i=0,r=n.exec(e);null!=r;){var o=r[1],a=r[2],s=r[3],l=parseFloat(a);if(i<=0&&(o=o||"+"),!o)return null;var u="+"===o?1:-1;"%"===s?t.percentage+=u*(l/100):t.absolute+=u*l,++i,r=n.exec(e)}return 0===i?null:t},G=function(e){return"object"==typeof e?e.panel:e},B=function(e,n){return e===n?A.NONE:e<n?A.NEXT:A.PREV},W=function(e){Array.isArray(e)||(e=[e]);var n=[];return e.forEach((function(e){if(Y(e)){var t=document.createElement("div");for(t.innerHTML=e,n.push.apply(n,c([],u(L(t.children))));t.firstChild;)t.removeChild(t.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new oe(d(e,["HTMLElement","string"]),h.WRONG_TYPE);n.push(e)}})),n},X=function(e,n){return D(e<0?e+n:e,0,n)},U=function(e,n){var t,i;try{for(var r=l(e),o=r.next();!o.done;o=r.next()){if(o.value===n)return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return!1},Y=function(e){return"string"==typeof e},K=function(e,n,t){var i=t-n;if(e<n)e=t-(n-e)%i;else if(e>t){e=n+(e-t)%i}return e},Z=function(e,n){var t,i;try{for(var r=l(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(n(a))return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return null},q=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1},J=function(e,n,t){return(e-n)/(t-n)},Q=function(e){return window.getComputedStyle(e)||e.currentStyle},$=function(e,n){var t=n.width,i=n.height;null!=t&&(Y(t)?e.style.width=t:e.style.width=t+"px"),null!=i&&(Y(i)?e.style.height=i:e.style.height=i+"px")},ee=function(e,n,t){return e>=n&&e<=t},ne=function(e,n){return e>=n?e%n:e<0?X((e+1)%n-1,n):e},te=function(e){for(var n=new Array(e),t=0;t<e;t++)n[t]=t;return n},ie=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},re={__proto__:null,merge:k,getElement:j,checkExistence:S,clamp:D,getFlickingAttached:z,toArray:L,parseAlign:M,parseBounce:V,parseArithmeticSize:H,parseArithmeticExpression:F,parseCSSSizeValue:function(e){return Y(e)?e:e+"px"},parsePanelAlign:G,getDirection:B,parseElement:W,getMinusCompensatedIndex:X,includes:U,isString:Y,circulatePosition:K,find:Z,findRight:function(e,n){for(var t=e.length-1;t>=0;t--){var i=e[t];if(n(i))return i}return null},findIndex:q,getProgress:J,getStyle:Q,setSize:$,isBetween:ee,circulateIndex:ne,range:te,setPrototypeOf:ie},oe=function(e){function n(t,i){var r=e.call(this,t)||this;return ie(r,n.prototype),r.name="FlickingError",r.code=i,r}return r(n,e),n}(Error),ae=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,o=this._isBorderBoxSizing;if(null!=n)if(Y(n))i.style.width=n;else{var a=o?n+r.left+r.right:n;i.style.width=a+"px"}if(null!=t)if(Y(t))i.style.height=t;else{var s=o?t+r.top+r.bottom:t;i.style.height=s+"px"}this.resize()},n.resize=function(){var e=this._el,n=Q(e);this._width=e.clientWidth,this._height=e.clientHeight,this._padding={left:n.paddingLeft?parseFloat(n.paddingLeft):0,right:n.paddingRight?parseFloat(n.paddingRight):0,top:n.paddingTop?parseFloat(n.paddingTop):0,bottom:n.paddingBottom?parseFloat(n.paddingBottom):0},this._isBorderBoxSizing="border-box"===n.boxSizing},e}(),se=function(){function e(e){var n,t=this;this._onResize=function(){t._flicking.resize()},this._skipFirstResize=(n=!0,function(){n?n=!1:t._onResize()}),this._flicking=e,this._enabled=!1,this._resizeObserver=null}var n=e.prototype;return Object.defineProperty(n,"enabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),n.enable=function(){var e=this._flicking,n=e.viewport;if(this._enabled&&this.disable(),e.useResizeObserver&&window.ResizeObserver){var t=0!==n.width||0!==n.height?new ResizeObserver(this._skipFirstResize):new ResizeObserver(this._onResize);t.observe(e.viewport.element),this._resizeObserver=t}else window.addEventListener("resize",this._onResize);return this._enabled=!0,this},n.disable=function(){if(!this._enabled)return this;var e=this._resizeObserver;return e?(e.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onResize),this._enabled=!1,this},e}(),le=function(){function e(e){this._element=e,this._rendered=!0}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),n.show=function(e){var n=this.element,t=e.camera.element;n.parentElement!==t&&(t.appendChild(n),this._rendered=!0)},n.hide=function(e){var n=this.element,t=e.camera.element;n.parentElement===t&&(t.removeChild(n),this._rendered=!1)},e}(),ue=function(){function e(e){this._flicking=e}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._virtualElement.nativeElement},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._virtualElement.visible},enumerable:!1,configurable:!0}),Object.defineProperty(n,"_virtualElement",{get:function(){var e=this._flicking,n=this._panel.elementIndex;return e.virtual.elements[n]},enumerable:!1,configurable:!0}),n.init=function(e){this._panel=e},n.show=function(){},n.hide=function(){},e}(),ce=function(){function e(e,n){var t,i,r,o;this._flicking=e,this._renderPanel=null!==(t=null==n?void 0:n.renderPanel)&&void 0!==t?t:function(){return""},this._initialPanelCount=null!==(i=null==n?void 0:n.initialPanelCount)&&void 0!==i?i:-1,this._cache=null!==(r=null==n?void 0:n.cache)&&void 0!==r&&r,this._panelClass=null!==(o=null==n?void 0:n.panelClass)&&void 0!==o?o:N.DEFAULT_VIRTUAL,this._elements=[]}var n=e.prototype;return Object.defineProperty(n,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderPanel",{get:function(){return this._renderPanel},set:function(e){this._renderPanel=e,this._flicking.renderer.panels.forEach((function(e){return e.uncacheRenderResult()}))},enumerable:!1,configurable:!0}),Object.defineProperty(n,"initialPanelCount",{get:function(){return this._initialPanelCount},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cache",{get:function(){return this._cache},set:function(e){this._cache=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelClass",{get:function(){return this._panelClass},set:function(e){this._panelClass=e},enumerable:!1,configurable:!0}),n.init=function(){var e=this._flicking;if(e.virtualEnabled){e.externalRenderer||e.renderExternal||this._initVirtualElements();var n=e.camera.children;this._elements=n.map((function(e){return{nativeElement:e,visible:!0}}))}},n.show=function(e){var n=this._elements[e],t=n.nativeElement;n.visible=!0,t.style.display&&(t.style.display="")},n.hide=function(e){var n=this._elements[e],t=n.nativeElement;n.visible=!1,t.style.display="none"},n.append=function(e){void 0===e&&(e=1);var n=this._flicking;return this.insert(n.panels.length,e)},n.prepend=function(e){return void 0===e&&(e=1),this.insert(0,e)},n.insert=function(e,n){return void 0===n&&(n=1),n<=0?[]:this._flicking.renderer.batchInsert({index:e,elements:te(n),hasDOMInElements:!1})},n.remove=function(e,n){return n<=0?[]:this._flicking.renderer.batchRemove({index:e,deleteCount:n,hasDOMInElements:!1})},n._initVirtualElements=function(){var e=this,n=this._flicking,t=n.camera.element,i=n.panelsPerView,r=document.createDocumentFragment();te(i+1).map((function(n){var t=document.createElement("div");return t.className=e._panelClass,t.dataset.elementIndex=n.toString(),t})).forEach((function(e){r.appendChild(e)})),t.appendChild(r)},e}(),fe={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},he="flick";!function(e){e[e.IDLE=0]="IDLE",e[e.HOLDING=1]="HOLDING",e[e.DRAGGING=2]="DRAGGING",e[e.ANIMATING=3]="ANIMATING",e[e.DISABLED=4]="DISABLED"}(f||(f={}));var de=function(){function n(){this._delta=0,this._targetPanel=null}var t=n.prototype;return Object.defineProperty(t,"delta",{get:function(){return this._delta},enumerable:!1,configurable:!0}),Object.defineProperty(t,"targetPanel",{get:function(){return this._targetPanel},set:function(e){this._targetPanel=e},enumerable:!1,configurable:!0}),t.onEnter=function(e){this._delta=e._delta,this._targetPanel=e._targetPanel},t.onHold=function(e){},t.onChange=function(e){},t.onRelease=function(e){},t.onAnimationEnd=function(e){},t.onFinish=function(e){},t._moveToChangedPosition=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo,o=i.delta.flick;if(o){this._delta+=o;var a=t.camera,s=a.position,l=i.pos.flick,u=t.circularEnabled?K(l,a.range.min,a.range.max):l;a.lookAt(u);var c=new e.ComponentEvent(I.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:B(0,i.delta.flick),axesEvent:i});t.trigger(c),c.isCanceled()&&(a.lookAt(s),r(f.DISABLED))}},n}(),ge=function(n){function t(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}r(t,n);var i=t.prototype;return i.onEnter=function(){this._delta=0,this._targetPanel=null},i.onHold=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo;if(t.renderer.panelCount<=0)r(f.DISABLED);else{var o=new e.ComponentEvent(I.HOLD_START,{axesEvent:i});t.trigger(o),o.isCanceled()?r(f.DISABLED):r(f.HOLDING)}},i.onChange=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo,o=t.control.controller.animatingContext,a=new e.ComponentEvent(I.MOVE_START,{isTrusted:i.isTrusted,holding:this.holding,direction:B(o.start,o.end),axesEvent:i});t.trigger(a),a.isCanceled()?r(f.DISABLED):r(f.ANIMATING).onChange(n)},t}(de),pe=function(n){function t(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}r(t,n);var i=t.prototype;return i.onChange=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo,o=i.inputEvent,a=t.horizontal?o.offsetX:o.offsetY,s=new e.ComponentEvent(I.MOVE_START,{isTrusted:i.isTrusted,holding:this.holding,direction:B(0,-a),axesEvent:i});t.trigger(s),s.isCanceled()?r(f.DISABLED):r(f.DRAGGING).onChange(n)},i.onRelease=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo;if(t.trigger(new e.ComponentEvent(I.HOLD_END,{axesEvent:i})),0!==i.delta.flick)return i.setTo({flick:t.camera.position},0),void r(f.IDLE);this._releaseEvent=i},i.onFinish=function(n){var t,i,r=n.flicking;if((0,n.transitTo)(f.IDLE),this._releaseEvent){var o,a=this._releaseEvent.inputEvent.srcEvent;if("touchend"===a.type){var s=a.changedTouches[0];o=document.elementFromPoint(s.clientX,s.clientY)}else o=a.target;var u=r.renderer.panels,c=null;try{for(var h=l(u),d=h.next();!d.done;d=h.next()){var g=d.value;if(g.contains(o)){c=g;break}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(t)throw t.error}}if(c){var p=r.camera.position,_=c.position;r.trigger(new e.ComponentEvent(I.SELECT,{index:c.index,panel:c,direction:B(p,_)}))}}},t}(de),_e=function(n){function t(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}r(t,n);var i=t.prototype;return i.onChange=function(e){this._moveToChangedPosition(e)},i.onRelease=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo;if(t.trigger(new e.ComponentEvent(I.HOLD_END,{axesEvent:i})),t.renderer.panelCount<=0)r(f.IDLE);else{r(f.ANIMATING);var o=t.control,a=i.destPos.flick,s=Math.max(i.duration,t.duration);o.moveToPosition(a,s,i)}},t}(de),ve=function(n){function t(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}r(t,n);var i=t.prototype;return i.onHold=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo;this._delta=0,t.control.updateInput();var o=new e.ComponentEvent(I.HOLD_START,{axesEvent:i});t.trigger(o),o.isCanceled()?r(f.DISABLED):r(f.DRAGGING)},i.onChange=function(e){this._moveToChangedPosition(e)},i.onFinish=function(n){var t=n.flicking,i=n.axesEvent,r=n.transitTo,o=t.control,a=o.controller.animatingContext;r(f.IDLE),t.trigger(new e.ComponentEvent(I.MOVE_END,{isTrusted:i.isTrusted,direction:B(a.start,a.end),axesEvent:i})),o.setActive(this._targetPanel,o.activePanel,i.isTrusted)},t}(de),me=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.holding=!1,n.animating=!0,n}r(n,e);var t=n.prototype;return t.onAnimationEnd=function(e){(0,e.transitTo)(f.IDLE)},t.onChange=function(e){var n=e.axesEvent,t=e.transitTo;n.stop(),t(f.IDLE)},t.onRelease=function(e){var n=e.axesEvent,t=e.transitTo;0===n.delta.flick&&t(f.IDLE)},n}(de),be=function(){function e(){var e=this;this.transitTo=function(n){var t;switch(n){case f.IDLE:t=new ge;break;case f.HOLDING:t=new pe;break;case f.DRAGGING:t=new _e;break;case f.ANIMATING:t=new ve;break;case f.DISABLED:t=new me}return t.onEnter(e._state),e._state=t,e._state},this._state=new ge}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=o(o({},n),{transitTo:this.transitTo});switch(e){case fe.HOLD:t.onHold(i);break;case fe.CHANGE:t.onChange(i);break;case fe.RELEASE:t.onRelease(i);break;case fe.ANIMATION_END:t.onAnimationEnd(i);break;case fe.FINISH:t.onFinish(i)}},e}(),Pe=function(){function e(){var e=this;this._onAxesHold=function(){e._dragged=!1},this._onAxesChange=function(){e._dragged=!0},this._preventClickWhenDragged=function(n){e._dragged&&(n.preventDefault(),n.stopPropagation()),e._dragged=!1},this._resetInternalValues(),this._stateMachine=new be}var t=e.prototype;return Object.defineProperty(t,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(t,"stateMachine",{get:function(){return this._stateMachine},enumerable:!1,configurable:!0}),Object.defineProperty(t,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(t,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(t,"controlParams",{get:function(){var e=this._axes;if(!e)return{range:{min:0,max:0},position:0,circular:!1};var n=e.axis.flick;return{range:{min:n.range[0],max:n.range[1]},circular:n.circular[0],position:this.position}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enabled",{get:function(){var e,n;return null!==(n=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==n&&n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"position",{get:function(){var e,n;return null!==(n=null===(e=this._axes)||void 0===e?void 0:e.get([he]).flick)&&void 0!==n?n:0},enumerable:!1,configurable:!0}),Object.defineProperty(t,"range",{get:function(){var e,n;return null!==(n=null===(e=this._axes)||void 0===e?void 0:e.axis.flick.range)&&void 0!==n?n:[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis.flick.bounce},enumerable:!1,configurable:!0}),t.init=function(e){var t,i=this;this._flicking=e,this._axes=new n(((t={}).flick={range:[0,0],circular:!1,bounce:[0,0]},t),{deceleration:e.deceleration,interruptable:e.interruptable,easing:e.easing}),this._panInput=new n.PanInput(e.viewport.element,{inputType:e.inputType,iOSEdgeSwipeThreshold:e.iOSEdgeSwipeThreshold,scale:e.horizontal?[-1,0]:[0,-1],releaseOnScroll:!0});var r=this._axes;r.connect(e.horizontal?[he,""]:["",he],this._panInput);var o=function(n){var t=fe[n];r.on(t,(function(n){i._stateMachine.fire(t,{flicking:e,axesEvent:n})}))};for(var a in fe)o(a);return this},t.destroy=function(){var e;this._axes&&(this.removePreventClickHandler(),this._axes.destroy()),null===(e=this._panInput)||void 0===e||e.destroy(),this._resetInternalValues()},t.enable=function(){var e;return null===(e=this._panInput)||void 0===e||e.enable(),this},t.disable=function(){var e;return null===(e=this._panInput)||void 0===e||e.disable(),this},t.update=function(e){var n,t=z(this._flicking),i=t.camera,r=this._axes,o=r.axis.flick;return o.circular=[e.circular,e.circular],o.range=[e.range.min,e.range.max],o.bounce=V(t.bounce,i.size),r.axm.set(((n={}).flick=e.position,n)),this},t.addPreventClickHandler=function(){var e=z(this._flicking),n=this._axes,t=e.camera.element;return n.on(fe.HOLD,this._onAxesHold),n.on(fe.CHANGE,this._onAxesChange),t.addEventListener("click",this._preventClickWhenDragged,!0),this},t.removePreventClickHandler=function(){var e=z(this._flicking),n=this._axes,t=e.camera.element;return n.off(fe.HOLD,this._onAxesHold),n.off(fe.CHANGE,this._onAxesChange),t.removeEventListener("click",this._preventClickWhenDragged,!0),this},t.animateTo=function(e,n,t){var i,r,o=this,a=this._axes,s=this._stateMachine.state;if(!a)return Promise.reject(new oe(_,h.NOT_ATTACHED_TO_FLICKING));var l=a.get([he]).flick;if(l===e)return(c=z(this._flicking)).camera.lookAt(e),s.targetPanel&&c.control.setActive(s.targetPanel,c.control.activePanel,null!==(r=null==t?void 0:t.isTrusted)&&void 0!==r&&r),Promise.resolve();this._animatingContext={start:l,end:e,offset:0};var u=function(){var i,r;a.once(fe.FINISH,(function(){o._animatingContext={start:0,end:0,offset:0}})),t?t.setTo(((i={}).flick=e,i),n):a.setTo(((r={}).flick=e,r),n)};if(0===n){var c,f=(c=z(this._flicking)).camera;u();var d=c.circularEnabled?K(e,f.range.min,f.range.max):e;return a.axm.set(((i={}).flick=d,i)),Promise.resolve()}return new Promise((function(e,n){var t=function(){a.off(fe.HOLD,i),e()},i=function(){a.off(fe.FINISH,t),n(new oe(y,h.ANIMATION_INTERRUPTED))};a.once(fe.FINISH,t),a.once(fe.HOLD,i),u()}))},t._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0},this._dragged=!1},e}(),Ee=function(){function n(){this._flicking=null,this._controller=new Pe,this._activePanel=null}var t=n.prototype;return Object.defineProperty(t,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(t,"activeIndex",{get:function(){var e,n;return null!==(n=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==n?n:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(t,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(t,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),t.init=function(e){return this._flicking=e,this._controller.init(e),this},t.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},t.enable=function(){return this._controller.enable(),this},t.disable=function(){return this._controller.disable(),this},t.updatePosition=function(e){var n=z(this._flicking).camera,t=this._activePanel;t&&n.lookAt(n.clampToReachablePosition(t.position))},t.updateInput=function(){var e=z(this._flicking).camera;return this._controller.update(e.controlParams),this},t.resetActive=function(){return this._activePanel=null,this},t.moveToPanel=function(e,n){var t=n.duration,i=n.direction,r=void 0===i?A.NONE:i,o=n.axesEvent;return a(this,void 0,void 0,(function(){var n,i,a,l,u,c,f;return s(this,(function(s){return n=z(this._flicking),i=n.camera,a=e.position,l=i.findNearestAnchor(a),e.removed||!l?[2,Promise.reject(new oe(b(e.position),h.POSITION_NOT_REACHABLE))]:(i.canReach(e)?n.circularEnabled&&(u=this._controller.position,c=i.rangeDiff,f=[a,a+c,a-c].filter((function(e){return r===A.NONE||(r===A.PREV?e<=u:e>=u)})),a=f.reduce((function(e,n){return Math.abs(u-n)<Math.abs(u-e)?n:e}),1/0)):(a=l.position,e=l.panel),this._triggerIndexChangeEvent(e,e.position,o),[2,this._animateToPosition({position:a,duration:t,newActivePanel:e,axesEvent:o})])}))}))},t.setActive=function(n,t,i){var r,o=z(this._flicking);this._activePanel=n,o.camera.updateAdaptiveHeight(),n!==t?o.trigger(new e.ComponentEvent(I.CHANGED,{index:n.index,panel:n,prevIndex:null!==(r=null==t?void 0:t.index)&&void 0!==r?r:-1,prevPanel:t,isTrusted:i,direction:t?B(t.position,n.position):A.NONE})):o.trigger(new e.ComponentEvent(I.RESTORED,{isTrusted:i}))},t._triggerIndexChangeEvent=function(n,t,i){var r,o=z(this._flicking),a=n!==this._activePanel?I.WILL_CHANGE:I.WILL_RESTORE,s=o.camera,l=this._activePanel,u=new e.ComponentEvent(a,{index:n.index,panel:n,isTrusted:(null==i?void 0:i.isTrusted)||!1,direction:B(null!==(r=null==l?void 0:l.position)&&void 0!==r?r:s.position,t)});if(o.trigger(u),u.isCanceled())throw new oe(E,h.STOP_CALLED_BY_USER)},t._animateToPosition=function(e){var n=e.position,t=e.duration,i=e.newActivePanel,r=e.axesEvent;return a(this,void 0,void 0,(function(){var e,o,l=this;return s(this,(function(u){return e=z(this._flicking),o=function(){return l._controller.animateTo(n,t,r)},this._controller.state.targetPanel=i,t<=0?[2,o()]:[2,o().then((function(){return a(l,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,e.renderer.render()];case 1:return n.sent(),[2]}}))}))})).catch((function(e){if(!(r&&e instanceof oe&&e.code===h.ANIMATION_INTERRUPTED))throw e}))]}))}))},n}(),ye=function(){function e(e){var n=e.index,t=e.position,i=e.panel;this._index=n,this._pos=t,this._panel=i}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}(),xe=function(e){function n(n){var t=(void 0===n?{}:n).count,i=void 0===t?1/0:t,r=e.call(this)||this;return r._count=i,r}r(n,e);var t=n.prototype;return Object.defineProperty(t,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),t.moveToPosition=function(e,n,t){return a(this,void 0,void 0,(function(){var i,r,o,a,l,u,c,f,d,g;return s(this,(function(s){return i=z(this._flicking),r=i.camera,o=r.findActiveAnchor(),a=r.findNearestAnchor(r.position),l=i.control.controller.state,o&&a?(u=this._calcSnapThreshold(e,o),c=i.animating?l.delta:e-r.position,f=Math.abs(c),d=t&&0!==t.delta.flick?Math.abs(t.delta.flick):f,g=d>=u&&d>0?this._findSnappedAnchor(e,a):f>=i.threshold&&f>0?this._findAdjacentAnchor(c,a):a,this._triggerIndexChangeEvent(g.panel,e,t),[2,this._animateToPosition({position:r.clampToReachablePosition(g.position),duration:n,newActivePanel:g.panel,axesEvent:t})]):[2,Promise.reject(new oe(b(e),h.POSITION_NOT_REACHABLE))]}))}))},t._findSnappedAnchor=function(e,n){var t=z(this._flicking),i=t.camera,r=this._count,o=i.position,a=i.clampToReachablePosition(e),s=i.findAnchorIncludePosition(a);if(!n||!s)throw new oe(b(e),h.POSITION_NOT_REACHABLE);if(!isFinite(r))return s;var l=t.panelCount,u=i.anchorPoints,c=Math.sign(e-o)*Math.floor(Math.abs(e-o)/i.rangeDiff);e>o&&s.index<n.index||s.position>n.position&&s.index===n.index?c+=1:(e<o&&s.index>n.index||s.position<n.position&&s.index===n.index)&&(c-=1);var f=c*l,d=s.index+f;if(Math.abs(d-n.index)<=r){var g=u[s.index];return new ye({index:g.index,position:g.position+c*i.rangeDiff,panel:g.panel})}if(t.circularEnabled){var p=u[ne(n.index+Math.sign(e-o)*r,l)],_=Math.floor(r/l);return e>o&&p.index<n.index?_+=1:e<o&&p.index>n.index&&(_-=1),new ye({index:p.index,position:p.position+_*i.rangeDiff,panel:p.panel})}return u[D(n.index+Math.sign(e-o)*r,0,u.length-1)]},t._findAdjacentAnchor=function(e,n){var t,i=z(this._flicking).camera;return null!==(t=e>0?i.getNextAnchor(n):i.getPrevAnchor(n))&&void 0!==t?t:n},t._calcSnapThreshold=function(e,n){var t=e>n.position,i=n.panel,r=i.size,o=i.alignPosition;return t?r-o+i.margin.next:o+i.margin.prev},n}(Ee),Oe=function(e){function n(n){var t=(void 0===n?{}:n).stopAtEdge,i=void 0===t||t,r=e.call(this)||this;return r._stopAtEdge=i,r}r(n,e);var t=n.prototype;return Object.defineProperty(t,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),t.updatePosition=function(e){var n=z(this._flicking).camera,t=this._activePanel;if(t){var i=t.range,r=i.min+(i.max-i.min)*e;n.lookAt(n.clampToReachablePosition(r))}},t.moveToPosition=function(e,n,t){return a(this,void 0,void 0,(function(){var i,r,o,a,l;return s(this,(function(s){return i=z(this._flicking),r=i.camera,o=r.clampToReachablePosition(e),(a=r.findAnchorIncludePosition(o))?((l=a.panel)!==this._activePanel&&this._triggerIndexChangeEvent(l,e,t),[2,this._animateToPosition({position:this._stopAtEdge?o:e,duration:n,newActivePanel:l,axesEvent:t})]):[2,Promise.reject(new oe(b(e),h.POSITION_NOT_REACHABLE))]}))}))},n}(Ee),Te=function(e){function n(n){var t=(void 0===n?{}:n).count,i=void 0===t?1:t,r=e.call(this)||this;return r.setActive=function(n,t,i){e.prototype.setActive.call(r,n,t,i),r.updateInput()},r._count=i,r._resetIndexRange(),r}r(n,e);var t=n.prototype;return Object.defineProperty(t,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),t.destroy=function(){e.prototype.destroy.call(this),this._resetIndexRange()},t.updateInput=function(){var e,n=z(this._flicking),t=n.camera,i=n.renderer,r=this._controller,o=t.controlParams,a=this._count,s=r.state.animating?null===(e=t.findNearestAnchor(t.position))||void 0===e?void 0:e.panel:this._activePanel;if(!s)return r.update(o),this._resetIndexRange(),this;var l=o.range,u=s.position,c=s.index,f=i.panelCount,h=c-a,d=c+a;h<0&&(h=n.circularEnabled?X((h+1)%f-1,f):D(h,0,f-1)),d>=f&&(d=n.circularEnabled?d%f:D(d,0,f-1));var g=i.panels[h],p=i.panels[d],_=Math.max(g.position,l.min),v=Math.min(p.position,l.max);return _>u&&(_-=t.rangeDiff),v<u&&(v+=t.rangeDiff),o.range={min:_,max:v},o.circular&&(o.position<_&&(o.position+=t.rangeDiff),o.position>v&&(o.position-=t.rangeDiff)),o.circular=!1,r.update(o),this._indexRange={min:g.index,max:p.index},this},t.moveToPosition=function(e,n,t){return a(this,void 0,void 0,(function(){var i,r,o,a,l,u,c,f,d,g,p,_,v,m,P,E,y,x,O;return s(this,(function(s){return i=z(this._flicking),r=i.camera,o=this._activePanel,a=this._controller.range,l=this._indexRange,u=r.range,c=D(r.clampToReachablePosition(e),a[0],a[1]),(f=r.findAnchorIncludePosition(c))&&o?(d=o.position,g=Math.abs(e-d)>=i.threshold,p=e>d?r.getNextAnchor(f):r.getPrevAnchor(f),m=r.anchorPoints,P=m[0],E=m[m.length-1],y=e<=u.min&&ee(P.panel.index,l.min,l.max),x=e>=u.max&&ee(E.panel.index,l.min,l.max),y||x?(O=e<u.min?P:E,v=O.panel,_=O.position):g&&f.position!==o.position?(v=f.panel,_=f.position):g&&p&&ee(p.index,l.min,l.max)?(v=p.panel,_=p.position):(_=r.clampToReachablePosition(o.position),v=o),this._triggerIndexChangeEvent(v,e,t),[2,this._animateToPosition({position:_,duration:n,newActivePanel:v,axesEvent:t})]):[2,Promise.reject(new oe(b(e),h.POSITION_NOT_REACHABLE))]}))}))},t._resetIndexRange=function(){this._indexRange={min:0,max:0}},n}(Ee),Ie={__proto__:null,Control:Ee,SnapControl:xe,FreeControl:Oe,StrictControl:Te,AxesController:Pe,State:de,IdleState:ge,HoldingState:pe,DraggingState:_e,AnimatingState:ve,DisabledState:me,StateMachine:be},Re=function(){function n(e){var n=this,t=(void 0===e?{}:e).align,i=void 0===t?R.CENTER:t;this._checkTranslateSupport=function(){var e,t,i=document.documentElement.style,r="";try{for(var o=l(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),a=o.next();!a.done;a=o.next()){var s=a.value;s in i&&(r=s)}}catch(n){e={error:n}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}if(!r)throw new oe(P,h.TRANSFORM_NOT_SUPPORTED);n._transform=r},this._flicking=null,this._resetInternalValues(),this._align=i}var t=n.prototype;return Object.defineProperty(t,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(t,"children",{get:function(){return L(this._el.children)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(t,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(t,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(t,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(t,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(t,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(t,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(t,"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,s=a.min,l=a.max,u=this.rangeDiff;if(n===r)return i.index;if(n<r){var c=i.prev(),f=c?c.position+c.offset:s-o[0];return f>r&&(f-=u),i.index-1+J(n,f,r)}var h=i.next(),d=h?h.position+h.offset:l+o[1];return d<r&&(d+=u),i.index+J(n,r,d)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),t.init=function(e){this._flicking=e;var n=e.viewport.element;return S(n.firstElementChild,"First element child of the viewport element"),this._el=n.firstElementChild,this._checkTranslateSupport(),this},t.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},t.lookAt=function(e){var n=this._position;this._position=e,this._refreshVisiblePanels(),this._checkNeedPanel(),this._checkReachEnd(n,e),this.applyTransform()},t.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},t.getNextAnchor=function(e){return this._anchors[e.index+1]||null},t.getProgressInPanel=function(e){var n=e.range;return(this._position-n.min)/(n.max-n.min)},t.findAnchorIncludePosition=function(e){return this._anchors.filter((function(n){return n.panel.includePosition(e,!0)})).reduce((function(n,t){return n&&Math.abs(n.position-e)<Math.abs(t.position-e)?n:t}),null)},t.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],o=Math.abs(r.position-e);if(o>t)return n[i-1];t=o}return n[n.length-1]},t.findActiveAnchor=function(){var e=z(this._flicking).control.activeIndex;return Z(this._anchors,(function(n){return n.panel.index===e}))},t.clampToReachablePosition=function(e){var n=this._range;return D(e,n.min,n.max)},t.canReach=function(e){var n=this._range;if(e.removed)return!1;var t=e.position;return t>=n.min&&t<=n.max},t.canSee=function(e){var n=this.visibleRange;return e.isVisibleOnRange(n.min,n.max)},t.updateAlignPos=function(){var e=this._align,n="object"==typeof e?e.camera:e;return this._alignPos=M(n,this.size),this},t.updateAnchors=function(){var e=z(this._flicking).renderer.panels;return this._anchors=e.map((function(e,n){return new ye({index:n,position:e.position,panel:e})})),this},t.updateAdaptiveHeight=function(){var e=z(this._flicking),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},t.updateOffset=function(){var e=z(this._flicking),n=this._position,t=e.panels.filter((function(e){return!e.rendered}));return this._offset=t.filter((function(e){return e.position+e.offset<n})).reduce((function(e,n){return e+n.sizeIncludingMargin}),0),this.applyTransform(),this},t.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},t.applyTransform=function(){var e=this._el,n=z(this._flicking),t=this._position-this._alignPos-this._offset;return e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)",this},t._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}},t._refreshVisiblePanels=function(){var n=this,t=z(this._flicking),i=t.renderer.panels.filter((function(e){return n.canSee(e)})),r=this._visiblePanels;this._visiblePanels=i;var o=i.filter((function(e){return!U(r,e)})),a=r.filter((function(e){return!U(i,e)}));(o.length>0||a.length>0)&&t.renderer.render().then((function(){t.trigger(new e.ComponentEvent(I.VISIBLE_CHANGE,{added:o,removed:a,visiblePanels:i}))}))},t._checkNeedPanel=function(){var n=this._needPanelTriggered;if(!n.prev||!n.next){var t=z(this._flicking),i=t.renderer.panels;if(i.length<=0)return n.prev||(t.trigger(new e.ComponentEvent(I.NEED_PANEL,{direction:A.PREV})),n.prev=!0),void(n.next||(t.trigger(new e.ComponentEvent(I.NEED_PANEL,{direction:A.NEXT})),n.next=!0));var r=this._position,o=this.size,a=this._range,s=t.needPanelThreshold,l=r-this._alignPos,u=l+o,c=i[0],f=i[i.length-1];if(!n.prev)(l<=c.range.min+s||r<=a.min+s)&&(t.trigger(new e.ComponentEvent(I.NEED_PANEL,{direction:A.PREV})),n.prev=!0);if(!n.next)(u>=f.range.max-s||r>=a.max-s)&&(t.trigger(new e.ComponentEvent(I.NEED_PANEL,{direction:A.NEXT})),n.next=!0)}},t._checkReachEnd=function(n,t){var i=z(this._flicking),r=this._range,o=n>r.min&&n<r.max,a=t>r.min&&t<r.max;if(o&&!a){var s=t<=r.min?A.PREV:A.NEXT;i.trigger(new e.ComponentEvent(I.REACH_EDGE,{direction:s}))}},n}(),Ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.updateRange=function(){var e,n,t=z(this._flicking).renderer,i=t.getPanel(0),r=t.getPanel(t.panelCount-1);return this._range={min:null!==(e=null==i?void 0:i.position)&&void 0!==e?e:0,max:null!==(n=null==r?void 0:r.position)&&void 0!==n?n:0},this},n}(Re),we=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n._circularOffset=0,n._circularEnabled=!1,n}r(n,e);var t=n.prototype;return Object.defineProperty(t,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(t,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),t.getPrevAnchor=function(n){if(!this._circularEnabled||0!==n.index)return e.prototype.getPrevAnchor.call(this,n);var t=this._anchors,i=this.rangeDiff,r=t[t.length-1];return new ye({index:r.index,position:r.position-i,panel:r.panel})},t.getNextAnchor=function(n){var t=this._anchors;if(!this._circularEnabled||n.index!==t.length-1)return e.prototype.getNextAnchor.call(this,n);var i=this.rangeDiff,r=t[0];return new ye({index:r.index,position:r.position+i,panel:r.panel})},t.findAnchorIncludePosition=function(n){if(!this._circularEnabled)return e.prototype.findAnchorIncludePosition.call(this,n);var t=this._range,i=this._anchors,r=this.rangeDiff,o=i.length,a=K(n,t.min,t.max),s=e.prototype.findAnchorIncludePosition.call(this,a);if(o>0&&(n===t.min||n===t.max)){var l=[s,new ye({index:0,position:i[0].position+r,panel:i[0].panel}),new ye({index:o-1,position:i[o-1].position-r,panel:i[o-1].panel})].filter((function(e){return!!e}));s=l.reduce((function(e,t){return e&&Math.abs(e.position-n)<Math.abs(t.position-n)?e:t}),null)}if(!s)return null;if(n<t.min){var u=-Math.floor((t.min-n)/r)-1;return new ye({index:s.index,position:s.position+r*u,panel:s.panel})}if(n>t.max){u=Math.floor((n-t.max)/r)+1;return new ye({index:s.index,position:s.position+r*u,panel:s.panel})}return s},t.clampToReachablePosition=function(n){return this._circularEnabled?n:e.prototype.clampToReachablePosition.call(this,n)},t.canReach=function(n){return!n.removed&&(!!this._circularEnabled||e.prototype.canReach.call(this,n))},t.canSee=function(n){var t=this._range,i=this.rangeDiff,r=this.visibleRange,o=e.prototype.canSee.call(this,n);return this._circularEnabled?r.min<t.min?o||n.isVisibleOnRange(r.min+i,r.max+i):r.max>t.max?o||n.isVisibleOnRange(r.min-i,r.max-i):o:o},t.updateRange=function(){var e=z(this._flicking).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,s?(this._range={min:i,max:r},e.forEach((function(e){return e.updateCircularToggleDirection()}))):this._range={min:n.position,max:t.position},this.updateOffset(),this},t.updateOffset=function(){return this._updateCircularOffset(),e.prototype.updateOffset.call(this)},t.lookAt=function(n){var t=this,i=z(this._flicking),r=this._position;if(n===r)return e.prototype.lookAt.call(this,n);var o=i.renderer.panels.map((function(e){return e.toggle(r,n)}));this._position=n,e.prototype.lookAt.call(this,n),o.some((function(e){return e}))&&i.renderer.render().then((function(){t.updateOffset()}))},t.applyTransform=function(){var e=this._el,n=z(this._flicking),t=this._position-this._alignPos-this._offset+this._circularOffset;return e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)",this},t._resetInternalValues=function(){e.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},t._calcPanelAreaSum=function(e){return e.reduce((function(e,n){return e+n.sizeIncludingMargin}),0)},t._updateCircularOffset=function(){if(this._circularEnabled){var e=z(this._flicking).panels.filter((function(e){return e.toggled})),n=e.filter((function(e){return e.toggleDirection===A.PREV})),t=e.filter((function(e){return e.toggleDirection===A.NEXT}));this._circularOffset=this._calcPanelAreaSum(n)-this._calcPanelAreaSum(t)}else this._circularOffset=0},n}(Re),Ne=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}r(n,e);var t=n.prototype;return t.updateRange=function(){var e=z(this._flicking).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,a=i.range.max,s=o+n,l=a-r+n;if(r<a-o)this._range={min:s,max:l};else{var u=this._align,c="object"==typeof u?u.camera:u,f=s+M(c,l-s);this._range={min:f,max:f}}return this},t.updateAnchors=function(){var e=this,n=z(this._flicking).renderer.panels;if(n.length<=0)return this._anchors=[],this;var t=this._range,i=n.filter((function(n){return e.canReach(n)}));if(i.length>0){var r=i[0].position!==t.min,o=i[i.length-1].position!==t.max,a=r?1:0,s=i.map((function(e,n){return new ye({index:n+a,position:e.position,panel:e})}));r&&s.splice(0,0,new ye({index:0,position:t.min,panel:n[i[0].index-1]})),o&&s.push(new ye({index:s.length,position:t.max,panel:n[i[i.length-1].index+1]})),this._anchors=s}else if(t.min!==t.max){var l=this._findNearestPanel(t.min,n),u=l.index===n.length-1?l.prev():l,c=u.next();this._anchors=[new ye({index:0,position:t.min,panel:u}),new ye({index:1,position:t.max,panel:c})]}else this._anchors=[new ye({index:0,position:t.min,panel:this._findNearestPanel(t.min,n)})];return this},t.findAnchorIncludePosition=function(n){var t=this._range,i=this._anchors;return i.length<=0?null:n<=t.min?i[0]:n>=t.max?i[i.length-1]:e.prototype.findAnchorIncludePosition.call(this,n)},t._findNearestPanel=function(e,n){for(var t=1/0,i=0;i<n.length;i++){var r=n[i],o=Math.abs(r.position-e);if(o>t)return n[i-1];t=o}return n[n.length-1]},n}(Re),Ce={__proto__:null,Camera:Re,LinearCamera:Ae,CircularCamera:we,BoundCamera:Ne},ke=function(){function n(e){var n=e.align,t=void 0===n?R.CENTER:n,i=e.strategy;this._flicking=null,this._panels=[],this._align=t,this._strategy=i}var i=n.prototype;return Object.defineProperty(i,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(i,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strategy",{get:function(){return this._strategy},enumerable:!1,configurable:!0}),Object.defineProperty(i,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=G(e);this._panels.forEach((function(e){e.align=n}))},enumerable:!1,configurable:!0}),i.init=function(e){return this._flicking=e,this._collectPanels(),this},i.destroy=function(){this._flicking=null,this._panels=[]},i.getPanel=function(e){return this._panels[e]||null},i.forceRenderAllPanels=function(){return this._panels.forEach((function(e){return e.markForShow()})),Promise.resolve()},i.updatePanelSize=function(){var e=z(this._flicking),n=this._panels;if(n.length<=0)return this;if(e.panelsPerView>0){var t=n[0];t.resize(),this._updatePanelSizeByGrid(t,n)}else e.panels.forEach((function(e){return e.resize()}));return this},i.batchInsert=function(){for(var n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=this._panels,o=z(this._flicking),a=o.control,s=r[0],l=G(this._align),f=t.reduce((function(e,t){var i,a=X(t.index,r.length),f=r.slice(a),h=t.elements.map((function(e,t){return n._createPanel(e,{index:a+t,align:l,flicking:o})}));if(r.splice.apply(r,c([a,0],u(h))),t.hasDOMInElements&&n._insertPanelElements(h,null!==(i=f[0])&&void 0!==i?i:null),o.panelsPerView>0){var d=s||h[0].resize();n._updatePanelSizeByGrid(d,h)}else h.forEach((function(e){return e.resize()}));return f.forEach((function(e){e.increaseIndex(h.length),e.updatePosition()})),c(c([],u(e)),u(h))}),[]);return f.length<=0?[]:(this._updateCameraAndControl(),this.render(),f.length>0&&!a.animating&&a.moveToPanel(a.activePanel||f[0],{duration:0}).catch((function(){})),o.camera.updateOffset(),o.trigger(new e.ComponentEvent(I.PANEL_CHANGE,{added:f,removed:[]})),this.checkPanelContentsReady(f),f)},i.batchRemove=function(){for(var n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=this._panels,o=z(this._flicking),a=o.camera,s=o.control,l=s.activePanel,f=s.activeIndex,h=t.reduce((function(e,t){var i=t.index,o=t.deleteCount,a=X(i,r.length),f=r.slice(a+o),h=r.splice(a,o);return h.length<=0?[]:(f.forEach((function(e){e.decreaseIndex(h.length),e.updatePosition()})),t.hasDOMInElements&&n._removePanelElements(h),h.forEach((function(e){return e.destroy()})),U(h,l)&&s.resetActive(),c(c([],u(e)),u(h)))}),[]);if(this._updateCameraAndControl(),this.render(),h.length>0&&!s.animating){var d=U(h,l)?r[f]||r[r.length-1]:l;d?s.moveToPanel(d,{duration:0}).catch((function(){})):a.lookAt(0)}return o.camera.updateOffset(),o.trigger(new e.ComponentEvent(I.PANEL_CHANGE,{added:[],removed:h})),h},i.checkPanelContentsReady=function(e){var n=this,i=z(this._flicking),r=i.resizeOnContentsReady,o=this._panels;if(r&&!i.virtualEnabled){if(!((e=e.filter((function(e){return function(e){return!!e.element.querySelector("img, video")}(e)}))).length<=0)){var a=new t;e.forEach((function(e){e.loading=!0})),a.on("readyElement",(function(t){if(n._flicking){var r=e[t.index],s=i.camera,l=i.control,u=l.activePanel?s.getProgressInPanel(l.activePanel):0;r.loading=!1,r.resize(),o.slice(r.index+1).forEach((function(e){return e.updatePosition()})),i.initialized&&(s.updateRange(),s.updateAnchors(),l.animating||(l.updatePosition(u),l.updateInput()))}else a.destroy()})),a.on("preReady",(function(e){n._flicking&&n.render(),e.readyCount===e.totalCount&&a.destroy()})),a.on("ready",(function(){n._flicking&&n.render(),a.destroy()})),a.check(e.map((function(e){return e.element})))}}},i._updateCameraAndControl=function(){var e=z(this._flicking),n=e.camera,t=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),t.updateInput()},i._showOnlyVisiblePanels=function(e){var n=e.renderer.panels,t=e.camera.visiblePanels.reduce((function(e,n){return e[n.index]=!0,e}),{});n.forEach((function(n){n.index in t||n.loading?n.markForShow():e.holding||n.markForHide()}))},i._updatePanelSizeByGrid=function(e,n){var t=z(this._flicking),i=t.panelsPerView;if(i<=0)throw new oe(v("panelsPerView",i),h.WRONG_OPTION);if(!(n.length<=0)){var r=(t.camera.size-(e.margin.prev+e.margin.next)*(i-1))/i,o=t.horizontal?{width:r}:{height:r},a={size:r,height:e.height,margin:e.margin};t.noPanelStyleOverride||this._strategy.updatePanelSizes(t,o),t.panels.forEach((function(e){return e.resize(a)}))}},i._removeAllChildsFromCamera=function(){for(var e=z(this._flicking).camera.element;e.firstChild;)e.removeChild(e.firstChild)},i._insertPanelElements=function(e,n){void 0===n&&(n=null);var t=z(this._flicking).camera.element,i=(null==n?void 0:n.element)||null,r=document.createDocumentFragment();e.forEach((function(e){return r.appendChild(e.element)})),t.insertBefore(r,i)},i._removePanelElements=function(e){var n=z(this._flicking).camera.element;e.forEach((function(e){n.removeChild(e.element)}))},n}(),je=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}r(n,e);var t=n.prototype;return t.render=function(){return a(this,void 0,void 0,(function(){var e,n;return s(this,(function(t){return e=z(this._flicking),(n=this._strategy).updateRenderingPanels(e),n.renderPanels(e),this._resetPanelElementOrder(),[2]}))}))},t._collectPanels=function(){var e=z(this._flicking),n=e.camera;this._removeAllTextNodes(),this._panels=this._strategy.collectPanels(e,n.children)},t._createPanel=function(e,n){return this._strategy.createPanel(e,n)},t._resetPanelElementOrder=function(){var e=z(this._flicking),n=e.camera.element,t=this._strategy.getRenderingElementsByOrder(e).reverse();t.forEach((function(e,i){var r=t[i-1]?t[i-1]:null;e.nextElementSibling!==r&&n.insertBefore(e,r)}))},t._removeAllTextNodes=function(){var e=z(this._flicking).camera.element;L(e.childNodes).forEach((function(n){n.nodeType===Node.TEXT_NODE&&e.removeChild(n)}))},n}(ke),Se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}r(n,e);var t=n.prototype;return t._removePanelElements=function(e){},t._removeAllChildsFromCamera=function(){},n}(ke),De=function(){function e(e){var n=e.index,t=e.align,i=e.flicking,r=e.elementProvider;this._index=n,this._flicking=i,this._elProvider=r,this._align=t,this._removed=!1,this._rendered=!0,this._loading=!1,this._resetInternalStates()}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._elProvider.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"elementProvider",{get:function(){return this._elProvider},enumerable:!1,configurable:!0}),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,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),Object.defineProperty(n,"loading",{get:function(){return this._loading},set:function(e){this._loading=e},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!==A.NONE&&this._toggled?e===A.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-J(i,e,r)}var o=e-(t.alignPosition+this._size-n);return 1-J(i,o,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,o=e.max+t;if(o<=i.min||r>=i.max)return 0;var a=n;return i.min>r&&(a-=i.min-r),i.max<o&&(a-=o-i.max),a/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.markForShow=function(){this._rendered=!0,this._elProvider.show(this._flicking)},n.markForHide=function(){this._rendered=!1,this._elProvider.hide(this._flicking)},n.resize=function(e){var n=this.element,t=this._flicking.horizontal;if(e)this._size=e.size,this._margin=o({},e.margin),this._height=e.height;else{var i=Q(n);this._size=t?n.offsetWidth:n.offsetHeight,this._margin=t?{prev:parseFloat(i.marginLeft||"0"),next:parseFloat(i.marginRight||"0")}:{prev:parseFloat(i.marginTop||"0"),next:parseFloat(i.marginBottom||"0")},this._height=t?n.offsetHeight:this._size}return this.updatePosition(),this._updateAlignPos(),this},n.setSize=function(e){return $(this.element,e),this},n.contains=function(e){var n;return!!(null===(n=this.element)||void 0===n?void 0:n.contains(e))},n.destroy=function(){this._resetInternalStates(),this._removed=!0},n.includePosition=function(e,n){return void 0===n&&(n=!1),this.includeRange(e,e,n)},n.includeRange=function(e,n,t){void 0===t&&(t=!1);var i=this._margin,r=this.range;return t&&(r.min-=i.prev,r.max+=i.next),n>=r.min&&e<=r.max},n.isVisibleOnRange=function(e,n){var t=this.range;return n>t.min&&e<t.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.updatePosition=function(){var e=this._flicking.renderer.panels[this._index-1];return this._pos=e?e.range.max+e.margin.next+this._margin.prev:this._margin.prev,this},n.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===A.NONE||n===e)return!1;var r=this._toggled;return n>e?i>=e&&i<=n&&(this._toggled=t===A.NEXT):i<=e&&i>=n&&(this._toggled=t!==A.NEXT),r!==this._toggled},n.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=A.NONE,this._toggled=!1,this;var n=e.camera,t=n.range,i=n.alignPosition,r=n.visibleRange,o=r.max-r.min,a=t.min-i,s=t.max-i+o,l=this.includeRange(s-o,s,!1),u=this.includeRange(a,a+o,!1);return this._toggled=!1,l?(this._toggleDirection=A.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):u?(this._toggleDirection=A.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=A.NONE,this._togglePosition=0),this},n._updateAlignPos=function(){this._alignPos=M(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=A.NONE},e}(),ze=function(){function e(e){var n=e.providerCtor;this._providerCtor=n}var n=e.prototype;return n.renderPanels=function(){},n.getRenderingIndexesByOrder=function(e){var n=e.renderer.panels.filter((function(e){return e.rendered})),t=n.filter((function(e){return e.toggled&&e.toggleDirection===A.PREV})),i=n.filter((function(e){return e.toggled&&e.toggleDirection===A.NEXT})),r=n.filter((function(e){return!e.toggled}));return c(c(c([],u(t)),u(r)),u(i)).map((function(e){return e.index}))},n.getRenderingElementsByOrder=function(e){var n=e.panels;return this.getRenderingIndexesByOrder(e).map((function(e){return n[e].element}))},n.updateRenderingPanels=function(e){e.renderOnlyVisible?this._showOnlyVisiblePanels(e):e.panels.forEach((function(e){return e.markForShow()}))},n.collectPanels=function(e,n){var t=this,i=G(e.renderer.align);return n.map((function(n,r){return new De({index:r,elementProvider:new t._providerCtor(n),align:i,flicking:e})}))},n.createPanel=function(e,n){return new De(o(o({},n),{elementProvider:new this._providerCtor(e)}))},n.updatePanelSizes=function(e,n){e.panels.forEach((function(e){return e.setSize(n)}))},n._showOnlyVisiblePanels=function(e){var n=e.renderer.panels,t=e.camera,i=t.visiblePanels.reduce((function(e,n){return e[n.index]=!0,e}),{});n.forEach((function(n){n.index in i||n.loading?n.markForShow():e.holding||n.markForHide()})),t.updateOffset()},e}(),Le=function(e){function n(n){var t=e.call(this,n)||this;return n.elementProvider.init(t),t._elProvider=n.elementProvider,t._cachedInnerHTML=null,t}r(n,e);var t=n.prototype;return Object.defineProperty(t,"element",{get:function(){return this._elProvider.element},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cachedInnerHTML",{get:function(){return this._cachedInnerHTML},enumerable:!1,configurable:!0}),Object.defineProperty(t,"elementIndex",{get:function(){var e=this._flicking,n=e.panelsPerView+1,t=e.panelCount,i=this._index;return this._toggled&&(i=this._toggleDirection===A.NEXT?i+t:i-t),ne(i,n)},enumerable:!1,configurable:!0}),t.cacheRenderResult=function(e){this._cachedInnerHTML=e},t.uncacheRenderResult=function(){this._cachedInnerHTML=null},t.render=function(){var e=this._flicking.virtual,n=e.renderPanel,t=e.cache,i=this._elProvider.element,r=this._cachedInnerHTML||n(this,this._index);r!==i.innerHTML&&(i.innerHTML=r,t&&this.cacheRenderResult(r))},t.increaseIndex=function(n){return this.uncacheRenderResult(),e.prototype.increaseIndex.call(this,n)},t.decreaseIndex=function(n){return this.uncacheRenderResult(),e.prototype.decreaseIndex.call(this,n)},n}(De),Me=function(){function e(){}var n=e.prototype;return n.renderPanels=function(e){var n=e.virtual,t=e.visiblePanels,i=te(e.panelsPerView+1);t.forEach((function(e){var t=e.elementIndex;e.render(),n.show(t),i[t]=-1})),i.filter((function(e){return e>=0})).forEach((function(e){n.hide(e)}))},n.getRenderingIndexesByOrder=function(e){var n=e.virtual,t=c([],u(e.visiblePanels)).filter((function(e){return e.rendered})).sort((function(e,n){return e.position+e.offset-(n.position+n.offset)}));if(t.length<=0)return n.elements.map((function(e,n){return n}));var i=t.map((function(e){return e.elementIndex})),r=n.elements.map((function(e,n){return o(o({},e),{idx:n})})).filter((function(e){return!e.visible})).map((function(e){return e.idx}));return c(c([],u(i)),u(r))},n.getRenderingElementsByOrder=function(e){var n=e.virtual.elements;return this.getRenderingIndexesByOrder(e).map((function(e){return n[e].nativeElement}))},n.updateRenderingPanels=function(e){var n=e.renderer.panels,t=e.camera,i=t.visiblePanels.reduce((function(e,n){return e[n.index]=!0,e}),{});n.forEach((function(e){e.index in i||e.loading?e.markForShow():e.markForHide()})),t.updateOffset()},n.collectPanels=function(e){var n=G(e.renderer.align);return te(e.virtual.initialPanelCount).map((function(t){return new Le({index:t,elementProvider:new ue(e),align:n,flicking:e})}))},n.createPanel=function(e,n){return new Le(o(o({},n),{elementProvider:new ue(n.flicking)}))},n.updatePanelSizes=function(e,n){e.virtual.elements.forEach((function(e){$(e.nativeElement,n)})),e.panels.forEach((function(e){return e.setSize(n)}))},e}(),Ve={__proto__:null,Renderer:ke,VanillaRenderer:je,ExternalRenderer:Se,NormalRenderingStrategy:ze,VirtualRenderingStrategy:Me},He=function(n){function t(e,t){var i=void 0===t?{}:t,r=i.align,o=void 0===r?R.CENTER:r,a=i.defaultIndex,s=void 0===a?0:a,l=i.horizontal,u=void 0===l||l,c=i.circular,f=void 0!==c&&c,h=i.bound,d=void 0!==h&&h,g=i.adaptive,p=void 0!==g&&g,_=i.panelsPerView,v=void 0===_?-1:_,m=i.noPanelStyleOverride,b=void 0!==m&&m,P=i.resizeOnContentsReady,E=void 0!==P&&P,y=i.needPanelThreshold,x=void 0===y?0:y,O=i.preventEventsBeforeInit,T=void 0===O||O,I=i.deceleration,A=void 0===I?.0075:I,w=i.duration,N=void 0===w?500:w,C=i.easing,k=void 0===C?function(e){return 1-Math.pow(1-e,3)}:C,S=i.inputType,D=void 0===S?["mouse","touch"]:S,z=i.moveType,L=void 0===z?"snap":z,M=i.threshold,V=void 0===M?40:M,H=i.interruptable,F=void 0===H||H,G=i.bounce,B=void 0===G?"20%":G,W=i.iOSEdgeSwipeThreshold,X=void 0===W?30:W,U=i.preventClickOnDrag,Y=void 0===U||U,K=i.disableOnInit,Z=void 0!==K&&K,q=i.renderOnlyVisible,J=void 0!==q&&q,Q=i.virtual,$=void 0===Q?null:Q,ee=i.autoInit,ne=void 0===ee||ee,te=i.autoResize,ie=void 0===te||te,re=i.useResizeObserver,oe=void 0===re||re,le=i.externalRenderer,ue=void 0===le?null:le,fe=i.renderExternal,he=void 0===fe?null:fe,de=n.call(this)||this;return de._initialized=!1,de._plugins=[],de._align=o,de._defaultIndex=s,de._horizontal=u,de._circular=f,de._bound=d,de._adaptive=p,de._panelsPerView=v,de._noPanelStyleOverride=b,de._resizeOnContentsReady=E,de._virtual=$,de._needPanelThreshold=x,de._preventEventsBeforeInit=T,de._deceleration=A,de._duration=N,de._easing=k,de._inputType=D,de._moveType=L,de._threshold=V,de._interruptable=F,de._bounce=B,de._iOSEdgeSwipeThreshold=X,de._preventClickOnDrag=Y,de._disableOnInit=Z,de._renderOnlyVisible=J,de._autoInit=ne,de._autoResize=ie,de._useResizeObserver=oe,de._externalRenderer=ue,de._renderExternal=he,de._viewport=new ae(j(e)),de._autoResizer=new se(de),de._renderer=de._createRenderer(),de._camera=de._createCamera(),de._control=de._createControl(),de._virtualManager=new ce(de,$),de._autoInit&&de.init(),de}r(t,n);var i=t.prototype;return Object.defineProperty(i,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(i,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(i,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(i,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(i,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(i,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(i,"virtualEnabled",{get:function(){return this._panelsPerView>0&&null!=this._virtual},enumerable:!1,configurable:!0}),Object.defineProperty(i,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(i,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(i,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(i,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(i,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(i,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(i,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(i,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(i,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(i,"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(i,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"panelsPerView",{get:function(){return this._panelsPerView},set:function(e){this._panelsPerView=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"noPanelStyleOverride",{get:function(){return this._noPanelStyleOverride},set:function(e){this._noPanelStyleOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"resizeOnContentsReady",{get:function(){return this._resizeOnContentsReady},set:function(e){this._resizeOnContentsReady=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"needPanelThreshold",{get:function(){return this._needPanelThreshold},set:function(e){this._needPanelThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"preventEventsBeforeInit",{get:function(){return this._preventEventsBeforeInit},set:function(e){this._preventEventsBeforeInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){if(e!==this._preventClickOnDrag){var n=this._control.controller;e?n.addPreventClickHandler():n.removePreventClickHandler(),this._preventClickOnDrag=e}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(i,"virtual",{get:function(){return this._virtualManager},enumerable:!1,configurable:!0}),Object.defineProperty(i,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(i,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e,e?this._autoResizer.enable():this._autoResizer.disable()},enumerable:!1,configurable:!0}),Object.defineProperty(i,"useResizeObserver",{get:function(){return this._useResizeObserver},set:function(e){this._useResizeObserver=e,this._autoResize&&this._autoResizer.enable()},enumerable:!1,configurable:!0}),Object.defineProperty(i,"externalRenderer",{get:function(){return this._externalRenderer},enumerable:!1,configurable:!0}),Object.defineProperty(i,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),i.init=function(){return a(this,void 0,void 0,(function(){var n,t,i,r,o,a,l=this;return s(this,(function(s){switch(s.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,r=this._virtualManager,o=this.trigger,a=this._preventEventsBeforeInit,n.init(this),r.init(),t.init(this),i.init(this),a&&(this.trigger=function(){return l}),[4,this.resize()]);case 1:return s.sent(),[4,this._moveToInitialPanel()];case 2:return s.sent(),this._autoResize&&this._autoResizer.enable(),this._preventClickOnDrag&&i.controller.addPreventClickHandler(),this._disableOnInit&&this.disableInput(),t.checkPanelContentsReady(t.panels),this._plugins.forEach((function(e){return e.init(l)})),this._initialized=!0,a&&(this.trigger=o),this.trigger(new e.ComponentEvent(I.READY)),[2]}}))}))},i.destroy=function(){this.off(),this._autoResizer.disable(),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach((function(e){return e.destroy()})),this._initialized=!1},i.prev=function(e){var n,t,i;return void 0===e&&(e=this._duration),this.moveTo(null!==(i=null===(t=null===(n=this._control.activePanel)||void 0===n?void 0:n.prev())||void 0===t?void 0:t.index)&&void 0!==i?i:-1,e,A.PREV)},i.next=function(e){var n,t,i;return void 0===e&&(e=this._duration),this.moveTo(null!==(i=null===(t=null===(n=this._control.activePanel)||void 0===n?void 0:n.next())||void 0===t?void 0:t.index)&&void 0!==i?i:this._renderer.panelCount,e,A.NEXT)},i.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=A.NONE);var i=this._renderer,r=i.panelCount,o=i.getPanel(e);return o?this._control.animating?Promise.reject(new oe(x,h.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(o,{duration:n,direction:t}):Promise.reject(new oe(m(e,0,r-1),h.INDEX_OUT_OF_RANGE))},i.getPanel=function(e){return this._renderer.getPanel(e)},i.enableInput=function(){return this._control.enable(),this},i.disableInput=function(){return this._control.disable(),this},i.getStatus=function(e){var n,t,i=void 0===e?{}:e,r=i.index,o=void 0===r||r,a=i.position,s=void 0===a||a,l=i.includePanelHTML,u=void 0!==l&&l,c=i.visiblePanelsOnly,f=void 0!==c&&c,h=this._camera,d={panels:(f?this.visiblePanels:this.panels).map((function(e){var n={index:e.index};return u&&(n.html=e.element.outerHTML),n}))};if(o&&(d.index=this.index),s){var g=h.findNearestAnchor(h.position);g&&(d.position={panel:g.panel.index,progressInPanel:h.getProgressInPanel(g.panel)})}if(f){var p=this.visiblePanels;d.visibleOffset=null!==(t=null===(n=p[0])||void 0===n?void 0:n.index)&&void 0!==t?t:0}return d},i.setStatus=function(e){var n;if(!this._initialized)throw new oe(T,h.NOT_INITIALIZED);var t=e.index,i=e.position,r=e.visibleOffset,o=e.panels,a=this._renderer,s=this._control;if((null===(n=o[0])||void 0===n?void 0:n.html)&&!this._renderExternal&&(a.batchRemove({index:0,deleteCount:this.panels.length,hasDOMInElements:!0}),a.batchInsert({index:0,elements:W(o.map((function(e){return e.html}))),hasDOMInElements:!0})),t){var l=r?t-r:t;this.moveTo(l,0).catch((function(){}))}if(i&&this._moveType===w.FREE_SCROLL){var u=i.panel,c=i.progressInPanel,f=(l=r?u-r:u,a.panels[l].range),d=f.min+(f.max-f.min)*c;s.moveToPosition(d,0).catch((function(){}))}},i.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,c([],u(t))),this},i.removePlugins=function(){for(var e=this,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n.forEach((function(n){var t=q(e._plugins,(function(e){return e===n}));t>=0&&(n.destroy(),e._plugins.splice(t,1))})),this},i.resize=function(){return a(this,void 0,void 0,(function(){var n,t,i,r,o,a,l,u,c,f,h;return s(this,(function(s){switch(s.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,r=this._control,o=r.activePanel,a=n.width,l=n.height,u=o?i.getProgressInPanel(o):0,this.trigger(new e.ComponentEvent(I.BEFORE_RESIZE,{width:a,height:l,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return s.sent(),t.updatePanelSize(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),[4,t.render()];case 2:return s.sent(),r.animating||(r.updatePosition(u),r.updateInput()),c=n.width,f=n.height,h=c!==a||f!==l,this.trigger(new e.ComponentEvent(I.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:a,height:l},sizeChanged:h,element:n.element})),[2]}}))}))},i.append=function(e){return this.insert(this._renderer.panelCount,e)},i.prepend=function(e){return this.insert(0,e)},i.insert=function(e,n){if(this._renderExternal)throw new oe(O,h.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:W(n),hasDOMInElements:!0})},i.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new oe(O,h.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n,hasDOMInElements:!0})},i._createControl=function(){var e,n=this._moveType,t=Object.keys(w).map((function(e){return w[e]})),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!U(t,i))throw new oe(v("moveType",JSON.stringify(n)),h.WRONG_OPTION);switch(i){case w.SNAP:return new xe(r);case w.FREE_SCROLL:return new Oe(r);case w.STRICT:return new Te(r)}},i._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 we(e)):this._bound?new Ne(e):new Ae(e)},i._createRenderer=function(){var e=this._externalRenderer;return this._virtual&&this._panelsPerView<=0&&console.warn('"virtual" and "panelsPerView" option should be used together, ignoring virtual.'),e||(this._renderExternal?this._createExternalRenderer():this._createVanillaRenderer())},i._createExternalRenderer=function(){var e=this._renderExternal,n=e.renderer,t=e.rendererOptions;return new n(o({align:this._align},t))},i._createVanillaRenderer=function(){var e=this.virtualEnabled;return new je({align:this._align,strategy:e?new Me:new ze({providerCtor:le})})},i._moveToInitialPanel=function(){return a(this,void 0,void 0,(function(){var e,n,t;return s(this,(function(i){return e=this._renderer,n=this._control,(t=e.getPanel(this._defaultIndex)||e.getPanel(0))?(n.setActive(t,null,!1),[2,n.moveToPanel(t,{duration:0})]):[2]}))}))},t.VERSION="4.4.1",t}(e),Fe=function(e,n,t,i,r){e.batchInsert.apply(e,c([],u(n.added.slice(i,r).map((function(e,i){return{index:e,elements:[t[i+n.prevList.length]],hasDOMInElements:!1}})))))},Ge=function(e,n,t){var i=e.panels.slice(n,t);e.batchRemove({index:n,deleteCount:i.length,hasDOMInElements:!1})},Be=function(e){var n="object"==typeof e?e.camera:e;return Xe(n)},We=function(e){var n="object"==typeof e?e.panel:e;return F(Xe(n))},Xe=function(e){if("number"==typeof e)return e+"px";switch(e){case R.CENTER:return"50%";case R.NEXT:return"100%";case R.PREV:return"0%";default:return e}},Ue={__proto__:null,withFlickingMethods:function(n,t){[e.prototype,He.prototype].forEach((function(e){Object.getOwnPropertyNames(e).filter((function(e){return!n[e]&&!e.startsWith("_")&&"constructor"!==e})).forEach((function(i){var r=Object.getOwnPropertyDescriptor(e,i);if(r.value)Object.defineProperty(n,i,{value:function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return(e=r.value).call.apply(e,c([this[t]],u(n)))}});else{var o={};r.get&&(o.get=function(){var e;return null===(e=r.get)||void 0===e?void 0:e.call(this[t])}),r.set&&(o.set=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return null===(e=r.set)||void 0===e?void 0:e.call.apply(e,c([this[t]],u(n)))}),Object.defineProperty(n,i,o)}}))}))},sync:function(e,n,t){var i=e.renderer,r=i.panels;if(n.removed.length>0){var o=-1,a=-1;n.removed.forEach((function(e){o<0&&(o=e),a>=0&&e!==a-1?(Ge(i,a,o+1),o=e,a=e):a=e})),Ge(i,a,o+1)}if(n.ordered.forEach((function(e){var n=u(e,2),t=n[0],i=n[1],o=r[t],a=i-t;if(a>0){var s=r.slice(t+1,i+1);o.increaseIndex(a),s.forEach((function(e){return e.decreaseIndex(1)}))}else{s=r.slice(i,t);o.decreaseIndex(-a),s.forEach((function(e){return e.increaseIndex(1)}))}o.resize()})),n.ordered.length>0&&r.sort((function(e,n){return e.index-n.index})),n.added.length>0){var s=-1,l=-1;n.added.forEach((function(e,r){s<0&&(s=r),l>=0&&e!==l+1?(Fe(i,n,t,s,r+1),s=-1,l=-1):l=e})),s>=0&&Fe(i,n,t,s)}},getRenderingPanels:function(e,n){var t=n.removed.reduce((function(e,n){return e[n]=!0,e}),{}),i=n.maintained.reduce((function(e,n){var t=u(n,2),i=t[0],r=t[1];return e[i]=r,e}),{});return c(c([],u(e.panels.filter((function(e){return!t[e.index]})).sort((function(e,n){return e.position+e.offset-(n.position+n.offset)})).map((function(e){return n.list[i[e.index]]})))),u(n.added.map((function(e){return n.list[e]}))))},getDefaultCameraTransform:function(e,n,t){void 0===e&&(e=R.CENTER),void 0===n&&(n=!0);var i=Be(e),r=We(e);if(null==r)return"";var o="calc("+i+" - ("+(t||"0px")+" * "+r.percentage+") - "+r.absolute+"px)";return n?"translate("+o+")":"translate(0, "+o+")"}};return k(He,{__proto__:null,Viewport:ae,FlickingError:oe,AnchorPoint:ye,VirtualManager:ce,VanillaElementProvider:le,VirtualElementProvider:ue,Panel:De,VirtualPanel:Le}),k(He,Ce),k(He,Ie),k(He,Ve),k(He,C),k(He,Ue),k(He,re),He}));
|
|
10
10
|
//# sourceMappingURL=flicking.min.js.map
|