Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

embla-carousel-svelte

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-svelte - npm Package Compare versions

Comparing version 8.0.3 to 8.0.4

6

cjs/package.json
{
"name": "embla-carousel-svelte",
"version": "8.0.3",
"version": "8.0.4",
"author": "David Jerleke",

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

"dependencies": {
"embla-carousel": "8.0.3",
"embla-carousel-reactive-utils": "8.0.3"
"embla-carousel": "8.0.4",
"embla-carousel-reactive-utils": "8.0.4"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

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

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

"dependencies": {
"embla-carousel": "8.0.3",
"embla-carousel-reactive-utils": "8.0.3"
"embla-carousel": "8.0.4",
"embla-carousel-reactive-utils": "8.0.4"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

{
"name": "embla-carousel-svelte",
"version": "8.0.3",
"version": "8.0.4",
"author": "David Jerleke",

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

"dependencies": {
"embla-carousel": "8.0.3",
"embla-carousel-reactive-utils": "8.0.3"
"embla-carousel": "8.0.4",
"embla-carousel-reactive-utils": "8.0.4"
},

@@ -67,0 +67,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc