uikit
Version:
UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.
2 lines (1 loc) • 23.9 kB
JavaScript
/*! UIkit 3.23.10 | https://www.getuikit.com | (c) 2014 - 2025 YOOtheme | MIT License */(function(i,w){typeof exports=="object"&&typeof module<"u"?module.exports=w(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslideshow",["uikit-util"],w):(i=typeof globalThis<"u"?globalThis:i||self,i.UIkitSlideshow=w(i.UIkit.util))})(this,function(i){"use strict";var w={connected(){i.addClass(this.$el,this.$options.id)}};function ht(t,e="update"){t._connected&&t._updates.length&&(t._queued||(t._queued=new Set,i.fastdom.read(()=>{t._connected&&dt(t,t._queued),t._queued=null})),t._queued.add(e.type||e))}function dt(t,e){for(const{read:n,write:s,events:a=[]}of t._updates){if(!e.has("update")&&!a.some(o=>e.has(o)))continue;let r;n&&(r=n.call(t,t._data,e),r&&i.isPlainObject(r)&&i.assign(t._data,r)),s&&r!==!1&&i.fastdom.write(()=>{t._connected&&s.call(t,t._data,e)})}}function R(t){return E(i.observeResize,t,"resize")}function ct(t){return E(i.observeIntersection,t)}function lt(t={}){return ct({handler:function(e,n){const{targets:s=this.$el,preload:a=5}=t;for(const r of i.toNodes(i.isFunction(s)?s(this):s))i.$$('[loading="lazy"]',r).slice(0,a-1).forEach(o=>i.removeAttr(o,"loading"));for(const r of e.filter(({isIntersecting:o})=>o).map(({target:o})=>o))n.unobserve(r)},...t})}function ft(t){return E((e,n)=>({disconnect:i.on(ut(e),"scroll",n,{passive:!0})}),t,"scroll")}function E(t,e,n){return{observe:t,handler(){ht(this,n)},...e}}function ut(t){return i.toNodes(t).map(e=>{const{ownerDocument:n}=e,s=i.scrollParent(e,!0);return s===n.scrollingElement?n:s})}function gt(t,e){var n;return(n=t==null?void 0:t.startsWith)==null?void 0:n.call(t,e)}const{from:mt}=Array;function pt(t){return typeof t=="function"}function T(t){return t!==null&&typeof t=="object"}function vt(t){return T(t)&&t===t.window}function xt(t){return W(t)===9}function L(t){return W(t)>=1}function W(t){return!vt(t)&&T(t)&&t.nodeType}function P(t){return typeof t=="string"}function wt(t){return t===void 0}function k(t){return t&&m(t)[0]}function m(t){return L(t)?[t]:Array.from(t||[]).filter(L)}function U(t){const e=Object.create(null);return(n,...s)=>e[n]||(e[n]=t(n,...s))}function H(t,e,n){var s;if(T(e)){for(const a in e)H(t,a,e[a]);return}if(wt(n))return(s=k(t))==null?void 0:s.getAttribute(e);for(const a of m(t))pt(n)&&(n=n.call(a,H(a,e))),n===null?It(a,e):a.setAttribute(e,n)}function It(t,e){m(t).forEach(n=>n.removeAttribute(e))}const bt=typeof window<"u"&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function yt(t){return m(t).some(e=>bt.call(e))}function $t(t){var e;return(e=k(t))==null?void 0:e.parentElement}function St(t,e){return m(t).filter(n=>j(n,e))}function j(t,e){return m(t).some(n=>n.matches(e))}function kt(t,e){t=k(t);const n=t?mt(t.children):[];return e?St(n,e):n}function B(t,e){return kt($t(t)).indexOf(t)}function _t(t,e){return m(Et(t,k(e),"querySelectorAll"))}const At=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,Ct=/(\([^)]*\)|[^,])+/g,zt=U(t=>{let e=!1;if(!t||!P(t))return{};const n=[];for(let s of t.match(Ct))s=s.trim().replace(At,"$1 *"),e||(e=["!","+","~","-",">"].includes(s[0])),n.push(s);return{selector:n.join(","),selectors:n,isContextSelector:e}}),Nt=/(\([^)]*\)|\S)*/,q=U(t=>{t=t.slice(1).trim();const[e]=t.match(Nt);return[e,t.slice(e.length+1)]});function Et(t,e=document,n){var s;const a=zt(t);if(!a.isContextSelector)return a.selector?M(e,n,a.selector):t;t="";const r=a.selectors.length===1;for(let o of a.selectors){let h,d=e;if(o[0]==="!"&&([h,o]=q(o),d=(s=e.parentElement)==null?void 0:s.closest(h),!o&&r)||d&&o[0]==="-"&&([h,o]=q(o),d=d.previousElementSibling,d=j(d,h)?d:null,!o&&r))return d;if(d){if(r)return o[0]==="~"||o[0]==="+"?(o=`:scope > :nth-child(${B(d)+1}) ${o}`,d=d.parentElement):o[0]===">"&&(o=`:scope ${o}`),M(d,n,o);t+=`${t?",":""}${Tt(d)} ${o}`}}return xt(e)||(e=e.ownerDocument),M(e,n,t)}function M(t,e,n){try{return t[e](n)}catch{return null}}function Tt(t){const e=[];for(;t.parentNode;){const n=H(t,"id");if(n){e.unshift(`#${Pt(n)}`);break}else{let{tagName:s}=t;s!=="HTML"&&(s+=`:nth-child(${B(t)+1})`),e.unshift(s),t=t.parentNode}}return e.join(" > ")}function Pt(t){return P(t)?CSS.escape(t):""}const Ht=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Mt(t){const e=Ht.exec(t);if(e)return document.createElement(e[1]);const n=document.createElement("template");return n.innerHTML=t.trim(),Dt(n.content.childNodes)}function Dt(t){return t.length>1?t:t[0]}function Ot(t,e){return Ft(t)?m(Mt(t)):_t(t,e)}function Ft(t){return P(t)&>(t.trim(),"<")}function Rt(t){return yt(t)?Math.ceil(Math.max(0,...Ot("[stroke]",t).map(e=>{var n;return((n=e.getTotalLength)==null?void 0:n.call(e))||0}))):0}const V={x:_,y:_,rotate:_,scale:_,color:D,backgroundColor:D,borderColor:D,blur:p,hue:p,fopacity:p,grayscale:p,invert:p,saturate:p,sepia:p,opacity:Wt,stroke:Ut,bgx:G,bgy:G},{keys:Q}=Object;Z(Q(V),"list"),Z(Q(V),void 0);function _(t,e,n){let s=C(n)||{x:"px",y:"px",rotate:"deg"}[t]||"",a;return t==="x"||t==="y"?(t=`translate${i.ucfirst(t)}`,a=r=>i.toFloat(i.toFloat(r).toFixed(s==="px"?0:6))):t==="scale"&&(s="",a=r=>{var o;return C([r])?i.toPx(r,"width",e,!0)/e[`offset${(o=r.endsWith)!=null&&o.call(r,"vh")?"Height":"Width"}`]:i.toFloat(r)}),n.length===1&&n.unshift(t==="scale"?1:0),n=x(n,a),(r,o)=>{r.transform=`${r.transform||""} ${t}(${I(n,o)}${s})`}}function D(t,e,n){return n.length===1&&n.unshift(b(e,t,"")),n=x(n,s=>Lt(e,s)),(s,a)=>{const[r,o,h]=Y(n,a),d=r.map((u,c)=>(u+=h*(o[c]-u),c===3?i.toFloat(u):parseInt(u,10))).join(",");s[t]=`rgba(${d})`}}function Lt(t,e){return b(t,"color",e).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(i.toFloat)}function p(t,e,n){n.length===1&&n.unshift(0);const s=C(n)||{blur:"px",hue:"deg"}[t]||"%";return t={fopacity:"opacity",hue:"hue-rotate"}[t]||t,n=x(n),(a,r)=>{const o=I(n,r);a.filter=`${a.filter||""} ${t}(${o+s})`}}function Wt(t,e,n){return n.length===1&&n.unshift(b(e,t,"")),n=x(n),(s,a)=>{s[t]=I(n,a)}}function Ut(t,e,n){n.length===1&&n.unshift(0);const s=C(n),a=Rt(e);return n=x(n.reverse(),r=>(r=i.toFloat(r),s==="%"?r*a/100:r)),n.some(([r])=>r)?(i.css(e,"strokeDasharray",a),(r,o)=>{r.strokeDashoffset=I(n,o)}):i.noop}function G(t,e,n,s){n.length===1&&n.unshift(0);const a=t==="bgy"?"height":"width";s[t]=x(n,h=>i.toPx(h,a,e));const r=["bgx","bgy"].filter(h=>h in s);if(r.length===2&&t==="bgx")return i.noop;if(b(e,"backgroundSize","")==="cover")return jt(t,e,n,s);const o={};for(const h of r)o[h]=X(e,h);return J(r,o,s)}function jt(t,e,n,s){const a=Bt(e);if(!a.width)return i.noop;const r={width:e.offsetWidth,height:e.offsetHeight},o=["bgx","bgy"].filter(c=>c in s),h={};for(const c of o){const l=s[c].map(([ge])=>ge),g=Math.min(...l),S=Math.max(...l),v=l.indexOf(g)<l.indexOf(S),ot=S-g;h[c]=`${(v?-ot:0)-(v?g:S)}px`,r[c==="bgy"?"height":"width"]+=ot}const d=i.Dimensions.cover(a,r);for(const c of o){const l=c==="bgy"?"height":"width",g=d[l]-r[l];h[c]=`max(${X(e,c)},-${g}px) + ${h[c]}`}const u=J(o,h,s);return(c,l)=>{u(c,l),c.backgroundSize=`${d.width}px ${d.height}px`,c.backgroundRepeat="no-repeat"}}function X(t,e){return b(t,`background-position-${e.slice(-1)}`,"")}function J(t,e,n){return function(s,a){for(const r of t){const o=I(n[r],a);s[`background-position-${r.slice(-1)}`]=`calc(${e[r]} + ${o}px)`}}}const K={},A={};function Bt(t){const e=i.css(t,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(A[e])return A[e];const n=new Image;return e&&(n.src=e,!n.naturalWidth&&!K[e])?(i.once(n,"error load",()=>{A[e]=O(n),i.trigger(t,i.createEvent("load",!1))}),K[e]=!0,O(n)):A[e]=O(n)}function O(t){return{width:t.naturalWidth,height:t.naturalHeight}}function x(t,e=i.toFloat){const n=[],{length:s}=t;let a=0;for(let r=0;r<s;r++){let[o,h]=i.isString(t[r])?t[r].trim().split(/ (?![^(]*\))/):[t[r]];if(o=e(o),h=h?i.toFloat(h)/100:null,r===0?h===null?h=0:h&&n.push([o,0]):r===s-1&&(h===null?h=1:h!==1&&(n.push([o,h]),h=1)),n.push([o,h]),h===null)a++;else if(a){const d=n[r-a-1][1],u=(h-d)/(a+1);for(let c=a;c>0;c--)n[r-c][1]=d+u*(a-c+1);a=0}}return n}function Y(t,e){const n=i.findIndex(t.slice(1),([,s])=>e<=s)+1;return[t[n-1][0],t[n][0],(e-t[n-1][1])/(t[n][1]-t[n-1][1])]}function I(t,e){const[n,s,a]=Y(t,e);return n+Math.abs(n-s)*a*(n<s?1:-1)}const qt=/^-?\d+(?:\.\d+)?(\S+)?/;function C(t,e){var n;for(const s of t){const a=(n=s.match)==null?void 0:n.call(s,qt);if(a)return a[1]}return e}function b(t,e,n){const s=t.style[e],a=i.css(i.css(t,e,n),e);return t.style[e]=s,a}function Z(t,e){return t.reduce((n,s)=>(n[s]=e,n),{})}function Vt(t,e){return e>=0?Math.pow(t,e+1):1-Math.pow(1-t,1-e)}var Qt={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[R({target:({$el:t,parallaxTarget:e})=>[t,e],filter:({parallax:t})=>t}),ft({filter:({parallax:t})=>t})],computed:{parallaxTarget({parallaxTarget:t},e){return t&&i.query(t,e)||this.list}},update:{read(){if(!this.parallax)return!1;const t=this.parallaxTarget;if(!t)return!1;const e=i.toPx(this.parallaxStart,"height",t,!0),n=i.toPx(this.parallaxEnd,"height",t,!0),s=Vt(i.scrolledOver(t,e,n),this.parallaxEasing);return{parallax:this.getIndexAt(s)}},write({parallax:t}){const[e,n]=t,s=this.getValidIndex(e+Math.ceil(n)),a=this.slides[e],r=this.slides[s],{triggerShow:o,triggerShown:h,triggerHide:d,triggerHidden:u}=Gt(this);if(~this.prevIndex)for(const l of new Set([this.index,this.prevIndex]))i.includes([s,e],l)||(d(this.slides[l]),u(this.slides[l]));const c=this.prevIndex!==e||this.index!==s;this.dir=1,this.prevIndex=e,this.index=s,a!==r&&d(a),o(r),c&&h(a),this._translate(a===r?1:n,a,r)},events:["scroll","resize"]},methods:{getIndexAt(t){const e=t*(this.length-1);return[Math.floor(e),e%1]}}};function Gt(t){const{clsSlideActive:e,clsEnter:n,clsLeave:s}=t;return{triggerShow:a,triggerShown:r,triggerHide:o,triggerHidden:h};function a(d){i.hasClass(d,s)&&(o(d),h(d)),i.hasClass(d,e)||(i.trigger(d,"beforeitemshow",[t]),i.trigger(d,"itemshow",[t]))}function r(d){i.hasClass(d,n)&&i.trigger(d,"itemshown",[t])}function o(d){i.hasClass(d,e)||a(d),i.hasClass(d,n)&&r(d),i.hasClass(d,s)||(i.trigger(d,"beforeitemhide",[t]),i.trigger(d,"itemhide",[t]))}function h(d){i.hasClass(d,s)&&i.trigger(d,"itemhidden",[t])}}var Xt={update:{write(){if(this.stack.length||this.dragging||this.parallax)return;const t=this.getValidIndex();!~this.prevIndex||this.index!==t?this.show(t):this._translate(1)},events:["resize"]}},tt={slide:{show(t){return[{transform:f(t*-100)},{transform:f()}]},percent(t){return y(t)},translate(t,e){return[{transform:f(e*-100*t)},{transform:f(e*100*(1-t))}]}}};function y(t){return Math.abs(new DOMMatrix(i.css(t,"transform")).m41/t.offsetWidth)}function f(t=0,e="%"){return t?`translate3d(${t+e}, 0, 0)`:""}function Jt(t,e,n,{animation:s,easing:a}){const{percent:r,translate:o,show:h=i.noop}=s,d=h(n),{promise:u,resolve:c}=Kt();return{dir:n,show(l,g=0,S){const v=S?"linear":a;return l-=Math.round(l*i.clamp(g,-1,1)),this.translate(g),z(e,"itemin",{percent:g,duration:l,timing:v,dir:n}),z(t,"itemout",{percent:1-g,duration:l,timing:v,dir:n}),Promise.all([i.Transition.start(e,d[1],l,v),i.Transition.start(t,d[0],l,v)]).then(()=>{this.reset(),c()},i.noop),u},cancel(){return i.Transition.cancel([e,t])},reset(){i.resetProps([e,t],d[0])},async forward(l,g=this.percent()){return await this.cancel(),this.show(l,g,!0)},translate(l){this.reset();const g=o(l,n);i.css(e,g[1]),i.css(t,g[0]),z(e,"itemtranslatein",{percent:l,dir:n}),z(t,"itemtranslateout",{percent:1-l,dir:n})},percent(){return r(t||e,e,n)},getDistance(){return t==null?void 0:t.offsetWidth}}}function z(t,e,n){i.trigger(t,i.createEvent(e,!1,!1,n))}function Kt(){let t;return{promise:new Promise(e=>t=e),resolve:t}}var Yt={props:{i18n:Object},data:{i18n:null},methods:{t(t,...e){var n,s,a;let r=0;return((a=((n=this.i18n)==null?void 0:n[t])||((s=this.$options.i18n)==null?void 0:s[t]))==null?void 0:a.replace(/%s/g,()=>e[r++]||""))||""}}},Zt={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){i.attr(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){i.attr(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:()=>document,filter:({autoplay:t})=>t,handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>{this.stack.length||this.draggable&&i.matches(this.$el,":focus-within")&&!i.matches(this.$el,":focus")||this.pauseOnHover&&i.matches(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};const N={passive:!1,capture:!0},et={passive:!0,capture:!0},te="touchstart mousedown",F="touchmove mousemove",nt="touchend touchcancel mouseup click input scroll";var ee={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(const t of["start","move","end"]){const e=this[t];this[t]=n=>{const s=i.getEventPos(n).x*(i.isRtl?-1:1);this.prevPos=s===this.pos?this.prevPos:this.pos,this.pos=s,e(n)}}},events:[{name:te,passive:!0,delegate:({selList:t})=>`${t} > *`,handler(t){!this.draggable||this.parallax||!i.isTouch(t)&&ne(t.target)||t.target.closest(i.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:F,el:({list:t})=>t,handler:i.noop,...N}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,i.on(document,F,this.move,N),i.on(document,nt,this.end,et),i.css(this.list,"userSelect","none")},move(t){const e=this.pos-this.drag;if(e===0||this.prevPos===this.pos||!this.dragging&&Math.abs(e)<this.threshold)return;t.cancelable&&t.preventDefault(),this.dragging=!0,this.dir=e<0?1:-1;let{slides:n,prevIndex:s}=this,a=Math.abs(e),r=this.getIndex(s+this.dir),o=it.call(this,s,r);for(;r!==s&&a>o;)this.drag-=o*this.dir,s=r,a-=o,r=this.getIndex(s+this.dir),o=it.call(this,s,r);this.percent=a/o;const h=n[s],d=n[r],u=this.index!==r,c=s===r;let l;for(const g of[this.index,this.prevIndex])i.includes([r,s],g)||(i.trigger(n[g],"itemhidden",[this]),c&&(l=!0,this.prevIndex=s));(this.index===s&&this.prevIndex!==s||l)&&i.trigger(n[this.index],"itemshown",[this]),u&&(this.prevIndex=s,this.index=r,c||(i.trigger(h,"beforeitemhide",[this]),i.trigger(h,"itemhide",[this])),i.trigger(d,"beforeitemshow",[this]),i.trigger(d,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),h,!c&&d)},end(){if(i.off(document,F,this.move,N),i.off(document,nt,this.end,et),this.dragging)if(setTimeout(i.on(this.list,"click",t=>t.preventDefault(),N)),this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{const t=(i.isRtl?this.dir*(i.isRtl?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=t?this.index:this.prevIndex,t&&(i.trigger(this.slides[this.prevIndex],"itemhidden",[this]),i.trigger(this.slides[this.index],"itemshown",[this]),this.percent=1-this.percent),this.show(this.dir>0&&!t||this.dir<0&&t?"next":"previous",!0)}i.css(this.list,{userSelect:""}),this.drag=this.percent=null}}};function it(t,e){return this._getTransitioner(t,t!==e&&e).getDistance()||this.slides[t].offsetWidth}function ne(t){return i.css(t,"userSelect")!=="none"&&i.toArray(t.childNodes).some(e=>e.nodeType===3&&e.textContent.trim())}i.memoize((t,e)=>{const n=Object.keys(e),s=n.concat(t).map(a=>[i.hyphenate(a),`data-${i.hyphenate(a)}`]).flat();return{attributes:n,filter:s}});let ie=1;function st(t,e=null){return(e==null?void 0:e.id)||`${t.$options.id}-${ie++}`}const $={SPACE:32,END:35,HOME:36,LEFT:37,RIGHT:39};function se(t){t.target.closest('a[href="#"],a[href=""]')&&t.preventDefault()}var re={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav:({selNav:t},e)=>i.$(t,e),navChildren(){return i.children(this.nav)},selNavItem:({attrItem:t})=>`[${t}],[data-${t}]`,navItems(t,e){return i.$$(this.selNavItem,e)}},watch:{nav(t,e){i.attr(t,"role","tablist"),this.padNavitems(),e&&this.$emit()},list(t){i.isTag(t,"ul")&&i.attr(t,"role","presentation")},navChildren(t){i.attr(t,"role","presentation"),this.padNavitems(),this.updateNav()},navItems(t){for(const e of t){const n=i.data(e,this.attrItem),s=i.$("a,button",e)||e;let a,r=null;if(i.isNumeric(n)){const o=i.toNumber(n),h=this.slides[o];h&&(h.id||(h.id=st(this,h)),r=h.id),a=this.t("slideX",i.toFloat(n)+1),s.role="tab"}else this.list&&(this.list.id||(this.list.id=st(this,this.list)),r=this.list.id),a=this.t(n);s.ariaControls=r,s.ariaLabel=s.ariaLabel||a}},slides(t){t.forEach((e,n)=>i.attr(e,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",n+1,this.length),"aria-roledescription":this.nav?null:"slide"})),this.padNavitems()}},connected(){this.$el.role=this.role,this.$el.ariaRoleDescription="carousel"},update:[{write(){this.navItems.concat(this.nav).forEach(t=>t&&(t.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate:({selNavItem:t})=>t,filter:({parallax:t})=>!t,handler(t){t.target.closest("a,button")&&(t.type==="click"||t.keyCode===$.SPACE)&&(se(t),this.show(i.data(t.current,this.attrItem)))}},{name:"itemshow",handler(){this.updateNav()}},{name:"keydown",delegate:({selNavItem:t})=>t,filter:({parallax:t})=>!t,handler(t){const{current:e,keyCode:n}=t,s=i.data(e,this.attrItem);if(!i.isNumeric(s))return;let a=n===$.HOME?0:n===$.END?"last":n===$.LEFT?"previous":n===$.RIGHT?"next":-1;~a&&(t.preventDefault(),this.show(a))}}],methods:{updateNav(){const t=this.getValidIndex();for(const e of this.navItems){const n=i.data(e,this.attrItem),s=i.$("a,button",e)||e;if(i.isNumeric(n)){const r=i.toNumber(n)===t;i.toggleClass(e,this.clsActive,r),i.toggleClass(s,"uk-disabled",!!this.parallax),s.ariaSelected=r,s.tabIndex=r&&!this.parallax?null:-1,r&&s&&i.matches(i.parent(e),":focus-within")&&s.focus()}else i.toggleClass(e,"uk-invisible",this.finite&&(n==="previous"&&t===0||n==="next"&&t>=this.maxIndex))}},padNavitems(){if(!this.nav)return;const t=[];for(let e=0;e<this.length;e++){const n=`${this.attrItem}="${e}"`;t[e]=this.navChildren.findLast(s=>s.matches(`[${n}]`))||i.$(`<li ${n}><a href></a></li>`)}i.isEqual(t,this.navChildren)||i.html(this.nav,t)}}};const ae="cubic-bezier(0.25, 0.46, 0.45, 0.94)",oe="cubic-bezier(0.165, 0.84, 0.44, 1)";var he={mixins:[Zt,ee,re,Yt],props:{clsActivated:String,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:"",clsEnter:"uk-slide-enter",clsLeave:"uk-slide-leave",clsSlideActive:"uk-slide-active",Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){i.removeClass(this.slides,this.clsActive)},computed:{duration:({velocity:t},e)=>ce(e.offsetWidth/t),list:({selList:t},e)=>i.$(t,e),maxIndex(){return this.length-1},slides(){return i.children(this.list)},length(){return this.slides.length}},watch:{slides(t,e){e&&this.$emit()}},events:{itemshow({target:t}){i.addClass(t,this.clsEnter,this.clsSlideActive)},itemshown({target:t}){i.removeClass(t,this.clsEnter)},itemhide({target:t}){i.addClass(t,this.clsLeave)},itemhidden({target:t}){i.removeClass(t,this.clsLeave,this.clsSlideActive)}},methods:{async show(t,e=!1){var n;if(this.dragging||!this.length||this.parallax)return;const{stack:s}=this,a=e?0:s.length,r=()=>{s.splice(a,1),s.length&&this.show(s.shift(),!0)};if(s[e?"unshift":"push"](t),!e&&s.length>1){s.length===2&&((n=this._transitioner)==null||n.forward(Math.min(this.duration,200)));return}const o=this.getIndex(this.index),h=i.hasClass(this.slides,this.clsActive)&&this.slides[o],d=this.getIndex(t,this.index),u=this.slides[d];if(h===u){r();return}if(this.dir=de(t,o),this.prevIndex=o,this.index=d,h&&!i.trigger(h,"beforeitemhide",[this])||!i.trigger(u,"beforeitemshow",[this,h])){this.index=this.prevIndex,r();return}h&&i.trigger(h,"itemhide",[this]),i.trigger(u,"itemshow",[this]),await this._show(h,u,e),h&&i.trigger(h,"itemhidden",[this]),i.trigger(u,"itemshown",[this]),s.shift(),this._transitioner=null,s.length&&requestAnimationFrame(()=>s.length&&this.show(s.shift(),!0))},getIndex(t=this.index,e=this.index){return i.clamp(i.getIndex(t,this.slides,e,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(t=this.index,e=this.prevIndex){return this.getIndex(t,e)},async _show(t,e,n){if(this._transitioner=this._getTransitioner(t,e,this.dir,{easing:n?e.offsetWidth<600?ae:oe:this.easing,...this.transitionOptions}),!n&&!t){this._translate(1);return}const{length:s}=this.stack;return this._transitioner[s>1?"forward":"show"](s>1?Math.min(this.duration,75+75/(s-1)):this.duration,this.percent)},_translate(t,e=this.prevIndex,n=this.index){const s=this._getTransitioner(e===n?!1:e,n);return s.translate(t),s},_getTransitioner(t=this.prevIndex,e=this.index,n=this.dir||1,s=this.transitionOptions){return new this.Transitioner(i.isNumber(t)?this.slides[t]:t,i.isNumber(e)?this.slides[e]:e,n*(i.isRtl?-1:1),s)}}};function de(t,e){return t==="next"?1:t==="previous"||t<e?-1:1}function ce(t){return .5*t+300}var le={mixins:[he],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:tt,Transitioner:Jt},computed:{animation({animation:t,Animations:e}){return{...e[t]||e.slide,name:t}},transitionOptions(){return{animation:this.animation}}},observe:R(),events:{itemshow({target:t}){i.addClass(t,this.clsActive)},itemshown({target:t}){i.addClass(t,this.clsActivated)},itemhidden({target:t}){i.removeClass(t,this.clsActive,this.clsActivated)}}},fe={observe:lt({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(t=>this.slides[this.getIndex(this.index+t)])}}},ue={...tt,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(t){return 1-i.css(t,"opacity")},translate(t){return[{opacity:1-t,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:rt(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-i.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:rt(1+.5*t),zIndex:0},{zIndex:-1}]}},pull:{show(t){return t<0?[{transform:f(30),zIndex:-1},{transform:f(),zIndex:0}]:[{transform:f(-100),zIndex:0},{transform:f(),zIndex:-1}]},percent(t,e,n){return n<0?1-y(e):y(t)},translate(t,e){return e<0?[{transform:f(30*t),zIndex:-1},{transform:f(-100*(1-t)),zIndex:0}]:[{transform:f(-t*100),zIndex:0},{transform:f(30*(1-t)),zIndex:-1}]}},push:{show(t){return t<0?[{transform:f(100),zIndex:0},{transform:f(),zIndex:-1}]:[{transform:f(-30),zIndex:-1},{transform:f(),zIndex:0}]},percent(t,e,n){return n>0?1-y(e):y(t)},translate(t,e){return e<0?[{transform:f(t*100),zIndex:0},{transform:f(-30*(1-t)),zIndex:-1}]:[{transform:f(-30*t),zIndex:-1},{transform:f(100*(1-t)),zIndex:0}]}}};function rt(t){return`scale3d(${t}, ${t}, 1)`}var at={mixins:[w,le,Xt,Qt,fe],props:{ratio:String,minHeight:String,maxHeight:String},data:{ratio:"16:9",minHeight:void 0,maxHeight:void 0,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:ue},watch:{list(t){i.css(t,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,width:"100%"})}},methods:{getAdjacentSlides(){return[1,-1].map(t=>this.slides[this.getIndex(this.index+t)])}}};return typeof window<"u"&&window.UIkit&&window.UIkit.component("slideshow",at),at});