UNPKG

uikit

Version:

UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.

2 lines (1 loc) • 24.5 kB
/*! UIkit 3.21.6 | https://www.getuikit.com | (c) 2014 - 2024 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 ct(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(h=>e.has(h)))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 W(t){return O(i.observeResize,t,"resize")}function lt(t){return O(i.observeIntersection,t)}function ft(t={}){return lt({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(h=>i.removeAttr(h,"loading"));for(const r of e.filter(({isIntersecting:h})=>h).map(({target:h})=>h))n.unobserve(r)},...t})}function ut(t){return O((e,n)=>({disconnect:i.on(gt(e),"scroll",n,{passive:!0})}),t,"scroll")}function O(t,e,n){return{observe:t,handler(){ct(this,n)},...e}}function gt(t){return i.toNodes(t).map(e=>{const{ownerDocument:n}=e,s=i.scrollParent(e,!0);return s===n.scrollingElement?n:s})}var mt={props:{media:Boolean},data:{media:!1},connected(){const t=pt(this.media,this.$el);if(this.matchMedia=!0,t){this.mediaObj=window.matchMedia(t);const e=()=>{this.matchMedia=this.mediaObj.matches,i.trigger(this.$el,i.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=i.on(this.mediaObj,"change",()=>{e(),this.$emit("resize")}),e()}},disconnected(){var t;(t=this.offMediaObj)==null||t.call(this)}};function pt(t,e){if(i.isString(t)){if(i.startsWith(t,"@"))t=i.toFloat(i.css(e,`--uk-breakpoint-${t.slice(1)}`));else if(isNaN(t))return t}return t&&i.isNumeric(t)?`(min-width: ${t}px)`:""}function vt(t,e){var n;return(n=t==null?void 0:t.startsWith)==null?void 0:n.call(t,e)}const{isArray:ve,from:xt}=Array;function wt(t){return typeof t=="function"}function M(t){return t!==null&&typeof t=="object"}function bt(t){return M(t)&&t===t.window}function It(t){return L(t)===9}function R(t){return L(t)>=1}function L(t){return!bt(t)&&M(t)&&t.nodeType}function T(t){return typeof t=="string"}function $t(t){return t===void 0}function b(t){return t&&m(t)[0]}function m(t){return R(t)?[t]:Array.from(t||[]).filter(R)}function U(t){const e=Object.create(null);return(n,...s)=>e[n]||(e[n]=t(n,...s))}function P(t,e,n){var s;if(M(e)){for(const a in e)P(t,a,e[a]);return}if($t(n))return(s=b(t))==null?void 0:s.getAttribute(e);for(const a of m(t))wt(n)&&(n=n.call(a,P(a,e))),n===null?yt(a,e):a.setAttribute(e,n)}function yt(t,e){m(t).forEach(n=>n.removeAttribute(e))}const St=typeof window<"u"&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function kt(t){return m(t).some(e=>St.call(e))}function _t(t){var e;return(e=b(t))==null?void 0:e.parentElement}function Ct(t,e){return m(t).filter(n=>B(n,e))}function B(t,e){return m(t).some(n=>n.matches(e))}function At(t,e){t=b(t);const n=t?xt(t.children):[];return e?Ct(n,e):n}function q(t,e){return e?m(t).indexOf(b(e)):At(_t(t)).indexOf(t)}function Nt(t,e){return m(Tt(t,b(e),"querySelectorAll"))}const zt=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,Et=/.*?[^\\](?![^(]*\))(?:,|$)/g,Ot=/\s*,$/,Mt=U(t=>{var e;t=t.replace(zt,"$1 *");let n=!1;const s=[];for(let a of(e=t.match(Et))!=null?e:[])a=a.replace(Ot,"").trim(),n||(n=["!","+","~","-",">"].includes(a[0])),s.push(a);return{selector:s.join(","),selectors:s,isContextSelector:n}}),V=U(t=>{t=t.slice(1).trim();const e=t.indexOf(" ");return~e?[t.slice(0,e),t.slice(e+1)]:[t,""]});function Tt(t,e=document,n){if(!t||!T(t))return t;const s=Mt(t);if(!s.isContextSelector)return H(e,n,s.selector);t="";const a=s.selectors.length===1;for(let r of s.selectors){let h,o=e;if(r[0]==="!"&&([h,r]=V(r),o=e.parentElement.closest(h),!r&&a)||o&&r[0]==="-"&&([h,r]=V(r),o=o.previousElementSibling,o=B(o,h)?o:null,!r&&a))return o;if(o){if(a)return r[0]==="~"||r[0]==="+"?(r=`:scope > :nth-child(${q(o)+1}) ${r}`,o=o.parentElement):r[0]===">"&&(r=`:scope ${r}`),H(o,n,r);t+=`${t?",":""}${Pt(o)} ${r}`}}return It(e)||(e=e.ownerDocument),H(e,n,t)}function H(t,e,n){try{return t[e](n)}catch{return null}}function Pt(t){const e=[];for(;t.parentNode;){const n=P(t,"id");if(n){e.unshift(`#${Ht(n)}`);break}else{let{tagName:s}=t;s!=="HTML"&&(s+=`:nth-child(${q(t)+1})`),e.unshift(s),t=t.parentNode}}return e.join(" > ")}function Ht(t){return T(t)?CSS.escape(t):""}const Dt=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Ft(t){const e=Dt.exec(t);if(e)return document.createElement(e[1]);const n=document.createElement("template");return n.innerHTML=t.trim(),jt(n.content.childNodes)}function jt(t){return t.length>1?t:t[0]}function Wt(t,e){return Rt(t)?m(Ft(t)):Nt(t,e)}function Rt(t){return T(t)&&vt(t.trim(),"<")}function Lt(t){return kt(t)?Math.ceil(Math.max(0,...Wt("[stroke]",t).map(e=>{var n;return((n=e.getTotalLength)==null?void 0:n.call(e))||0}))):0}const C={x:A,y:A,rotate:A,scale:A,color:D,backgroundColor:D,borderColor:D,blur:p,hue:p,fopacity:p,grayscale:p,invert:p,saturate:p,sepia:p,opacity:Bt,stroke:qt,bgx:G,bgy:G},{keys:Q}=Object;Z(Q(C),"list"),Z(Q(C),void 0);function A(t,e,n){let s=z(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 h;return z([r])?i.toPx(r,"width",e,!0)/e[`offset${(h=r.endsWith)!=null&&h.call(r,"vh")?"Height":"Width"}`]:i.toFloat(r)}),n.length===1&&n.unshift(t==="scale"?1:0),n=x(n,a),(r,h)=>{r.transform=`${r.transform||""} ${t}(${I(n,h)}${s})`}}function D(t,e,n){return n.length===1&&n.unshift($(e,t,"")),n=x(n,s=>Ut(e,s)),(s,a)=>{const[r,h,o]=Y(n,a),c=r.map((u,d)=>(u+=o*(h[d]-u),d===3?i.toFloat(u):parseInt(u,10))).join(",");s[t]=`rgba(${c})`}}function Ut(t,e){return $(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=z(n)||{blur:"px",hue:"deg"}[t]||"%";return t={fopacity:"opacity",hue:"hue-rotate"}[t]||t,n=x(n),(a,r)=>{const h=I(n,r);a.filter=`${a.filter||""} ${t}(${h+s})`}}function Bt(t,e,n){return n.length===1&&n.unshift($(e,t,"")),n=x(n),(s,a)=>{s[t]=I(n,a)}}function qt(t,e,n){n.length===1&&n.unshift(0);const s=z(n),a=Lt(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,h)=>{r.strokeDashoffset=I(n,h)}):i.noop}function G(t,e,n,s){n.length===1&&n.unshift(0);const a=t==="bgy"?"height":"width";s[t]=x(n,o=>i.toPx(o,a,e));const r=["bgx","bgy"].filter(o=>o in s);if(r.length===2&&t==="bgx")return i.noop;if($(e,"backgroundSize","")==="cover")return Vt(t,e,n,s);const h={};for(const o of r)h[o]=X(e,o);return J(r,h,s)}function Vt(t,e,n,s){const a=Qt(e);if(!a.width)return i.noop;const r={width:e.offsetWidth,height:e.offsetHeight},h=["bgx","bgy"].filter(d=>d in s),o={};for(const d of h){const l=s[d].map(([pe])=>pe),g=Math.min(...l),_=Math.max(...l),v=l.indexOf(g)<l.indexOf(_),ht=_-g;o[d]=`${(v?-ht:0)-(v?g:_)}px`,r[d==="bgy"?"height":"width"]+=ht}const c=i.Dimensions.cover(a,r);for(const d of h){const l=d==="bgy"?"height":"width",g=c[l]-r[l];o[d]=`max(${X(e,d)},-${g}px) + ${o[d]}`}const u=J(h,o,s);return(d,l)=>{u(d,l),d.backgroundSize=`${c.width}px ${c.height}px`,d.backgroundRepeat="no-repeat"}}function X(t,e){return $(t,`background-position-${e.slice(-1)}`,"")}function J(t,e,n){return function(s,a){for(const r of t){const h=I(n[r],a);s[`background-position-${r.slice(-1)}`]=`calc(${e[r]} + ${h}px)`}}}const K={},N={};function Qt(t){const e=i.css(t,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(N[e])return N[e];const n=new Image;return e&&(n.src=e,!n.naturalWidth&&!K[e])?(i.once(n,"error load",()=>{N[e]=F(n),i.trigger(t,i.createEvent("load",!1))}),K[e]=!0,F(n)):N[e]=F(n)}function F(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[h,o]=i.isString(t[r])?t[r].trim().split(/ (?![^(]*\))/):[t[r]];if(h=e(h),o=o?i.toFloat(o)/100:null,r===0?o===null?o=0:o&&n.push([h,0]):r===s-1&&(o===null?o=1:o!==1&&(n.push([h,o]),o=1)),n.push([h,o]),o===null)a++;else if(a){const c=n[r-a-1][1],u=(o-c)/(a+1);for(let d=a;d>0;d--)n[r-d][1]=c+u*(a-d+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 Gt=/^-?\d+(?:\.\d+)?(\S+)?/;function z(t,e){var n;for(const s of t){const a=(n=s.match)==null?void 0:n.call(s,Gt);if(a)return a[1]}return e}function $(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 Xt(t,e){return e>=0?Math.pow(t,e+1):1-Math.pow(1-t,1-e)}var Jt={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[W({target:({$el:t,parallaxTarget:e})=>[t,e],filter:({parallax:t})=>t}),ut({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=Xt(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:h,triggerShown:o,triggerHide:c,triggerHidden:u}=Kt(this);if(~this.prevIndex)for(const l of new Set([this.index,this.prevIndex]))i.includes([s,e],l)||(c(this.slides[l]),u(this.slides[l]));const d=this.prevIndex!==e||this.index!==s;this.dir=1,this.prevIndex=e,this.index=s,a!==r&&c(a),h(r),d&&o(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 Kt(t){const{clsSlideActive:e,clsEnter:n,clsLeave:s}=t;return{triggerShow:a,triggerShown:r,triggerHide:h,triggerHidden:o};function a(c){i.hasClass(c,s)&&(h(c),o(c)),i.hasClass(c,e)||(i.trigger(c,"beforeitemshow",[t]),i.trigger(c,"itemshow",[t]))}function r(c){i.hasClass(c,n)&&i.trigger(c,"itemshown",[t])}function h(c){i.hasClass(c,e)||a(c),i.hasClass(c,n)&&r(c),i.hasClass(c,s)||(i.trigger(c,"beforeitemhide",[t]),i.trigger(c,"itemhide",[t]))}function o(c){i.hasClass(c,s)&&i.trigger(c,"itemhidden",[t])}}var Yt={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+=t?e:"",`translate3d(${t}, 0, 0)`}function et(t){return`scale3d(${t}, ${t}, 1)`}function Zt(t,e,n,{animation:s,easing:a}){const{percent:r,translate:h,show:o=i.noop}=s,c=o(n),{promise:u,resolve:d}=te();return{dir:n,show(l,g=0,_){const v=_?"linear":a;return l-=Math.round(l*i.clamp(g,-1,1)),this.translate(g),E(e,"itemin",{percent:g,duration:l,timing:v,dir:n}),E(t,"itemout",{percent:1-g,duration:l,timing:v,dir:n}),Promise.all([i.Transition.start(e,c[1],l,v),i.Transition.start(t,c[0],l,v)]).then(()=>{this.reset(),d()},i.noop),u},cancel(){return i.Transition.cancel([e,t])},reset(){for(const l in c[0])i.css([e,t],l,"")},async forward(l,g=this.percent()){return await this.cancel(),this.show(l,g,!0)},translate(l){this.reset();const g=h(l,n);i.css(e,g[1]),i.css(t,g[0]),E(e,"itemtranslatein",{percent:l,dir:n}),E(t,"itemtranslateout",{percent:1-l,dir:n})},percent(){return r(t||e,e,n)},getDistance(){return t==null?void 0:t.offsetWidth}}}function E(t,e,n){i.trigger(t,i.createEvent(e,!1,!1,n))}function te(){let t;return{promise:new Promise(e=>t=e),resolve:t}}var ee={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++]||""))||""}}},ne={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 S={passive:!1,capture:!0},nt={passive:!0,capture:!0},ie="touchstart mousedown",j="touchmove mousemove",it="touchend touchcancel mouseup click input scroll",st=t=>t.preventDefault();var se={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:ie,passive:!0,delegate:({selList:t})=>`${t} > *`,handler(t){!this.draggable||this.parallax||!i.isTouch(t)&&re(t.target)||t.target.closest(i.selInput)||t.button>0||this.length<2||this.start(t)}},{name:"dragstart",handler(t){t.preventDefault()}},{name:j,el:({list:t})=>t,handler:i.noop,...S}],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,j,this.move,S),i.on(document,it,this.end,nt),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;this.dragging||i.on(this.list,"click",st,S),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),h=rt.call(this,s,r);for(;r!==s&&a>h;)this.drag-=h*this.dir,s=r,a-=h,r=this.getIndex(s+this.dir),h=rt.call(this,s,r);this.percent=a/h;const o=n[s],c=n[r],u=this.index!==r,d=s===r;let l;for(const g of[this.index,this.prevIndex])i.includes([r,s],g)||(i.trigger(n[g],"itemhidden",[this]),d&&(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,d||(i.trigger(o,"beforeitemhide",[this]),i.trigger(o,"itemhide",[this])),i.trigger(c,"beforeitemshow",[this]),i.trigger(c,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),o,!d&&c)},end(){if(i.off(document,j,this.move,S),i.off(document,it,this.end,nt),this.dragging)if(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&&(this.percent=1-this.percent),this.show(this.dir>0&&!t||this.dir<0&&t?"next":"previous",!0)}setTimeout(()=>i.off(this.list,"click",st,S)),i.css(this.list,{userSelect:""}),this.drag=this.percent=null}}};function rt(t,e){return this._getTransitioner(t,t!==e&&e).getDistance()||this.slides[t].offsetWidth}function re(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 ae=1;function at(t,e=null){return(e==null?void 0:e.id)||`${t.$options.id}-${ae++}`}const k={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var oe={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 h=i.toNumber(n),o=this.slides[h];o&&(o.id||(o.id=at(this,o)),r=o.id),a=this.t("slideX",i.toFloat(n)+1),i.attr(s,"role","tab")}else this.list&&(this.list.id||(this.list.id=at(this,this.list)),r=this.list.id),a=this.t(n);i.attr(s,{"aria-controls":r,"aria-label":i.attr(s,"aria-label")||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(){i.attr(this.$el,{role:this.role,"aria-roledescription":"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===k.SPACE)&&(t.preventDefault(),this.show(i.data(t.current,this.attrItem)))}},{name:"itemshow",handler:"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===k.HOME?0:n===k.END?"last":n===k.LEFT?"previous":n===k.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),i.attr(s,{"aria-selected":r,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 he="cubic-bezier(0.25, 0.46, 0.45, 0.94)",ce="cubic-bezier(0.165, 0.84, 0.44, 1)";var de={mixins:[ne,se,oe,ee],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)=>fe(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:{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 h=this.getIndex(this.index),o=i.hasClass(this.slides,this.clsActive)&&this.slides[h],c=this.getIndex(t,this.index),u=this.slides[c];if(o===u){r();return}if(this.dir=le(t,h),this.prevIndex=h,this.index=c,o&&!i.trigger(o,"beforeitemhide",[this])||!i.trigger(u,"beforeitemshow",[this,o])){this.index=this.prevIndex,r();return}const d=this._show(o,u,e).then(()=>{o&&i.trigger(o,"itemhidden",[this]),i.trigger(u,"itemshown",[this]),s.shift(),this._transitioner=null,s.length&&requestAnimationFrame(()=>s.length&&this.show(s.shift(),!0))});return o&&i.trigger(o,"itemhide",[this]),i.trigger(u,"itemshow",[this]),d},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?he:ce: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 le(t,e){return t==="next"?1:t==="previous"||t<e?-1:1}function fe(t){return .5*t+300}var ue={mixins:[de],props:{animation:String},data:{animation:"slide",clsActivated:"uk-transition-active",Animations:tt,Transitioner:Zt},computed:{animation({animation:t,Animations:e}){return{...e[t]||e.slide,name:t}},transitionOptions(){return{animation:this.animation}}},observe:W(),events:{beforeitemshow({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)}}},ge={observe:ft({target:({slides:t})=>t,targets:t=>t.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(t=>this.slides[this.getIndex(this.index+t)])}}},me={...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:et(1+.5),zIndex:0},{zIndex:-1}]},percent(t){return 1-i.css(t,"opacity")},translate(t){return[{opacity:1-t,transform:et(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}]}}},ot={mixins:[w,ue,Yt,Jt,ge],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:me},watch:{list(t){i.css(t,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,minWidth:"100%",maxWidth:"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",ot),ot});