Socket
Socket
Sign inDemoInstall

embla-carousel

Package Overview
Dependencies
0
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0-rc09 to 8.0.0-rc10

2

components/Animations.d.ts
import { EngineType } from './Engine';
import { WindowType } from './utils';
export type AnimationUpdateType = (engine: EngineType) => void;
export type AnimationRenderType = (engine: EngineType, lagFactor: number) => void;
export type AnimationType = {

@@ -8,2 +9,3 @@ start: () => void;

update: () => void;
render: (lagFactor: number) => void;
};

@@ -10,0 +12,0 @@ export type AnimationsType = {

@@ -39,2 +39,3 @@ import { AxisType } from './Axis';

location: Vector1DType;
offsetLocation: Vector1DType;
options: OptionsType;

@@ -41,0 +42,0 @@ percentOfView: PercentOfViewType;

@@ -5,2 +5,3 @@ import { Vector1DType } from './Vector1d';

duration: () => number;
velocity: () => number;
seek: () => ScrollBodyType;

@@ -7,0 +8,0 @@ settled: () => boolean;

2

components/ScrollLooper.d.ts

@@ -6,2 +6,2 @@ import { LimitType } from './Limit';

};
export declare function ScrollLooper(contentSize: number, limit: LimitType, location: Vector1DType, vectors: Vector1DType[]): ScrollLooperType;
export declare function ScrollLooper(contentSize: number, limit: LimitType, offsetLocation: Vector1DType, vectors: Vector1DType[]): ScrollLooperType;

@@ -18,3 +18,3 @@ import { AxisType } from './Axis';

};
export declare function SlideLooper(axis: AxisType, direction: DirectionType, viewSize: number, contentSize: number, slideSizesWithGaps: number[], scrollSnaps: number[], slidesInView: SlidesInViewType, location: Vector1DType, slides: HTMLElement[]): SlideLooperType;
export declare function SlideLooper(axis: AxisType, direction: DirectionType, viewSize: number, contentSize: number, slideSizesWithGaps: number[], scrollSnaps: number[], slidesInView: SlidesInViewType, offsetLocation: Vector1DType, slides: HTMLElement[]): SlideLooperType;
export {};

@@ -463,2 +463,5 @@ 'use strict';

}
function velocity() {
return bodyVelocity;
}
function useBaseDuration() {

@@ -485,2 +488,3 @@ return useDuration(baseDuration);

duration,
velocity,
seek,

@@ -569,3 +573,3 @@ settled,

function ScrollLooper(contentSize, limit, location, vectors) {
function ScrollLooper(contentSize, limit, offsetLocation, vectors) {
const jointSafety = 0.1;

@@ -579,4 +583,4 @@ const min = limit.min + jointSafety;

function shouldLoop(direction) {
if (direction === 1) return reachedMax(location.get());
if (direction === -1) return reachedMin(location.get());
if (direction === 1) return reachedMax(offsetLocation.get());
if (direction === -1) return reachedMin(offsetLocation.get());
return false;

@@ -715,3 +719,11 @@ }

targetVector.add(distanceDiff);
if (distanceDiff) animation.start();
if (distanceDiff) {
if (scrollBody.duration()) {
animation.start();
} else {
animation.update();
animation.render(1);
animation.update();
}
}
if (indexDiff) {

@@ -795,3 +807,3 @@ indexPrevious.set(indexCurrent.get());

function SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, location, slides) {
function SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, offsetLocation, slides) {
const ascItems = arrayKeys(slideSizesWithGaps);

@@ -824,3 +836,3 @@ const descItems = arrayKeys(slideSizesWithGaps).reverse();

translate: Translate(axis, direction, slides[index]),
target: () => location.get() > loopPoint ? initial : altered
target: () => offsetLocation.get() > loopPoint ? initial : altered
};

@@ -1065,7 +1077,4 @@ });

scrollBounds,
scrollLooper,
eventHandler,
animation,
slideLooper,
translate,
options: {

@@ -1083,2 +1092,16 @@ loop

if (!hasSettled) eventHandler.emit('scroll');
};
const render = ({
scrollBody,
translate,
location,
offsetLocation,
scrollLooper,
slideLooper,
options: {
loop
}
}, lagOffset) => {
const velocity = scrollBody.velocity();
offsetLocation.set(location.get() - velocity + velocity * lagOffset);
if (loop) {

@@ -1088,3 +1111,3 @@ scrollLooper.loop(scrollBody.direction());

}
translate.to(location.get());
translate.to(offsetLocation.get());
};

@@ -1094,3 +1117,4 @@ const animation = {

stop: () => animations.stop(engine),
update: () => update(engine)
update: () => update(engine),
render: lagOffset => render(engine, lagOffset)
};

@@ -1101,2 +1125,3 @@ // Shared

const location = Vector1D(startLocation);
const offsetLocation = Vector1D(startLocation);
const target = Vector1D(startLocation);

@@ -1124,2 +1149,3 @@ const scrollBody = ScrollBody(location, target, duration, friction);

location,
offsetLocation,
options,

@@ -1129,3 +1155,3 @@ resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis),

scrollBounds: ScrollBounds(limit, location, target, scrollBody, percentOfView),
scrollLooper: ScrollLooper(contentSize, limit, location, [location, target]),
scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [location, offsetLocation, target]),
scrollProgress: ScrollProgress(limit),

@@ -1135,3 +1161,3 @@ scrollSnaps,

scrollTo,
slideLooper: SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, location, slides),
slideLooper: SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, offsetLocation, slides),
slidesHandler: SlidesHandler(container, eventHandler),

@@ -1164,2 +1190,6 @@ slidesInView,

}
const lagOffset = mathAbs(lag / timeStep);
engines.forEach(({
animation
}) => animation.render(lagOffset));
if (animationFrame) ownerWindow.requestAnimationFrame(animate);

@@ -1166,0 +1196,0 @@ }

@@ -461,2 +461,5 @@ function isNumber(subject) {

}
function velocity() {
return bodyVelocity;
}
function useBaseDuration() {

@@ -483,2 +486,3 @@ return useDuration(baseDuration);

duration,
velocity,
seek,

@@ -567,3 +571,3 @@ settled,

function ScrollLooper(contentSize, limit, location, vectors) {
function ScrollLooper(contentSize, limit, offsetLocation, vectors) {
const jointSafety = 0.1;

@@ -577,4 +581,4 @@ const min = limit.min + jointSafety;

function shouldLoop(direction) {
if (direction === 1) return reachedMax(location.get());
if (direction === -1) return reachedMin(location.get());
if (direction === 1) return reachedMax(offsetLocation.get());
if (direction === -1) return reachedMin(offsetLocation.get());
return false;

@@ -713,3 +717,11 @@ }

targetVector.add(distanceDiff);
if (distanceDiff) animation.start();
if (distanceDiff) {
if (scrollBody.duration()) {
animation.start();
} else {
animation.update();
animation.render(1);
animation.update();
}
}
if (indexDiff) {

@@ -793,3 +805,3 @@ indexPrevious.set(indexCurrent.get());

function SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, location, slides) {
function SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, offsetLocation, slides) {
const ascItems = arrayKeys(slideSizesWithGaps);

@@ -822,3 +834,3 @@ const descItems = arrayKeys(slideSizesWithGaps).reverse();

translate: Translate(axis, direction, slides[index]),
target: () => location.get() > loopPoint ? initial : altered
target: () => offsetLocation.get() > loopPoint ? initial : altered
};

@@ -1063,7 +1075,4 @@ });

scrollBounds,
scrollLooper,
eventHandler,
animation,
slideLooper,
translate,
options: {

@@ -1081,2 +1090,16 @@ loop

if (!hasSettled) eventHandler.emit('scroll');
};
const render = ({
scrollBody,
translate,
location,
offsetLocation,
scrollLooper,
slideLooper,
options: {
loop
}
}, lagOffset) => {
const velocity = scrollBody.velocity();
offsetLocation.set(location.get() - velocity + velocity * lagOffset);
if (loop) {

@@ -1086,3 +1109,3 @@ scrollLooper.loop(scrollBody.direction());

}
translate.to(location.get());
translate.to(offsetLocation.get());
};

@@ -1092,3 +1115,4 @@ const animation = {

stop: () => animations.stop(engine),
update: () => update(engine)
update: () => update(engine),
render: lagOffset => render(engine, lagOffset)
};

@@ -1099,2 +1123,3 @@ // Shared

const location = Vector1D(startLocation);
const offsetLocation = Vector1D(startLocation);
const target = Vector1D(startLocation);

@@ -1122,2 +1147,3 @@ const scrollBody = ScrollBody(location, target, duration, friction);

location,
offsetLocation,
options,

@@ -1127,3 +1153,3 @@ resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis),

scrollBounds: ScrollBounds(limit, location, target, scrollBody, percentOfView),
scrollLooper: ScrollLooper(contentSize, limit, location, [location, target]),
scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [location, offsetLocation, target]),
scrollProgress: ScrollProgress(limit),

@@ -1133,3 +1159,3 @@ scrollSnaps,

scrollTo,
slideLooper: SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, location, slides),
slideLooper: SlideLooper(axis, direction, viewSize, contentSize, slideSizesWithGaps, scrollSnaps, slidesInView, offsetLocation, slides),
slidesHandler: SlidesHandler(container, eventHandler),

@@ -1162,2 +1188,6 @@ slidesInView,

}
const lagOffset = mathAbs(lag / timeStep);
engines.forEach(({
animation
}) => animation.render(lagOffset));
if (animationFrame) ownerWindow.requestAnimationFrame(animate);

@@ -1164,0 +1194,0 @@ }

@@ -1,1 +0,1 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarousel=t()}(this,(function(){"use strict";function n(n){return"number"==typeof n}function t(n){return"string"==typeof n}function e(n){return"boolean"==typeof n}function r(n){return"[object Object]"===Object.prototype.toString.call(n)}function o(n){return Math.abs(n)}function i(n){return Math.sign(n)}function c(n,t){return o(n-t)}function u(n){return d(n).map(Number)}function s(n){return n[a(n)]}function a(n){return Math.max(0,n.length-1)}function d(n){return Object.keys(n)}function l(n,t){return[n,t].reduce(((n,t)=>(d(t).forEach((e=>{const o=n[e],i=t[e],c=r(o)&&r(i);n[e]=c?l(o,i):i})),n)),{})}function f(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function p(t,e){const r={start:function(){return 0},center:function(n){return o(n)/2},end:o};function o(n){return e-n}return{measure:function(o){return n(t)?e*Number(t):r[t](o)}}}function m(n,t){const e=o(n-t);function r(t){return t<n}function i(n){return n>t}function c(n){return r(n)||i(n)}return{length:e,max:t,min:n,constrain:function(e){return c(e)?r(e)?n:t:e},reachedAny:c,reachedMax:i,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function g(n,t,e){const{constrain:r}=m(0,n),i=n+1;let c=u(t);function u(n){return e?o((i+n)%i):r(n)}function s(){return c}function a(){return g(n,s(),e)}const d={get:s,set:function(n){return c=u(n),d},add:function(n){return a().set(s()+n)},clone:a};return d}function h(){let n=[];const t={add:function(e,r,o,i={passive:!0}){return e.addEventListener(r,o,i),n.push((()=>e.removeEventListener(r,o,i))),t},clear:function(){n=n.filter((n=>n()))}};return t}function x(n,t,r,u,s,a,d,l,p,g,x,y,v,b,S,w,D,E,M){const{cross:A}=n,O=["INPUT","SELECT","TEXTAREA"],I={passive:!1},P=h(),T=h(),L=m(50,225).constrain(S.measure(20)),F={mouse:300,touch:400},z={mouse:500,touch:600},k=w?43:25;let B=!1,H=0,R=0,N=!1,C=!1,V=!1,j=!1;function q(n){const e=d.readPoint(n),r=d.readPoint(n,A),o=c(e,H),i=c(r,R);if(!C&&!j){if(!n.cancelable)return U(n);if(C=o>i,!C)return U(n)}const u=d.pointerMove(n),s=t.apply(u);o>D&&(V=!0),x.useFriction(.3).useDuration(1),s&&x.useDirection(s),p.start(),a.add(s),n.preventDefault()}function U(n){const e=y.byDistance(0,!1).index!==v.get(),r=d.pointerUp(n)*(w?z:F)[j?"mouse":"touch"],u=function(n,t){const e=v.add(-1*i(n)),r=y.byDistance(n,!w).distance;return w||o(n)<L?r:E&&t?.5*r:y.byIndex(e.get(),0).distance}(t.apply(r),e),s=function(n,t){if(0===n||0===t)return 0;if(o(n)<=o(t))return 0;const e=c(o(n),o(t));return o(e/n)}(r,u),a=k-10*s,l=M+s/50;C=!1,N=!1,T.clear(),x.useDuration(a).useFriction(l),g.distance(u,!w),j=!1,b.emit("pointerUp")}function W(n){V&&(n.stopPropagation(),n.preventDefault())}return{init:function(n,t){if(!t)return;function o(o){(e(t)||t(n,o))&&function(n){const t=f(n,s);if(j=t,t&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return O.includes(t)}(n.target))return;V=w&&t&&!n.buttons&&B,B=c(a.get(),l.get())>=2,N=!0,d.pointerDown(n),x.useFriction(0).useDuration(0),a.set(l),function(){const n=j?u:r;T.add(n,"touchmove",q,I).add(n,"touchend",U).add(n,"mousemove",q,I).add(n,"mouseup",U)}(),H=d.readPoint(n),R=d.readPoint(n,A),b.emit("pointerDown")}(o)}const i=r;P.add(i,"dragstart",(n=>n.preventDefault()),I).add(i,"touchmove",(()=>{}),I).add(i,"touchend",(()=>{})).add(i,"touchstart",o).add(i,"mousedown",o).add(i,"touchcancel",U).add(i,"contextmenu",U).add(i,"click",W,!0)},pointerDown:function(){return N},destroy:function(){P.clear(),T.clear()}}}function y(n,t){let e,r;function i(n){return n.timeStamp}function c(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(f(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,c(n)},pointerMove:function(n){const t=c(n)-c(r),o=i(n)-i(e)>170;return r=n,o&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=c(r)-c(e),u=i(n)-i(e),s=i(n)-i(r)>170,a=t/u;return u&&!s&&o(a)>.1?a:0},readPoint:c}}function v(n,t,r,o,i){let c,u,s=[],a=!1;function d(n){return i.measureSize(n.getBoundingClientRect())}return{init:function(i,l){if(!l)return;u=d(n),s=o.map(d),c=new ResizeObserver((c=>{a||(e(l)||l(i,c))&&function(e){for(const c of e){const e=c.target===n,a=o.indexOf(c.target);if((e?u:s[a])!==d(e?n:o[a])){r.requestAnimationFrame((()=>{i.reInit(),t.emit("resize")}));break}}}(c)})),[n].concat(o).forEach((n=>c.observe(n)))},destroy:function(){c&&c.disconnect(),a=!0}}}function b(n,t,e,r,i){const c=i.measure(10),u=i.measure(50),s=m(.1,.99);let a=!1;return{constrain:function(i){if(a||!n.reachedAny(e.get())||!n.reachedAny(t.get()))return;const d=n.reachedMin(t.get())?"min":"max",l=o(n[d]-t.get()),f=e.get()-t.get(),p=s.constrain(l/u);e.subtract(f*p),!i&&o(f)<c&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function S(n,t,e,r){const o=m(-t+n,e[0]),i=e.map(o.constrain).map((n=>parseFloat(n.toFixed(3))));return{snapsContained:function(){if(t<=n)return[o.max];if("keepSnaps"===r)return i;const{min:e,max:c}=function(){const n=i[0],t=s(i),e=i.lastIndexOf(n),r=i.indexOf(t)+1;return m(e,r)}();return i.slice(e,c)}()}}function w(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=m(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function D(n){const{max:t,length:e}=n;return{get:function(n){return(n-t)/-e}}}function E(n,t,e,r,c){const{reachedAny:u,removeOffset:s,constrain:a}=r;function d(n){return n.concat().sort(((n,t)=>o(n)-o(t)))[0]}function l(t,r){const o=[t,t+e,t-e];if(!n)return o[0];if(!r)return d(o);return d(o.filter((n=>i(n)===r)))}return{byDistance:function(e,r){const i=c.get()+e,{index:d,distance:f}=function(e){const r=n?s(e):a(e),i=t.map((n=>n-r)).map((n=>l(n,0))).map(((n,t)=>({diff:n,index:t}))).sort(((n,t)=>o(n.diff)-o(t.diff))),{index:c}=i[0];return{index:c,distance:r}}(i),p=!n&&u(i);return!r||p?{index:d,distance:e}:{index:d,distance:e+l(t[d]-f,0)}},byIndex:function(n,e){return{index:n,distance:l(t[n]-c.get(),e)}},shortcut:l}}function M(t){let e=t;function r(t){return n(t)?t:t.get()}return{get:function(){return e},set:function(n){e=r(n)},add:function(n){e+=r(n)},subtract:function(n){e-=r(n)}}}function A(n,t,e){const r="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},o=e.style;let i=!1;return{clear:function(){i||(o.transform="",e.getAttribute("style")||e.removeAttribute("style"))},to:function(n){i||(o.transform=r(t.apply(n)))},toggleActive:function(n){i=!n}}}function O(n,t,e,r,o,i,c,s,a){const d=u(o),l=u(o).reverse(),f=function(){const n=i[0]-1;return g(m(l,n),"end")}().concat(function(){const n=e-i[0]-1;return g(m(d,n),"start")}());function p(n,t){return n.reduce(((n,t)=>n-o[t]),t)}function m(n,t){return n.reduce(((n,e)=>p(n,t)>0?n.concat([e]):n),[])}function g(e,o){const i="start"===o,u=i?-r:r,d=c.findSlideBounds([u]);return e.map((e=>{const o=i?0:-r,c=i?r:0,u=d.filter((n=>n.index===e))[0][i?"end":"start"];return{index:e,slideLocation:M(-1),translate:A(n,t,a[e]),target:()=>s.get()>u?o:c}}))}return{canLoop:function(){return f.every((({index:n})=>p(d.filter((t=>t!==n)),e)<=.1))},clear:function(){f.forEach((n=>n.translate.clear()))},loop:function(){f.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:f}}function I(n,t){let r,o=!1;return{init:function(i,c){c&&(r=new MutationObserver((n=>{o||(e(c)||c(i,n))&&function(n){for(const e of n)if("childList"===e.type){i.reInit(),t.emit("slidesChanged");break}}(n)})),r.observe(n,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function P(n,t,e,r,o,i,c){const{removeOffset:u,constrain:s}=o,a=i?[0,t,-t]:[0],d=l(a,c);function l(t,o){const i=t||a,c=function(n){const t=n||0;return e.map((n=>m(.5,n-.5).constrain(n*t)))}(o);return i.reduce(((t,o)=>{const i=r.map(((t,r)=>({start:t-e[r]+c[r]+o,end:t+n-c[r]+o,index:r})));return t.concat(i)}),[])}return{check:function(n,t){const e=i?u(n):s(n);return(t||d).reduce(((n,t)=>{const{index:r,start:o,end:i}=t;return!n.includes(r)&&(o<e&&i>e)?n.concat([r]):n}),[])},findSlideBounds:l}}function T(t,e,r){const o=n(r);return{groupSlides:function(n){return o?function(n,t){return u(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,r):function(n){return u(n).reduce(((n,r)=>{const o=e.slice(s(n),r+1).reduce(((n,t)=>n+t),0);return!r||o>t?n.concat(r):n}),[]).map(((t,e,r)=>n.slice(t,r[e+1])))}(n)}}}function L(n,t,e,r,c,d,l,f){const{align:L,axis:F,direction:z,startIndex:k,inViewThreshold:B,loop:H,duration:R,dragFree:N,dragThreshold:C,slidesToScroll:V,skipSnaps:j,containScroll:q}=d,U=t.getBoundingClientRect(),W=e.map((n=>n.getBoundingClientRect())),$=function(n){const t="rtl"===n?-1:1;return{apply:function(n){return n*t}}}(z),G=function(n,t){const e="y"===n?"y":"x";return{scroll:e,cross:"y"===n?"x":"y",startEdge:"y"===e?"top":"rtl"===t?"right":"left",endEdge:"y"===e?"bottom":"rtl"===t?"left":"right",measureSize:function(n){const{width:t,height:r}=n;return"x"===e?t:r}}}(F,z),Q=G.measureSize(U),X=function(n){return{measure:function(t){return n*(t/100)}}}(Q),Y=p(L,Q),J=!H&&!!q,K=H||!!q,{slideSizes:Z,slideSizesWithGaps:_}=function(n,t,e,r,i,c){const{measureSize:u,startEdge:d,endEdge:l}=n,f=e[0]&&i,p=function(){if(!f)return 0;const n=e[0];return o(t[d]-n[d])}(),m=function(){if(!f)return 0;const n=c.getComputedStyle(s(r));return parseFloat(n.getPropertyValue(`margin-${l}`))}(),g=e.map(u),h=e.map(((n,t,e)=>{const r=!t,o=t===a(e);return r?g[t]+p:o?g[t]+m:e[t+1][d]-n[d]})).map(o);return{slideSizes:g,slideSizesWithGaps:h}}(G,U,W,e,K,c),nn=T(Q,_,V),{snaps:tn,snapsAligned:en}=function(n,t,e,r,i,c,u){const{startEdge:d,endEdge:l}=n,{groupSlides:f}=c,p=f(r).map((n=>s(n)[l]-n[0][d])).map(o).map(t.measure),m=r.map((n=>e[d]-n[d])).map((n=>-o(n))),g=function(){const n=s(m)-s(i);return f(m).map((n=>n[0])).map(((t,e,r)=>{const o=!e,i=e===a(r);return u&&o?0:u&&i?n:t+p[e]}))}();return{snaps:m,snapsAligned:g}}(G,Y,U,W,_,nn,J),rn=-s(tn)+s(_),{snapsContained:on}=S(Q,rn,en,q),cn=J?on:en,{limit:un}=function(n,t,e){const r=t[0];return{limit:m(e?r-n:s(t),r)}}(rn,cn,H),sn=g(a(cn),k,H),an=sn.clone(),dn=u(e),ln={start:()=>f.start(vn),stop:()=>f.stop(vn),update:()=>(({dragHandler:n,scrollBody:t,scrollBounds:e,scrollLooper:r,eventHandler:o,animation:i,slideLooper:c,translate:u,options:{loop:s}})=>{const a=n.pointerDown();s||e.constrain(a);const d=t.seek().settled();d&&!a&&(i.stop(),o.emit("settle")),d||o.emit("scroll"),s&&(r.loop(t.direction()),c.loop()),u.to(pn.get())})(vn)},fn=cn[sn.get()],pn=M(fn),mn=M(fn),gn=function(n,t,e,r){let c=!0,u=0,s=0,a=e,d=r;function l(n){return a=n,p}function f(n){return d=n,p}const p={direction:function(){return s},duration:function(){return a},seek:function(){const e=t.get()-n.get();return a?(u+=e/a,u*=d,n.add(u)):(u=0,n.set(t)),c=o(e)<.001,p},settled:function(){return c},useBaseFriction:function(){return f(r)},useBaseDuration:function(){return l(e)},useDirection:function(n){return s=i(n),p},useFriction:f,useDuration:l};return p}(pn,mn,R,.68),hn=E(H,cn,rn,un,mn),xn=function(n,t,e,r,o,i,c){function u(r){const u=r.distance,s=r.index!==t.get();o.useDirection(u),i.add(u),u&&n.start(),s&&(e.set(t.get()),t.set(r.index),c.emit("select"))}return{distance:function(n,t){u(r.byDistance(n,t))},index:function(n,e){const o=t.clone().set(n);u(r.byIndex(o.get(),e))}}}(ln,sn,an,hn,gn,mn,l),yn=P(Q,rn,Z,tn,un,H,B),vn={ownerDocument:r,ownerWindow:c,eventHandler:l,containerRect:U,slideRects:W,animation:ln,axis:G,direction:$,dragHandler:x(G,$,n,r,c,mn,y(G,c),pn,ln,xn,gn,hn,sn,l,X,N,C,j,.68),eventStore:h(),percentOfView:X,index:sn,indexPrevious:an,limit:un,location:pn,options:d,resizeHandler:v(t,l,c,e,G),scrollBody:gn,scrollBounds:b(un,pn,mn,gn,X),scrollLooper:w(rn,un,pn,[pn,mn]),scrollProgress:D(un),scrollSnaps:cn,scrollTarget:hn,scrollTo:xn,slideLooper:O(G,$,Q,rn,_,cn,yn,pn,e),slidesHandler:I(t,l),slidesInView:yn,slideIndexes:dn,slidesToScroll:nn,target:mn,translate:A(G,$,t)};return vn}const F={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function z(n){function t(n,t){return l(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=d(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>d(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function k(n,e,r){const o=n.ownerDocument,i=o.defaultView,c=z(i),u=function(n){let t=[];return{init:function(e,r){return t=e.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(r,n))),e.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(c),s=h(),a=h(),d=function(){const n={};let t;function e(t){return n[t]||[]}const r={init:function(n){t=n},emit:function(n){return e(n).forEach((e=>e(t,n))),r},off:function(t,o){return n[t]=e(t).filter((n=>n!==o)),r},on:function(t,o){return n[t]=e(t).concat([o]),r}};return r}(),{animationRealms:l}=k,{mergeOptions:f,optionsAtMedia:p,optionsMediaQueries:m}=c,{on:g,off:x,emit:y}=d,v=T;let b,S,w,D,E=!1,M=f(F,k.globalOptions),A=f(M),O=[];function I(t,e){const r=L(n,w,D,o,i,t,d,e);if(t.loop&&!r.slideLooper.canLoop()){return I(Object.assign({},t,{loop:!1}),e)}return r}function P(e,r){if(E)return;const c=l.find((n=>n.window===i)),d=c||function(n){const t=1e3/60;let e=[],r=null,o=0,i=0;function c(u){r||(r=u);const s=u-r;for(r=u,o+=s;o>=t;)e.forEach((({animation:n})=>n.update())),o-=t;i&&n.requestAnimationFrame(c)}return{start:function(t){e.includes(t)||e.push(t),i||(i=n.requestAnimationFrame(c))},stop:function(t){e=e.filter((n=>n!==t)),e.length||(n.cancelAnimationFrame(i),r=null,o=0,i=0)},reset:function(){r=null,o=0},window:n}}(i);c||l.push(d),M=f(M,e),A=p(M),O=r||O,function(){const{container:e,slides:r}=A,o=t(e)?n.querySelector(e):e;w=o||n.children[0];const i=t(r)?w.querySelectorAll(r):r;D=[].slice.call(i||w.children)}(),b=I(A,d),m([M,...O.map((({options:n})=>n))]).forEach((n=>s.add(n,"change",T))),A.active&&(b.translate.to(b.location.get()),b.eventHandler.init(C),b.resizeHandler.init(C,A.watchResize),b.slidesHandler.init(C,A.watchSlides),a.add(o,"visibilitychange",(()=>{o.hidden&&d.reset()})),b.options.loop&&b.slideLooper.loop(),w.offsetParent&&D.length&&b.dragHandler.init(C,A.watchDrag),S=u.init(O,C))}function T(n,t){const e=N();B(),P(f({startIndex:e},n),t),d.emit("reInit")}function B(){b.dragHandler.destroy(),b.animation.stop(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),u.destroy(),s.clear(),a.clear()}function H(n){const t=b[n?"target":"location"].get(),e=A.loop?"removeOffset":"constrain";return b.slidesInView.check(b.limit[e](t))}function R(n,t,e){A.active&&!E&&(b.scrollBody.useBaseFriction().useDuration(t?0:A.duration),b.scrollTo.index(n,e||0))}function N(){return b.index.get()}const C={canScrollNext:function(){return b.index.add(1).get()!==N()},canScrollPrev:function(){return b.index.add(-1).get()!==N()},containerNode:function(){return w},internalEngine:function(){return b},destroy:function(){E||(E=!0,s.clear(),B(),d.emit("destroy"))},off:x,on:g,emit:y,plugins:function(){return S},previousScrollSnap:function(){return b.indexPrevious.get()},reInit:v,rootNode:function(){return n},scrollNext:function(n){R(b.index.add(1).get(),!0===n,-1)},scrollPrev:function(n){R(b.index.add(-1).get(),!0===n,1)},scrollProgress:function(){return b.scrollProgress.get(b.location.get())},scrollSnapList:function(){return b.scrollSnaps.map(b.scrollProgress.get)},scrollTo:R,selectedScrollSnap:N,slideNodes:function(){return D},slidesInView:H,slidesNotInView:function(n){const t=H(n);return b.slideIndexes.filter((n=>!t.includes(n)))}};return P(e,r),setTimeout((()=>d.emit("init")),0),C}return k.animationRealms=[],k.globalOptions=void 0,k}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarousel=t()}(this,(function(){"use strict";function n(n){return"number"==typeof n}function t(n){return"string"==typeof n}function e(n){return"boolean"==typeof n}function r(n){return"[object Object]"===Object.prototype.toString.call(n)}function o(n){return Math.abs(n)}function i(n){return Math.sign(n)}function c(n,t){return o(n-t)}function u(n){return d(n).map(Number)}function s(n){return n[a(n)]}function a(n){return Math.max(0,n.length-1)}function d(n){return Object.keys(n)}function l(n,t){return[n,t].reduce(((n,t)=>(d(t).forEach((e=>{const o=n[e],i=t[e],c=r(o)&&r(i);n[e]=c?l(o,i):i})),n)),{})}function f(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function p(t,e){const r={start:function(){return 0},center:function(n){return o(n)/2},end:o};function o(n){return e-n}return{measure:function(o){return n(t)?e*Number(t):r[t](o)}}}function m(n,t){const e=o(n-t);function r(t){return t<n}function i(n){return n>t}function c(n){return r(n)||i(n)}return{length:e,max:t,min:n,constrain:function(e){return c(e)?r(e)?n:t:e},reachedAny:c,reachedMax:i,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function g(n,t,e){const{constrain:r}=m(0,n),i=n+1;let c=u(t);function u(n){return e?o((i+n)%i):r(n)}function s(){return c}function a(){return g(n,s(),e)}const d={get:s,set:function(n){return c=u(n),d},add:function(n){return a().set(s()+n)},clone:a};return d}function h(){let n=[];const t={add:function(e,r,o,i={passive:!0}){return e.addEventListener(r,o,i),n.push((()=>e.removeEventListener(r,o,i))),t},clear:function(){n=n.filter((n=>n()))}};return t}function x(n,t,r,u,s,a,d,l,p,g,x,y,v,b,S,w,D,E,M){const{cross:A}=n,L=["INPUT","SELECT","TEXTAREA"],O={passive:!1},I=h(),P=h(),T=m(50,225).constrain(S.measure(20)),F={mouse:300,touch:400},z={mouse:500,touch:600},B=w?43:25;let k=!1,H=0,R=0,N=!1,C=!1,V=!1,j=!1;function q(n){const e=d.readPoint(n),r=d.readPoint(n,A),o=c(e,H),i=c(r,R);if(!C&&!j){if(!n.cancelable)return U(n);if(C=o>i,!C)return U(n)}const u=d.pointerMove(n),s=t.apply(u);o>D&&(V=!0),x.useFriction(.3).useDuration(1),s&&x.useDirection(s),p.start(),a.add(s),n.preventDefault()}function U(n){const e=y.byDistance(0,!1).index!==v.get(),r=d.pointerUp(n)*(w?z:F)[j?"mouse":"touch"],u=function(n,t){const e=v.add(-1*i(n)),r=y.byDistance(n,!w).distance;return w||o(n)<T?r:E&&t?.5*r:y.byIndex(e.get(),0).distance}(t.apply(r),e),s=function(n,t){if(0===n||0===t)return 0;if(o(n)<=o(t))return 0;const e=c(o(n),o(t));return o(e/n)}(r,u),a=B-10*s,l=M+s/50;C=!1,N=!1,P.clear(),x.useDuration(a).useFriction(l),g.distance(u,!w),j=!1,b.emit("pointerUp")}function W(n){V&&(n.stopPropagation(),n.preventDefault())}return{init:function(n,t){if(!t)return;function o(o){(e(t)||t(n,o))&&function(n){const t=f(n,s);if(j=t,t&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return L.includes(t)}(n.target))return;V=w&&t&&!n.buttons&&k,k=c(a.get(),l.get())>=2,N=!0,d.pointerDown(n),x.useFriction(0).useDuration(0),a.set(l),function(){const n=j?u:r;P.add(n,"touchmove",q,O).add(n,"touchend",U).add(n,"mousemove",q,O).add(n,"mouseup",U)}(),H=d.readPoint(n),R=d.readPoint(n,A),b.emit("pointerDown")}(o)}const i=r;I.add(i,"dragstart",(n=>n.preventDefault()),O).add(i,"touchmove",(()=>{}),O).add(i,"touchend",(()=>{})).add(i,"touchstart",o).add(i,"mousedown",o).add(i,"touchcancel",U).add(i,"contextmenu",U).add(i,"click",W,!0)},pointerDown:function(){return N},destroy:function(){I.clear(),P.clear()}}}function y(n,t){let e,r;function i(n){return n.timeStamp}function c(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(f(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,c(n)},pointerMove:function(n){const t=c(n)-c(r),o=i(n)-i(e)>170;return r=n,o&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=c(r)-c(e),u=i(n)-i(e),s=i(n)-i(r)>170,a=t/u;return u&&!s&&o(a)>.1?a:0},readPoint:c}}function v(n,t,r,o,i){let c,u,s=[],a=!1;function d(n){return i.measureSize(n.getBoundingClientRect())}return{init:function(i,l){if(!l)return;u=d(n),s=o.map(d),c=new ResizeObserver((c=>{a||(e(l)||l(i,c))&&function(e){for(const c of e){const e=c.target===n,a=o.indexOf(c.target);if((e?u:s[a])!==d(e?n:o[a])){r.requestAnimationFrame((()=>{i.reInit(),t.emit("resize")}));break}}}(c)})),[n].concat(o).forEach((n=>c.observe(n)))},destroy:function(){c&&c.disconnect(),a=!0}}}function b(n,t,e,r,i){const c=i.measure(10),u=i.measure(50),s=m(.1,.99);let a=!1;return{constrain:function(i){if(a||!n.reachedAny(e.get())||!n.reachedAny(t.get()))return;const d=n.reachedMin(t.get())?"min":"max",l=o(n[d]-t.get()),f=e.get()-t.get(),p=s.constrain(l/u);e.subtract(f*p),!i&&o(f)<c&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function S(n,t,e,r){const o=m(-t+n,e[0]),i=e.map(o.constrain).map((n=>parseFloat(n.toFixed(3))));return{snapsContained:function(){if(t<=n)return[o.max];if("keepSnaps"===r)return i;const{min:e,max:c}=function(){const n=i[0],t=s(i),e=i.lastIndexOf(n),r=i.indexOf(t)+1;return m(e,r)}();return i.slice(e,c)}()}}function w(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=m(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function D(n){const{max:t,length:e}=n;return{get:function(n){return(n-t)/-e}}}function E(n,t,e,r,c){const{reachedAny:u,removeOffset:s,constrain:a}=r;function d(n){return n.concat().sort(((n,t)=>o(n)-o(t)))[0]}function l(t,r){const o=[t,t+e,t-e];if(!n)return o[0];if(!r)return d(o);return d(o.filter((n=>i(n)===r)))}return{byDistance:function(e,r){const i=c.get()+e,{index:d,distance:f}=function(e){const r=n?s(e):a(e),i=t.map((n=>n-r)).map((n=>l(n,0))).map(((n,t)=>({diff:n,index:t}))).sort(((n,t)=>o(n.diff)-o(t.diff))),{index:c}=i[0];return{index:c,distance:r}}(i),p=!n&&u(i);return!r||p?{index:d,distance:e}:{index:d,distance:e+l(t[d]-f,0)}},byIndex:function(n,e){return{index:n,distance:l(t[n]-c.get(),e)}},shortcut:l}}function M(t){let e=t;function r(t){return n(t)?t:t.get()}return{get:function(){return e},set:function(n){e=r(n)},add:function(n){e+=r(n)},subtract:function(n){e-=r(n)}}}function A(n,t,e){const r="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},o=e.style;let i=!1;return{clear:function(){i||(o.transform="",e.getAttribute("style")||e.removeAttribute("style"))},to:function(n){i||(o.transform=r(t.apply(n)))},toggleActive:function(n){i=!n}}}function L(n,t,e,r,o,i,c,s,a){const d=u(o),l=u(o).reverse(),f=function(){const n=i[0]-1;return g(m(l,n),"end")}().concat(function(){const n=e-i[0]-1;return g(m(d,n),"start")}());function p(n,t){return n.reduce(((n,t)=>n-o[t]),t)}function m(n,t){return n.reduce(((n,e)=>p(n,t)>0?n.concat([e]):n),[])}function g(e,o){const i="start"===o,u=i?-r:r,d=c.findSlideBounds([u]);return e.map((e=>{const o=i?0:-r,c=i?r:0,u=d.filter((n=>n.index===e))[0][i?"end":"start"];return{index:e,slideLocation:M(-1),translate:A(n,t,a[e]),target:()=>s.get()>u?o:c}}))}return{canLoop:function(){return f.every((({index:n})=>p(d.filter((t=>t!==n)),e)<=.1))},clear:function(){f.forEach((n=>n.translate.clear()))},loop:function(){f.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:f}}function O(n,t){let r,o=!1;return{init:function(i,c){c&&(r=new MutationObserver((n=>{o||(e(c)||c(i,n))&&function(n){for(const e of n)if("childList"===e.type){i.reInit(),t.emit("slidesChanged");break}}(n)})),r.observe(n,{childList:!0}))},destroy:function(){r&&r.disconnect(),o=!0}}}function I(n,t,e,r,o,i,c){const{removeOffset:u,constrain:s}=o,a=i?[0,t,-t]:[0],d=l(a,c);function l(t,o){const i=t||a,c=function(n){const t=n||0;return e.map((n=>m(.5,n-.5).constrain(n*t)))}(o);return i.reduce(((t,o)=>{const i=r.map(((t,r)=>({start:t-e[r]+c[r]+o,end:t+n-c[r]+o,index:r})));return t.concat(i)}),[])}return{check:function(n,t){const e=i?u(n):s(n);return(t||d).reduce(((n,t)=>{const{index:r,start:o,end:i}=t;return!n.includes(r)&&(o<e&&i>e)?n.concat([r]):n}),[])},findSlideBounds:l}}function P(t,e,r){const o=n(r);return{groupSlides:function(n){return o?function(n,t){return u(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,r):function(n){return u(n).reduce(((n,r)=>{const o=e.slice(s(n),r+1).reduce(((n,t)=>n+t),0);return!r||o>t?n.concat(r):n}),[]).map(((t,e,r)=>n.slice(t,r[e+1])))}(n)}}}function T(n,t,e,r,c,d,l,f){const{align:T,axis:F,direction:z,startIndex:B,inViewThreshold:k,loop:H,duration:R,dragFree:N,dragThreshold:C,slidesToScroll:V,skipSnaps:j,containScroll:q}=d,U=t.getBoundingClientRect(),W=e.map((n=>n.getBoundingClientRect())),$=function(n){const t="rtl"===n?-1:1;return{apply:function(n){return n*t}}}(z),G=function(n,t){const e="y"===n?"y":"x";return{scroll:e,cross:"y"===n?"x":"y",startEdge:"y"===e?"top":"rtl"===t?"right":"left",endEdge:"y"===e?"bottom":"rtl"===t?"left":"right",measureSize:function(n){const{width:t,height:r}=n;return"x"===e?t:r}}}(F,z),Q=G.measureSize(U),X=function(n){return{measure:function(t){return n*(t/100)}}}(Q),Y=p(T,Q),J=!H&&!!q,K=H||!!q,{slideSizes:Z,slideSizesWithGaps:_}=function(n,t,e,r,i,c){const{measureSize:u,startEdge:d,endEdge:l}=n,f=e[0]&&i,p=function(){if(!f)return 0;const n=e[0];return o(t[d]-n[d])}(),m=function(){if(!f)return 0;const n=c.getComputedStyle(s(r));return parseFloat(n.getPropertyValue(`margin-${l}`))}(),g=e.map(u),h=e.map(((n,t,e)=>{const r=!t,o=t===a(e);return r?g[t]+p:o?g[t]+m:e[t+1][d]-n[d]})).map(o);return{slideSizes:g,slideSizesWithGaps:h}}(G,U,W,e,K,c),nn=P(Q,_,V),{snaps:tn,snapsAligned:en}=function(n,t,e,r,i,c,u){const{startEdge:d,endEdge:l}=n,{groupSlides:f}=c,p=f(r).map((n=>s(n)[l]-n[0][d])).map(o).map(t.measure),m=r.map((n=>e[d]-n[d])).map((n=>-o(n))),g=function(){const n=s(m)-s(i);return f(m).map((n=>n[0])).map(((t,e,r)=>{const o=!e,i=e===a(r);return u&&o?0:u&&i?n:t+p[e]}))}();return{snaps:m,snapsAligned:g}}(G,Y,U,W,_,nn,J),rn=-s(tn)+s(_),{snapsContained:on}=S(Q,rn,en,q),cn=J?on:en,{limit:un}=function(n,t,e){const r=t[0];return{limit:m(e?r-n:s(t),r)}}(rn,cn,H),sn=g(a(cn),B,H),an=sn.clone(),dn=u(e),ln={start:()=>f.start(bn),stop:()=>f.stop(bn),update:()=>(({dragHandler:n,scrollBody:t,scrollBounds:e,eventHandler:r,animation:o,options:{loop:i}})=>{const c=n.pointerDown();i||e.constrain(c);const u=t.seek().settled();u&&!c&&(o.stop(),r.emit("settle")),u||r.emit("scroll")})(bn),render:n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,scrollLooper:o,slideLooper:i,options:{loop:c}},u)=>{const s=n.velocity();r.set(e.get()-s+s*u),c&&(o.loop(n.direction()),i.loop()),t.to(r.get())})(bn,n)},fn=cn[sn.get()],pn=M(fn),mn=M(fn),gn=M(fn),hn=function(n,t,e,r){let c=!0,u=0,s=0,a=e,d=r;function l(n){return a=n,p}function f(n){return d=n,p}const p={direction:function(){return s},duration:function(){return a},velocity:function(){return u},seek:function(){const e=t.get()-n.get();return a?(u+=e/a,u*=d,n.add(u)):(u=0,n.set(t)),c=o(e)<.001,p},settled:function(){return c},useBaseFriction:function(){return f(r)},useBaseDuration:function(){return l(e)},useDirection:function(n){return s=i(n),p},useFriction:f,useDuration:l};return p}(pn,gn,R,.68),xn=E(H,cn,rn,un,gn),yn=function(n,t,e,r,o,i,c){function u(r){const u=r.distance,s=r.index!==t.get();o.useDirection(u),i.add(u),u&&(o.duration()?n.start():(n.update(),n.render(1),n.update())),s&&(e.set(t.get()),t.set(r.index),c.emit("select"))}return{distance:function(n,t){u(r.byDistance(n,t))},index:function(n,e){const o=t.clone().set(n);u(r.byIndex(o.get(),e))}}}(ln,sn,an,xn,hn,gn,l),vn=I(Q,rn,Z,tn,un,H,k),bn={ownerDocument:r,ownerWindow:c,eventHandler:l,containerRect:U,slideRects:W,animation:ln,axis:G,direction:$,dragHandler:x(G,$,n,r,c,gn,y(G,c),pn,ln,yn,hn,xn,sn,l,X,N,C,j,.68),eventStore:h(),percentOfView:X,index:sn,indexPrevious:an,limit:un,location:pn,offsetLocation:mn,options:d,resizeHandler:v(t,l,c,e,G),scrollBody:hn,scrollBounds:b(un,pn,gn,hn,X),scrollLooper:w(rn,un,mn,[pn,mn,gn]),scrollProgress:D(un),scrollSnaps:cn,scrollTarget:xn,scrollTo:yn,slideLooper:L(G,$,Q,rn,_,cn,vn,mn,e),slidesHandler:O(t,l),slidesInView:vn,slideIndexes:dn,slidesToScroll:nn,target:gn,translate:A(G,$,t)};return bn}const F={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function z(n){function t(n,t){return l(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=d(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>d(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function B(n,e,r){const i=n.ownerDocument,c=i.defaultView,u=z(c),s=function(n){let t=[];return{init:function(e,r){return t=e.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(r,n))),e.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(u),a=h(),d=h(),l=function(){const n={};let t;function e(t){return n[t]||[]}const r={init:function(n){t=n},emit:function(n){return e(n).forEach((e=>e(t,n))),r},off:function(t,o){return n[t]=e(t).filter((n=>n!==o)),r},on:function(t,o){return n[t]=e(t).concat([o]),r}};return r}(),{animationRealms:f}=B,{mergeOptions:p,optionsAtMedia:m,optionsMediaQueries:g}=u,{on:x,off:y,emit:v}=l,b=k;let S,w,D,E,M=!1,A=p(F,B.globalOptions),L=p(A),O=[];function I(t,e){const r=T(n,D,E,i,c,t,l,e);if(t.loop&&!r.slideLooper.canLoop()){return I(Object.assign({},t,{loop:!1}),e)}return r}function P(e,r){if(M)return;const u=f.find((n=>n.window===c)),l=u||function(n){const t=1e3/60;let e=[],r=null,i=0,c=0;function u(s){r||(r=s);const a=s-r;for(r=s,i+=a;i>=t;)e.forEach((({animation:n})=>n.update())),i-=t;const d=o(i/t);e.forEach((({animation:n})=>n.render(d))),c&&n.requestAnimationFrame(u)}return{start:function(t){e.includes(t)||e.push(t),c||(c=n.requestAnimationFrame(u))},stop:function(t){e=e.filter((n=>n!==t)),e.length||(n.cancelAnimationFrame(c),r=null,i=0,c=0)},reset:function(){r=null,i=0},window:n}}(c);u||f.push(l),A=p(A,e),L=m(A),O=r||O,function(){const{container:e,slides:r}=L,o=t(e)?n.querySelector(e):e;D=o||n.children[0];const i=t(r)?D.querySelectorAll(r):r;E=[].slice.call(i||D.children)}(),S=I(L,l),g([A,...O.map((({options:n})=>n))]).forEach((n=>a.add(n,"change",k))),L.active&&(S.translate.to(S.location.get()),S.eventHandler.init(V),S.resizeHandler.init(V,L.watchResize),S.slidesHandler.init(V,L.watchSlides),d.add(i,"visibilitychange",(()=>{i.hidden&&l.reset()})),S.options.loop&&S.slideLooper.loop(),D.offsetParent&&E.length&&S.dragHandler.init(V,L.watchDrag),w=s.init(O,V))}function k(n,t){const e=C();H(),P(p({startIndex:e},n),t),l.emit("reInit")}function H(){S.dragHandler.destroy(),S.animation.stop(),S.eventStore.clear(),S.translate.clear(),S.slideLooper.clear(),S.resizeHandler.destroy(),S.slidesHandler.destroy(),s.destroy(),a.clear(),d.clear()}function R(n){const t=S[n?"target":"location"].get(),e=L.loop?"removeOffset":"constrain";return S.slidesInView.check(S.limit[e](t))}function N(n,t,e){L.active&&!M&&(S.scrollBody.useBaseFriction().useDuration(t?0:L.duration),S.scrollTo.index(n,e||0))}function C(){return S.index.get()}const V={canScrollNext:function(){return S.index.add(1).get()!==C()},canScrollPrev:function(){return S.index.add(-1).get()!==C()},containerNode:function(){return D},internalEngine:function(){return S},destroy:function(){M||(M=!0,a.clear(),H(),l.emit("destroy"))},off:y,on:x,emit:v,plugins:function(){return w},previousScrollSnap:function(){return S.indexPrevious.get()},reInit:b,rootNode:function(){return n},scrollNext:function(n){N(S.index.add(1).get(),!0===n,-1)},scrollPrev:function(n){N(S.index.add(-1).get(),!0===n,1)},scrollProgress:function(){return S.scrollProgress.get(S.location.get())},scrollSnapList:function(){return S.scrollSnaps.map(S.scrollProgress.get)},scrollTo:N,selectedScrollSnap:C,slideNodes:function(){return E},slidesInView:R,slidesNotInView:function(n){const t=R(n);return S.slideIndexes.filter((n=>!t.includes(n)))}};return P(e,r),setTimeout((()=>l.emit("init")),0),V}return B.animationRealms=[],B.globalOptions=void 0,B}));
{
"name": "embla-carousel",
"version": "8.0.0-rc09",
"version": "8.0.0-rc10",
"author": "David Jerleke",

@@ -5,0 +5,0 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc