function copyToClipboard(elem){
var targetId="_hiddenCopyText_";
var isInput=elem.tagName==="INPUT"||elem.tagName==="TEXTAREA";
var origSelectionStart, origSelectionEnd;
if(isInput){
target=elem;
origSelectionStart=elem.selectionStart;
origSelectionEnd=elem.selectionEnd;
}else{
target=document.getElementById(targetId);
if(!target){
var target=document.createElement("textarea");
target.style.position="absolute";
target.style.left="-9999px";
target.style.top="0";
target.id=targetId;
document.body.appendChild(target);
}
target.textContent=elem.textContent;
}
var currentFocus=document.activeElement;
target.focus();
target.setSelectionRange(0, target.value.length);
var succeed;
try {
succeed=document.execCommand ("copy");
} catch (e){
succeed=false;
}
if(currentFocus&&typeof currentFocus.focus==="function"){
currentFocus.focus();
}
if(isInput){
elem.setSelectionRange(origSelectionStart, origSelectionEnd);
}else{
target.textContent="";
}
return succeed;
}
jQuery(document).ready(function ($){
var appendthis=("<div class='modal-overlay js-modal-close'></div>");
var orderby=$(".js-open-modal").data("orderby");
var ordering=$(".js-open-modal").data("order");
var url=$(".js-open-modal").data("url");
var mode=$(".js-open-modal").data("mode");
var list_id=$(".js-open-modal").data("list-id");
var column=$(".js-open-modal").data("column");
var style=$(".js-open-modal").data("style");
var search=$(".js-open-modal").data("search");
var category=$(".js-open-modal").data("category");
var upvote=$(".js-open-modal").data("upvote");
var credittitle=$(".js-open-modal").data("credittitle");
var creditlink=$(".js-open-modal").data("creditlink");
var tooltip=$(".js-open-modal").data("tooltip");
var map=$(".js-open-modal").data("map");
var maponly=$(".js-open-modal").data("maponly");
var enable_tag_filter=$(".js-open-modal").data("enable_tag_filter");
var distance_search=$(".js-open-modal").data("distance_search");
var marker_cluster=$(".js-open-modal").data("marker_cluster");
var image_infowindow=$(".js-open-modal").data("image_infowindow");
var item_count=$(".js-open-modal").data("item_count");
var item_details_page=$(".js-open-modal").data("item_details_page");
var filterorderby=$(".js-open-modal").data("filterorderby");
var main_click_action=$(".js-open-modal").data("main_click_action");
var phone_number=$(".js-open-modal").data("phone_number");
var paginate_items=$(".js-open-modal").data("paginate_items");
var per_page=$(".js-open-modal").data("per_page");
var enable_rtl=$(".js-open-modal").data("enable_rtl");
var enable_left_filter=$(".js-open-modal").data("enable_left_filter");
var enable_tag_filter_dropdown=$(".js-open-modal").data("enable_tag_filter_dropdown");
var enable_map_fullwidth=$(".js-open-modal").data("enable_map_fullwidth");
var enable_map_fullscreen=$(".js-open-modal").data("enable_map_fullscreen");
var enable_map_toggle_filter=$(".js-open-modal").data("enable_map_toggle_filter");
var map_position=$(".js-open-modal").data("map_position");
var list_title_font_size=$(".js-open-modal").data("list_title_font_size");
var item_orderby=$(".js-open-modal").data("item_orderby");
var list_title_line_height=$(".js-open-modal").data("list_title_line_height");
var title_font_size=$(".js-open-modal").data("title_font_size");
var review=$(".js-open-modal").data("review");
var subtitle_font_size=$(".js-open-modal").data("subtitle_font_size");
var title_line_height=$(".js-open-modal").data("title_line_height");
var subtitle_line_height=$(".js-open-modal").data("subtitle_line_height");
var pdmapofflightbox=$(".js-open-modal").data("pdmapofflightbox");
var filter_area=$(".js-open-modal").data("filter_area");
var topspacing=$(".js-open-modal").data("topspacing");
$('a[data-modal-id]').click(function (e){
e.preventDefault();
$("body").append(appendthis);
$(".modal-overlay").fadeTo(500, 0.7);
var modalBox=$(this).attr('data-modal-id');
$('#' + modalBox).fadeIn($(this).data());
$('body').addClass('modalOn');
});
jQuery(document).on('click', ".js-modal-close, .modal-overlay", function(event){
$(".modal-box, .modal-overlay").fadeOut(500, function (){
$(".modal-overlay").remove();
});
$('body').removeClass('modalOn');
});
$(window).resize(function (){
$(".modal-box").css({
});
});
$(window).resize();
$("#generate-igcode").on("click", function (){
var list_id_ext="&list_id=";
if(list_id!=""||list_id!=null){
list_id_ext='&list_id=' + list_id;
}
var i_height=$("#igheight").val();
var i_width=$("#igwidth").val();
var selected_value=$(".iframe-main-select option:selected").text();
var iframe_template='<iframe src="' + url + '/?order=' + ordering + '&orderby=' + orderby + '&mode=' + mode + list_id_ext + '&column=' + column +'&tooltip='+ tooltip + '&style=' + style + '&search=' + search + '&category=' + category + '&map=' + map + '&showmaponly=' + maponly + '&upvote=' + upvote + '&enable_tag_filter='+enable_tag_filter + '&distance_search='+distance_search + '&marker_cluster='+marker_cluster + '&image_infowindow='+image_infowindow + '&item_count='+item_count + '&item_details_page='+item_details_page + '&filterorderby='+filterorderby + '&main_click_action='+main_click_action + '&phone_number='+phone_number + '&paginate_items='+paginate_items + '&per_page='+per_page + '&enable_rtl='+enable_rtl + '&enable_left_filter='+enable_left_filter + '&enable_tag_filter_dropdown='+enable_tag_filter_dropdown + '&enable_map_fullwidth='+enable_map_fullwidth + '&enable_map_fullscreen='+enable_map_fullscreen + '&enable_map_toggle_filter='+enable_map_toggle_filter + '&map_position='+map_position + '&list_title_font_size='+list_title_font_size + '&item_orderby='+item_orderby + '&list_title_line_height='+list_title_line_height + '&title_font_size='+title_font_size + '&review='+review + '&subtitle_font_size='+subtitle_font_size + '&title_line_height='+title_line_height + '&subtitle_line_height='+subtitle_line_height + '&pdmapofflightbox='+pdmapofflightbox + '&filter_area='+filter_area + '&topspacing='+topspacing+' " '
+' scrolling="auto" ' + 'height="' + i_height + 'px' + '" width="' + i_width + selected_value + '" frameborder="0"></iframe>';
var ext='';
if(credittitle.length > 0||creditlink.length > 0){
if(credittitle.length > 0&&creditlink.length > 0){
ext +='<span style="float:right; margin:10px;">List Created by <a href="' + creditlink + '" target="_blank">' + credittitle + '</a></span>';
}else{
ext +='<span style="float:right; margin:10px;">List Created by <a href="' + creditlink + '" target="_blank">' + creditlink + '</a></span>';
}}
iframe_template +=ext;
$(".igcode_textarea").html(iframe_template);
copyToClipboard(document.getElementById("igcode_textarea"));
$("#igcode_textarea").select();
});
});
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:"body",plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.1.6",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__destroying=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a("body").on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.destroy()},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else{if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{var d=c.__geometry(),e=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.left<i.left||d.origin.windowOffset.right>i.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.top<i.top||d.origin.windowOffset.bottom>i.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.__Geometry.origin.offset.left,g=d.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+f,top:c.__lastPosition.coord.top+g})}}c._trigger({type:"scroll",event:b})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.__destroying){c&&d.__callbacks.close.push(c),d.__callbacks.open=[],d.__timeoutsClear();var f=function(){a.each(d.__callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d._$origin[0]})}),d.__callbacks.close=[]};if("closed"!=d.__state){var g=!0,i=new Date,j=i.getTime(),k=j+d.__options.animationDuration[1];if("disappearing"==d.__state&&k>d.__closingTime&&(g=!1),g){d.__closingTime=k,"disappearing"!=d.__state&&d.__stateSet("disappearing");var l=function(){clearInterval(d.__tracker),d._trigger({type:"closing",event:b}),d._$tooltip.off("."+d.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+d.__namespace+"-triggerClose"),d.__$originParents.each(function(b,c){a(c).off("scroll."+d.__namespace+"-triggerClose")}),d.__$originParents=null,a("body").off("."+d.__namespace+"-triggerClose"),d._$origin.off("."+d.__namespace+"-triggerClose"),d._off("dismissable"),d.__stateSet("closed"),d._trigger({type:"after",event:b}),d.__options.functionAfter&&d.__options.functionAfter.call(d,d,{event:b,origin:d._$origin[0]}),f()};h.hasTransitions?(d._$tooltip.css({"-moz-animation-duration":d.__options.animationDuration[1]+"ms","-ms-animation-duration":d.__options.animationDuration[1]+"ms","-o-animation-duration":d.__options.animationDuration[1]+"ms","-webkit-animation-duration":d.__options.animationDuration[1]+"ms","animation-duration":d.__options.animationDuration[1]+"ms","transition-duration":d.__options.animationDuration[1]+"ms"}),d._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.__options.animationDuration[1]>0&&d._$tooltip.delay(d.__options.animationDuration[1]),d._$tooltip.queue(l)):d._$tooltip.stop().fadeOut(d.__options.animationDuration[1],l)}}else f()}return d},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="";e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),a("body").on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&a("body").on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;return b.__destroyed?b.__destroyError():b.__destroying||(b.__destroying=!0,b._close(null,function(){b._trigger("destroy"),b.__destroying=!1,b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a("body").off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)})),b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed||this.__destroying?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,destroying:this.__destroying,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo("body")},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom,width:a.width||a.right}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),
b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});
jQuery(document).ready(function($){
$('#pd-upload-btn').click(function(e){
e.preventDefault();
var image=wp.media({
title: 'Upload Image',
multiple: false
}).open()
.on('select', function(e){
var uploaded_image=image.state().get('selection').first();
var image_url=uploaded_image.toJSON().url;
$('#pd_pf_image_url').val(image_url);
var html=['<span class="pd_remove_bg_image">X</span>',
'<img src="'+image_url+'" alt="" />'
].join("");
$('#pd_preview_img').html(html);
});
});
$(document).on('click', '.pd_remove_bg_image', function(){
$('#pd_preview_img').html('');
$('#pd_pf_image_url').val('');
if($('#sbd_prev_image').length>0){
$('#sbd_prev_image').val('');
}})
$('#qc_pd_category').on('change', function(){
var city=$('#qc_pd_category').val();
$.post(ajaxurl,
{
action:'qcld_pd_category_filter',
cat:city,
},
function(data){
$('#qc_pd_list').html(data);
}
);
})
$('#sld_claim_list').on('change',function(e){
e.preventDefault();
if($(this).val()!==''){
$.post(ajaxurl,
{
action:'qcld_sbd_show_list_item',
listid: $(this).val()
},
function(data){
$('#sld_list_item').html(data);
}
);
}else{
$('#sld_list_item').html('');
}})
$(document).on('click', "#sbd_generate", function(e){
var objc=$(this);
if($('#sbd_item_link').val()!=''){
var html="<div id='sbd_ajax_preloader'><div class='sbd_ajax_loader'></div></div>";
$('body').append(html);
$.post(ajaxurl, {
action: 'qcpd_generate_text',
url: $('#sbd_item_link').val(),
},
function(data){
$('#sbd_ajax_preloader').remove();
var data=JSON.parse(data);
$('#sbd_title').val(data.title)
$('#sbd_subtitle').val(data.description)
});
}else{
alert('Item link field cannot left empty!');
}})
})
function initMap(){
};
! function(a){
"function"==typeof define&&define.amd ? define(["jquery"], a):a("object"==typeof exports ? require("jquery"):window.jQuery||window.Zepto)
}(function(a){
var b, c, d, e, f, g, h="Close",
i="BeforeClose",
j="AfterClose",
k="BeforeAppend",
l="MarkupParse",
m="Open",
n="Change",
o="mfp",
p="." + o,
q="mfp-ready",
r="mfp-removing",
s="mfp-prevent-close",
t=function(){},
u = !!window.jQuery,
v=a(window),
w=function(a, c){
b.ev.on(o + a + p, c)
},
x=function(b, c, d, e){
var f=document.createElement("div");
return f.className="mfp-" + b, d&&(f.innerHTML=d), e ? c&&c.appendChild(f):(f=a(f), c&&f.appendTo(c)), f
},
y=function(c, d){
b.ev.triggerHandler(o + c, d), b.st.callbacks&&(c=c.charAt(0).toLowerCase() + c.slice(1), b.st.callbacks[c]&&b.st.callbacks[c].apply(b, a.isArray(d) ? d:[d]))
},
z=function(c){
return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%", b.st.tClose)), g=c), b.currTemplate.closeBtn
},
A=function(){
a.magnificPopup.instance||(b=new t, b.init(), a.magnificPopup.instance=b)
},
B=function(){
var a=document.createElement("p").style,
b=["ms", "O", "Moz", "Webkit"];
if(void 0!==a.transition) return !0;
for (; b.length;)
if(b.pop() + "Transition" in a) return !0;
return !1
};
t.prototype={
constructor: t,
init: function(){
var c=navigator.appVersion;
b.isLowIE=b.isIE8=document.all&&!document.addEventListener, b.isAndroid=/android/gi.test(c), b.isIOS=/iphone|ipad|ipod/gi.test(c), b.supportsTransition=B(), b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), d=a(document), b.popupsCache={}},
open: function(c){
var e;
if(c.isObj===!1){
b.items=c.items.toArray(), b.index=0;
var g, h=c.items;
for (e=0; e < h.length; e++)
if(g=h[e], g.parsed&&(g=g.el[0]), g===c.el[0]){
b.index=e;
break
}} else b.items=a.isArray(c.items) ? c.items:[c.items], b.index=c.index||0;
if(b.isOpen) return void b.updateItemHTML();
b.types=[], f="", c.mainEl&&c.mainEl.length ? b.ev=c.mainEl.eq(0):b.ev=d, c.key ? (b.popupsCache[c.key]||(b.popupsCache[c.key]={}), b.currTemplate=b.popupsCache[c.key]):b.currTemplate={}, b.st=a.extend(!0, {}, a.magnificPopup.defaults, c), b.fixedContentPos="auto"===b.st.fixedContentPos ? !b.probablyMobile:b.st.fixedContentPos, b.st.modal&&(b.st.closeOnContentClick = !1, b.st.closeOnBgClick = !1, b.st.showCloseBtn = !1, b.st.enableEscapeKey = !1), b.bgOverlay||(b.bgOverlay=x("bg").on("click" + p, function(){
b.close()
}), b.wrap=x("wrap").attr("tabindex", -1).on("click" + p, function(a){
b._checkIfClose(a.target)&&b.close()
}), b.container=x("container", b.wrap)), b.contentContainer=x("content"), b.st.preloader&&(b.preloader=x("preloader", b.container, b.st.tLoading));
var i=a.magnificPopup.modules;
for (e=0; e < i.length; e++){
var j=i[e];
j=j.charAt(0).toUpperCase() + j.slice(1), b["init" + j].call(b)
}
y("BeforeOpen"), b.st.showCloseBtn&&(b.st.closeBtnInside ? (w(l, function(a, b, c, d){
c.close_replaceWith=z(d.type)
}), f +=" mfp-close-btn-in"):b.wrap.append(z())), b.st.alignTop&&(f +=" mfp-align-top"), b.fixedContentPos ? b.wrap.css({
overflow: b.st.overflowY,
overflowX: "hidden",
overflowY: b.st.overflowY
}):b.wrap.css({
top: v.scrollTop(),
position: "absolute"
}), (b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({
height: d.height(),
position: "absolute"
}), b.st.enableEscapeKey&&d.on("keyup" + p, function(a){
27===a.keyCode&&b.close()
}), v.on("resize" + p, function(){
b.updateSize()
}), b.st.closeOnContentClick||(f +=" mfp-auto-cursor"), f&&b.wrap.addClass(f);
var k=b.wH=v.height(),
n={};
if(b.fixedContentPos&&b._hasScrollBar(k)){
var o=b._getScrollbarSize();
o&&(n.marginRight=o)
}
b.fixedContentPos&&(b.isIE7 ? a("body, html").css("overflow", "hidden"):n.overflow="hidden");
var r=b.st.mainClass;
return b.isIE7&&(r +=" mfp-ie7"), r&&b._addClassToMFP(r), b.updateItemHTML(), y("BuildControls"), a("html").css(n), b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)), b._lastFocusedEl=document.activeElement, setTimeout(function(){
b.content ? (b._addClassToMFP(q), b._setFocus()):b.bgOverlay.addClass(q), d.on("focusin" + p, b._onFocusIn)
}, 16), b.isOpen = !0, b.updateSize(k), y(m), c
},
close: function(){
b.isOpen&&(y(i), b.isOpen = !1, b.st.removalDelay&&!b.isLowIE&&b.supportsTransition ? (b._addClassToMFP(r), setTimeout(function(){
b._close()
}, b.st.removalDelay)):b._close())
},
_close: function(){
y(h);
var c=r + " " + q + " ";
if(b.bgOverlay.detach(), b.wrap.detach(), b.container.empty(), b.st.mainClass&&(c +=b.st.mainClass + " "), b._removeClassFromMFP(c), b.fixedContentPos){
var e={
marginRight: ""
};
b.isIE7 ? a("body, html").css("overflow", ""):e.overflow="", a("html").css(e)
}
d.off("keyup" + p + " focusin" + p), b.ev.off(p), b.wrap.attr("class", "mfp-wrap").removeAttr("style"), b.bgOverlay.attr("class", "mfp-bg"), b.container.attr("class", "mfp-container"), !b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(), b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(), b.currItem=null, b.content=null, b.currTemplate=null, b.prevHeight=0, y(j)
},
updateSize: function(a){
if(b.isIOS){
var c=document.documentElement.clientWidth / window.innerWidth,
d=window.innerHeight * c;
b.wrap.css("height", d), b.wH=d
} else b.wH=a||v.height();
b.fixedContentPos||b.wrap.css("height", b.wH), y("Resize")
},
updateItemHTML: function(){
var c=b.items[b.index];
b.contentContainer.detach(), b.content&&b.content.detach(), c.parsed||(c=b.parseEl(b.index));
var d=c.type;
if(y("BeforeChange", [b.currItem ? b.currItem.type:"", d]), b.currItem=c, !b.currTemplate[d]){
var f=b.st[d] ? b.st[d].markup:!1;
y("FirstMarkupParse", f), f ? b.currTemplate[d]=a(f):b.currTemplate[d] = !0
}
e&&e!==c.type&&b.container.removeClass("mfp-" + e + "-holder");
var g=b["get" + d.charAt(0).toUpperCase() + d.slice(1)](c, b.currTemplate[d]);
b.appendContent(g, d), c.preloaded = !0, y(n, c), e=c.type, b.container.prepend(b.contentContainer), y("AfterChange")
},
appendContent: function(a, c){
b.content=a, a ? b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0 ? b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="", y(k), b.container.addClass("mfp-" + c + "-holder"), b.contentContainer.append(b.content)
},
parseEl: function(c){
var d, e=b.items[c];
if(e.tagName ? e={
el: a(e)
}:(d=e.type, e={
data: e,
src: e.src
}), e.el){
for (var f=b.types, g=0; g < f.length; g++)
if(e.el.hasClass("mfp-" + f[g])){
d=f[g];
break
}
e.src=e.el.attr("data-mfp-src"), e.src||(e.src=e.el.attr("href"))
}
return e.type=d||b.st.type||"inline", e.index=c, e.parsed = !0, b.items[c]=e, y("ElementParse", e), b.items[c]
},
addGroup: function(a, c){
var d=function(d){
d.mfpEl=this, b._openClick(d, a, c)
};
c||(c={});
var e="click.magnificPopup";
c.mainEl=a, c.items ? (c.isObj = !0, a.off(e).on(e, d)):(c.isObj = !1, c.delegate ? a.off(e).on(e, c.delegate, d):(c.items=a, a.off(e).on(e, d)))
},
_openClick: function(c, d, e){
var f=void 0!==e.midClick ? e.midClick:a.magnificPopup.defaults.midClick;
if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){
var g=void 0!==e.disableOn ? e.disableOn:a.magnificPopup.defaults.disableOn;
if(g)
if(a.isFunction(g)){
if(!g.call(b)) return !0
}else if(v.width() < g) return !0;
c.type&&(c.preventDefault(), b.isOpen&&c.stopPropagation()), e.el=a(c.mfpEl), e.delegate&&(e.items=d.find(e.delegate)), b.open(e)
}},
updateStatus: function(a, d){
if(b.preloader){
c!==a&&b.container.removeClass("mfp-s-" + c), d||"loading"!==a||(d=b.st.tLoading);
var e={
status: a,
text: d
};
y("UpdateStatus", e), a=e.status, d=e.text, b.preloader.html(d), b.preloader.find("a").on("click", function(a){
a.stopImmediatePropagation()
}), b.container.addClass("mfp-s-" + a), c=a
}},
_checkIfClose: function(c){
if(!a(c).hasClass(s)){
var d=b.st.closeOnContentClick,
e=b.st.closeOnBgClick;
if(d&&e) return !0;
if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0]) return !0;
if(c===b.content[0]||a.contains(b.content[0], c)){
if(d) return !0
}else if(e&&a.contains(document, c)) return !0;
return !1
}},
_addClassToMFP: function(a){
b.bgOverlay.addClass(a), b.wrap.addClass(a)
},
_removeClassFromMFP: function(a){
this.bgOverlay.removeClass(a), b.wrap.removeClass(a)
},
_hasScrollBar: function(a){
return (b.isIE7 ? d.height():document.body.scrollHeight) > (a||v.height())
},
_setFocus: function(){
(b.st.focus ? b.content.find(b.st.focus).eq(0):b.wrap).focus()
},
_onFocusIn: function(c){
return c.target===b.wrap[0]||a.contains(b.wrap[0], c.target) ? void 0:(b._setFocus(), !1)
},
_parseMarkup: function(b, c, d){
var e;
d.data&&(c=a.extend(d.data, c)), y(l, [b, c, d]), a.each(c, function(c, d){
if(void 0===d||d===!1) return !0;
if(e=c.split("_"), e.length > 1){
var f=b.find(p + "-" + e[0]);
if(f.length > 0){
var g=e[1];
"replaceWith"===g ? f[0]!==d[0]&&f.replaceWith(d):"img"===g ? f.is("img") ? f.attr("src", d):f.replaceWith(a("<img>").attr("src", d).attr("class", f.attr("class"))):f.attr(e[1], d)
}} else b.find(p + "-" + c).html(d)
})
},
_getScrollbarSize: function(){
if(void 0===b.scrollbarSize){
var a=document.createElement("div");
a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(a), b.scrollbarSize=a.offsetWidth - a.clientWidth, document.body.removeChild(a)
}
return b.scrollbarSize
}}, a.magnificPopup={
instance: null,
proto: t.prototype,
modules: [],
open: function(b, c){
return A(), b=b ? a.extend(!0, {}, b):{}, b.isObj = !0, b.index=c||0, this.instance.open(b)
},
close: function(){
return a.magnificPopup.instance&&a.magnificPopup.instance.close()
},
registerModule: function(b, c){
c.options&&(a.magnificPopup.defaults[b]=c.options), a.extend(this.proto, c.proto), this.modules.push(b)
},
defaults: {
disableOn: 0,
key: null,
midClick: !1,
mainClass: "",
preloader: !0,
focus: "",
closeOnContentClick: !1,
closeOnBgClick: !0,
closeBtnInside: !0,
showCloseBtn: !0,
enableEscapeKey: !0,
modal: !1,
alignTop: !1,
removalDelay: 0,
prependTo: null,
fixedContentPos: "auto",
fixedBgPos: "auto",
overflowY: "auto",
closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
tClose: "Close (Esc)",
tLoading: "Loading...",
autoFocusLast: !0
}}, a.fn.magnificPopup=function(c){
A();
var d=a(this);
if("string"==typeof c)
if("open"===c){
var e, f=u ? d.data("magnificPopup"):d[0].magnificPopup,
g=parseInt(arguments[1], 10)||0;
f.items ? e=f.items[g]:(e=d, f.delegate&&(e=e.find(f.delegate)), e=e.eq(g)), b._openClick({
mfpEl: e
}, d, f)
} else b.isOpen&&b[c].apply(b, Array.prototype.slice.call(arguments, 1));
else c=a.extend(!0, {}, c), u ? d.data("magnificPopup", c):d[0].magnificPopup=c, b.addGroup(d, c);
return d
};
var C, D, E, F="inline",
G=function(){
E&&(D.after(E.addClass(C)).detach(), E=null)
};
a.magnificPopup.registerModule(F, {
options: {
hiddenClass: "hide",
markup: "",
tNotFound: "Content not found"
},
proto: {
initInline: function(){
b.types.push(F), w(h + "." + F, function(){
G()
})
},
getInline: function(c, d){
if(G(), c.src){
var e=b.st.inline,
f=a(c.src);
if(f.length){
var g=f[0].parentNode;
g&&g.tagName&&(D||(C=e.hiddenClass, D=x(C), C="mfp-" + C), E=f.after(D).detach().removeClass(C)), b.updateStatus("ready")
} else b.updateStatus("error", e.tNotFound), f=a("<div>");
return c.inlineElement=f, f
}
return b.updateStatus("ready"), b._parseMarkup(d, {}, c), d
}}
});
var H, I="ajax",
J=function(){
H&&a(document.body).removeClass(H)
},
K=function(){
J(), b.req&&b.req.abort()
};
a.magnificPopup.registerModule(I, {
options: {
settings: null,
cursor: "mfp-ajax-cur",
tError: '<a href="%url%">The content</a> could not be loaded.'
},
proto: {
initAjax: function(){
b.types.push(I), H=b.st.ajax.cursor, w(h + "." + I, K), w("BeforeChange." + I, K)
},
getAjax: function(c){
H&&a(document.body).addClass(H), b.updateStatus("loading");
var d=a.extend({
url: c.src,
success: function(d, e, f){
var g={
data: d,
xhr: f
};
y("ParseAjax", g), b.appendContent(a(g.data), I), c.finished = !0, J(), b._setFocus(), setTimeout(function(){
b.wrap.addClass(q)
}, 16), b.updateStatus("ready"), y("AjaxContentAdded")
},
error: function(){
J(), c.finished=c.loadError = !0, b.updateStatus("error", b.st.ajax.tError.replace("%url%", c.src))
}}, b.st.ajax.settings);
return b.req=a.ajax(d), ""
}}
});
var L, M=function(c){
if(c.data&&void 0!==c.data.title) return c.data.title;
var d=b.st.image.titleSrc;
if(d){
if(a.isFunction(d)) return d.call(b, c);
if(c.el) return c.el.attr(d)||""
}
return ""
};
a.magnificPopup.registerModule("image", {
options: {
markup: '<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',
cursor: "mfp-zoom-out-cur",
titleSrc: "title",
verticalFit: !0,
tError: '<a href="%url%">The image</a> could not be loaded.'
},
proto: {
initImage: function(){
var c=b.st.image,
d=".image";
b.types.push("image"), w(m + d, function(){
"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)
}), w(h + d, function(){
c.cursor&&a(document.body).removeClass(c.cursor), v.off("resize" + p)
}), w("Resize" + d, b.resizeImage), b.isLowIE&&w("AfterChange", b.resizeImage)
},
resizeImage: function(){
var a=b.currItem;
if(a&&a.img&&b.st.image.verticalFit){
var c=0;
b.isLowIE&&(c=parseInt(a.img.css("padding-top"), 10) + parseInt(a.img.css("padding-bottom"), 10)), a.img.css("max-height", b.wH - c)
}},
_onImageHasSize: function(a){
a.img&&(a.hasSize = !0, L&&clearInterval(L), a.isCheckingImgSize = !1, y("ImageHasSize", a), a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"), a.imgHidden = !1))
},
findImageSize: function(a){
var c=0,
d=a.img[0],
e=function(f){
L&&clearInterval(L), L=setInterval(function(){
return d.naturalWidth > 0 ? void b._onImageHasSize(a):(c > 200&&clearInterval(L), c++, void(3===c ? e(10):40===c ? e(50):100===c&&e(500)))
}, f)
};
e(1)
},
getImage: function(c, d){
var e=0,
f=function(){
c&&(c.img[0].complete ? (c.img.off(".mfploader"), c===b.currItem&&(b._onImageHasSize(c), b.updateStatus("ready")), c.hasSize = !0, c.loaded = !0, y("ImageLoadComplete")):(e++, 200 > e ? setTimeout(f, 100):g()))
},
g=function(){
c&&(c.img.off(".mfploader"), c===b.currItem&&(b._onImageHasSize(c), b.updateStatus("error", h.tError.replace("%url%", c.src))), c.hasSize = !0, c.loaded = !0, c.loadError = !0)
},
h=b.st.image,
i=d.find(".mfp-img");
if(i.length){
var j=document.createElement("img");
j.className="mfp-img", c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")), c.img=a(j).on("load.mfploader", f).on("error.mfploader", g), j.src=c.src, i.is("img")&&(c.img=c.img.clone()), j=c.img[0], j.naturalWidth > 0 ? c.hasSize = !0:j.width||(c.hasSize = !1)
}
return b._parseMarkup(d, {
title: M(c),
img_replaceWith: c.img
}, c), b.resizeImage(), c.hasSize ? (L&&clearInterval(L), c.loadError ? (d.addClass("mfp-loading"), b.updateStatus("error", h.tError.replace("%url%", c.src))):(d.removeClass("mfp-loading"), b.updateStatus("ready")), d):(b.updateStatus("loading"), c.loading = !0, c.hasSize||(c.imgHidden = !0, d.addClass("mfp-loading"), b.findImageSize(c)), d)
}}
});
var N, O=function(){
return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform), N
};
a.magnificPopup.registerModule("zoom", {
options: {
enabled: !1,
easing: "ease-in-out",
duration: 300,
opener: function(a){
return a.is("img") ? a:a.find("img")
}},
proto: {
initZoom: function(){
var a, c=b.st.zoom,
d=".zoom";
if(c.enabled&&b.supportsTransition){
var e, f, g=c.duration,
j=function(a){
var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
d="all " + c.duration / 1e3 + "s " + c.easing,
e={
position: "fixed",
zIndex: 9999,
left: 0,
top: 0,
"-webkit-backface-visibility": "hidden"
},
f="transition";
return e["-webkit-" + f]=e["-moz-" + f]=e["-o-" + f]=e[f]=d, b.css(e), b
},
k=function(){
b.content.css("visibility", "visible")
};
w("BuildControls" + d, function(){
if(b._allowZoom()){
if(clearTimeout(e), b.content.css("visibility", "hidden"), a=b._getItemToZoom(), !a) return void k();
f=j(a), f.css(b._getOffset()), b.wrap.append(f), e=setTimeout(function(){
f.css(b._getOffset(!0)), e=setTimeout(function(){
k(), setTimeout(function(){
f.remove(), a=f = null, y("ZoomAnimationEnded")
}, 16)
}, g)
}, 16)
}}), w(i + d, function(){
if(b._allowZoom()){
if(clearTimeout(e), b.st.removalDelay=g, !a){
if(a=b._getItemToZoom(), !a) return;
f=j(a)
}
f.css(b._getOffset(!0)), b.wrap.append(f), b.content.css("visibility", "hidden"), setTimeout(function(){
f.css(b._getOffset())
}, 16)
}}), w(h + d, function(){
b._allowZoom()&&(k(), f&&f.remove(), a=null)
})
}},
_allowZoom: function(){
return "image"===b.currItem.type
},
_getItemToZoom: function(){
return b.currItem.hasSize ? b.currItem.img:!1
},
_getOffset: function(c){
var d;
d=c ? b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);
var e=d.offset(),
f=parseInt(d.css("padding-top"), 10),
g=parseInt(d.css("padding-bottom"), 10);
e.top -=a(window).scrollTop() - f;
var h={
width: d.width(),
height: (u ? d.innerHeight():d[0].offsetHeight) - g - f
};
return O() ? h["-moz-transform"]=h.transform="translate(" + e.left + "px," + e.top + "px)":(h.left=e.left, h.top=e.top), h
}}
});
var P="iframe",
Q="//about:blank",
R=function(a){
if(b.currTemplate[P]){
var c=b.currTemplate[P].find("iframe");
c.length&&(a||(c[0].src=Q), b.isIE8&&c.css("display", a ? "block":"none"))
}};
a.magnificPopup.registerModule(P, {
options: {
markup: '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',
srcAction: "iframe_src",
patterns: {
youtube: {
index: "youtube.com",
id: "v=",
src: "//www.youtube.com/embed/%id%?autoplay=1"
},
vimeo: {
index: "vimeo.com/",
id: "/",
src: "//player.vimeo.com/video/%id%?autoplay=1"
},
gmaps: {
index: "//maps.google.",
src: "%id%&output=embed"
}}
},
proto: {
initIframe: function(){
b.types.push(P), w("BeforeChange", function(a, b, c){
b!==c&&(b===P ? R():c===P&&R(!0))
}), w(h + "." + P, function(){
R()
})
},
getIframe: function(c, d){
var e=c.src,
f=b.st.iframe;
a.each(f.patterns, function(){
return e.indexOf(this.index) > -1 ? (this.id&&(e="string"==typeof this.id ? e.substr(e.lastIndexOf(this.id) + this.id.length, e.length):this.id.call(this, e)), e=this.src.replace("%id%", e), !1):void 0
});
var g={};
return f.srcAction&&(g[f.srcAction]=e), b._parseMarkup(d, g, c), b.updateStatus("ready"), d
}}
});
var S=function(a){
var c=b.items.length;
return a > c - 1 ? a - c:0 > a ? c + a:a
},
T=function(a, b, c){
return a.replace(/%curr%/gi, b + 1).replace(/%total%/gi, c)
};
a.magnificPopup.registerModule("gallery", {
options: {
enabled: !1,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
preload: [0, 2],
navigateByImgClick: !0,
arrows: !0,
tPrev: "Previous (Left arrow key)",
tNext: "Next (Right arrow key)",
tCounter: "%curr% of %total%"
},
proto: {
initGallery: function(){
var c=b.st.gallery,
e=".mfp-gallery";
return b.direction = !0, c&&c.enabled ? (f +=" mfp-gallery", w(m + e, function(){
c.navigateByImgClick&&b.wrap.on("click" + e, ".mfp-img", function(){
return b.items.length > 1 ? (b.next(), !1):void 0
}), d.on("keydown" + e, function(a){
37===a.keyCode ? b.prev():39===a.keyCode&&b.next()
})
}), w("UpdateStatus" + e, function(a, c){
c.text&&(c.text=T(c.text, b.currItem.index, b.items.length))
}), w(l + e, function(a, d, e, f){
var g=b.items.length;
e.counter=g > 1 ? T(c.tCounter, f.index, g):""
}), w("BuildControls" + e, function(){
if(b.items.length > 1&&c.arrows&&!b.arrowLeft){
var d=c.arrowMarkup,
e=b.arrowLeft=a(d.replace(/%title%/gi, c.tPrev).replace(/%dir%/gi, "left")).addClass(s),
f=b.arrowRight=a(d.replace(/%title%/gi, c.tNext).replace(/%dir%/gi, "right")).addClass(s);
e.click(function(){
b.prev()
}), f.click(function(){
b.next()
}), b.container.append(e.add(f))
}}), w(n + e, function(){
b._preloadTimeout&&clearTimeout(b._preloadTimeout), b._preloadTimeout=setTimeout(function(){
b.preloadNearbyImages(), b._preloadTimeout=null
}, 16)
}), void w(h + e, function(){
d.off(e), b.wrap.off("click" + e), b.arrowRight=b.arrowLeft=null
})):!1
},
next: function(){
b.direction = !0, b.index=S(b.index + 1), b.updateItemHTML()
},
prev: function(){
b.direction = !1, b.index=S(b.index - 1), b.updateItemHTML()
},
goTo: function(a){
b.direction=a >=b.index, b.index=a, b.updateItemHTML()
},
preloadNearbyImages: function(){
var a, c=b.st.gallery.preload,
d=Math.min(c[0], b.items.length),
e=Math.min(c[1], b.items.length);
for (a=1; a <=(b.direction ? e:d); a++) b._preloadItem(b.index + a);
for (a=1; a <=(b.direction ? d:e); a++) b._preloadItem(b.index - a)
},
_preloadItem: function(c){
if(c=S(c), !b.items[c].preloaded){
var d=b.items[c];
d.parsed||(d=b.parseEl(c)), y("LazyLoad", d), "image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader", function(){
d.hasSize = !0
}).on("error.mfploader", function(){
d.hasSize = !0, d.loadError = !0, y("LazyLoadError", d)
}).attr("src", d.src)), d.preloaded = !0
}}
}});
var U="retina";
a.magnificPopup.registerModule(U, {
options: {
replaceSrc: function(a){
return a.src.replace(/\.\w+$/, function(a){
return "@2x" + a
})
},
ratio: 1
},
proto: {
initRetina: function(){
if(window.devicePixelRatio > 1){
var a=b.st.retina,
c=a.ratio;
c=isNaN(c) ? c():c, c > 1&&(w("ImageHasSize." + U, function(a, b){
b.img.css({
"max-width": b.img[0].naturalWidth / c,
width: "100%"
})
}), w("ElementParse." + U, function(b, d){
d.src=a.replaceSrc(d, c)
}))
}}
}}), A()
});
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('jquery-bridget/jquery-bridget',[ 'jquery' ], function(jQuery){
factory(window, jQuery);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('jquery')
);
}else{
window.jQueryBridget=factory(
window,
window.jQuery
);
}}(window, function factory(window, jQuery){
'use strict';
var arraySlice=Array.prototype.slice;
var console=window.console;
var logError=typeof console=='undefined' ? function(){} :
function(message){
console.error(message);
};
function jQueryBridget(namespace, PluginClass, $){
$=$||jQuery||window.jQuery;
if(!$){
return;
}
if(!PluginClass.prototype.option){
PluginClass.prototype.option=function(opts){
if(!$.isPlainObject(opts) ){
return;
}
this.options=$.extend(true, this.options, opts);
};}
$.fn[ namespace ]=function(arg0 ){
if(typeof arg0=='string'){
var args=arraySlice.call(arguments, 1);
return methodCall(this, arg0, args);
}
plainCall(this, arg0);
return this;
};
function methodCall($elems, methodName, args){
var returnValue;
var pluginMethodStr='$().' + namespace + '("' + methodName + '")';
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(!instance){
logError(namespace + ' not initialized. Cannot call methods, i.e. ' +
pluginMethodStr);
return;
}
var method=instance[ methodName ];
if(!method||methodName.charAt(0)=='_'){
logError(pluginMethodStr + ' is not a valid method');
return;
}
var value=method.apply(instance, args);
returnValue=returnValue===undefined ? value:returnValue;
});
return returnValue!==undefined ? returnValue:$elems;
}
function plainCall($elems, options){
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(instance){
instance.option(options);
instance._init();
}else{
instance=new PluginClass(elem, options);
$.data(elem, namespace, instance);
}});
}
updateJQuery($);
}
function updateJQuery($){
if(!$||($&&$.bridget) ){
return;
}
$.bridget=jQueryBridget;
}
updateJQuery(jQuery||window.jQuery);
return jQueryBridget;
}));
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('get-size/get-size',[],function(){
return factory();
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.getSize=factory();
}})(window, function factory(){
'use strict';
function getStyleSize(value){
var num=parseFloat(value);
var isValid=value.indexOf('%')==-1&&!isNaN(num);
return isValid&&num;
}
function noop(){}
var logError=typeof console=='undefined' ? noop :
function(message){
console.error(message);
};
var measurements=[
'paddingLeft',
'paddingRight',
'paddingTop',
'paddingBottom',
'marginLeft',
'marginRight',
'marginTop',
'marginBottom',
'borderLeftWidth',
'borderRightWidth',
'borderTopWidth',
'borderBottomWidth'
];
var measurementsLength=measurements.length;
function getZeroSize(){
var size={
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0
};
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
size[ measurement ]=0;
}
return size;
}
function getStyle(elem){
var style=getComputedStyle(elem);
if(!style){
logError('Style returned ' + style +
'. Are you running this code in a hidden iframe on Firefox? ' +
'See http://bit.ly/getsizebug1');
}
return style;
}
var isSetup=false;
var isBoxSizeOuter;
function setup(){
if(isSetup){
return;
}
isSetup=true;
var div=document.createElement('div');
div.style.width='200px';
div.style.padding='1px 2px 3px 4px';
div.style.borderStyle='solid';
div.style.borderWidth='1px 2px 3px 4px';
div.style.boxSizing='border-box';
var body=document.body||document.documentElement;
body.appendChild(div);
var style=getStyle(div);
getSize.isBoxSizeOuter=isBoxSizeOuter=getStyleSize(style.width)==200;
body.removeChild(div);
}
function getSize(elem){
setup();
if(typeof elem=='string'){
elem=document.querySelector(elem);
}
if(!elem||typeof elem!='object'||!elem.nodeType){
return;
}
var style=getStyle(elem);
if(style.display=='none'){
return getZeroSize();
}
var size={};
size.width=elem.offsetWidth;
size.height=elem.offsetHeight;
var isBorderBox=size.isBorderBox=style.boxSizing=='border-box';
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
var value=style[ measurement ];
var num=parseFloat(value);
size[ measurement ] = !isNaN(num) ? num:0;
}
var paddingWidth=size.paddingLeft + size.paddingRight;
var paddingHeight=size.paddingTop + size.paddingBottom;
var marginWidth=size.marginLeft + size.marginRight;
var marginHeight=size.marginTop + size.marginBottom;
var borderWidth=size.borderLeftWidth + size.borderRightWidth;
var borderHeight=size.borderTopWidth + size.borderBottomWidth;
var isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter;
var styleWidth=getStyleSize(style.width);
if(styleWidth!==false){
size.width=styleWidth +
(isBorderBoxSizeOuter ? 0:paddingWidth + borderWidth);
}
var styleHeight=getStyleSize(style.height);
if(styleHeight!==false){
size.height=styleHeight +
(isBorderBoxSizeOuter ? 0:paddingHeight + borderHeight);
}
size.innerWidth=size.width -(paddingWidth + borderWidth);
size.innerHeight=size.height -(paddingHeight + borderHeight);
size.outerWidth=size.width + marginWidth;
size.outerHeight=size.height + marginHeight;
return size;
}
return getSize;
});
(function(global, factory){
if(typeof define=='function'&&define.amd){
define('ev-emitter/ev-emitter',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
global.EvEmitter=factory();
}}(this, function(){
function EvEmitter(){}
var proto=EvEmitter.prototype;
proto.on=function(eventName, listener){
if(!eventName||!listener){
return;
}
var events=this._events=this._events||{};
var listeners=events[ eventName ]=events[ eventName ]||[];
if(listeners.indexOf(listener)==-1){
listeners.push(listener);
}
return this;
};
proto.once=function(eventName, listener){
if(!eventName||!listener){
return;
}
this.on(eventName, listener);
var onceEvents=this._onceEvents=this._onceEvents||{};
var onceListeners=onceEvents[ eventName ]=onceEvents[ eventName ]||{};
onceListeners[ listener ]=true;
return this;
};
proto.off=function(eventName, listener){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
var index=listeners.indexOf(listener);
if(index!=-1){
listeners.splice(index, 1);
}
return this;
};
proto.emitEvent=function(eventName, args){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
var i=0;
var listener=listeners[i];
args=args||[];
var onceListeners=this._onceEvents&&this._onceEvents[ eventName ];
while(listener){
var isOnce=onceListeners&&onceListeners[ listener ];
if(isOnce){
this.off(eventName, listener);
delete onceListeners[ listener ];
}
listener.apply(this, args);
i +=isOnce ? 0:1;
listener=listeners[i];
}
return this;
};
return EvEmitter;
}));
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('desandro-matches-selector/matches-selector',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.matchesSelector=factory();
}}(window, function factory(){
'use strict';
var matchesMethod=(function(){
var ElemProto=Element.prototype;
if(ElemProto.matches){
return 'matches';
}
if(ElemProto.matchesSelector){
return 'matchesSelector';
}
var prefixes=[ 'webkit', 'moz', 'ms', 'o' ];
for(var i=0; i < prefixes.length; i++){
var prefix=prefixes[i];
var method=prefix + 'MatchesSelector';
if(ElemProto[ method ]){
return method;
}}
})();
return function matchesSelector(elem, selector){
return elem[ matchesMethod ](selector);
};}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('fizzy-ui-utils/utils',[
'desandro-matches-selector/matches-selector'
], function(matchesSelector){
return factory(window, matchesSelector);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('desandro-matches-selector')
);
}else{
window.fizzyUIUtils=factory(
window,
window.matchesSelector
);
}}(window, function factory(window, matchesSelector){
var utils={};
utils.extend=function(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
};
utils.modulo=function(num, div){
return(( num % div) + div) % div;
};
utils.makeArray=function(obj){
var ary=[];
if(Array.isArray(obj) ){
ary=obj;
}else if(obj&&typeof obj.length=='number'){
for(var i=0; i < obj.length; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
};
utils.removeFrom=function(ary, obj){
var index=ary.indexOf(obj);
if(index!=-1){
ary.splice(index, 1);
}};
utils.getParent=function(elem, selector){
while(elem!=document.body){
elem=elem.parentNode;
if(matchesSelector(elem, selector) ){
return elem;
}}
};
utils.getQueryElement=function(elem){
if(typeof elem=='string'){
return document.querySelector(elem);
}
return elem;
};
utils.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
utils.filterFindElements=function(elems, selector){
elems=utils.makeArray(elems);
var ffElems=[];
elems.forEach(function(elem){
if(!(elem instanceof HTMLElement) ){
return;
}
if(!selector){
ffElems.push(elem);
return;
}
if(matchesSelector(elem, selector) ){
ffElems.push(elem);
}
var childElems=elem.querySelectorAll(selector);
for(var i=0; i < childElems.length; i++){
ffElems.push(childElems[i]);
}});
return ffElems;
};
utils.debounceMethod=function(_class, methodName, threshold){
var method=_class.prototype[ methodName ];
var timeoutName=methodName + 'Timeout';
_class.prototype[ methodName ]=function(){
var timeout=this[ timeoutName ];
if(timeout){
clearTimeout(timeout);
}
var args=arguments;
var _this=this;
this[ timeoutName ]=setTimeout(function(){
method.apply(_this, args);
delete _this[ timeoutName ];
}, threshold||100);
};};
utils.docReady=function(callback){
if(document.readyState=='complete'){
callback();
}else{
document.addEventListener('DOMContentLoaded', callback);
}};
utils.toDashed=function(str){
return str.replace(/(.)([A-Z])/g, function(match, $1, $2){
return $1 + '-' + $2;
}).toLowerCase();
};
var console=window.console;
utils.htmlInit=function(WidgetClass, namespace){
utils.docReady(function(){
var dashedNamespace=utils.toDashed(namespace);
var dataAttr='data-' + dashedNamespace;
var dataAttrElems=document.querySelectorAll('[' + dataAttr + ']');
var jsDashElems=document.querySelectorAll('.js-' + dashedNamespace);
var elems=utils.makeArray(dataAttrElems)
.concat(utils.makeArray(jsDashElems) );
var dataOptionsAttr=dataAttr + '-options';
var jQuery=window.jQuery;
elems.forEach(function(elem){
var attr=elem.getAttribute(dataAttr) ||
elem.getAttribute(dataOptionsAttr);
var options;
try {
options=attr&&JSON.parse(attr);
} catch(error){
if(console){
console.error('Error parsing ' + dataAttr + ' on ' + elem.className +
': ' + error);
}
return;
}
var instance=new WidgetClass(elem, options);
if(jQuery){
jQuery.data(elem, namespace, instance);
}});
});
};
return utils;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('outlayer/item',[
'ev-emitter/ev-emitter',
'get-size/get-size'
],
factory
);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('ev-emitter'),
require('get-size')
);
}else{
window.Outlayer={};
window.Outlayer.Item=factory(
window.EvEmitter,
window.getSize
);
}}(window, function factory(EvEmitter, getSize){
'use strict';
function isEmptyObj(obj){
for(var prop in obj){
return false;
}
prop=null;
return true;
}
var docElemStyle=document.documentElement.style;
var transitionProperty=typeof docElemStyle.transition=='string' ?
'transition':'WebkitTransition';
var transformProperty=typeof docElemStyle.transform=='string' ?
'transform':'WebkitTransform';
var transitionEndEvent={
WebkitTransition: 'webkitTransitionEnd',
transition: 'transitionend'
}[ transitionProperty ];
var vendorProperties={
transform: transformProperty,
transition: transitionProperty,
transitionDuration: transitionProperty + 'Duration',
transitionProperty: transitionProperty + 'Property',
transitionDelay: transitionProperty + 'Delay'
};
function Item(element, layout){
if(!element){
return;
}
this.element=element;
this.layout=layout;
this.position={
x: 0,
y: 0
};
this._create();
}
var proto=Item.prototype=Object.create(EvEmitter.prototype);
proto.constructor=Item;
proto._create=function(){
this._transn={
ingProperties: {},
clean: {},
onEnd: {}};
this.css({
position: 'absolute'
});
};
proto.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
proto.getSize=function(){
this.size=getSize(this.element);
};
proto.css=function(style){
var elemStyle=this.element.style;
for(var prop in style){
var supportedProp=vendorProperties[ prop ]||prop;
elemStyle[ supportedProp ]=style[ prop ];
}};
proto.getPosition=function(){
var style=getComputedStyle(this.element);
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
var xValue=style[ isOriginLeft ? 'left':'right' ];
var yValue=style[ isOriginTop ? 'top':'bottom' ];
var layoutSize=this.layout.size;
var x=xValue.indexOf('%')!=-1 ?
(parseFloat(xValue) / 100) * layoutSize.width:parseInt(xValue, 10);
var y=yValue.indexOf('%')!=-1 ?
(parseFloat(yValue) / 100) * layoutSize.height:parseInt(yValue, 10);
x=isNaN(x) ? 0:x;
y=isNaN(y) ? 0:y;
x -=isOriginLeft ? layoutSize.paddingLeft:layoutSize.paddingRight;
y -=isOriginTop ? layoutSize.paddingTop:layoutSize.paddingBottom;
this.position.x=x;
this.position.y=y;
};
proto.layoutPosition=function(){
var layoutSize=this.layout.size;
var style={};
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
var xPadding=isOriginLeft ? 'paddingLeft':'paddingRight';
var xProperty=isOriginLeft ? 'left':'right';
var xResetProperty=isOriginLeft ? 'right':'left';
var x=this.position.x + layoutSize[ xPadding ];
style[ xProperty ]=this.getXValue(x);
style[ xResetProperty ]='';
var yPadding=isOriginTop ? 'paddingTop':'paddingBottom';
var yProperty=isOriginTop ? 'top':'bottom';
var yResetProperty=isOriginTop ? 'bottom':'top';
var y=this.position.y + layoutSize[ yPadding ];
style[ yProperty ]=this.getYValue(y);
style[ yResetProperty ]='';
this.css(style);
this.emitEvent('layout', [ this ]);
};
proto.getXValue=function(x){
var isHorizontal=this.layout._getOption('horizontal');
return this.layout.options.percentPosition&&!isHorizontal ?
(( x / this.layout.size.width) * 100) + '%':x + 'px';
};
proto.getYValue=function(y){
var isHorizontal=this.layout._getOption('horizontal');
return this.layout.options.percentPosition&&isHorizontal ?
(( y / this.layout.size.height) * 100) + '%':y + 'px';
};
proto._transitionTo=function(x, y){
this.getPosition();
var curX=this.position.x;
var curY=this.position.y;
var compareX=parseInt(x, 10);
var compareY=parseInt(y, 10);
var didNotMove=compareX===this.position.x&&compareY===this.position.y;
this.setPosition(x, y);
if(didNotMove&&!this.isTransitioning){
this.layoutPosition();
return;
}
var transX=x - curX;
var transY=y - curY;
var transitionStyle={};
transitionStyle.transform=this.getTranslate(transX, transY);
this.transition({
to: transitionStyle,
onTransitionEnd: {
transform: this.layoutPosition
},
isCleaning: true
});
};
proto.getTranslate=function(x, y){
var isOriginLeft=this.layout._getOption('originLeft');
var isOriginTop=this.layout._getOption('originTop');
x=isOriginLeft ? x:-x;
y=isOriginTop ? y:-y;
return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
};
proto.goTo=function(x, y){
this.setPosition(x, y);
this.layoutPosition();
};
proto.moveTo=proto._transitionTo;
proto.setPosition=function(x, y){
this.position.x=parseInt(x, 10);
this.position.y=parseInt(y, 10);
};
proto._nonTransition=function(args){
this.css(args.to);
if(args.isCleaning){
this._removeStyles(args.to);
}
for(var prop in args.onTransitionEnd){
args.onTransitionEnd[ prop ].call(this);
}};
proto.transition=function(args){
if(!parseFloat(this.layout.options.transitionDuration) ){
this._nonTransition(args);
return;
}
var _transition=this._transn;
for(var prop in args.onTransitionEnd){
_transition.onEnd[ prop ]=args.onTransitionEnd[ prop ];
}
for(prop in args.to){
_transition.ingProperties[ prop ]=true;
if(args.isCleaning){
_transition.clean[ prop ]=true;
}}
if(args.from){
this.css(args.from);
var h=this.element.offsetHeight;
h=null;
}
this.enableTransition(args.to);
this.css(args.to);
this.isTransitioning=true;
};
function toDashedAll(str){
return str.replace(/([A-Z])/g, function($1){
return '-' + $1.toLowerCase();
});
}
var transitionProps='opacity,' + toDashedAll(transformProperty);
proto.enableTransition=function(){
if(this.isTransitioning){
return;
}
var duration=this.layout.options.transitionDuration;
duration=typeof duration=='number' ? duration + 'ms':duration;
this.css({
transitionProperty: transitionProps,
transitionDuration: duration,
transitionDelay: this.staggerDelay||0
});
this.element.addEventListener(transitionEndEvent, this, false);
};
proto.onwebkitTransitionEnd=function(event){
this.ontransitionend(event);
};
proto.onotransitionend=function(event){
this.ontransitionend(event);
};
var dashedVendorProperties={
'-webkit-transform': 'transform'
};
proto.ontransitionend=function(event){
if(event.target!==this.element){
return;
}
var _transition=this._transn;
var propertyName=dashedVendorProperties[ event.propertyName ]||event.propertyName;
delete _transition.ingProperties[ propertyName ];
if(isEmptyObj(_transition.ingProperties) ){
this.disableTransition();
}
if(propertyName in _transition.clean){
this.element.style[ event.propertyName ]='';
delete _transition.clean[ propertyName ];
}
if(propertyName in _transition.onEnd){
var onTransitionEnd=_transition.onEnd[ propertyName ];
onTransitionEnd.call(this);
delete _transition.onEnd[ propertyName ];
}
this.emitEvent('transitionEnd', [ this ]);
};
proto.disableTransition=function(){
this.removeTransitionStyles();
this.element.removeEventListener(transitionEndEvent, this, false);
this.isTransitioning=false;
};
proto._removeStyles=function(style){
var cleanStyle={};
for(var prop in style){
cleanStyle[ prop ]='';
}
this.css(cleanStyle);
};
var cleanTransitionStyle={
transitionProperty: '',
transitionDuration: '',
transitionDelay: ''
};
proto.removeTransitionStyles=function(){
this.css(cleanTransitionStyle);
};
proto.stagger=function(delay){
delay=isNaN(delay) ? 0:delay;
this.staggerDelay=delay + 'ms';
};
proto.removeElem=function(){
this.element.parentNode.removeChild(this.element);
this.css({ display: '' });
this.emitEvent('remove', [ this ]);
};
proto.remove=function(){
if(!transitionProperty||!parseFloat(this.layout.options.transitionDuration) ){
this.removeElem();
return;
}
this.once('transitionEnd', function(){
this.removeElem();
});
this.hide();
};
proto.reveal=function(){
delete this.isHidden;
this.css({ display: '' });
var options=this.layout.options;
var onTransitionEnd={};
var transitionEndProperty=this.getHideRevealTransitionEndProperty('visibleStyle');
onTransitionEnd[ transitionEndProperty ]=this.onRevealTransitionEnd;
this.transition({
from: options.hiddenStyle,
to: options.visibleStyle,
isCleaning: true,
onTransitionEnd: onTransitionEnd
});
};
proto.onRevealTransitionEnd=function(){
if(!this.isHidden){
this.emitEvent('reveal');
}};
proto.getHideRevealTransitionEndProperty=function(styleProperty){
var optionStyle=this.layout.options[ styleProperty ];
if(optionStyle.opacity){
return 'opacity';
}
for(var prop in optionStyle){
return prop;
}};
proto.hide=function(){
this.isHidden=true;
this.css({ display: '' });
var options=this.layout.options;
var onTransitionEnd={};
var transitionEndProperty=this.getHideRevealTransitionEndProperty('hiddenStyle');
onTransitionEnd[ transitionEndProperty ]=this.onHideTransitionEnd;
this.transition({
from: options.visibleStyle,
to: options.hiddenStyle,
isCleaning: true,
onTransitionEnd: onTransitionEnd
});
};
proto.onHideTransitionEnd=function(){
if(this.isHidden){
this.css({ display: 'none' });
this.emitEvent('hide');
}};
proto.destroy=function(){
this.css({
position: '',
left: '',
right: '',
top: '',
bottom: '',
transition: '',
transform: ''
});
};
return Item;
}));
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('outlayer/outlayer',[
'ev-emitter/ev-emitter',
'get-size/get-size',
'fizzy-ui-utils/utils',
'./item'
],
function(EvEmitter, getSize, utils, Item){
return factory(window, EvEmitter, getSize, utils, Item);
}
);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('ev-emitter'),
require('get-size'),
require('fizzy-ui-utils'),
require('./item')
);
}else{
window.Outlayer=factory(
window,
window.EvEmitter,
window.getSize,
window.fizzyUIUtils,
window.Outlayer.Item
);
}}(window, function factory(window, EvEmitter, getSize, utils, Item){
'use strict';
var console=window.console;
var jQuery=window.jQuery;
var noop=function(){};
var GUID=0;
var instances={};
function Outlayer(element, options){
var queryElement=utils.getQueryElement(element);
if(!queryElement){
if(console){
console.error('Bad element for ' + this.constructor.namespace +
': ' +(queryElement||element) );
}
return;
}
this.element=queryElement;
if(jQuery){
this.$element=jQuery(this.element);
}
this.options=utils.extend({}, this.constructor.defaults);
this.option(options);
var id=++GUID;
this.element.outlayerGUID=id;
instances[ id ]=this;
this._create();
var isInitLayout=this._getOption('initLayout');
if(isInitLayout){
this.layout();
}}
Outlayer.namespace='outlayer';
Outlayer.Item=Item;
Outlayer.defaults={
containerStyle: {
position: 'relative'
},
initLayout: true,
originLeft: true,
originTop: true,
resize: true,
resizeContainer: true,
transitionDuration: '0.4s',
hiddenStyle: {
opacity: 0,
transform: 'scale(0.001)'
},
visibleStyle: {
opacity: 1,
transform: 'scale(1)'
}};
var proto=Outlayer.prototype;
utils.extend(proto, EvEmitter.prototype);
proto.option=function(opts){
utils.extend(this.options, opts);
};
proto._getOption=function(option){
var oldOption=this.constructor.compatOptions[ option ];
return oldOption&&this.options[ oldOption ]!==undefined ?
this.options[ oldOption ]:this.options[ option ];
};
Outlayer.compatOptions={
initLayout: 'isInitLayout',
horizontal: 'isHorizontal',
layoutInstant: 'isLayoutInstant',
originLeft: 'isOriginLeft',
originTop: 'isOriginTop',
resize: 'isResizeBound',
resizeContainer: 'isResizingContainer'
};
proto._create=function(){
this.reloadItems();
this.stamps=[];
this.stamp(this.options.stamp);
utils.extend(this.element.style, this.options.containerStyle);
var canBindResize=this._getOption('resize');
if(canBindResize){
this.bindResize();
}};
proto.reloadItems=function(){
this.items=this._itemize(this.element.children);
};
proto._itemize=function(elems){
var itemElems=this._filterFindItemElements(elems);
var Item=this.constructor.Item;
var items=[];
for(var i=0; i < itemElems.length; i++){
var elem=itemElems[i];
var item=new Item(elem, this);
items.push(item);
}
return items;
};
proto._filterFindItemElements=function(elems){
return utils.filterFindElements(elems, this.options.itemSelector);
};
proto.getItemElements=function(){
return this.items.map(function(item){
return item.element;
});
};
proto.layout=function(){
this._resetLayout();
this._manageStamps();
var layoutInstant=this._getOption('layoutInstant');
var isInstant=layoutInstant!==undefined ?
layoutInstant:!this._isLayoutInited;
this.layoutItems(this.items, isInstant);
this._isLayoutInited=true;
};
proto._init=proto.layout;
proto._resetLayout=function(){
this.getSize();
};
proto.getSize=function(){
this.size=getSize(this.element);
};
proto._getMeasurement=function(measurement, size){
var option=this.options[ measurement ];
var elem;
if(!option){
this[ measurement ]=0;
}else{
if(typeof option=='string'){
elem=this.element.querySelector(option);
}else if(option instanceof HTMLElement){
elem=option;
}
this[ measurement ]=elem ? getSize(elem)[ size ]:option;
}};
proto.layoutItems=function(items, isInstant){
items=this._getItemsForLayout(items);
this._layoutItems(items, isInstant);
this._postLayout();
};
proto._getItemsForLayout=function(items){
return items.filter(function(item){
return !item.isIgnored;
});
};
proto._layoutItems=function(items, isInstant){
this._emitCompleteOnItems('layout', items);
if(!items||!items.length){
return;
}
var queue=[];
items.forEach(function(item){
var position=this._getItemLayoutPosition(item);
position.item=item;
position.isInstant=isInstant||item.isLayoutInstant;
queue.push(position);
}, this);
this._processLayoutQueue(queue);
};
proto._getItemLayoutPosition=function(){
return {
x: 0,
y: 0
};};
proto._processLayoutQueue=function(queue){
this.updateStagger();
queue.forEach(function(obj, i){
this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i);
}, this);
};
proto.updateStagger=function(){
var stagger=this.options.stagger;
if(stagger===null||stagger===undefined){
this.stagger=0;
return;
}
this.stagger=getMilliseconds(stagger);
return this.stagger;
};
proto._positionItem=function(item, x, y, isInstant, i){
if(isInstant){
item.goTo(x, y);
}else{
item.stagger(i * this.stagger);
item.moveTo(x, y);
}};
proto._postLayout=function(){
this.resizeContainer();
};
proto.resizeContainer=function(){
var isResizingContainer=this._getOption('resizeContainer');
if(!isResizingContainer){
return;
}
var size=this._getContainerSize();
if(size){
this._setContainerMeasure(size.width, true);
this._setContainerMeasure(size.height, false);
}};
proto._getContainerSize=noop;
proto._setContainerMeasure=function(measure, isWidth){
if(measure===undefined){
return;
}
var elemSize=this.size;
if(elemSize.isBorderBox){
measure +=isWidth ? elemSize.paddingLeft + elemSize.paddingRight +
elemSize.borderLeftWidth + elemSize.borderRightWidth :
elemSize.paddingBottom + elemSize.paddingTop +
elemSize.borderTopWidth + elemSize.borderBottomWidth;
}
measure=Math.max(measure, 0);
this.element.style[ isWidth ? 'width':'height' ]=measure + 'px';
};
proto._emitCompleteOnItems=function(eventName, items){
var _this=this;
function onComplete(){
_this.dispatchEvent(eventName + 'Complete', null, [ items ]);
}
var count=items.length;
if(!items||!count){
onComplete();
return;
}
var doneCount=0;
function tick(){
doneCount++;
if(doneCount==count){
onComplete();
}}
items.forEach(function(item){
item.once(eventName, tick);
});
};
proto.dispatchEvent=function(type, event, args){
var emitArgs=event ? [ event ].concat(args):args;
this.emitEvent(type, emitArgs);
if(jQuery){
this.$element=this.$element||jQuery(this.element);
if(event){
var $event=jQuery.Event(event);
$event.type=type;
this.$element.trigger($event, args);
}else{
this.$element.trigger(type, args);
}}
};
proto.ignore=function(elem){
var item=this.getItem(elem);
if(item){
item.isIgnored=true;
}};
proto.unignore=function(elem){
var item=this.getItem(elem);
if(item){
delete item.isIgnored;
}};
proto.stamp=function(elems){
elems=this._find(elems);
if(!elems){
return;
}
this.stamps=this.stamps.concat(elems);
elems.forEach(this.ignore, this);
};
proto.unstamp=function(elems){
elems=this._find(elems);
if(!elems){
return;
}
elems.forEach(function(elem){
utils.removeFrom(this.stamps, elem);
this.unignore(elem);
}, this);
};
proto._find=function(elems){
if(!elems){
return;
}
if(typeof elems=='string'){
elems=this.element.querySelectorAll(elems);
}
elems=utils.makeArray(elems);
return elems;
};
proto._manageStamps=function(){
if(!this.stamps||!this.stamps.length){
return;
}
this._getBoundingRect();
this.stamps.forEach(this._manageStamp, this);
};
proto._getBoundingRect=function(){
var boundingRect=this.element.getBoundingClientRect();
var size=this.size;
this._boundingRect={
left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
top: boundingRect.top + size.paddingTop + size.borderTopWidth,
right: boundingRect.right -(size.paddingRight + size.borderRightWidth),
bottom: boundingRect.bottom -(size.paddingBottom + size.borderBottomWidth)
};};
proto._manageStamp=noop;
proto._getElementOffset=function(elem){
var boundingRect=elem.getBoundingClientRect();
var thisRect=this._boundingRect;
var size=getSize(elem);
var offset={
left: boundingRect.left - thisRect.left - size.marginLeft,
top: boundingRect.top - thisRect.top - size.marginTop,
right: thisRect.right - boundingRect.right - size.marginRight,
bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
};
return offset;
};
proto.handleEvent=utils.handleEvent;
proto.bindResize=function(){
window.addEventListener('resize', this);
this.isResizeBound=true;
};
proto.unbindResize=function(){
window.removeEventListener('resize', this);
this.isResizeBound=false;
};
proto.onresize=function(){
this.resize();
};
utils.debounceMethod(Outlayer, 'onresize', 100);
proto.resize=function(){
if(!this.isResizeBound||!this.needsResizeLayout()){
return;
}
this.layout();
};
proto.needsResizeLayout=function(){
var size=getSize(this.element);
var hasSizes=this.size&&size;
return hasSizes&&size.innerWidth!==this.size.innerWidth;
};
proto.addItems=function(elems){
var items=this._itemize(elems);
if(items.length){
this.items=this.items.concat(items);
}
return items;
};
proto.appended=function(elems){
var items=this.addItems(elems);
if(!items.length){
return;
}
this.layoutItems(items, true);
this.reveal(items);
};
proto.prepended=function(elems){
var items=this._itemize(elems);
if(!items.length){
return;
}
var previousItems=this.items.slice(0);
this.items=items.concat(previousItems);
this._resetLayout();
this._manageStamps();
this.layoutItems(items, true);
this.reveal(items);
this.layoutItems(previousItems);
};
proto.reveal=function(items){
this._emitCompleteOnItems('reveal', items);
if(!items||!items.length){
return;
}
var stagger=this.updateStagger();
items.forEach(function(item, i){
item.stagger(i * stagger);
item.reveal();
});
};
proto.hide=function(items){
this._emitCompleteOnItems('hide', items);
if(!items||!items.length){
return;
}
var stagger=this.updateStagger();
items.forEach(function(item, i){
item.stagger(i * stagger);
item.hide();
});
};
proto.revealItemElements=function(elems){
var items=this.getItems(elems);
this.reveal(items);
};
proto.hideItemElements=function(elems){
var items=this.getItems(elems);
this.hide(items);
};
proto.getItem=function(elem){
for(var i=0; i < this.items.length; i++){
var item=this.items[i];
if(item.element==elem){
return item;
}}
};
proto.getItems=function(elems){
elems=utils.makeArray(elems);
var items=[];
elems.forEach(function(elem){
var item=this.getItem(elem);
if(item){
items.push(item);
}}, this);
return items;
};
proto.remove=function(elems){
var removeItems=this.getItems(elems);
this._emitCompleteOnItems('remove', removeItems);
if(!removeItems||!removeItems.length){
return;
}
removeItems.forEach(function(item){
item.remove();
utils.removeFrom(this.items, item);
}, this);
};
proto.destroy=function(){
var style=this.element.style;
style.height='';
style.position='';
style.width='';
this.items.forEach(function(item){
item.destroy();
});
this.unbindResize();
var id=this.element.outlayerGUID;
delete instances[ id ];
delete this.element.outlayerGUID;
if(jQuery){
jQuery.removeData(this.element, this.constructor.namespace);
}};
Outlayer.data=function(elem){
elem=utils.getQueryElement(elem);
var id=elem&&elem.outlayerGUID;
return id&&instances[ id ];
};
Outlayer.create=function(namespace, options){
var Layout=subclass(Outlayer);
Layout.defaults=utils.extend({}, Outlayer.defaults);
utils.extend(Layout.defaults, options);
Layout.compatOptions=utils.extend({}, Outlayer.compatOptions);
Layout.namespace=namespace;
Layout.data=Outlayer.data;
Layout.Item=subclass(Item);
utils.htmlInit(Layout, namespace);
if(jQuery&&jQuery.bridget){
jQuery.bridget(namespace, Layout);
}
return Layout;
};
function subclass(Parent){
function SubClass(){
Parent.apply(this, arguments);
}
SubClass.prototype=Object.create(Parent.prototype);
SubClass.prototype.constructor=SubClass;
return SubClass;
}
var msUnits={
ms: 1,
s: 1000
};
function getMilliseconds(time){
if(typeof time=='number'){
return time;
}
var matches=time.match(/(^\d*\.?\d*)(\w*)/);
var num=matches&&matches[1];
var unit=matches&&matches[2];
if(!num.length){
return 0;
}
num=parseFloat(num);
var mult=msUnits[ unit ]||1;
return num * mult;
}
Outlayer.Item=Item;
return Outlayer;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('packery/js/rect',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.Packery=window.Packery||{};
window.Packery.Rect=factory();
}}(window, function factory(){
'use strict';
function Rect(props){
for(var prop in Rect.defaults){
this[ prop ]=Rect.defaults[ prop ];
}
for(prop in props){
this[ prop ]=props[ prop ];
}}
Rect.defaults={
x: 0,
y: 0,
width: 0,
height: 0
};
var proto=Rect.prototype;
proto.contains=function(rect){
var otherWidth=rect.width||0;
var otherHeight=rect.height||0;
return this.x <=rect.x &&
this.y <=rect.y &&
this.x + this.width >=rect.x + otherWidth &&
this.y + this.height >=rect.y + otherHeight;
};
proto.overlaps=function(rect){
var thisRight=this.x + this.width;
var thisBottom=this.y + this.height;
var rectRight=rect.x + rect.width;
var rectBottom=rect.y + rect.height;
return this.x < rectRight &&
thisRight > rect.x &&
this.y < rectBottom &&
thisBottom > rect.y;
};
proto.getMaximalFreeRects=function(rect){
if(!this.overlaps(rect) ){
return false;
}
var freeRects=[];
var freeRect;
var thisRight=this.x + this.width;
var thisBottom=this.y + this.height;
var rectRight=rect.x + rect.width;
var rectBottom=rect.y + rect.height;
if(this.y < rect.y){
freeRect=new Rect({
x: this.x,
y: this.y,
width: this.width,
height: rect.y - this.y
});
freeRects.push(freeRect);
}
if(thisRight > rectRight){
freeRect=new Rect({
x: rectRight,
y: this.y,
width: thisRight - rectRight,
height: this.height
});
freeRects.push(freeRect);
}
if(thisBottom > rectBottom){
freeRect=new Rect({
x: this.x,
y: rectBottom,
width: this.width,
height: thisBottom - rectBottom
});
freeRects.push(freeRect);
}
if(this.x < rect.x){
freeRect=new Rect({
x: this.x,
y: this.y,
width: rect.x - this.x,
height: this.height
});
freeRects.push(freeRect);
}
return freeRects;
};
proto.canFit=function(rect){
return this.width >=rect.width&&this.height >=rect.height;
};
return Rect;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('packery/js/packer',[ './rect' ], factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('./rect')
);
}else{
var Packery=window.Packery=window.Packery||{};
Packery.Packer=factory(Packery.Rect);
}}(window, function factory(Rect){
'use strict';
function Packer(width, height, sortDirection){
this.width=width||0;
this.height=height||0;
this.sortDirection=sortDirection||'downwardLeftToRight';
this.reset();
}
var proto=Packer.prototype;
proto.reset=function(){
this.spaces=[];
var initialSpace=new Rect({
x: 0,
y: 0,
width: this.width,
height: this.height
});
this.spaces.push(initialSpace);
this.sorter=sorters[ this.sortDirection ]||sorters.downwardLeftToRight;
};
proto.pack=function(rect){
for(var i=0; i < this.spaces.length; i++){
var space=this.spaces[i];
if(space.canFit(rect) ){
this.placeInSpace(rect, space);
break;
}}
};
proto.columnPack=function(rect){
for(var i=0; i < this.spaces.length; i++){
var space=this.spaces[i];
var canFitInSpaceColumn=space.x <=rect.x &&
space.x + space.width >=rect.x + rect.width &&
space.height >=rect.height - 0.01;
if(canFitInSpaceColumn){
rect.y=space.y;
this.placed(rect);
break;
}}
};
proto.rowPack=function(rect){
for(var i=0; i < this.spaces.length; i++){
var space=this.spaces[i];
var canFitInSpaceRow=space.y <=rect.y &&
space.y + space.height >=rect.y + rect.height &&
space.width >=rect.width - 0.01;
if(canFitInSpaceRow){
rect.x=space.x;
this.placed(rect);
break;
}}
};
proto.placeInSpace=function(rect, space){
rect.x=space.x;
rect.y=space.y;
this.placed(rect);
};
proto.placed=function(rect){
var revisedSpaces=[];
for(var i=0; i < this.spaces.length; i++){
var space=this.spaces[i];
var newSpaces=space.getMaximalFreeRects(rect);
if(newSpaces){
revisedSpaces.push.apply(revisedSpaces, newSpaces);
}else{
revisedSpaces.push(space);
}}
this.spaces=revisedSpaces;
this.mergeSortSpaces();
};
proto.mergeSortSpaces=function(){
Packer.mergeRects(this.spaces);
this.spaces.sort(this.sorter);
};
proto.addSpace=function(rect){
this.spaces.push(rect);
this.mergeSortSpaces();
};
Packer.mergeRects=function(rects){
var i=0;
var rect=rects[i];
rectLoop:
while(rect){
var j=0;
var compareRect=rects[ i + j ];
while(compareRect){
if(compareRect==rect){
j++;
}else if(compareRect.contains(rect) ){
rects.splice(i, 1);
rect=rects[i];
continue rectLoop;
}else if(rect.contains(compareRect) ){
rects.splice(i + j, 1);
}else{
j++;
}
compareRect=rects[ i + j ];
}
i++;
rect=rects[i];
}
return rects;
};
var sorters={
downwardLeftToRight: function(a, b){
return a.y - b.y||a.x - b.x;
},
rightwardTopToBottom: function(a, b){
return a.x - b.x||a.y - b.y;
}};
return Packer;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('packery/js/item',[
'outlayer/outlayer',
'./rect'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('outlayer'),
require('./rect')
);
}else{
window.Packery.Item=factory(
window.Outlayer,
window.Packery.Rect
);
}}(window, function factory(Outlayer, Rect){
'use strict';
var docElemStyle=document.documentElement.style;
var transformProperty=typeof docElemStyle.transform=='string' ?
'transform':'WebkitTransform';
var Item=function PackeryItem(){
Outlayer.Item.apply(this, arguments);
};
var proto=Item.prototype=Object.create(Outlayer.Item.prototype);
var __create=proto._create;
proto._create=function(){
__create.call(this);
this.rect=new Rect();
};
var _moveTo=proto.moveTo;
proto.moveTo=function(x, y){
var dx=Math.abs(this.position.x - x);
var dy=Math.abs(this.position.y - y);
var canHackGoTo=this.layout.dragItemCount&&!this.isPlacing &&
!this.isTransitioning&&dx < 1&&dy < 1;
if(canHackGoTo){
this.goTo(x, y);
return;
}
_moveTo.apply(this, arguments);
};
proto.enablePlacing=function(){
this.removeTransitionStyles();
if(this.isTransitioning&&transformProperty){
this.element.style[ transformProperty ]='none';
}
this.isTransitioning=false;
this.getSize();
this.layout._setRectSize(this.element, this.rect);
this.isPlacing=true;
};
proto.disablePlacing=function(){
this.isPlacing=false;
};
proto.removeElem=function(){
this.element.parentNode.removeChild(this.element);
this.layout.packer.addSpace(this.rect);
this.emitEvent('remove', [ this ]);
};
proto.showDropPlaceholder=function(){
var dropPlaceholder=this.dropPlaceholder;
if(!dropPlaceholder){
dropPlaceholder=this.dropPlaceholder=document.createElement('div');
dropPlaceholder.className='packery-drop-placeholder';
dropPlaceholder.style.position='absolute';
}
dropPlaceholder.style.width=this.size.width + 'px';
dropPlaceholder.style.height=this.size.height + 'px';
this.positionDropPlaceholder();
this.layout.element.appendChild(dropPlaceholder);
};
proto.positionDropPlaceholder=function(){
this.dropPlaceholder.style[ transformProperty ]='translate(' +
this.rect.x + 'px, ' + this.rect.y + 'px)';
};
proto.hideDropPlaceholder=function(){
var parent=this.dropPlaceholder.parentNode;
if(parent){
parent.removeChild(this.dropPlaceholder);
}};
return Item;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define([
'get-size/get-size',
'outlayer/outlayer',
'packery/js/rect',
'packery/js/packer',
'packery/js/item'
],
factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('get-size'),
require('outlayer'),
require('./rect'),
require('./packer'),
require('./item')
);
}else{
window.Packery=factory(
window.getSize,
window.Outlayer,
window.Packery.Rect,
window.Packery.Packer,
window.Packery.Item
);
}}(window, function factory(getSize, Outlayer, Rect, Packer, Item){
'use strict';
Rect.prototype.canFit=function(rect){
return this.width >=rect.width - 1&&this.height >=rect.height - 1;
};
var Packery=Outlayer.create('packery');
Packery.Item=Item;
var proto=Packery.prototype;
proto._create=function(){
Outlayer.prototype._create.call(this);
this.packer=new Packer();
this.shiftPacker=new Packer();
this.isEnabled=true;
this.dragItemCount=0;
var _this=this;
this.handleDraggabilly={
dragStart: function(){
_this.itemDragStart(this.element);
},
dragMove: function(){
_this.itemDragMove(this.element, this.position.x, this.position.y);
},
dragEnd: function(){
_this.itemDragEnd(this.element);
}};
this.handleUIDraggable={
start: function handleUIDraggableStart(event, ui){
if(!ui){
return;
}
_this.itemDragStart(event.currentTarget);
},
drag: function handleUIDraggableDrag(event, ui){
if(!ui){
return;
}
_this.itemDragMove(event.currentTarget, ui.position.left, ui.position.top);
},
stop: function handleUIDraggableStop(event, ui){
if(!ui){
return;
}
_this.itemDragEnd(event.currentTarget);
}};};
proto._resetLayout=function(){
this.getSize();
this._getMeasurements();
var width, height, sortDirection;
if(this._getOption('horizontal')){
width=Infinity;
height=this.size.innerHeight + this.gutter;
sortDirection='rightwardTopToBottom';
}else{
width=this.size.innerWidth + this.gutter;
height=Infinity;
sortDirection='downwardLeftToRight';
}
this.packer.width=this.shiftPacker.width=width;
this.packer.height=this.shiftPacker.height=height;
this.packer.sortDirection=this.shiftPacker.sortDirection=sortDirection;
this.packer.reset();
this.maxY=0;
this.maxX=0;
};
proto._getMeasurements=function(){
this._getMeasurement('columnWidth', 'width');
this._getMeasurement('rowHeight', 'height');
this._getMeasurement('gutter', 'width');
};
proto._getItemLayoutPosition=function(item){
this._setRectSize(item.element, item.rect);
if(this.isShifting||this.dragItemCount > 0){
var packMethod=this._getPackMethod();
this.packer[ packMethod ](item.rect);
}else{
this.packer.pack(item.rect);
}
this._setMaxXY(item.rect);
return item.rect;
};
proto.shiftLayout=function(){
this.isShifting=true;
this.layout();
delete this.isShifting;
};
proto._getPackMethod=function(){
return this._getOption('horizontal') ? 'rowPack':'columnPack';
};
proto._setMaxXY=function(rect){
this.maxX=Math.max(rect.x + rect.width, this.maxX);
this.maxY=Math.max(rect.y + rect.height, this.maxY);
};
proto._setRectSize=function(elem, rect){
var size=getSize(elem);
var w=size.outerWidth;
var h=size.outerHeight;
if(w||h){
w=this._applyGridGutter(w, this.columnWidth);
h=this._applyGridGutter(h, this.rowHeight);
}
rect.width=Math.min(w, this.packer.width);
rect.height=Math.min(h, this.packer.height);
};
proto._applyGridGutter=function(measurement, gridSize){
if(!gridSize){
return measurement + this.gutter;
}
gridSize +=this.gutter;
var remainder=measurement % gridSize;
var mathMethod=remainder&&remainder < 1 ? 'round':'ceil';
measurement=Math[ mathMethod ](measurement / gridSize) * gridSize;
return measurement;
};
proto._getContainerSize=function(){
if(this._getOption('horizontal')){
return {
width: this.maxX - this.gutter
};}else{
return {
height: this.maxY - this.gutter
};}};
proto._manageStamp=function(elem){
var item=this.getItem(elem);
var rect;
if(item&&item.isPlacing){
rect=item.rect;
}else{
var offset=this._getElementOffset(elem);
rect=new Rect({
x: this._getOption('originLeft') ? offset.left:offset.right,
y: this._getOption('originTop') ? offset.top:offset.bottom
});
}
this._setRectSize(elem, rect);
this.packer.placed(rect);
this._setMaxXY(rect);
};
function verticalSorter(a, b){
return a.position.y - b.position.y||a.position.x - b.position.x;
}
function horizontalSorter(a, b){
return a.position.x - b.position.x||a.position.y - b.position.y;
}
proto.sortItemsByPosition=function(){
var sorter=this._getOption('horizontal') ? horizontalSorter:verticalSorter;
this.items.sort(sorter);
};
proto.fit=function(elem, x, y){
var item=this.getItem(elem);
if(!item){
return;
}
this.stamp(item.element);
item.enablePlacing();
this.updateShiftTargets(item);
x=x===undefined ? item.rect.x: x;
y=y===undefined ? item.rect.y: y;
this.shift(item, x, y);
this._bindFitEvents(item);
item.moveTo(item.rect.x, item.rect.y);
this.shiftLayout();
this.unstamp(item.element);
this.sortItemsByPosition();
item.disablePlacing();
};
proto._bindFitEvents=function(item){
var _this=this;
var ticks=0;
function onLayout(){
ticks++;
if(ticks!=2){
return;
}
_this.dispatchEvent('fitComplete', null, [ item ]);
}
item.once('layout', onLayout);
this.once('layoutComplete', onLayout);
};
proto.resize=function(){
if(!this.isResizeBound||!this.needsResizeLayout()){
return;
}
if(this.options.shiftPercentResize){
this.resizeShiftPercentLayout();
}else{
this.layout();
}};
proto.needsResizeLayout=function(){
var size=getSize(this.element);
var innerSize=this._getOption('horizontal') ? 'innerHeight':'innerWidth';
return size[ innerSize ]!=this.size[ innerSize ];
};
proto.resizeShiftPercentLayout=function(){
var items=this._getItemsForLayout(this.items);
var isHorizontal=this._getOption('horizontal');
var coord=isHorizontal ? 'y':'x';
var measure=isHorizontal ? 'height':'width';
var segmentName=isHorizontal ? 'rowHeight':'columnWidth';
var innerSize=isHorizontal ? 'innerHeight':'innerWidth';
var previousSegment=this[ segmentName ];
previousSegment=previousSegment&&previousSegment + this.gutter;
if(previousSegment){
this._getMeasurements();
var currentSegment=this[ segmentName ] + this.gutter;
items.forEach(function(item){
var seg=Math.round(item.rect[ coord ] / previousSegment);
item.rect[ coord ]=seg * currentSegment;
});
}else{
var currentSize=getSize(this.element)[ innerSize ] + this.gutter;
var previousSize=this.packer[ measure ];
items.forEach(function(item){
item.rect[ coord ]=(item.rect[ coord ] / previousSize) * currentSize;
});
}
this.shiftLayout();
};
proto.itemDragStart=function(elem){
if(!this.isEnabled){
return;
}
this.stamp(elem);
var item=this.getItem(elem);
if(!item){
return;
}
item.enablePlacing();
item.showDropPlaceholder();
this.dragItemCount++;
this.updateShiftTargets(item);
};
proto.updateShiftTargets=function(dropItem){
this.shiftPacker.reset();
this._getBoundingRect();
var isOriginLeft=this._getOption('originLeft');
var isOriginTop=this._getOption('originTop');
this.stamps.forEach(function(stamp){
var item=this.getItem(stamp);
if(item&&item.isPlacing){
return;
}
var offset=this._getElementOffset(stamp);
var rect=new Rect({
x: isOriginLeft ? offset.left:offset.right,
y: isOriginTop ? offset.top:offset.bottom
});
this._setRectSize(stamp, rect);
this.shiftPacker.placed(rect);
}, this);
var isHorizontal=this._getOption('horizontal');
var segmentName=isHorizontal ? 'rowHeight':'columnWidth';
var measure=isHorizontal ? 'height':'width';
this.shiftTargetKeys=[];
this.shiftTargets=[];
var boundsSize;
var segment=this[ segmentName ];
segment=segment&&segment + this.gutter;
if(segment){
var segmentSpan=Math.ceil(dropItem.rect[ measure ] / segment);
var segs=Math.floor(( this.shiftPacker[ measure ] + this.gutter) / segment);
boundsSize=(segs - segmentSpan) * segment;
for(var i=0; i < segs; i++){
var initialX=isHorizontal ? 0:i * segment;
var initialY=isHorizontal ? i * segment:0;
this._addShiftTarget(initialX, initialY, boundsSize);
}}else{
boundsSize=(this.shiftPacker[ measure ] + this.gutter) - dropItem.rect[ measure ];
this._addShiftTarget(0, 0, boundsSize);
}
var items=this._getItemsForLayout(this.items);
var packMethod=this._getPackMethod();
items.forEach(function(item){
var rect=item.rect;
this._setRectSize(item.element, rect);
this.shiftPacker[ packMethod ](rect);
this._addShiftTarget(rect.x, rect.y, boundsSize);
var cornerX=isHorizontal ? rect.x + rect.width:rect.x;
var cornerY=isHorizontal ? rect.y:rect.y + rect.height;
this._addShiftTarget(cornerX, cornerY, boundsSize);
if(segment){
var segSpan=Math.round(rect[ measure ] / segment);
for(var i=1; i < segSpan; i++){
var segX=isHorizontal ? cornerX:rect.x + segment * i;
var segY=isHorizontal ? rect.y + segment * i:cornerY;
this._addShiftTarget(segX, segY, boundsSize);
}}
}, this);
};
proto._addShiftTarget=function(x, y, boundsSize){
var checkCoord=this._getOption('horizontal') ? y:x;
if(checkCoord!==0&&checkCoord > boundsSize){
return;
}
var key=x + ',' + y;
var hasKey=this.shiftTargetKeys.indexOf(key)!=-1;
if(hasKey){
return;
}
this.shiftTargetKeys.push(key);
this.shiftTargets.push({ x: x, y: y });
};
proto.shift=function(item, x, y){
var shiftPosition;
var minDistance=Infinity;
var position={ x: x, y: y };
this.shiftTargets.forEach(function(target){
var distance=getDistance(target, position);
if(distance < minDistance){
shiftPosition=target;
minDistance=distance;
}});
item.rect.x=shiftPosition.x;
item.rect.y=shiftPosition.y;
};
function getDistance(a, b){
var dx=b.x - a.x;
var dy=b.y - a.y;
return Math.sqrt(dx * dx + dy * dy);
}
var DRAG_THROTTLE_TIME=120;
proto.itemDragMove=function(elem, x, y){
var item=this.isEnabled&&this.getItem(elem);
if(!item){
return;
}
x -=this.size.paddingLeft;
y -=this.size.paddingTop;
var _this=this;
function onDrag(){
_this.shift(item, x, y);
item.positionDropPlaceholder();
_this.layout();
}
var now=new Date();
if(this._itemDragTime&&now - this._itemDragTime < DRAG_THROTTLE_TIME){
clearTimeout(this.dragTimeout);
this.dragTimeout=setTimeout(onDrag, DRAG_THROTTLE_TIME);
}else{
onDrag();
this._itemDragTime=now;
}};
proto.itemDragEnd=function(elem){
var item=this.isEnabled&&this.getItem(elem);
if(!item){
return;
}
clearTimeout(this.dragTimeout);
item.element.classList.add('is-positioning-post-drag');
var completeCount=0;
var _this=this;
function onDragEndLayoutComplete(){
completeCount++;
if(completeCount!=2){
return;
}
item.element.classList.remove('is-positioning-post-drag');
item.hideDropPlaceholder();
_this.dispatchEvent('dragItemPositioned', null, [ item ]);
}
item.once('layout', onDragEndLayoutComplete);
this.once('layoutComplete', onDragEndLayoutComplete);
item.moveTo(item.rect.x, item.rect.y);
this.layout();
this.dragItemCount=Math.max(0, this.dragItemCount - 1);
this.sortItemsByPosition();
item.disablePlacing();
this.unstamp(item.element);
};
proto.bindDraggabillyEvents=function(draggie){
this._bindDraggabillyEvents(draggie, 'on');
};
proto.unbindDraggabillyEvents=function(draggie){
this._bindDraggabillyEvents(draggie, 'off');
};
proto._bindDraggabillyEvents=function(draggie, method){
var handlers=this.handleDraggabilly;
draggie[ method ]('dragStart', handlers.dragStart);
draggie[ method ]('dragMove', handlers.dragMove);
draggie[ method ]('dragEnd', handlers.dragEnd);
};
proto.bindUIDraggableEvents=function($elems){
this._bindUIDraggableEvents($elems, 'on');
};
proto.unbindUIDraggableEvents=function($elems){
this._bindUIDraggableEvents($elems, 'off');
};
proto._bindUIDraggableEvents=function($elems, method){
var handlers=this.handleUIDraggable;
$elems
[ method ]('dragstart', handlers.start)
[ method ]('drag', handlers.drag)
[ method ]('dragstop', handlers.stop);
};
var _destroy=proto.destroy;
proto.destroy=function(){
_destroy.apply(this, arguments);
this.isEnabled=false;
};
Packery.Rect=Rect;
Packery.Packer=Packer;
return Packery;
}));
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3",
x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),
x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),
x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},
x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}),
x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},
x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}},
W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){var t,e,i;return void 0!==n?n:(i=(e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>")).children()[0],x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){var c,d,p,g,m,v,y,w,b,_,t,e;return f&&f.of?(v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()},v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})):h.apply(this,arguments)},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;n<e.collisionWidth?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;o<e.collisionHeight?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")},
x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)},
x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),
x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}});
var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","../keycode","../position","../safe-active-element","../unique-id","../version","../widget"],e):e(jQuery)}(function(a){"use strict";return a.widget("ui.menu",{version:"1.13.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault(),this._activateItem(e)},"click .ui-menu-item":function(e){var t=a(e.target),i=a(a.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&t.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),t.has(".ui-menu").length?this.expand (e):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active)&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this._menuItems().first();t||this.focus(e,i)},blur:function(e){this._delay(function(){a.contains(this.element[0],a.ui.safeActiveElement(this.document[0]))||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e,!0),this.mouseHandled=!1}})},_activateItem:function(e){var t,i;this.previousFilter||e.clientX===this.lastMousePosition.x&&e.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:e.clientX,y:e.clientY},t=a(e.target).closest(".ui-menu-item"),i=a(e.currentTarget),t[0]!==i[0])||i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,i))},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),e.children().each(function(){var e=a(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var t,i,s,n=!0;switch(e.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(e);break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case a.ui.keyCode.HOME:this._move("first","first",e);break;case a.ui.keyCode.END:this._move("last","last",e);break;case a.ui.keyCode.UP:this.previous(e);break;case a.ui.keyCode.DOWN:this.next(e);break;case a.ui.keyCode.LEFT:this.collapse(e);break;case a.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand (e);break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:this._activate(e);break;case a.ui.keyCode.ESCAPE:this.collapse(e);break;default:t=this.previousFilter||"",s=n=!1,i=96<=e.keyCode&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),i===t?s=!0:i=t+i,t=this._filterMenuItems(i),(t=s&&-1!==t.index(this.active.next())?this.active.nextAll(".ui-menu-item"):t).length||(i=String.fromCharCode(e.keyCode),t=this._filterMenuItems(i)),t.length?(this.focus(e,t),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&e.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand (e):this.select(e))},refresh:function(){var e,t,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=a(this),t=e.prev(),i=a("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),t.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",t.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(e=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=a(this);s._isDivider(e)&&s._addClass(e,"ui-menu-divider","ui-widget-content")}),t=(i=e.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(t,"ui-menu-item-wrapper"),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!a.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){var i;"icons"===e&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",String(e)),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(e){var t,i,s;this._hasScroll()&&(t=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0,t=e.offset().top-this.activeMenu.offset().top-t-i,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),e=e.outerHeight(),t<0?this.activeMenu.scrollTop(i+t):s<t+e&&this.activeMenu.scrollTop(i+t-s+e))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(e){var t=a.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(t)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var e=i?this.element:a(t&&t.target).closest(this.element.find(".ui-menu"));e.length||(e=this.element),this._close(e),this.blur(t),this._removeClass(e.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=e},i?0:this.delay)},_close:function(e){(e=e||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!a(e.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this._menuItems(this.active.children(".ui-menu")).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(e){return(e||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(e,t,i){var s;(s=this.active?"first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").last():this.active[e+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[t]()),this.focus(i,s)},nextPage:function(e){var t,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===a.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(t=a(this)).offset().top-i-s<0}),this.focus(e,t)):this.focus(e,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var t,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===a.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(t=a(this)).offset().top-i+s}),this.focus(e,t)):this.focus(e,this._menuItems(this.activeMenu).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||a(e.target).closest(".ui-menu-item");var t={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,t)},_filterMenuItems:function(e){var e=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),t=new RegExp("^"+e,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return t.test(String.prototype.trim.call(a(this).children(".ui-menu-item-wrapper").text()))})}})});
(()=>{"use strict";var e={d:(t,d)=>{for(var o in d)e.o(d,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:d[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function d(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:()=>d}),(window.wp=window.wp||{}).domReady=t.default})();
(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{__:()=>F,_n:()=>L,_nx:()=>D,_x:()=>w,createI18n:()=>h,defaultI18n:()=>b,getLocaleData:()=>g,hasTranslation:()=>O,isRTL:()=>P,resetLocaleData:()=>x,setLocaleData:()=>v,sprintf:()=>l,subscribe:()=>m});var e,r,a,i,o=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function l(t,...n){return function(t,...n){var e=0;return Array.isArray(n[0])&&(n=n[0]),t.replace(o,(function(){var t,r,a,i,o;return t=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(a=arguments[7])&&(a=n[e],e++),void 0===r?(void 0===t&&(t=e+1),e++,o=n[t-1]):n[0]&&"object"==typeof n[0]&&n[0].hasOwnProperty(r)&&(o=n[0][r]),"f"===i?o=parseFloat(o)||0:"d"===i&&(o=parseInt(o)||0),void 0!==a&&("f"===i?o=o.toFixed(a):"s"===i&&(o=o.substr(0,a))),null!=o?o:"")}))}(t,...n)}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},r=["(","?"],a={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(t){return!t},"*":function(t,n){return t*n},"/":function(t,n){return t/n},"%":function(t,n){return t%n},"+":function(t,n){return t+n},"-":function(t,n){return t-n},"<":function(t,n){return t<n},"<=":function(t,n){return t<=n},">":function(t,n){return t>n},">=":function(t,n){return t>=n},"==":function(t,n){return t===n},"!=":function(t,n){return t!==n},"&&":function(t,n){return t&&n},"||":function(t,n){return t||n},"?:":function(t,n,e){if(t)throw n;return e}};function u(t){var n=function(t){for(var n,o,l,s,u=[],d=[];n=t.match(i);){for(o=n[0],(l=t.substr(0,n.index).trim())&&u.push(l);s=d.pop();){if(a[o]){if(a[o][0]===s){o=a[o][1]||o;break}}else if(r.indexOf(s)>=0||e[s]<e[o]){d.push(s);break}u.push(s)}a[o]||d.push(o),t=t.substr(n.index+o.length)}return(t=t.trim())&&u.push(t),u.concat(d.reverse())}(t);return function(t){return function(t,n){var e,r,a,i,o,l,u=[];for(e=0;e<t.length;e++){if(o=t[e],i=s[o]){for(r=i.length,a=Array(r);r--;)a[r]=u.pop();try{l=i.apply(null,a)}catch(t){return t}}else l=n.hasOwnProperty(o)?n[o]:+o;u.push(l)}return u[0]}(n,t)}}var d={contextDelimiter:"",onMissingKey:null};function c(t,n){var e;for(e in this.data=t,this.pluralForms={},this.options={},d)this.options[e]=void 0!==n&&e in n?n[e]:d[e]}c.prototype.getPluralForm=function(t,n){var e,r,a,i=this.pluralForms[t];return i||("function"!=typeof(a=(e=this.data[t][""])["Plural-Forms"]||e["plural-forms"]||e.plural_forms)&&(r=function(t){var n,e,r;for(n=t.split(";"),e=0;e<n.length;e++)if(0===(r=n[e].trim()).indexOf("plural="))return r.substr(7)}(e["Plural-Forms"]||e["plural-forms"]||e.plural_forms),a=function(t){var n=u(t);return function(t){return+n({n:t})}}(r)),i=this.pluralForms[t]=a),i(n)},c.prototype.dcnpgettext=function(t,n,e,r,a){var i,o,l;return i=void 0===a?0:this.getPluralForm(t,a),o=e,n&&(o=n+this.options.contextDelimiter+e),(l=this.data[t][o])&&l[i]?l[i]:(this.options.onMissingKey&&this.options.onMissingKey(e,t),0===i?e:r)};const p={plural_forms:t=>1===t?0:1},f=/^i18n\.(n?gettext|has_translation)(_|$)/,h=(t,n,e)=>{const r=new c({}),a=new Set,i=()=>{a.forEach((t=>t()))},o=(t,n="default")=>{r.data[n]={...r.data[n],...t},r.data[n][""]={...p,...r.data[n]?.[""]},delete r.pluralForms[n]},l=(t,n)=>{o(t,n),i()},s=(t="default",n,e,a,i)=>(r.data[t]||o(void 0,t),r.dcnpgettext(t,n,e,a,i)),u=t=>t||"default",d=(t,n,r)=>{let a=s(r,n,t);return e?(a=e.applyFilters("i18n.gettext_with_context",a,t,n,r),e.applyFilters("i18n.gettext_with_context_"+u(r),a,t,n,r)):a};if(t&&l(t,n),e){const t=t=>{f.test(t)&&i()};e.addAction("hookAdded","core/i18n",t),e.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>r.data[t],setLocaleData:l,addLocaleData:(t,n="default")=>{r.data[n]={...r.data[n],...t,"":{...p,...r.data[n]?.[""],...t?.[""]}},delete r.pluralForms[n],i()},resetLocaleData:(t,n)=>{r.data={},r.pluralForms={},l(t,n)},subscribe:t=>(a.add(t),()=>a.delete(t)),__:(t,n)=>{let r=s(n,void 0,t);return e?(r=e.applyFilters("i18n.gettext",r,t,n),e.applyFilters("i18n.gettext_"+u(n),r,t,n)):r},_x:d,_n:(t,n,r,a)=>{let i=s(a,void 0,t,n,r);return e?(i=e.applyFilters("i18n.ngettext",i,t,n,r,a),e.applyFilters("i18n.ngettext_"+u(a),i,t,n,r,a)):i},_nx:(t,n,r,a,i)=>{let o=s(i,a,t,n,r);return e?(o=e.applyFilters("i18n.ngettext_with_context",o,t,n,r,a,i),e.applyFilters("i18n.ngettext_with_context_"+u(i),o,t,n,r,a,i)):o},isRTL:()=>"rtl"===d("ltr","text direction"),hasTranslation:(t,n,a)=>{const i=n?n+""+t:t;let o=!!r.data?.[a??"default"]?.[i];return e&&(o=e.applyFilters("i18n.has_translation",o,t,n,a),o=e.applyFilters("i18n.has_translation_"+u(a),o,t,n,a)),o}}},_=window.wp.hooks,y=h(void 0,void 0,_.defaultHooks);var b=y;const g=y.getLocaleData.bind(y),v=y.setLocaleData.bind(y),x=y.resetLocaleData.bind(y),m=y.subscribe.bind(y),F=y.__.bind(y),w=y._x.bind(y),L=y._n.bind(y),D=y._nx.bind(y),P=y.isRTL.bind(y),O=y.hasTranslation.bind(y);(window.wp=window.wp||{}).i18n=n})();