Files
svelte-carousel/docs/index.js
2021-01-24 19:23:04 +03:00

2 lines
20 KiB
JavaScript

var app=function(){"use strict";function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function c(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function u(n,e,o){n.$$.on_destroy.push(function(n,...e){if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o}(e,o))}function l(t,n,e,o){if(t){const r=a(t,n,e,o);return t[0](r)}}function a(t,n,o,r){return t[1]&&r?e(o.ctx.slice(),t[1](r(n))):o.ctx}function f(t,n,e,o,r,i,c){const s=function(t,n,e,o){if(t[2]&&o){const r=t[2](o(e));if(void 0===n.dirty)return r;if("object"==typeof r){const t=[],e=Math.max(n.dirty.length,r.length);for(let o=0;o<e;o+=1)t[o]=n.dirty[o]|r[o];return t}return n.dirty|r}return n.dirty}(n,o,r,i);if(s){const r=a(n,e,o,c);t.p(r,s)}}const d="undefined"!=typeof window;let p=d?()=>window.performance.now():()=>Date.now(),m=d?t=>requestAnimationFrame(t):t;const h=new Set;function g(t){h.forEach((n=>{n.c(t)||(h.delete(n),n.f())})),0!==h.size&&m(g)}function $(t,n){t.appendChild(n)}function y(t,n,e){t.insertBefore(n,e||null)}function v(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function b(t){return document.createTextNode(t)}function w(){return b(" ")}function k(){return b("")}function E(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function P(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function C(t,n,e,o){t.style.setProperty(n,e,o?"important":"")}function I(t,n,e){t.classList[e?"add":"remove"](n)}let _;function M(t){_=t}function L(){if(!_)throw new Error("Function called outside component initialization");return _}function A(){const t=L();return(n,e)=>{const o=t.$$.callbacks[n];if(o){const r=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);o.slice().forEach((n=>{n.call(t,r)}))}}}function j(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach((t=>t(n)))}const D=[],N=[],S=[],O=[],T=Promise.resolve();let z=!1;function X(){z||(z=!0,T.then(Y))}function W(t){S.push(t)}let q=!1;const F=new Set;function Y(){if(!q){q=!0;do{for(let t=0;t<D.length;t+=1){const n=D[t];M(n),B(n.$$)}for(M(null),D.length=0;N.length;)N.pop()();for(let t=0;t<S.length;t+=1){const n=S[t];F.has(n)||(F.add(n),n())}S.length=0}while(D.length);for(;O.length;)O.pop()();z=!1,q=!1,F.clear()}}function B(t){if(null!==t.fragment){t.update(),i(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(W)}}const G=new Set;let H;function J(){H={r:0,c:[],p:H}}function K(){H.r||i(H.c),H=H.p}function Q(t,n){t&&t.i&&(G.delete(t),t.i(n))}function R(t,n,e,o){if(t&&t.o){if(G.has(t))return;G.add(t),H.c.push((()=>{G.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}function U(t,n){t.d(1),n.delete(t.key)}function V(t,n){R(t,1,1,(()=>{n.delete(t.key)}))}function Z(t,n,e,o,r,i,c,s,u,l,a,f){let d=t.length,p=i.length,m=d;const h={};for(;m--;)h[t[m].key]=m;const g=[],$=new Map,y=new Map;for(m=p;m--;){const t=f(r,i,m),s=e(t);let u=c.get(s);u?o&&u.p(t,n):(u=l(s,t),u.c()),$.set(s,g[m]=u),s in h&&y.set(s,Math.abs(m-h[s]))}const v=new Set,x=new Set;function b(t){Q(t,1),t.m(s,a),c.set(t.key,t),a=t.first,p--}for(;d&&p;){const n=g[p-1],e=t[d-1],o=n.key,r=e.key;n===e?(a=n.first,d--,p--):$.has(r)?!c.has(o)||v.has(o)?b(n):x.has(r)?d--:y.get(o)>y.get(r)?(x.add(o),b(n)):(v.add(r),d--):(u(e,c),d--)}for(;d--;){const n=t[d];$.has(n.key)||u(n,c)}for(;p;)b(g[p-1]);return g}function tt(t){t&&t.c()}function nt(t,n,e){const{fragment:r,on_mount:s,on_destroy:u,after_update:l}=t.$$;r&&r.m(n,e),W((()=>{const n=s.map(o).filter(c);u?u.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(W)}function et(t,n){const e=t.$$;null!==e.fragment&&(i(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function ot(n,e,o,c,s,u,l=[-1]){const a=_;M(n);const f=e.props||{},d=n.$$={fragment:null,ctx:null,props:u,update:t,not_equal:s,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:r(),dirty:l,skip_bound:!1};let p=!1;if(d.ctx=o?o(n,f,((t,e,...o)=>{const r=o.length?o[0]:e;return d.ctx&&s(d.ctx[t],d.ctx[t]=r)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](r),p&&function(t,n){-1===t.$$.dirty[0]&&(D.push(t),X(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}(n,t)),e})):[],d.update(),p=!0,i(d.before_update),d.fragment=!!c&&c(d.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);d.fragment&&d.fragment.l(t),t.forEach(v)}else d.fragment&&d.fragment.c();e.intro&&Q(n.$$.fragment),nt(n,e.target,e.anchor),Y()}M(a)}class rt{$destroy(){et(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const it=[];function ct(n,e=t){let o;const r=[];function i(t){if(s(n,t)&&(n=t,o)){const t=!it.length;for(let t=0;t<r.length;t+=1){const e=r[t];e[1](),it.push(e,n)}if(t){for(let t=0;t<it.length;t+=2)it[t][0](it[t+1]);it.length=0}}}return{set:i,update:function(t){i(t(n))},subscribe:function(c,s=t){const u=[c,s];return r.push(u),1===r.length&&(o=e(i)||t),c(n),()=>{const t=r.indexOf(u);-1!==t&&r.splice(t,1),0===r.length&&(o(),o=null)}}}}function st(t,n){return Math.min(t+1,n-1)}function ut(t,n){const e=t+1;return e>n-1?0:e}function lt(t,n){return Math.max(t-1,0)}function at(t,n){const e=t-1;return e>=0?e:n-1}const ft={currentPageIndex:0};const dt=function(){const{subscribe:t,set:n,update:e}=ct(ft);return{subscribe:t,next:function({infinite:t,pagesCount:n}){e((e=>{const o=function(t){return t?ut:st}(t)(e.currentPageIndex,n);return{...e,currentPageIndex:o}}))},prev:function({infinite:t,pagesCount:n}){e((e=>{const o=function(t){return t?at:lt}(t)(e.currentPageIndex,n);return{...e,currentPageIndex:o}}))},setCurrentPageIndex:function(t){e((n=>({...n,currentPageIndex:t})))},init:function(t){n({...ft,currentPageIndex:t})},moveToPage:function({pageIndex:t,pagesCount:n}){e((e=>({...e,currentPageIndex:t<0?0:Math.min(t,n-1)})))}}}();function pt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function mt(t){return"[object Date]"===Object.prototype.toString.call(t)}function ht(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(e!==typeof n||Array.isArray(t)!==Array.isArray(n))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const e=n.map(((n,e)=>ht(t[e],n)));return t=>e.map((n=>n(t)))}if("object"===e){if(!t||!n)throw new Error("Object cannot be null");if(mt(t)&&mt(n)){t=t.getTime();const e=(n=n.getTime())-t;return n=>new Date(t+n*e)}const e=Object.keys(n),o={};return e.forEach((e=>{o[e]=ht(t[e],n[e])})),t=>{const n={};return e.forEach((e=>{n[e]=o[e](t)})),n}}if("number"===e){const e=n-t;return n=>t+n*e}throw new Error(`Cannot interpolate ${e} values`)}function gt(t,o={}){const r=ct(t);let i,c=t;function s(s,u){if(null==t)return r.set(t=s),Promise.resolve();c=s;let l=i,a=!1,{delay:f=0,duration:d=400,easing:$=n,interpolate:y=ht}=e(e({},o),u);if(0===d)return l&&(l.abort(),l=null),r.set(t=c),Promise.resolve();const v=p()+f;let x;return i=function(t){let n;return 0===h.size&&m(g),{promise:new Promise((e=>{h.add(n={c:t,f:e})})),abort(){h.delete(n)}}}((n=>{if(n<v)return!0;a||(x=y(t,s),"function"==typeof d&&(d=d(t,s)),a=!0),l&&(l.abort(),l=null);const e=n-v;return e>d?(r.set(t=s),!1):(r.set(t=x($(e/d))),!0)})),i.promise}return{set:s,update:(n,e)=>s(n(c,t),e),subscribe:r.subscribe}}function $t(n){let e,o,r,i;return{c(){e=x("div"),o=x("div"),P(o,"class","dot svelte-6wkp3k"),C(o,"height",n[1]+"px"),C(o,"width",n[1]+"px"),I(o,"current",n[0]),P(e,"class","main-container svelte-6wkp3k")},m(t,c){y(t,e,c),$(e,o),r||(i=E(o,"click",n[3]),r=!0)},p(t,[n]){2&n&&C(o,"height",t[1]+"px"),2&n&&C(o,"width",t[1]+"px"),1&n&&I(o,"current",t[0])},i:t,o:t,d(t){t&&v(e),r=!1,i()}}}function yt(t,n,e){let o;const r=gt(5,{duration:250,easing:pt});u(t,r,(t=>e(1,o=t)));let{active:i=!1}=n;return t.$$set=t=>{"active"in t&&e(0,i=t.active)},t.$$.update=()=>{1&t.$$.dirty&&r.set(i?8:5)},[i,o,r,function(n){j(t,n)}]}class vt extends rt{constructor(t){super(),ot(this,t,yt,$t,s,{active:0})}}function xt(t,n,e){const o=t.slice();return o[5]=n[e],o[7]=e,o}function bt(t,n){let e,o,r,i;return o=new vt({props:{active:n[1]===n[7]}}),o.$on("click",(function(){return n[3](n[7])})),{key:t,first:null,c(){e=x("div"),tt(o.$$.fragment),r=w(),P(e,"class","dot-container svelte-1j143j1"),this.first=e},m(t,n){y(t,e,n),nt(o,e,null),$(e,r),i=!0},p(t,e){n=t;const r={};3&e&&(r.active=n[1]===n[7]),o.$set(r)},i(t){i||(Q(o.$$.fragment,t),i=!0)},o(t){R(o.$$.fragment,t),i=!1},d(t){t&&v(e),et(o)}}}function wt(t){let n,e,o=[],r=new Map,i=Array(t[0]);const c=t=>t[7];for(let n=0;n<i.length;n+=1){let e=xt(t,i,n),s=c(e);r.set(s,o[n]=bt(s,e))}return{c(){n=x("div");for(let t=0;t<o.length;t+=1)o[t].c();P(n,"class","main-container svelte-1j143j1")},m(t,r){y(t,n,r);for(let t=0;t<o.length;t+=1)o[t].m(n,null);e=!0},p(t,[e]){7&e&&(i=Array(t[0]),J(),o=Z(o,e,c,1,t,i,r,n,V,bt,null,xt),K())},i(t){if(!e){for(let t=0;t<i.length;t+=1)Q(o[t]);e=!0}},o(t){for(let t=0;t<o.length;t+=1)R(o[t]);e=!1},d(t){t&&v(n);for(let t=0;t<o.length;t+=1)o[t].d()}}}function kt(t,n,e){const o=A();let{pagesCount:r=1}=n,{currentPageIndex:i=0}=n;function c(t){o("pageChange",t)}return t.$$set=t=>{"pagesCount"in t&&e(0,r=t.pagesCount),"currentPageIndex"in t&&e(1,i=t.currentPageIndex)},[r,i,c,t=>c(t)]}class Et extends rt{constructor(t){super(),ot(this,t,kt,wt,s,{pagesCount:0,currentPageIndex:1})}}const Pt="prev",Ct="next";function It(n){let e,o,r,i;return{c(){e=x("div"),o=x("i"),P(o,"class","arrow svelte-1bt6c9d"),I(o,"next",n[0]===Ct),I(o,"prev",n[0]===Pt),P(e,"class","circle svelte-1bt6c9d"),I(e,"disabled",n[1])},m(t,c){y(t,e,c),$(e,o),r||(i=E(e,"click",n[2]),r=!0)},p(t,[n]){1&n&&I(o,"next",t[0]===Ct),1&n&&I(o,"prev",t[0]===Pt),2&n&&I(e,"disabled",t[1])},i:t,o:t,d(t){t&&v(e),r=!1,i()}}}function _t(t,n,e){let{direction:o=Ct}=n,{disabled:r=!1}=n;return t.$$set=t=>{"direction"in t&&e(0,o=t.direction),"disabled"in t&&e(1,r=t.disabled)},[o,r,function(n){j(t,n)}]}class Mt extends rt{constructor(t){super(),ot(this,t,_t,It,s,{direction:0,disabled:1})}}function Lt(t,n){t.removeEventListener("mouseup",n),t.removeEventListener("touchend",n)}function At(t,n){t.removeEventListener("mousemove",n),t.removeEventListener("touchmove",n)}function jt(t){if(t instanceof TouchEvent){const n=t.touches[0];return{x:n?n.clientX:0,y:n?n.clientY:0}}return{x:t.clientX,y:t.clientY}}function Dt(t,{thresholdProvider:n}){const e=(o=t,function(t,n){o.dispatchEvent(new CustomEvent(t,{detail:n}))});var o;let r,i,c=0;function s(t){c=0;const n=jt(t);r=n.x,i=n.y,e("start",{x:r,y:i}),function(t,n){t.addEventListener("mousemove",n),t.addEventListener("touchmove",n)}(window,u),function(t,n){t.addEventListener("mouseup",n),t.addEventListener("touchend",n)}(window,l)}function u(t){const o=jt(t),s=o.x-r,a=o.y-i;r=o.x,i=o.y,e("move",{x:r,y:i,dx:s,dy:a}),0!==s&&Math.sign(s)!==Math.sign(c)&&(c=0),c+=s,Math.abs(c)>n()&&(e("threshold",{direction:c>0?Pt:Ct}),Lt(window,l),At(window,u))}function l(t){const n=jt(t);r=n.x,i=n.y,e("end",{x:r,y:i}),Lt(window,l),At(window,u)}return function(t,n){t.addEventListener("mousedown",n),t.addEventListener("touchstart",n)}(t,s),{destroy(){!function(t,n){t.removeEventListener("mousedown",n),t.removeEventListener("touchstart",n)}(t,s)}}}const Nt=t=>({currentPageIndex:256&t[0],pagesCount:512&t[0]}),St=t=>({currentPageIndex:t[8],pagesCount:t[9],showPage:t[30]}),Ot=t=>({}),Tt=t=>({showNextPage:t[13]}),zt=t=>({}),Xt=t=>({showPrevPage:t[12]});function Wt(t){let n;const e=t[26].prev,o=l(e,t,t[25],Xt),r=o||function(t){let n,e,o;return e=new Mt({props:{direction:"prev",disabled:!t[1]&&0===t[8]}}),e.$on("click",t[12]),{c(){n=x("div"),tt(e.$$.fragment),P(n,"class","arrow-container svelte-7d88a5")},m(t,r){y(t,n,r),nt(e,n,null),o=!0},p(t,n){const o={};258&n[0]&&(o.disabled=!t[1]&&0===t[8]),e.$set(o)},i(t){o||(Q(e.$$.fragment,t),o=!0)},o(t){R(e.$$.fragment,t),o=!1},d(t){t&&v(n),et(e)}}}(t);return{c(){r&&r.c()},m(t,e){r&&r.m(t,e),n=!0},p(t,n){o?o.p&&33554432&n[0]&&f(o,e,t,t[25],n,zt,Xt):r&&r.p&&258&n[0]&&r.p(t,n)},i(t){n||(Q(r,t),n=!0)},o(t){R(r,t),n=!1},d(t){r&&r.d(t)}}}function qt(t){let n;const e=t[26].next,o=l(e,t,t[25],Tt),r=o||function(t){let n,e,o;return e=new Mt({props:{direction:"next",disabled:!t[1]&&t[8]===t[9]-1}}),e.$on("click",t[13]),{c(){n=x("div"),tt(e.$$.fragment),P(n,"class","arrow-container svelte-7d88a5")},m(t,r){y(t,n,r),nt(e,n,null),o=!0},p(t,n){const o={};770&n[0]&&(o.disabled=!t[1]&&t[8]===t[9]-1),e.$set(o)},i(t){o||(Q(e.$$.fragment,t),o=!0)},o(t){R(e.$$.fragment,t),o=!1},d(t){t&&v(n),et(e)}}}(t);return{c(){r&&r.c()},m(t,e){r&&r.m(t,e),n=!0},p(t,n){o?o.p&&33554432&n[0]&&f(o,e,t,t[25],n,Ot,Tt):r&&r.p&&770&n[0]&&r.p(t,n)},i(t){n||(Q(r,t),n=!0)},o(t){R(r,t),n=!1},d(t){r&&r.d(t)}}}function Ft(t){let n;const e=t[26].dots,o=l(e,t,t[25],St),r=o||function(t){let n,e;return n=new Et({props:{pagesCount:t[9],currentPageIndex:t[8]}}),n.$on("pageChange",t[10]),{c(){tt(n.$$.fragment)},m(t,o){nt(n,t,o),e=!0},p(t,e){const o={};512&e[0]&&(o.pagesCount=t[9]),256&e[0]&&(o.currentPageIndex=t[8]),n.$set(o)},i(t){e||(Q(n.$$.fragment,t),e=!0)},o(t){R(n.$$.fragment,t),e=!1},d(t){et(n,t)}}}(t);return{c(){r&&r.c()},m(t,e){r&&r.m(t,e),n=!0},p(t,n){o?o.p&&33555200&n[0]&&f(o,e,t,t[25],n,Nt,St):r&&r.p&&768&n[0]&&r.p(t,n)},i(t){n||(Q(r,t),n=!0)},o(t){R(r,t),n=!1},d(t){r&&r.d(t)}}}function Yt(n){let e,o,r,s,u,a,d,p,m,h,g,b=n[0]&&Wt(n);const k=n[26].default,I=l(k,n,n[25],null);let _=n[0]&&qt(n),M=n[2]&&Ft(n);return{c(){e=x("div"),o=x("div"),b&&b.c(),r=w(),s=x("div"),u=x("div"),I&&I.c(),d=w(),_&&_.c(),p=w(),M&&M.c(),C(u,"transform","translateX("+n[5]+"px)"),C(u,"transition-duration",n[3]+"ms"),P(u,"class","svelte-7d88a5"),P(s,"class","content-container svelte-7d88a5"),P(o,"class","carousel-container svelte-7d88a5"),P(e,"class","main-container svelte-7d88a5")},m(i,l){var f;y(i,e,l),$(e,o),b&&b.m(o,null),$(o,r),$(o,s),$(s,u),I&&I.m(u,null),n[28](u),n[29](s),$(o,d),_&&_.m(o,null),$(e,p),M&&M.m(e,null),m=!0,h||(g=[(f=a=Dt.call(null,u,{thresholdProvider:n[27]}),f&&c(f.destroy)?f.destroy:t),E(u,"start",n[14]),E(u,"move",n[16]),E(u,"end",n[17]),E(u,"threshold",n[15])],h=!0)},p(t,n){t[0]?b?(b.p(t,n),1&n[0]&&Q(b,1)):(b=Wt(t),b.c(),Q(b,1),b.m(o,r)):b&&(J(),R(b,1,1,(()=>{b=null})),K()),I&&I.p&&33554432&n[0]&&f(I,k,t,t[25],n,null,null),(!m||32&n[0])&&C(u,"transform","translateX("+t[5]+"px)"),(!m||8&n[0])&&C(u,"transition-duration",t[3]+"ms"),a&&c(a.update)&&16&n[0]&&a.update.call(null,{thresholdProvider:t[27]}),t[0]?_?(_.p(t,n),1&n[0]&&Q(_,1)):(_=qt(t),_.c(),Q(_,1),_.m(o,null)):_&&(J(),R(_,1,1,(()=>{_=null})),K()),t[2]?M?(M.p(t,n),4&n[0]&&Q(M,1)):(M=Ft(t),M.c(),Q(M,1),M.m(e,null)):M&&(J(),R(M,1,1,(()=>{M=null})),K())},i(t){m||(Q(b),Q(I,t),Q(_),Q(M),m=!0)},o(t){R(b),R(I,t),R(_),R(M),m=!1},d(t){t&&v(e),b&&b.d(),I&&I.d(t),n[28](null),n[29](null),_&&_.d(),M&&M.d(),h=!1,i(g)}}}function Bt(t,n,e){let o,r,{$$slots:i={},$$scope:c}=n;const s={[Ct]:M,[Pt]:_};let u,l,{arrows:a=!0}=n,{infinite:f=!0}=n,{initialPageIndex:d=1}=n,{speed:p=500}=n,m=p,{autoplay:h=!1}=n,{autoplaySpeed:g=3e3}=n,{autoplayDirection:$=Ct}=n,{dots:y=!0}=n,v=0,x=0,b=0,w=0;const k=dt.subscribe((t=>{e(23,v=t.currentPageIndex)}));function E(){const t=l.children;e(4,b=u.clientWidth),e(24,x=t.length);for(let n=0;n<x;n++)t[n].style.minWidth=`${b}px`,t[n].style.maxWidth=`${b}px`;dt.init(d+Number(f)),C(!1)}var P;function C(t){e(3,m=t?p:0),e(5,w=-v*b),f&&(0===v?I(x-2,{offsetDelay:p,animated:!1}):v===x-1&&I(1,{offsetDelay:p,animated:!1}))}function I(t,{offsetDelay:n,animated:e}){dt.moveToPage({pageIndex:t,pagesCount:x}),setTimeout((()=>{C(e)}),n)}function _(){dt.prev({infinite:f,pagesCount:x}),C(!0)}function M(){dt.next({infinite:f,pagesCount:x}),C(!0)}P=async()=>{await(X(),T),l&&u&&(f&&function(){const t=l.firstChild,n=l.children[l.children.length-1];l.prepend(n.cloneNode(!0)),l.append(t.cloneNode(!0))}(),E());const{teardownAutoplay:t}=function(){let t;return h&&(t=setInterval((()=>{s[$]()}),g)),{teardownAutoplay:()=>{t&&clearInterval(t)}}}();var n;return n=E,window.addEventListener("resize",n),()=>{!function(t){window.removeEventListener("resize",t)}(E),t()}},L().$$.on_mount.push(P),function(t){L().$$.on_destroy.push(t)}((()=>{k()}));return t.$$set=t=>{"arrows"in t&&e(0,a=t.arrows),"infinite"in t&&e(1,f=t.infinite),"initialPageIndex"in t&&e(18,d=t.initialPageIndex),"speed"in t&&e(19,p=t.speed),"autoplay"in t&&e(20,h=t.autoplay),"autoplaySpeed"in t&&e(21,g=t.autoplaySpeed),"autoplayDirection"in t&&e(22,$=t.autoplayDirection),"dots"in t&&e(2,y=t.dots),"$$scope"in t&&e(25,c=t.$$scope)},t.$$.update=()=>{8388610&t.$$.dirty[0]&&e(8,o=v-Number(f)),16777218&t.$$.dirty[0]&&e(9,r=Math.max(x-(f?2:0),0))},[a,f,y,m,b,w,u,l,o,r,function(t){I(t.detail+Number(f),{offsetDelay:0,animated:!0})},I,_,M,function(){e(3,m=0)},function(t){s[t.detail.direction]()},function(t){e(5,w+=t.detail.dx)},function(){I(v,{offsetDelay:0,animated:!0})},d,p,h,g,$,v,x,c,i,()=>b/3,function(t){N[t?"unshift":"push"]((()=>{l=t,e(7,l)}))},function(t){N[t?"unshift":"push"]((()=>{u=t,e(6,u)}))},t=>I(t,{offsetDelay:0,animated:!0})]}class Gt extends rt{constructor(t){super(),ot(this,t,Bt,Yt,s,{arrows:0,infinite:1,initialPageIndex:18,speed:19,autoplay:20,autoplaySpeed:21,autoplayDirection:22,dots:2},[-1,-1])}}function Ht(t,n,e){const o=t.slice();return o[1]=n[e],o[3]=e,o}function Jt(t,n,e){const o=t.slice();return o[4]=n[e].color,o[5]=n[e].text,o}function Kt(t,n,e){const o=t.slice();return o[4]=n[e].color,o[5]=n[e].text,o}function Qt(t,n){let e,o,r,i,c=n[5]+"";return{key:t,first:null,c(){e=x("div"),o=x("p"),r=b(c),i=w(),P(o,"class","svelte-yl9omk"),P(e,"class","color-container svelte-yl9omk"),C(e,"background-color",n[4]),this.first=e},m(t,n){y(t,e,n),$(e,o),$(o,r),$(e,i)},p(t,e){n=t},d(t){t&&v(e)}}}function Rt(t){let n,e=[],o=new Map,r=t[0].flat();const i=t=>t[4];for(let n=0;n<r.length;n+=1){let c=Kt(t,r,n),s=i(c);o.set(s,e[n]=Qt(s,c))}return{c(){for(let t=0;t<e.length;t+=1)e[t].c();n=k()},m(t,o){for(let n=0;n<e.length;n+=1)e[n].m(t,o);y(t,n,o)},p(t,c){1&c&&(r=t[0].flat(),e=Z(e,c,i,1,t,r,o,n.parentNode,U,Qt,n,Kt))},d(t){for(let n=0;n<e.length;n+=1)e[n].d(t);t&&v(n)}}}function Ut(t,n){let e,o,r,i=n[5]+"";return{key:t,first:null,c(){e=x("div"),o=x("p"),r=b(i),P(o,"class","svelte-yl9omk"),P(e,"class","color-container svelte-yl9omk"),C(e,"background-color",n[4]),C(e,"width","33.33%"),this.first=e},m(t,n){y(t,e,n),$(e,o),$(o,r)},p(t,e){n=t},d(t){t&&v(e)}}}function Vt(t,n){let e,o,r=[],i=new Map,c=n[1];const s=t=>t[4];for(let t=0;t<c.length;t+=1){let e=Jt(n,c,t),o=s(e);i.set(o,r[t]=Ut(o,e))}return{key:t,first:null,c(){e=x("div");for(let t=0;t<r.length;t+=1)r[t].c();o=w(),C(e,"display","flex"),this.first=e},m(t,n){y(t,e,n);for(let t=0;t<r.length;t+=1)r[t].m(e,null);$(e,o)},p(t,u){n=t,1&u&&(c=n[1],r=Z(r,u,s,1,n,c,i,e,U,Ut,o,Jt))},d(t){t&&v(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function Zt(t){let n,e=[],o=new Map,r=t[0];const i=t=>t[3];for(let n=0;n<r.length;n+=1){let c=Ht(t,r,n),s=i(c);o.set(s,e[n]=Vt(s,c))}return{c(){for(let t=0;t<e.length;t+=1)e[t].c();n=k()},m(t,o){for(let n=0;n<e.length;n+=1)e[n].m(t,o);y(t,n,o)},p(t,c){1&c&&(r=t[0],e=Z(e,c,i,1,t,r,o,n.parentNode,U,Vt,n,Ht))},d(t){for(let n=0;n<e.length;n+=1)e[n].d(t);t&&v(n)}}}function tn(t){let n,e,o,r,i,c,s,u;return o=new Gt({props:{$$slots:{default:[Rt]},$$scope:{ctx:t}}}),s=new Gt({props:{$$slots:{default:[Zt]},$$scope:{ctx:t}}}),{c(){n=x("h2"),n.textContent="Single item",e=w(),tt(o.$$.fragment),r=w(),i=x("h2"),i.textContent="Multiple items",c=w(),tt(s.$$.fragment)},m(t,l){y(t,n,l),y(t,e,l),nt(o,t,l),y(t,r,l),y(t,i,l),y(t,c,l),nt(s,t,l),u=!0},p(t,[n]){const e={};1024&n&&(e.$$scope={dirty:n,ctx:t}),o.$set(e);const r={};1024&n&&(r.$$scope={dirty:n,ctx:t}),s.$set(r)},i(t){u||(Q(o.$$.fragment,t),Q(s.$$.fragment,t),u=!0)},o(t){R(o.$$.fragment,t),R(s.$$.fragment,t),u=!1},d(t){t&&v(n),t&&v(e),et(o,t),t&&v(r),t&&v(i),t&&v(c),et(s,t)}}}function nn(t){return[[[{color:"#e5f9f0",text:"#e5f9f0"},{color:"#ccf3e2",text:"#ccf3e2"},{color:"#b2edd3",text:"#b2edd3"}],[{color:"#99e7c5",text:"#99e7c5"},{color:"#7fe1b7",text:"#7fe1b7"},{color:"#66dba8",text:"#66dba8"}],[{color:"#4cd59a",text:"#4cd59a"},{color:"#32cf8b",text:"#32cf8b"},{color:"#19c97d",text:"#19c97d"}]]]}class en extends rt{constructor(t){super(),ot(this,t,nn,tn,s,{})}}function on(n){let e,o,r;return o=new en({}),{c(){e=x("main"),tt(o.$$.fragment)},m(t,n){y(t,e,n),nt(o,e,null),r=!0},p:t,i(t){r||(Q(o.$$.fragment,t),r=!0)},o(t){R(o.$$.fragment,t),r=!1},d(t){t&&v(e),et(o)}}}return new class extends rt{constructor(t){super(),ot(this,t,null,on,s,{})}}({target:document.body})}();