!function(a){"use strict";function b(b,c,d,e){if(b=a.$(b),c=a.$(c),d=d||window.innerWidth,e=e||b.offset(),c.length){var f=c.outerWidth();if(b.css("min-width",f),"right"==a.langdirection){var g=d-(c.offset().left+f),h=d-(b.offset().left+b.outerWidth());b.css("margin-right",g-h)}else b.css("margin-left",c.offset().left-e.left)}}var c,d=!1,e={x:{"bottom-left":"bottom-right","bottom-right":"bottom-left","bottom-center":"bottom-center","top-left":"top-right","top-right":"top-left","top-center":"top-center","left-top":"right-top","left-bottom":"right-bottom","left-center":"right-center","right-top":"left-top","right-bottom":"left-bottom","right-center":"left-center"},y:{"bottom-left":"top-left","bottom-right":"top-right","bottom-center":"top-center","top-left":"bottom-left","top-right":"bottom-right","top-center":"bottom-center","left-top":"left-bottom","left-bottom":"left-top","left-center":"left-center","right-top":"right-bottom","right-bottom":"right-top","right-center":"right-center"},xy:{"bottom-left":"top-right","bottom-right":"top-left","bottom-center":"top-center","top-left":"bottom-right","top-right":"bottom-left","top-center":"bottom-center","left-top":"right-bottom","left-bottom":"right-top","left-center":"right-center","right-top":"left-bottom","right-bottom":"left-top","right-center":"left-center"}};a.component("dropdown",{defaults:{mode:"hover",pos:"bottom-left",offset:0,remaintime:800,justify:!1,boundary:a.$win,delay:0,dropdownSelector:".uk-dropdown,.uk-dropdown-blank",hoverDelayIdle:250,preventflip:!1},remainIdle:!1,boot:function(){var b=a.support.touch?"click":"mouseenter";a.$html.on(b+".dropdown.uikit","[data-uk-dropdown]",function(c){var d=a.$(this);if(!d.data("dropdown")){var e=a.dropdown(d,a.Utils.options(d.attr("data-uk-dropdown")));("click"==b||"mouseenter"==b&&"hover"==e.options.mode)&&e.element.trigger(b),e.element.find(e.options.dropdownSelector).length&&c.preventDefault()}})},init:function(){var b=this;this.dropdown=this.find(this.options.dropdownSelector),this.offsetParent=this.dropdown.parents().filter(function(){return a.$.inArray(a.$(this).css("position"),["relative","fixed","absolute"])!==-1}).slice(0,1),this.centered=this.dropdown.hasClass("uk-dropdown-center"),this.justified=!!this.options.justify&&a.$(this.options.justify),this.boundary=a.$(this.options.boundary),this.boundary.length||(this.boundary=a.$win),this.dropdown.hasClass("uk-dropdown-up")&&(this.options.pos="top-left"),this.dropdown.hasClass("uk-dropdown-flip")&&(this.options.pos=this.options.pos.replace("left","right")),this.dropdown.hasClass("uk-dropdown-center")&&(this.options.pos=this.options.pos.replace(/(left|right)/,"center")),this.element.attr("aria-haspopup","true"),this.element.attr("aria-expanded",this.element.hasClass("uk-open")),"click"==this.options.mode||a.support.touch?this.on("click.uk.dropdown",function(c){var d=a.$(c.target);d.parents(b.options.dropdownSelector).length||((d.is("a[href='#']")||d.parent().is("a[href='#']")||b.dropdown.length&&!b.dropdown.is(":visible"))&&c.preventDefault(),d.blur()),b.element.hasClass("uk-open")?(!b.dropdown.find(c.target).length||d.is(".uk-dropdown-close")||d.parents(".uk-dropdown-close").length)&&b.hide():b.show()}):this.on("mouseenter",function(a){b.trigger("pointerenter.uk.dropdown",[b]),b.remainIdle&&clearTimeout(b.remainIdle),c&&clearTimeout(c),d&&d==b||(c=d&&d!=b?setTimeout(function(){c=setTimeout(b.show.bind(b),b.options.delay)},b.options.hoverDelayIdle):setTimeout(b.show.bind(b),b.options.delay))}).on("mouseleave",function(){c&&clearTimeout(c),b.remainIdle=setTimeout(function(){d&&d==b&&b.hide()},b.options.remaintime),b.trigger("pointerleave.uk.dropdown",[b])}).on("click",function(c){var e=a.$(c.target);return b.remainIdle&&clearTimeout(b.remainIdle),d&&d==b?void((!b.dropdown.find(c.target).length||e.is(".uk-dropdown-close")||e.parents(".uk-dropdown-close").length)&&b.hide()):((e.is("a[href='#']")||e.parent().is("a[href='#']"))&&c.preventDefault(),void b.show())})},show:function(){a.$html.off("click.outer.dropdown"),d&&d!=this&&d.hide(!0),c&&clearTimeout(c),this.trigger("beforeshow.uk.dropdown",[this]),this.checkDimensions(),this.element.addClass("uk-open"),this.element.attr("aria-expanded","true"),this.trigger("show.uk.dropdown",[this]),a.Utils.checkDisplay(this.dropdown,!0),d=this,this.registerOuterClick()},hide:function(a){this.trigger("beforehide.uk.dropdown",[this,a]),this.element.removeClass("uk-open"),this.remainIdle&&clearTimeout(this.remainIdle),this.remainIdle=!1,this.element.attr("aria-expanded","false"),this.trigger("hide.uk.dropdown",[this,a]),d==this&&(d=!1)},registerOuterClick:function(){var b=this;a.$html.off("click.outer.dropdown"),setTimeout(function(){a.$html.on("click.outer.dropdown",function(e){c&&clearTimeout(c);a.$(e.target);d!=b||b.element.find(e.target).length||(b.hide(!0),a.$html.off("click.outer.dropdown"))})},10)},checkDimensions:function(){if(this.dropdown.length){this.dropdown.removeClass("uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack").css({"top-left":"",left:"","margin-left":"","margin-right":""}),this.justified&&this.justified.length&&this.dropdown.css("min-width","");var c,d=a.$.extend({},this.offsetParent.offset(),{width:this.offsetParent[0].offsetWidth,height:this.offsetParent[0].offsetHeight}),f=this.options.offset,g=this.dropdown,h=(g.show().offset()||{left:0,top:0},g.outerWidth()),i=g.outerHeight(),j=this.boundary.width(),k=(this.boundary[0]!==window&&this.boundary.offset()?this.boundary.offset():{top:0,left:0},this.options.pos),l={"bottom-left":{top:0+d.height+f,left:0},"bottom-right":{top:0+d.height+f,left:0+d.width-h},"bottom-center":{top:0+d.height+f,left:0+d.width/2-h/2},"top-left":{top:0-i-f,left:0},"top-right":{top:0-i-f,left:0+d.width-h},"top-center":{top:0-i-f,left:0+d.width/2-h/2},"left-top":{top:0,left:0-h-f},"left-bottom":{top:0+d.height-i,left:0-h-f},"left-center":{top:0+d.height/2-i/2,left:0-h-f},"right-top":{top:0,left:0+d.width+f},"right-bottom":{top:0+d.height-i,left:0+d.width+f},"right-center":{top:0+d.height/2-i/2,left:0+d.width+f}},m={};if(c=k.split("-"),m=l[k]?l[k]:l["bottom-left"],this.justified&&this.justified.length)b(g.css({left:0}),this.justified,j);else if(this.options.preventflip!==!0){var n;switch(this.checkBoundary(d.left+m.left,d.top+m.top,h,i,j)){case"x":"x"!==this.options.preventflip&&(n=e.x[k]||"right-top");break;case"y":"y"!==this.options.preventflip&&(n=e.y[k]||"top-left");break;case"xy":this.options.preventflip||(n=e.xy[k]||"right-bottom")}n&&(c=n.split("-"),m=l[n]?l[n]:l["bottom-left"],this.checkBoundary(d.left+m.left,d.top+m.top,h,i,j)&&(c=k.split("-"),m=l[k]?l[k]:l["bottom-left"]))}h>j&&(g.addClass("uk-dropdown-stack"),this.trigger("stack.uk.dropdown",[this])),g.css(m).css("display","").addClass("uk-dropdown-"+c[0])}},checkBoundary:function(b,c,d,e,f){var g="";return(b<0||b-a.$win.scrollLeft()+d>f)&&(g+="x"),(c-a.$win.scrollTop()<0||c-a.$win.scrollTop()+e>window.innerHeight)&&(g+="y"),g}}),a.component("dropdownOverlay",{defaults:{justify:!1,cls:"",duration:200},boot:function(){a.ready(function(b){a.$("[data-uk-dropdown-overlay]",b).each(function(){var b=a.$(this);b.data("dropdownOverlay")||a.dropdownOverlay(b,a.Utils.options(b.attr("data-uk-dropdown-overlay")))})})},init:function(){var c=this;this.justified=!!this.options.justify&&a.$(this.options.justify),this.overlay=this.element.find("uk-dropdown-overlay"),this.overlay.length||(this.overlay=a.$('
').appendTo(this.element)),this.overlay.addClass(this.options.cls),this.on({"beforeshow.uk.dropdown":function(a,d){c.dropdown=d,c.justified&&c.justified.length&&b(c.overlay.css({display:"block","margin-left":"","margin-right":""}),c.justified,c.justified.outerWidth())},"show.uk.dropdown":function(b,d){var e=c.dropdown.dropdown.outerHeight(!0);c.dropdown.element.removeClass("uk-open"),c.overlay.stop().css("display","block").animate({height:e},c.options.duration,function(){c.dropdown.dropdown.css("visibility",""),c.dropdown.element.addClass("uk-open"),a.Utils.checkDisplay(c.dropdown.dropdown,!0)}),c.pointerleave=!1},"hide.uk.dropdown":function(){c.overlay.stop().animate({height:0},c.options.duration)},"pointerenter.uk.dropdown":function(a,b){clearTimeout(c.remainIdle)},"pointerleave.uk.dropdown":function(a,b){c.pointerleave=!0}}),this.overlay.on({mouseenter:function(){c.remainIdle&&(clearTimeout(c.dropdown.remainIdle),clearTimeout(c.remainIdle))},mouseleave:function(){c.pointerleave&&d&&(c.remainIdle=setTimeout(function(){d&&d.hide()},d.options.remaintime))}})}})}(UIkit);