!function($,e){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i={exports:{}};i.exports=function(){function e(e){for(var t=1;t11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},w={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},x=function(e,t,i){for(t+=e.firstDay;t>=7;)t-=7;return i?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},k=function(e){var t=[],i="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),i="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},D=function(e,t){e.setHours(0,0,0,0);var i=e.getDate(),n=e.getDay(),o=t,a=o-1,s=7,r=function(e){return(e+s-1)%s};e.setDate(i+a-r(n));var c=new Date(e.getFullYear(),0,o),l=864e5,d=(e.getTime()-c.getTime())/l;return 1+Math.round((d-a+r(c.getDay()))/s)},M=function(i,n,o,a){var s=new Date(o,n,i);return''+(t?e(s).isoWeek():D(s,a))+""},F=function(e,t,i,n){return''+(t?e.reverse():e).join("")+""},O=function(e){return""+e.join("")+""},C=function(e){var t,i=[];for(e.showWeekNumber&&i.push(""),t=0;t<7;t++)i.push(''+x(e,t,!0)+"");return""+(e.isRTL?i.reverse():i).join("")+""},E=function(e,t,i,n,o,a){var s,r,c,l,d,_=e._o,p=i===_.minYear,f=i===_.maxYear,m='
',h=!0,g=!0;for(c=[],s=0;s<12;s++)c.push('");for(l='
'+_.i18n.months[n]+'
",u(_.yearRange)?(s=_.yearRange[0],r=_.yearRange[1]+1):(s=i-_.yearRange,r=1+i+_.yearRange),c=[];s=_.minYear&&c.push('");return d='
'+i+_.yearSuffix+'
",_.showMonthAfterYear?m+=d+l:m+=l+d,p&&(0===n||_.minMonth>=n)&&(h=!1),f&&(11===n||_.maxMonth<=n)&&(g=!1),0===t&&(m+='"),t===e._o.numberOfMonths-1&&(m+='"),m+"
"},S=function(e,t,i){return''+C(e)+O(t)+"
"},T=function(s){var r=this,l=r.config(s);r._onMouseDown=function(e){if(r._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(c(t,"is-disabled")||(!c(t,"pika-button")||c(t,"is-empty")||c(t.parentNode,"is-disabled")?c(t,"pika-prev")?r.prevMonth():c(t,"pika-next")&&r.nextMonth():(r.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&o((function(){r.hide(),l.blurFieldOnSelect&&l.field&&l.field.blur()}),100))),c(t,"pika-select"))r._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},r._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(c(t,"pika-select-month")?r.gotoMonth(t.value):c(t,"pika-select-year")&&r.gotoYear(t.value))},r._onKeyChange=function(e){if(e=e||window.event,r.isVisible())switch(e.keyCode){case 13:case 27:l.field&&l.field.blur();break;case 37:r.adjustDate("subtract",1);break;case 38:r.adjustDate("subtract",7);break;case 39:r.adjustDate("add",1);break;case 40:r.adjustDate("add",7);break;case 8:case 46:r.setDate(null)}},r._parseFieldValue=function(){if(l.parse)return l.parse(l.field.value,l.format);if(t){var i=e(l.field.value,l.format,l.formatStrict);return i&&i.isValid()?i.toDate():null}return new Date(Date.parse(l.field.value))},r._onInputChange=function(e){var t;e.firedBy!==r&&(t=r._parseFieldValue(),_(t)&&r.setDate(t),r._v||r.show())},r._onInputFocus=function(){r.show()},r._onInputClick=function(){r.show()},r._onInputBlur=function(){var e=n.activeElement;do{if(c(e,"pika-single"))return}while(e=e.parentNode);r._c||(r._b=o((function(){r.hide()}),50)),r._c=!1},r._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,n=t;if(t){!i&&c(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),a(t,"change",r._onChange)));do{if(c(n,"pika-single")||n===l.trigger)return}while(n=n.parentNode);r._v&&t!==l.trigger&&n!==l.trigger&&r.hide()}},r.el=n.createElement("div"),r.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),a(r.el,"mousedown",r._onMouseDown,!0),a(r.el,"touchend",r._onMouseDown,!0),a(r.el,"change",r._onChange),l.keyboardInput&&a(n,"keydown",r._onKeyChange),l.field&&(l.container?l.container.appendChild(r.el):l.bound?n.body.appendChild(r.el):l.field.parentNode.insertBefore(r.el,l.field.nextSibling),a(l.field,"change",r._onInputChange),l.defaultDate||(l.defaultDate=r._parseFieldValue(),l.setDefaultDate=!0));var d=l.defaultDate;_(d)?l.setDefaultDate?r.setDate(d,!0):r.gotoDate(d):r.gotoDate(new Date),l.bound?(this.hide(),r.el.className+=" is-bound",a(l.trigger,"click",r._onInputClick),a(l.trigger,"focus",r._onInputFocus),a(l.trigger,"blur",r._onInputBlur)):this.show()};return T.prototype={config:function(e){this._o||(this._o=v({},w,!0));var t=v(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var i=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=i>4?4:i,_(t.minDate)||(t.minDate=!1),_(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(i){return i=i||this._o.format,_(this._d)?this._o.toString?this._o.toString(this._d,i):t?e(this._d).format(i):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(i,n){t&&e.isMoment(i)&&this.setDate(i.toDate(),n)},getDate:function(){return _(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",b(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),_(e)){var i=this._o.minDate,n=this._o.maxDate;_(i)&&en&&(e=n),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),b(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},clear:function(){this.setDate(null)},gotoDate:function(e){var t=!0;if(_(e)){if(this.calendars){var i=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=e.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),t=o=a&&(this._y=a,!isNaN(r)&&this._m>r&&(this._m=r));for(var l=0;l";this.el.innerHTML=c,i.bound&&"hidden"!==i.field.type&&o((function(){i.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),i.bound&&i.field.setAttribute("aria-label",i.ariaLabel)}},adjustPosition:function(){var e,t,i,o,a,s,r,c,u,_,p,f;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,i=this.el.offsetWidth,o=this.el.offsetHeight,a=window.innerWidth||n.documentElement.clientWidth,s=window.innerHeight||n.documentElement.clientHeight,r=window.pageYOffset||n.body.scrollTop||n.documentElement.scrollTop,p=!0,f=!0,"function"==typeof e.getBoundingClientRect)c=(_=e.getBoundingClientRect()).left+window.pageXOffset,u=_.bottom+window.pageYOffset;else for(c=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)c+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&c+i>a||this._o.position.indexOf("right")>-1&&c-i+e.offsetWidth>0)&&(c=c-i+e.offsetWidth,p=!1),(this._o.reposition&&u+o>s+r||this._o.position.indexOf("top")>-1&&u-o-e.offsetHeight>0)&&(u=u-o-e.offsetHeight,f=!1),this.el.style.left=c+"px",this.el.style.top=u+"px",l(this.el,p?"left-aligned":"right-aligned"),l(this.el,f?"bottom-aligned":"top-aligned"),d(this.el,p?"right-aligned":"left-aligned"),d(this.el,f?"top-aligned":"bottom-aligned")}},render:function(e,t,i){var n=this._o,o=new Date,a=m(e,t),s=new Date(e,t,1).getDay(),r=[],c=[];h(o),n.firstDay>0&&(s-=n.firstDay)<0&&(s+=7);for(var l=0===t?11:t-1,d=11===t?0:t+1,u=0===t?e-1:e,f=11===t?e+1:e,v=m(u,l),b=a+s,y=b;y>7;)y-=7;b+=7-y;for(var w=!1,x=0,D=0;x=a+s,R=x-s+1,I=t,B=e,j=n.startRange&&g(n.startRange,O),N=n.endRange&&g(n.endRange,O),z=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(O)||n.disableDayFn&&n.disableDayFn(O),isEmpty:A,isStartRange:j,isEndRange:N,isInRange:z,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&C&&(w=!0),c.push(k(Y)),7==++D&&(n.showWeekNumber&&c.unshift(M(x-s,t,e,n.firstWeekOfYearMinDays)),r.push(F(c,n.isRTL,n.pickWholeWeek,w)),c=[],D=0,w=!1)}return S(n,r,i)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),d(this.el,"is-hidden"),this._o.bound&&(a(n,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;!1!==e&&(this._o.bound&&s(n,"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),l(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var e=this._o;this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),e.keyboardInput&&s(n,"keydown",this._onKeyChange),e.field&&(s(e.field,"change",this._onInputChange),e.bound&&(s(e.trigger,"click",this._onInputClick),s(e.trigger,"focus",this._onInputFocus),s(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},T}(n)}()}(o);var a=t(o.exports);$.MailOptin={is_adblock_script_loaded:!1,is_customize_preview:"true"===e.is_customize_preview,track_impression:function(t){if(!0!==$.MailOptin.is_customize_preview&&"true"!==e.disable_impression_tracking){var i={optin_uuid:t,conversion_page:window.location.href,referrer:document.referrer||""};$.post(e.mailoptin_ajaxurl.toString().replace("%%endpoint%%","track_optin_impression"),{stat_data:i})}}};var s={content_locker_storage:[],mailoptin_jq_plugin:function(){var e=this;$.fn.mailoptin=function(t){var i,n,o,a,r,c;if(t=void 0!==t&&t,n=this.attr("id"),o=this.attr("data-optin-type"),a=n+"_"+o,void 0!==(r=e.optin_js_config(a))){if(c=!0===$.MailOptin.is_customize_preview||r.test_mode,!1===this.hasClass("mo-optin-form-lightbox")&&$(document).on("click.moOptin",'a[rel~="moOptin:close"], .mo-close-optin',{optin_uuid:n,optin_type:o,optin_js_config:r,self:e},e.close_optin),!0===$.MailOptin.is_customize_preview&&($(document).off("submit.moOptinSubmit","form.mo-optin-form"),$(document).off("click.moOptinSubmit",".mo-optin-form-submit-button"),$(document).off("click.moOptin",'a[rel~="moOptin:close"]'),$(document).off("click.moOptin",".mo-close-optin")),this.hasClass("mo-optin-form-lightbox")&&(i={optin_uuid:n,bodyClose:r.body_close,keyClose:r.body_close,test_mode:c,iconClose:r.icon_close,onOpen:function(){e.animate_optin_display.call(this,r.effects)},onClose:function(){e.set_cookie("exit",n,r)}},!0===$.MailOptin.is_customize_preview&&(i.keyClose=!1,i.bodyClose=!1,i.test_mode=!0),r=$.extend({},i,r),e.process_optin_form_display.call(this,r,"lightbox",t)),this.hasClass("mo-optin-form-bar")){if(e.is_flag_optin_type_active(r,"bar"))return;e.process_optin_form_display.call(this,r,"bar",t)}if(this.hasClass("mo-optin-form-slidein")){if(e.is_flag_optin_type_active(r,"slidein"))return;e.process_optin_form_display.call(this,r,"slidein",t)}this.hasClass("mo-optin-form-sidebar")&&e.process_optin_form_display.call(this,r,"sidebar",t),this.hasClass("mo-optin-form-inpost")&&e.process_optin_form_display.call(this,r,"inpost",t),$(document).on("click",".mo-trigger-conversion",(function(){e.set_cookie("success",n,r),r.mo_email="CTA",e.ga_event_tracking("conversion",r)})),e.is_var_defined(r,"cta_display")&&!0===r.cta_display&&e.is_var_defined(r,"cta_action")&&$(document).on("click","#"+a+"_cta_button",(function(t){t.preventDefault();var i=$(this).parents(".moOptinForm");if("navigate_to_url"===r.cta_action&&e.is_var_defined(r,"cta_navigate_url")){if(!0===$.MailOptin.is_customize_preview)return;e.set_cookie("success",n,r),r.mo_email="CTA",e.ga_event_tracking("conversion",r),window.location.assign(r.cta_navigate_url)}else if("reveal_optin_form"===r.cta_action){var o=$("#"+a);o.find(".mo-optin-form-cta-button, .mo-optin-form-cta-wrapper").hide(),o.find(".mo-optin-fields-wrapper").show(),o.find(".mo-optin-form-submit-button").show(),$("#"+n).removeClass("mo-cta-button-flag")}else-1!==$.inArray(r.cta_action,["close_optin","close_optin_reload_page"])?($.MoModalBox.close(),s._close_optin(i),"close_optin_reload_page"===r.cta_action&&window.location.reload()):console.warn("something went wrong.");return!1})),$.MailOptin.is_customize_preview||!0!==e.is_adblock_rule_active(r)||!1!==$.MailOptin.is_adblock_script_loaded||(e.load_adblock_detect_script(),$.MailOptin.is_adblock_script_loaded=!0)}},$.fn.extend({animateOptin:function(e){this.addClass("MOanimated "+e).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",(function(){$(this).removeClass("MOanimated "+e)}))}})},is_after_x_seconds_active:function(e){return void 0!==e.x_seconds_status&&!0===e.x_seconds_status&&void 0!==e.x_seconds_value},is_after_x_scroll_active:function(e){return!0===e.x_scroll_status&&void 0!==e.x_scroll_value},is_after_x_page_views_active:function(e){return!0===e.x_page_views_status&&void 0!==e.x_page_views_condition&&void 0!==e.x_page_views_value},is_exit_intent_active:function(e){return!0===e.exit_intent_status},load_adblock_detect_script:function(){var t=document.createElement("script");t.src=e.public_js+"/ad-m.js",t.async=!0,(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t)},is_newvsreturn_rule_active:function(e){return!0===e.newvsreturn_status},is_referrer_detection_rule_active:function(e){return!0===e.referrer_detection_status},is_cookie_targeting_rule_active:function(e){return!0===e.cookie_targeting_status},is_adblock_rule_active:function(e){return!0===e.adblock_status},is_optin_visible:function(e){if("optin_form_shown"!==e.state_after_conversion){var t=e.optin_uuid;if(e.global_success_cookie>0&&n.get("mo_global_success_cookie"))return!1;if(e.global_cookie>0&&n.get("mo_global_cookie"))return!1;if(n.get("mo_success_"+t))return!1;if(n.get("mo_"+t))return!1}return!0},split_test_cookie_test:function(e){if(!0===e.is_split_test){var t=!0,i=s;if(e.optin_campaign_id in e.split_test_variants)return $.each(e.split_test_variants,(function(e,n){if(i.is_var_defined(n,"state_after_conversion")&&"optin_form_shown"!==n.state_after_conversion&&!1===i.is_optin_visible(n))return t=!1,!1})),t}return!0},process_optin_form_display:function(e,t,i){var n=s,o=this;!0===n.is_adblock_rule_active(e)?$(window).on("load",(function(){n.rule_base_show_optin_form.call(o,e,t,i)})):n.rule_base_show_optin_form.call(o,e,t,i)},rule_base_show_optin_form:function(t,i,o){var a=s,r=this;if(!0===$.MailOptin.is_customize_preview||!0===t.test_mode||!0===o)return a.display_optin_form.call(r,t,i,o);if((!a.is_var_defined(t,"click_launch_status")||!0!==t.click_launch_status||!1!==o)&&!1!==a.is_optin_visible(t)&&!1!==a.split_test_cookie_test(t)){if(a.is_after_x_page_views_active(t)){var c=t.x_page_views_condition,l=t.x_page_views_value;switch(c){case"equals":if(a.get_page_views()!==l)return;break;case"more_than":if(a.get_page_views()<=l)return;break;case"less_than":if(a.get_page_views()>=l)return;break;case"at_least":if(a.get_page_views()l)return}}if(!0===a.is_cookie_targeting_rule_active(t)){var d,u=t.cookie_targeting_settings,_=t.cookie_targeting_name,p=t.cookie_targeting_value;if("show"===u&&(d=!1,s.is_defined_not_empty(_)&&s.is_defined_not_empty(p)?n.get(_)===p&&(d=!0):s.is_defined_not_empty(_)&&void 0!==n.get(_)&&(d=!0)),"hide"===u&&(d=!0,s.is_defined_not_empty(_)&&s.is_defined_not_empty(p)?n.get(_)===p&&(d=!1):s.is_defined_not_empty(_)&&void 0!==n.get(_)&&(d=!1)),!d)return}if(!0===a.is_referrer_detection_rule_active(t)){var f=function(e){return e.replace(/\/+$/,"")},m=document.referrer.toLowerCase()||!1;if(!m)return;var h=t.referrer_detection_settings,g=t.referrer_detection_values;if("show_to"===h){var v=!1;$.each(g,(function(e,t){if(t=f(t).toLowerCase(),-1!==m.indexOf(t))return v=!0,!1}))}if("hide_from"===h){v=!0;$.each(g,(function(e,t){if(t=f(t),-1!==m.indexOf(t))return v=!1,!1}))}if(!v)return}if(!0===a.is_newvsreturn_rule_active(t)){if("is_new"===t.newvsreturn_settings&&a.visitor_is_returning())return;if("is_returning"===t.newvsreturn_settings&&a.visitor_is_new())return}if(!0===a.is_adblock_rule_active(t)){if("adblock_enabled"===t.adblock_settings&&a.isAdblockDisabled())return;if("adblock_disabled"===t.adblock_settings&&a.isAdblockEnabled())return}if(void 0!==window.MobileDetect){var b=new MobileDetect(window.navigator.userAgent);if(!0===t.device_targeting_hide_mobile&&b.phone())return;if(!0===t.device_targeting_hide_tablet&&b.tablet())return;if(!0===t.device_targeting_hide_desktop&&!b.mobile())return}if(a.is_var_defined(t,"wc_atc_activate_rule")&&!0===t.wc_atc_activate_rule){if($(document.body).on("added_to_cart",(function(e,n,o,s){var c=s.data("product_id");return(!a.is_var_defined(t,"wc_atc_products")||-1!==$.inArray(c,t.wc_atc_products))&&a.display_optin_form.call(r,t,i)})),a.is_var_defined(e,"wc_atc_products")){if(a.is_var_defined(t,"wc_atc_products"))if(0===t.wc_atc_products.filter((function(t){return-1!==e.wc_atc_products.indexOf(t)})).length)return!1;return a.display_optin_form.call(r,t,i)}}else{var y=1e3*t.x_seconds_value,w=t.x_scroll_value;if(!0!==a.is_after_x_seconds_active(t)||!0!==a.is_after_x_scroll_active(t)||!0!==a.is_exit_intent_active(t)){if(!0===a.is_after_x_scroll_active(t)&&!0===a.is_exit_intent_active(t))return $.moScrollTrigger("enable"),void $(document).on("moScrollTrigger",(function(e,n){n>=w&&($.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return a.display_optin_form.call(r,t,i)})))}));if(!0!==a.is_after_x_seconds_active(t)||!0!==a.is_after_x_scroll_active(t))if(!0!==a.is_after_x_seconds_active(t)||!0!==a.is_exit_intent_active(t)){if(!0!==a.is_after_x_seconds_active(t))return a.is_after_x_scroll_active(t)?($.moScrollTrigger("enable"),void $(document).on("moScrollTrigger",(function(e,n){if(!1===r.hasClass("si-open")&&n>=w)return r.addClass("si-open"),a.display_optin_form.call(r,t,i)}))):a.is_exit_intent_active(t)?($.moExitIntent("enable"),void $(document).on("moExitIntent",(function(){return a.display_optin_form.call(r,t,i)}))):a.display_optin_form.call(r,t,i);setTimeout((function(){return a.display_optin_form.call(r,t,i)}),y)}else setTimeout((function(){$.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return a.display_optin_form.call(r,t,i)}))}),y);else setTimeout((function(){$.moScrollTrigger("enable"),$(document).on("moScrollTrigger",(function(e,n){if(!1===r.hasClass("si-open")&&n>=w)return r.addClass("si-open"),a.display_optin_form.call(r,t,i)}))}),y)}else setTimeout((function(){$.moScrollTrigger("enable"),$(document).on("moScrollTrigger",(function(e,n){n>=w&&($.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return a.display_optin_form.call(r,t,i)})))}))}),y)}}},display_optin_form:function(e,t,i){if(void 0!==t&&void 0!==t){var n=s;if(!1===$.MailOptin.is_customize_preview&&!1===e.test_mode&&!0!==i){if(!1===n.is_optin_visible(e))return;if(!1===n.split_test_cookie_test(e))return}if(void 0!==t&&"lightbox"===t)return $(document.body).on($.MoModalBox.OPEN,(function(e,i,n){$(this).trigger("moOptin:show",[n.optin_uuid,n,t])})),void this.MoModalBox(e);if(n.animate_optin_display.call(this,e.effects),n.flag_optin_type_displayed(e,t),"bar"===t&&"top"===e.bar_position){var o=parseFloat($(document.body).css("margin-top")),a=e.optin_uuid;$(window).on("resize.MoBarTop",(function(){setTimeout((function(){var e=$("#"+a+"_bar"),t=$("#wpadminbar"),i=e.outerHeight();$(window).width()<=600&&t.length>0&&($("#"+a+".mo-optin-form-bar-sticky").length>0?i-=t.outerHeight():i+=t.outerHeight()),i=$.MailOptin.activeBarHeight=o+i,$(document.body).css("margin-top",o+i+"px")}),500)})),$(window).resize()}this.show(),$(this).trigger("moOptin:show",[e.optin_uuid,e,t])}},optin_sound_selected:function(t,i){if(!0!==$.MailOptin.is_customize_preview&&("bar"===i||"lightbox"===i||"slidein"===i)){var n=void 0!==t.optin_sound?t.optin_sound:"";if("none"!==n&&""!==n){var o="custom"!==n?e.public_sound+n:t.optin_custom_sound,a=new Audio(o);a.addEventListener("canplaythrough",(function(){this.play().catch((function(e){console.warn("Sound was not able to play when selected. Reason: "+e)}))})),a.addEventListener("error",(function(){console.error("Error occurred when trying to load popup opening sound.")}))}}},flag_optin_type_displayed:function(e,t){if("bar"===t){var i=e.bar_position;$.MailOptin["isActiveMOBar_"+i]=!0}if("slidein"===t){var n=e.slidein_position;$.MailOptin["isActiveMOSlidein_"+n]=!0}},flag_optin_type_close:function(e,t){if("bar"===t){var i=e.bar_position;$.MailOptin["isActiveMOBar_"+i]=!1}if("slidein"===t){var n=e.slidein_position;$.MailOptin["isActiveMOSlidein_"+n]=!1}},is_flag_optin_type_active:function(e,t){if("bar"===t){var i=e.bar_position;return!0===$.MailOptin["isActiveMOBar_"+i]}if("slidein"===t){var n=e.slidein_position;return!0===$.MailOptin["isActiveMOSlidein_"+n]}},close_optin:function(e){e.preventDefault();var t=$(this).parents(".moOptinForm"),i=t.attr("id"),n=t.attr("data-optin-type"),o=s.optin_js_config(i);s._close_optin(t),t.removeClass("si-open"),s.set_cookie("exit",i,o),s.flag_optin_type_close(o,n)},_close_optin:function(e){e.fadeOut(400,(function(){$(this).trigger("moOptin:close",[this]);var t=e.attr("id"),i=s.optin_js_config(t);if("bar"===i.optin_type&&"top"===i.bar_position){var n=parseFloat($(document.body).css("margin-top"));$(document.body).css("margin-top",n-$.MailOptin.activeBarHeight+"px"),delete $.MailOptin.activeBarHeight,$(window).off("resize.MoBarTop")}}))},track_page_views:function(){if("true"===e.is_new_returning_visitors_cookies){var t=n.get("mo_page_views_counter"),i=void 0===t?0:t;n.set("mo_page_views_counter",++i)}},set_visitor_cookies:function(){"true"===e.is_new_returning_visitors_cookies&&(n.get("mo_has_visited")||(n.set("mo_is_new","true"),n.set("mo_has_visited","true",{expires:3999})))},isAdblockEnabled:function(){return"undefined"==typeof mailoptin_no_adblock_detected},isAdblockDisabled:function(){return"undefined"!=typeof mailoptin_no_adblock_detected},visitor_is_new:function(){return"true"===n.get("mo_has_visited")&&"true"===n.get("mo_is_new")},visitor_is_returning:function(){return"true"===n.get("mo_has_visited")&&!n.get("mo_is_new")},get_page_views:function(){return Number(n.get("mo_page_views_counter"))},animate_optin_display:function(e){""===e&&void 0===e||this.find(".mo-optin-form-wrapper").animateOptin(e)},optin_js_config:function(e){return window[e]},optin_conversion:function(){var e,t,i,n,o,a,s;if(s=this,!0!==$.MailOptin.is_customize_preview){var r=function(r){if(r.preventDefault(),r.stopImmediatePropagation(),t=$(this).parents(".moOptinForm"),i=t.attr("id"),n=t.attr("data-optin-type"),o=i+"_"+n,a=s.optin_js_config(o),s.hide_optin_error(i,t),s.validate_optin_form_fields(o,a,t)){var c=$("form#"+o+"_form").serializeArray().reduce((function(e,t){if(-1!==t.name.indexOf("[]")){var i=t.name.replace("[]","");void 0===e[i]?(e[i]=[],e[i].push(t.value)):e[i].push(t.value)}else e[t.name]=t.value;return e}),{});e=$.extend({},c,{optin_uuid:i,optin_campaign_id:a.optin_campaign_id,email:$("input#"+o+"_email_field",t).val(),name:$("input#"+o+"_name_field",t).val(),_mo_timestamp:$("input#"+o+"_honeypot_timestamp").val(),user_agent:navigator.userAgent,conversion_page:window.location.href,referrer:document.referrer||""}),s.addProcessingOverlay.call(t),s.subscribe_to_email_list(e,t,a,n)}} ;$(document).on("submit.moOptinSubmit","form.mo-optin-form",r),$(document).on("click.moOptinSubmit",".mo-optin-form-submit-button",r)}},addProcessingOverlay:function(){this.find(".mo-optin-spinner").show()},removeProcessingOverlay:function(){this.find(".mo-optin-spinner").hide()},addSuccessCloseIcon:function(){this.find(".mo-optin-spinner").after('×')},removeSuccessCloseIcon:function(){this.find(".mo-optin-success-close").remove()},displaySuccessContent:function(){this.find(".mo-optin-success-msg").show(),this.addClass("mo-optin-success-state")},removeSpinner:function(){this.find(".mo-optin-spinner").css("background-image","none")},displayErrorMessage:function(e){this.find(".mo-optin-error").html(e).show()},set_cookie:function(e,t,i){var o=i.test_mode||!1,a=i.cookie;"success"==e&&(a=i.success_cookie),e="exit"===e?"":e+"_",o||(n.set("mo_"+e+t,!0,{expires:a}),n.set("mo_global_"+e+"cookie",!0,{expires:i["global_"+e+"cookie"]}))},subscribe_to_email_list:function(t,i,n,o){var a=this;$.post(e.mailoptin_ajaxurl.toString().replace("%%endpoint%%","subscribe_to_email_list"),{optin_data:t},(function(e){!$.isEmptyObject(e)&&"success"in e?!0===e.success?($(document.body).trigger("moOptinConversion",[i,n,t]),a.set_cookie("success",t.optin_uuid,n),-1!==$.inArray(o,["lightbox","bar","slidein"])&&!0!==n.icon_close&&a.addSuccessCloseIcon.call(i),a.displaySuccessContent.call(i),a.removeSpinner.call(i)):(a.removeProcessingOverlay.call(i),a.removeSuccessCloseIcon.call(i),a.displayErrorMessage.call(i,e.message)):(a.displayErrorMessage.call(i,n.unexpected_error),a.removeProcessingOverlay.call(i),a.removeSuccessCloseIcon.call(i))}),"json")},validate_optin_form_fields:function(e,t,i){var n=t.name_missing_error,o=t.email_missing_error,a=t.honeypot_error,s=t.note_acceptance_error,r=t.custom_field_required_error,c=this,l=$("#"+e+"_name_field:visible",i),d=$("#"+e+"_email_field:visible",i),u=$("#"+e+" .mo-acceptance-checkbox",i),_=$("#"+e+"_honeypot_email_field",i).val(),p=$("#"+e+"_honeypot_website_field",i).val(),f=!0;return(_.length>0||p.length>0)&&(c.display_optin_error.call(void 0,e,a,i),f=!1),$("#"+e+" .mo-optin-form-custom-field",i).each((function(){var n=$(this),o=$(this).data("field-id"),a=t.required_custom_fields,s=n.val();n.find("input[type=radio]").length>0&&(s=0===n.find("input[type=radio]:checked").length?"":n.find("input[type=radio]:checked").val()),n.find("input[type=checkbox]").length>0&&(s=0===n.find("input[type=checkbox]:checked").length?"":n.find("input[type=checkbox]:checked").val()),-1!==$.inArray(o,a)&&""===s&&(c.display_optin_error.call(n,e,r,i),f=!1)})),d.length>0&&!1===c.isValidEmail(d.val())&&(c.display_optin_error.call(d,e,o,i),f=!1),!0===t.name_field_required&&l.length>0&&""===l.val()&&(c.display_optin_error.call(l,e,n,i),f=!1),!1===f?f:u.length>0&&!1===u[0].checked?(c.display_optin_error.call(void 0,e,s,i),!1):(!1===$(document.body).triggerHandler("mo_validate_optin_form_fields",[c,e,t])&&(f=!1),f)},display_optin_error:function(e,t,i){void 0!==this&&(this.css("-webkit-box-shadow","inset 0px 0px 0px 2px #f45a4a"),this.css("-moz-box-shadow","inset 0px 0px 0px 2px #f45a4a"),this.css("box-shadow","inset 0px 0px 0px 2px #f45a4a"));var n=$("div#"+e+" .mo-optin-error",i);void 0!==t&&void 0!==n&&n.length>0&&"string"==typeof t&&n.text(t).show()},hide_optin_error:function(e,t){var i=$(".mo-optin-field",t);$(".mo-optin-error",t).hide(),i.css("-webkit-box-shadow",""),i.css("-moz-box-shadow",""),i.css("box-shadow","")},isValidEmail:function(e){return new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(e)},ga_event_tracking:function(e,t){if(e=e||"impression",!1!==s.is_var_defined(t,"ga_active")&&("function"==typeof ga&&ga((function(){var i=ga.getAll()[0].get("trackingId");!1!==s.is_defined_not_empty(i)&&(ga("create",i,"auto","moTracker"),ga("moTracker.send","event",t.optin_campaign_name,e,t.optin_uuid,{nonInteraction:!0}))})),"function"==typeof gtag)){var i="mailoptin_"+e,n={optin_campaign:t.optin_campaign_name,optin_uuid:t.optin_uuid};void 0!==t.mo_email&&(n.lead_email=t.mo_email),gtag("event",i,n)}},success_action_after_conversion:function(e,t,i,n){var o=i.success_action,a=i.redirect_url_value,r=i.success_js_script,c=void 0!==r&&""!==r,l={};l.mo_name=l.mo_email="",s.is_defined_not_empty(n.name)&&(l.mo_name=n.name),s.is_defined_not_empty(n.email)&&(l.mo_email=n.email,i.mo_email=n.email),s.ga_event_tracking("conversion",i),s.content_locker_removal(i),!0===c&&(-1===r.indexOf("'+r+"<\/script>"),r=r.replace(/\[EMAIL\]/gi,l.mo_email).replace(/\[NAME\]/gi,l.mo_name),$(t).append(r)),void 0!==o&&-1!==$.inArray(o,["close_optin","redirect_url","close_optin_reload_page"])&&setTimeout((function(){if($.MoModalBox.close(),s._close_optin(t),"close_optin_reload_page"===o)return window.location.reload();"redirect_url"===o&&void 0!==a&&""!==a&&(void 0!==i.pass_lead_data&&!0===i.pass_lead_data&&(a=s.add_query_args(a,l)),window.location.assign(a))}),1e3)},eventSubscription:function(){$(document.body).on("moOptin:show",(function(e,t,i,n){s.content_locker_init(i),$.MailOptin.track_impression(t),s.ga_event_tracking("impression",i),s.optin_sound_selected(i,n)})),$(document.body).on("moOptinConversion",this.success_action_after_conversion)},is_content_locker_enabled:function(e){return s.is_var_defined(e,"content_lock_status")&&!0===e.content_lock_status&&s.is_var_defined(e,"content_lock_style")},content_locker_init:function(e){if(s.is_content_locker_enabled(e)){var t=!1,i=e.content_lock_selector.toString(),n=$("#"+e.optin_uuid).nextAll();i.length>0&&$(i).length>0&&(t=$(i)),"removal"===e.content_lock_style?(!1!==t&&t.hide(),n.each((function(e,t){s.content_locker_storage.push($(t).clone(!0)),$(t).remove()}))):(!1!==t&&t.addClass("mailoptin-content-lock"),n.each((function(e,t){$(t).addClass("mailoptin-content-lock")})))}},content_locker_removal:function(e){if(s.is_content_locker_enabled(e)){var t=$("#"+e.optin_uuid),i=!1,n=t.nextAll(),o=e.content_lock_selector.toString();o.length>0&&$(o).length>0&&(i=$(o)),"removal"===e.content_lock_style?(s.content_locker_storage.reverse(),!1!==i&&i.show(),$.each(s.content_locker_storage,(function(e,i){t.after(i)}))):(n.removeClass("mailoptin-content-lock"),!1!==i&&i.removeClass("mailoptin-content-lock"))}},add_query_args:function(e,t){var i=-1!==e.indexOf("?")?"&":"?";for(var n in t)t.hasOwnProperty(n)&&(e+=i+n+"="+t[n],i="&");return e},initOptinForms:function(){$(".moOptinForm").each((function(e,t){$(t).mailoptin()}));var e=function(e){void 0!==e&&$(["#"+e+".mo-optin-form-lightbox","#"+e+".mo-optin-form-bar","#"+e+".mo-optin-form-slidein"].join(",")).mailoptin(!0)};$(document).on("click",".mailoptin-click-trigger",(function(t){t.preventDefault();var i=$(this).data("optin-uuid")||$(this).attr("id");e(i)})),$(document).on("click",'[class*="mailoptin-click-trigger-"]',(function(t){t.preventDefault();var i,n=this.className.match(/mailoptin-click-trigger-([a-z0-1]+)\s?/i);null!==n&&(i=n[1],e(i))}))},is_scheduled_for_display:function(){!0!==$.MailOptin.is_customize_preview&&$(".moOptinForm").each((function(){var e=$(this).attr("id"),t=s.optin_js_config(e),i=t.schedule_status,n=t.schedule_start,o=t.schedule_end,a=t.schedule_timezone;if(s.is_defined_not_empty(i)&&s.is_defined_not_empty(n)&&s.is_defined_not_empty(o)&&s.is_defined_not_empty(a)){var r,c,l,d,u=new Date;r="visitors_local_time"===a?60*u.getTimezoneOffset()*1e3:1e3*a,c=u.getTime(),l=Date.parse(n+" GMT")-r,d=Date.parse(o+" GMT")-r,!1===(c>=l&&c<=d)?$(this).remove():$(this).mailoptin()}}))},is_var_defined:function(e,t){return void 0!==e[t]},is_defined_not_empty:function(e){return void 0!==e&&""!==e},init_date_picker:function(){$(".mo-optin-form-custom-field.date-field").each((function(){var e=(new Date).getFullYear(),t=150;new a({field:this,minDate:new Date(e-t,0),maxDate:new Date(e+t,0),yearRange:300,toString:function(e,t){var i=("0"+e.getDate()).slice(-2),n=("0"+(e.getMonth()+1)).slice(-2);return e.getFullYear()+"-"+n+"-"+i}})}))},init:function(){var e=this;e.track_page_views(),e.set_visitor_cookies(),$((function(){e.eventSubscription(),e.mailoptin_jq_plugin(),e.is_scheduled_for_display(),e.initOptinForms(),e.optin_conversion(),e.init_date_picker(),$(document.body).trigger("mo-mailoptinjs-loaded")}))}};!function(){var e={open:function(e){e=$.extend({},$.MoModalBox.defaults,e);var i=this,n=this.attr("id"),o=n+"_lightbox";i.trigger($.MoModalBox.BEFORE_OPEN,[i,e]),i.addClass("moModal"),i.show();var a=$(window).height(),s=$("#"+o+"_container"),r=s.outerHeight(!0);if("iconClose"in e&&!0===e.iconClose&&(r+=15),r>=a)s.css({top:10});else{var c=(a-r)/2;s.css({top:c})}if($(window).on("resize",(function(){var e=$(window).height(),t=$("#"+o+"_container"),i=t.outerHeight(!0);if(i>=e)t.css({top:10});else{var n=(e-i)/2;t.css({top:n})}})),"iconClose"in e&&!0===e.iconClose){var l=$(''+e.closeText+"");i.find(".mo-optin-form-wrapper").append(l)}if(e.keyClose&&$(document).on("keyup.moModal",t),e.bodyClose){var d=$("#"+n+".mo-optin-form-lightbox");d.on("click",(function(e){e.target==d.get(0)&&$.MoModalBox.close()}))}$.MoModalBox.isActive=!0,e.onOpen.call(this),i.data("closeFun",e.onClose),i.trigger($.MoModalBox.OPEN,[i,e])},close:function(){var e=this;e.hasClass("moModal")&&(e.trigger($.MoModalBox.BEFORE_CLOSE,[e]),e.fadeOut(400,(function(){void 0!==(e=$(this)).data&&void 0!==e.data("closeFun")&&void 0!==e.data("closeFun").call&&e.data("closeFun").call(this),e.removeData("closeFun").removeClass("moModal"),e.trigger($.MoModalBox.CLOSE,[e]),0===$(".moModal").length&&($(".mo-optin-form-lightbox").hide(),$(document).off("keyup.moModal")),$.MoModalBox.isActive=!1,e.trigger($.MoModalBox.AFTER_CLOSE,[e])})))}};$.fn.MoModalBox=function(t,i){return $.MoModalBox.isActive||(e[t]?e[t].call(this,i):"object"!=typeof t&&t||e.open.call(this,t)),this},$.MoModalBox={},$.MoModalBox.defaults={overlay:!0,iconClose:!0,closeClass:"",closeText:"Close",keyClose:!0,bodyClose:!0,onOpen:function(){},onClose:function(){}},$.MoModalBox.close=function(){e.close.call($(".moModal"))};var t=function(e){27==e.keyCode&&$.MoModalBox.close()},i=function(e){e.preventDefault(),$.MoModalBox.close()};$.MoModalBox.BEFORE_OPEN="moOptin:before-open",$.MoModalBox.OPEN="moOptin:open",$.MoModalBox.BEFORE_CLOSE="moOptin:before-close",$.MoModalBox.CLOSE="moOptin:close",$.MoModalBox.AFTER_CLOSE="moOptin:after-close",$(document).on("click.moOptin",'a[rel~="moOptin:close"]',i),$(document).on("click.moOptin",".mo-close-optin",i)}(),function(){var e;function t(t){t.clientY>20||(e&&clearTimeout(e),e=setTimeout((function(){e=null,$.event.trigger("moExitIntent")}),300))}function i(){e&&(clearTimeout(e),e=null)}$.moExitIntent=function(e){"enable"===e?($(window).on("mouseleave.moOptin",t),$(window).on("mouseenter.moOptin",i)):"disable"===e&&(i(),$(window).off("mouseleave.moOptin",t),$(window).off("mouseenter.moOptin",i))}}(),function(){var e,t,i,n;function o(){e=$(window).height(),t=$(document).height(),i=t-e}$(window).on("resize",(function(){o()})),$.moScrollTrigger=function(e){"enable"===e&&(o(),$(window).on("scroll",(function(){clearTimeout(n),n=setTimeout((function(){var e,t;e=$(window).scrollTop(),t=Math.floor(e/i*100),$.event.trigger("moScrollTrigger",[t])}),50)})))}}(),$(document.body).on("mo_validate_optin_form_fields",(function(e,t,i,n){var o=$("#"+i).find(".mo-mailchimp-interest-choice");if(0!==o.length&&!1!==n.mailchimp_segment_required){var a=!1;return o.each((function(){this.checked&&(a=!0)})),!1===a?(t.display_optin_error.call(void 0,i,n.mailchimp_segment_required_error),!1):void 0}})),window.moFormRecaptchaLoadCallback=function(){$(".mo-g-recaptcha").each((function(e,t){var i=$(t).attr("data-sitekey");if("v3"===$(t).attr("data-type")){var n=$(this).parents("form.mo-optin-form");n.find("input.mo-optin-form-submit-button").on("click",(function(e){e.preventDefault(),grecaptcha.ready((function(){grecaptcha.execute(i,{action:"form"}).then((function(e){n.find('[name="g-recaptcha-response"]').remove(),n.append($("",{type:"hidden",value:e,name:"g-recaptcha-response"})),n.submit()}))}))}))}else grecaptcha.render(t,{sitekey:i,theme:$(t).attr("data-theme"),size:$(t).attr("data-size")})}))},s.init()}(jQuery,mailoptin_globals);; /*! jQuery UI - v1.13.2 - 2022-07-14 * http://jqueryui.com * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ !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.2", /*! * jQuery UI :data 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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])}}), /*! * jQuery UI Disable Selection 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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")}}), /*! * jQuery UI Focusable 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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)}, /*! * jQuery UI Form Reset Mixin 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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()), /*! * jQuery UI Support for jQuery core 1.8.x and newer 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * */ 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})}}), /*! * jQuery UI Keycode 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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}, /*! * jQuery UI Labels 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ 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
")).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.widthW(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;e.collisionWidth>n?0o?0",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',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.csstransforms=function(){return!!F("transform")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,e.prefixed=function(a,b,c){return b?F(a,b,c):F(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document); ; !function(t){"function"==typeof define&&define.amd?define(["jquery","modernizr"],t):t(window.jQuery,window.Modernizr)}(function(t,i,e){"use strict";if("object"!=typeof i)throw new Error("Shuffle.js requires Modernizr.\nhttp://vestride.github.io/Shuffle/#dependencies");var s,n=i.prefixed("transition"),r=i.prefixed("transitionDelay"),o=i.prefixed("transitionDuration"),a={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[n],l=i.prefixed("transform"),h=(s=l)?s.replace(/([A-Z])/g,function(t,i){return"-"+i.toLowerCase()}).replace(/^ms-/,"-ms-"):"",u=i.csstransforms&&i.csstransitions,f=i.csstransforms3d;var d=0,c=function(i,e){e=e||{},t.extend(this,c.options,e,c.settings),this.$el=t(i),this.$window=t(window),this.unique="shuffle_"+d++,this._fire(c.EventType.LOADING),this._init(),setTimeout(t.proxy(function(){this.initialized=!0,this._fire(c.EventType.DONE)},this),16)};return c.EventType={LOADING:"loading",DONE:"done",SHRINK:"shrink",SHRUNK:"shrunk",FILTER:"filter",FILTERED:"filtered",SORTED:"sorted",LAYOUT:"layout",REMOVED:"removed"},c.prototype={_init:function(){var i,e,s=this,r=t.proxy(s._onResize,s),o=s.throttle?s.throttle(r,s.throttleTime):r,a=s.initialSort?s.initialSort:null;s._layoutList=[],s._shrinkList=[],s._setVars(),s._resetCols(),s._addClasses(),s._initItems(),s.$window.on("resize.shuffle."+s.unique,o),i=s.$el.css(["paddingLeft","paddingRight","position"]),e=s._getOuterWidth(s.$el[0]),"static"===i.position&&(s.$el[0].style.position="relative"),s.offset={left:parseInt(i.paddingLeft,10)||0,top:parseInt(i.paddingTop,10)||0},s._setColumns(parseInt(e,10)),s.shuffle(s.group,a),s.supported&&setTimeout(function(){s._setTransitions(),s.$el[0].style[n]="height "+s.speed+"ms "+s.easing},0)},_addClasses:function(){this.$el.addClass("shuffle"),this.$items.addClass("shuffle-item filtered")},_setVars:function(){var i=this.columnWidth;this.$items=this._getItems(),0===i&&null!==this.sizer&&(i=this.sizer),"string"==typeof i?this.$sizer=this.$el.find(i):i&&i.nodeType&&1===i.nodeType?this.$sizer=t(i):i&&i.jquery&&(this.$sizer=i),this.$sizer&&this.$sizer.length&&(this.useSizer=!0,this.sizer=this.$sizer[0])},_filter:function(i,s){var n=this,r=s!==e?s:n.$items,o=t();return i=i||n.lastFilter,n._fire(c.EventType.FILTER),t.isFunction(i)?r.each(function(){var e=t(this);i.call(e[0],e,n)&&(o=o.add(e))}):(n.group=i,"all"===i?o=r:r.each(function(){var e=t(this),s=e.data("groups"),r=n.delimeter&&!t.isArray(s)?s.split(n.delimeter):s;t.inArray(i,r)>-1&&(o=o.add(e))})),n._toggleFilterClasses(r,o),r=null,s=null,o},_toggleFilterClasses:function(i,e){i.filter(e).each(function(){var i=t(this);i.hasClass("concealed")&&i.removeClass("concealed"),i.hasClass("filtered")||i.addClass("filtered")}),i.not(e).each(function(){var i=t(this);i.hasClass("concealed")||i.addClass("concealed"),i.hasClass("filtered")&&i.removeClass("filtered")})},_initItems:function(t){(t=t||this.$items).css(this.itemCss).data("position",{x:0,y:0})},_updateItemCount:function(){this.visibleItems=this.$items.filter(".filtered").length},_setTransition:function(t){t.style[n]=h+" "+this.speed+"ms "+this.easing},_setTransitions:function(t){var i=this;(t=t||i.$items).each(function(){i._setTransition(this)})},_setSequentialDelay:function(i){var e=this;e.supported&&t.each(i,function(i,s){s.style[r]="0ms,"+(i+1)*e.sequentialFadeDelay+"ms",t(s).on(a+"."+e.unique,function(i){var s=i.currentTarget;s===i.target&&(s.style[r]="0ms",t(s).off(a+"."+e.unique))})})},_getItems:function(){return this.$el.children(this.itemSelector)},_getPreciseDimension:function(i,e){var s;return s=window.getComputedStyle?window.getComputedStyle(i,null)[e]:t(i).css(e),parseFloat(s)},_getOuterWidth:function(i,e){var s=i.offsetWidth;if(e){var n=t(i).css(["marginLeft","marginRight"]);s+=(parseFloat(n.marginLeft)||0)+(parseFloat(n.marginRight)||0)}return s},_getOuterHeight:function(i,e){var s=i.offsetHeight;if(e){var n=t(i).css(["marginTop","marginBottom"]);s+=(parseFloat(n.marginTop)||0)+(parseFloat(n.marginBottom)||0)}return s},_getColumnSize:function(i,e){var s;return 0===(s=t.isFunction(this.columnWidth)?this.columnWidth(e):this.useSizer?this._getPreciseDimension(this.sizer,"width"):this.columnWidth?this.columnWidth:this.$items.length>0?this._getOuterWidth(this.$items[0],!0):e)&&(s=e),s+i},_getGutterSize:function(i){return t.isFunction(this.gutterWidth)?this.gutterWidth(i):this.useSizer?this._getPreciseDimension(this.sizer,"marginLeft"):this.gutterWidth},_setColumns:function(t){var i=t||this._getOuterWidth(this.$el[0]),e=this._getGutterSize(i),s=this._getColumnSize(e,i),n=(i+e)/s;Math.abs(Math.round(n)-n)<.03&&(n=Math.round(n)),this.cols=Math.max(Math.floor(n),1),this.containerWidth=i,this.colWidth=s},_setContainerSize:function(){this.$el.css("height",Math.max.apply(Math,this.colYs))},_fire:function(t,i){this.$el.trigger(t+".shuffle",i&&i.length?i:[this])},_layout:function(i,e,s){var n=this;e=e||n._filterEnd,t.each(i,function(i,r){var o=t(r),a=o.data(),l=a.position,h=n._getItemPosition(o);if(o.data("position",h),h.x!==l.x||h.y!==l.y||1!==a.scale){var u={$item:o,x:h.x,y:h.y,scale:1};s?(u.skipTransition=!0,u.opacity=0):(u.opacity=1,u.callback=e),n.styleQueue.push(u),n._layoutList.push(o[0])}}),n._processStyleQueue(),n._setContainerSize()},_resetCols:function(){var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0)},_reLayout:function(){this._resetCols(),this.lastSort?this.sort(this.lastSort,!0):this._layout(this.$items.filter(".filtered").get(),this._filterEnd)},_getItemPosition:function(t){var i=this._getOuterWidth(t[0],!0)/this.colWidth;Math.abs(Math.round(i)-i)<.03&&(i=Math.round(i));var e=Math.min(Math.ceil(i),this.cols);if(1===e)return this._placeItem(t,this.colYs);var s,n,r=this.cols+1-e,o=[];for(n=0;n=e-this.buffer&&i[n]<=e+this.buffer){s=n;break}var o={x:Math.round(this.colWidth*s+this.offset.left),y:Math.round(e+this.offset.top)},a=e+this._getOuterHeight(t[0],!0),l=this.cols+1-r;for(n=0;n0&&t.inArray(e,this._layoutList)>-1?(this._fire(c.EventType.LAYOUT),i.call(this),this._layoutList.length=0):this._shrinkList.length>0&&t.inArray(e,this._shrinkList)>-1&&(i.call(this),this._shrinkList.length=0),s||(e.style.visibility="hidden")},_processStyleQueue:function(){var i=this;t.each(this.styleQueue,function(t,e){e.skipTransition?i._skipTransition(e.$item[0],function(){e.$item.css(i._getStylesForTransition(e))}):i._transition(e)}),i.styleQueue.length=0},_shrinkEnd:function(){this._fire(c.EventType.SHRUNK)},_filterEnd:function(){this._fire(c.EventType.FILTERED)},_sortEnd:function(){this._fire(c.EventType.SORTED)},_skipTransition:function(i,e,s){var n=i.style[o];i.style[o]="0ms",t.isFunction(e)?e():i.style[e]=s;i.offsetWidth;i.style[o]=n},_addItems:function(t,i,s){this.supported||(i=!1),t.addClass("shuffle-item"),this._initItems(t),this._setTransitions(t),this.$items=this._getItems(),t.css("opacity",0);var n=this._filter(e,t),r=n.get();this._updateItemCount(),i?(this._layout(r,null,!0),s&&this._setSequentialDelay(n),this._revealAppended(n)):this._layout(r)},_revealAppended:function(i){var e=this;setTimeout(function(){i.each(function(i,s){e._transition({$item:t(s),opacity:1,scale:1})})},e.revealAppendedDelay)},shuffle:function(t,i){this.enabled&&(t||(t="all"),this._filter(t),this.lastFilter=t,this._updateItemCount(),this._shrink(),i&&(this.lastSort=i),this._reLayout())},sort:function(t,i){var e=this,s=e.$items.filter(".filtered").sorted(t);i||e._resetCols(),e._layout(s,function(){i&&e._filterEnd(),e._sortEnd()}),e.lastSort=t},resized:function(t){this.enabled&&(t||this._setColumns(),this._reLayout())},layout:function(){this.update(!0)},update:function(t){this.resized(t)},appended:function(t,i,e){i=!1!==i,e=!1!==e,this._addItems(t,i,e)},disable:function(){this.enabled=!1},enable:function(t){this.enabled=!0,!1!==t&&this.update()},remove:function(t){if(t.length&&t.jquery){return this._shrink(t,function(){var i=this;t.remove(),setTimeout(function(){i.$items=i._getItems(),i.layout(),i._updateItemCount(),i._fire(c.EventType.REMOVED,[t,i]),t=null},0)}),this._processStyleQueue(),this}},destroy:function(){this.$window.off("."+this.unique),this.$el.removeClass("shuffle").removeAttr("style").removeData("shuffle"),this.$items.removeAttr("style").removeClass("concealed filtered shuffle-item"),this.$window=null,this.$items=null,this.$el=null,this.$sizer=null,this.sizer=null,this.destroyed=!0}},c.options={group:"all",speed:250,easing:"ease-out",itemSelector:"",sizer:null,gutterWidth:0,columnWidth:0,delimeter:null,buffer:0,initialSort:null,throttle:function(i,e,s){var n,r,o,a=null,l=0;s=s||{};var h=function(){l=!1===s.leading?0:t.now(),a=null,o=i.apply(n,r),n=r=null};return function(){var u=t.now();l||!1!==s.leading||(l=u);var f=e-(u-l);return n=this,r=arguments,f<=0||f>e?(clearTimeout(a),a=null,l=u,o=i.apply(n,r),n=r=null):a||!1===s.trailing||(a=setTimeout(h,f)),o}},throttleTime:300,sequentialFadeDelay:150,supported:u},c.settings={$sizer:null,useSizer:!1,itemCss:{position:"absolute",top:0,left:0},offset:{top:0,left:0},revealAppendedDelay:300,enabled:!0,destroyed:!1,initialized:!1,styleQueue:[]},t.fn.shuffle=function(i){var e=Array.prototype.slice.call(arguments,1);return this.each(function(){var s=t(this),n=s.data("shuffle");n||(n=new c(s,i),s.data("shuffle",n)),"string"==typeof i&&n[i]&&n[i].apply(n,e)})},t.fn.sorted=function(i){var s=t.extend({},t.fn.sorted.defaults,i),n=this.get(),r=!1;return n.length?s.randomize?t.fn.sorted.randomize(n):(s.by!==t.noop&&null!==s.by&&s.by!==e&&n.sort(function(i,n){if(r)return 0;var o=s.by(t(i)),a=s.by(t(n));return o===e&&a===e?(r=!0,0):"sortFirst"===o||"sortLast"===a?-1:"sortLast"===o||"sortFirst"===a?1:oa?1:0}),r?this.get():(s.reverse&&n.reverse(),n)):[]},t.fn.sorted.defaults={reverse:!1,by:null,randomize:!1},t.fn.sorted.randomize=function(t){var i,e,s=t.length;if(!s)return t;for(;--s;)i=t[e=Math.floor(Math.random()*(s+1))],t[e]=t[s],t[s]=i;return t},c});; window.Manipulator=function(e){"use strict";var t=window.console&&typeof window.console.log==="function";var n=function(t){var n=this;n.$el=e(t);n.init()};n.prototype.init=function(){var e=this;e.initShuffle();e.setupEvents()};n.prototype.initShuffle=function(){this.$el.shuffle({itemSelector:".shuffeldiv",speed:250,easing:"ease",columnWidth:function(t){return parseInt(e(".shuffeldiv").css("width"))},gutterWidth:function(t){return parseInt(e(".shuffeldiv").css("margin-left"))}});this.shuffle=this.$el.data("shuffle")};n.prototype.setupEvents=function(){var n=this;e("#sfsi_wDiv").on("click",e.proxy(n.onRandomize,n));n.$el.on("removed.shuffle",function(e,n,r){if(!t){return}})};n.prototype.onAddClick=function(){var t=this,n=5,r=document.createDocumentFragment(),i=t.$el[0],s=[],o,u=["w2","h2","w3"],a,f,l,c;for(f=0;f.8){c=Math.floor(Math.random()*3);a.className=a.className+" "+u[c]}s.push(a);r.appendChild(a)}i.appendChild(r);o=e(s);t.shuffle.appended(o)};n.prototype.getRandomInt=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};n.prototype.onRemoveClick=function(){var t=this,n=t.shuffle.visibleItems,r=Math.min(3,n),i=[],s=0,o=e();if(!n){return}for(;s." + t).html(i), SFSI(".tab" + e + ">." + t).show(), SFSI(".tab" + e + ">." + t).effect("highlight", {}, 5e3), setTimeout(function () { SFSI("." + t).slideUp("slow"); }, 5e3), !1; } function beForeLoad() { SFSI(".loader-img").show(), SFSI(".save_button >a").html("Saving..."), SFSI(".save_button >a").css("pointer-events", "none"); } function sfsi_make_popBox() { var s = 0; SFSI(".sfsi_sample_icons >li").each(function () { "none" != SFSI(this).css("display") && (s = 1); }), 0 == s ? SFSI(".sfsi_Popinner").hide() : SFSI(".sfsi_Popinner").show(), "" != SFSI('input[name="sfsi_popup_text"]').val() ? (SFSI(".sfsi_Popinner >h2").html(SFSI('input[name="sfsi_popup_text"]').val()), SFSI(".sfsi_Popinner >h2").show()) : SFSI(".sfsi_Popinner >h2").hide(), SFSI(".sfsi_Popinner").css({ "border-color": SFSI('input[name="sfsi_popup_border_color"]').val(), "border-width": SFSI('input[name="sfsi_popup_border_thickness"]').val(), "border-style": "solid" }), SFSI(".sfsi_Popinner").css("background-color", SFSI('input[name="sfsi_popup_background_color"]').val()), SFSI(".sfsi_Popinner h2").css("font-family", SFSI("#sfsi_popup_font").val()), SFSI(".sfsi_Popinner h2").css("font-style", SFSI("#sfsi_popup_fontStyle").val()), SFSI(".sfsi_Popinner >h2").css("font-size", parseInt(SFSI('input[name="sfsi_popup_fontSize"]').val())), SFSI(".sfsi_Popinner >h2").css("color", SFSI('input[name="sfsi_popup_fontColor"]').val() + " !important"), "yes" == SFSI('input[name="sfsi_popup_border_shadow"]:checked').val() ? SFSI(".sfsi_Popinner").css("box-shadow", "12px 30px 18px #CCCCCC") : SFSI(".sfsi_Popinner").css("box-shadow", "none"); } function sfsi_stick_widget(s) { 0 == initTop.length && (SFSI(".sfsi_widget").each(function (s) { initTop[s] = SFSI(this).position().top; })); var i = SFSI(window).scrollTop(), e = [], t = []; SFSI(".sfsi_widget").each(function (s) { e[s] = SFSI(this).position().top, t[s] = SFSI(this); }); var n = !1; for (var o in e) { var a = parseInt(o) + 1; e[o] < i && e[a] > i && a < e.length ? (SFSI(t[o]).css({ position: "fixed", top: s }), SFSI(t[a]).css({ position: "", top: initTop[a] }), n = !0) : SFSI(t[o]).css({ position: "", top: initTop[o] }); } if (!n) { var r = e.length - 1, c = -1; e.length > 1 && (c = e.length - 2), initTop[r] < i ? (SFSI(t[r]).css({ position: "fixed", top: s }), c >= 0 && SFSI(t[c]).css({ position: "", top: initTop[c] })) : (SFSI(t[r]).css({ position: "", top: initTop[r] }), c >= 0 && e[c] < i); } } function sfsi_float_widget(s) { function i() { r = "Microsoft Internet Explorer" === navigator.appName ? a - document.documentElement.scrollTop : a - window.pageYOffset, Math.abs(r) > 0 ? (window.removeEventListener("scroll", i), a -= r * o, SFSI("#sfsi_floater").css({ top: Math.round((a + t).toString()) + "px", transition: "all 0.6s ease 0s" }), setTimeout(i, n)) : window.addEventListener("scroll", i, !1); } function e() { var documentheight = SFSI("#sfsi_floater").attr("data-top"); var fltrhght = parseInt(SFSI("#sfsi_floater").height()); var fltrtp = parseInt(SFSI("#sfsi_floater").css("top")); if (parseInt(fltrhght) + parseInt(fltrtp) <= documentheight) { window.addEventListener("scroll", i, !1); } else { window.removeEventListener("scroll", i); SFSI("#sfsi_floater").css("top", documentheight + "px"); } } if ("center" == s) { var t = (SFSI(window).height() - SFSI("#sfsi_floater").height()) / 2; } else if ("bottom" == s) { var t = window.innerHeight - (SFSI("#sfsi_floater").height() + parseInt(SFSI('#sfsi_floater').css('margin-bottom'))); } else { var t = parseInt(s); } var n = 50, o = .1, a = 0, r = 0; SFSI("#sfsi_floater"); var prev_onscroll = window.onscroll; window.onscroll = function () { if ('function' === typeof prev_onload) { prev_onload(), e(); } else { e(); } } } function sfsi_shuffle() { var $ = window.jQuery; return SFSI('.sfsi_wDiv').each(function (index, container) { var s = []; s = SFSI(container).find(".sfsi_wicons "); s = Shuffle(s); SFSI(container).html(""); for (var i = 0; i < s.length; i++) { SFSI(s[i]).css('transform', 'none'); SFSI(s[i]).css('position', 'relative'); SFSI(container).append(s[i]); } }) } function Shuffle(s) { for (var i, e, t = s.length; t; i = parseInt(Math.random() * t), e = s[--t], s[t] = s[i], s[i] = e); return s } function sfsi_setCookie(s, i, e) { var t = new Date(); t.setTime(t.getTime() + 1e3 * 60 * 60 * 24 * e); var n = "expires=" + t.toGMTString(); document.cookie = s + "=" + i + "; " + n; } function sfsfi_getCookie(s) { for (var i = s + "=", e = document.cookie.split(";"), t = 0; t < e.length; t++) { var n = e[t].trim(); if (0 == n.indexOf(i)) return n.substring(i.length, n.length); } return ""; } function sfsi_hideFooter() { } window.onerror = function () { jQuery("#sfpageLoad").fadeOut(2e3); }, SFSI = jQuery, SFSI(window).on('load', function () { SFSI("#sfpageLoad").fadeOut(2e3); if (jQuery('#sfsi_tifm_scroll_value').val()) { jQuery('.sfsi_tifm_module_menu_block').click(); setTimeout(function () { document.querySelector('.sfsi_tifm_tab_module_block').scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }); }, 300); } }); var global_error = 0; SFSI(document).ready(function (s) { //changes done {Monad} //putting it before to make sure it registers before the mobile click function SFSI(document).on('click', '.inerCnt a[href=""]', function (event) { //check if not mobile if (!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) { event.preventDefault(); } }); SFSI("head").append(''), SFSI("head").append(''), SFSI("head").append(''), SFSI(document).click(function (s) { var i = SFSI(".sfsi_FrntInner"), e = SFSI(".sfsi_wDiv"), t = SFSI("#at15s"); i.is(s.target) || 0 !== i.has(s.target).length || e.is(s.target) || 0 !== e.has(s.target).length || t.is(s.target) || 0 !== t.has(s.target).length || i.fadeOut(); }), SFSI("div#sfsiid_linkedin").find(".icon4").find("a").find("img").mouseover(function () { SFSI(this).css("opacity", "0.9"); }), SFSI("div#sfsiid_linkedin").find(".icon4").find("a").find("img").mouseleave(function () { SFSI(this).css("opacity", "1"); }), SFSI("div#sfsiid_youtube").find(".icon1").find("a").find("img").mouseover(function () { SFSI(this).css("opacity", "0.9"); }), SFSI("div#sfsiid_youtube").find(".icon1").find("a").find("img").mouseleave(function () { SFSI(this).css("opacity", "1"); }), SFSI("div#sfsiid_facebook").find(".icon1").find("a").find("img").mouseover(function () { SFSI(this).css("opacity", "0.9"); }), SFSI("div#sfsiid_facebook").find(".icon1").find("a").find("img").mouseleave(function () { SFSI(this).css("opacity", "1"); /*{Monad}*/ }), SFSI("div#sfsiid_twitter").find(".cstmicon1").find("a").find("img").mouseover(function () { SFSI(this).css("opacity", "0.9"); }), SFSI("div#sfsiid_twitter").find(".cstmicon1").find("a").find("img").mouseleave(function () { SFSI(this).css("opacity", "1"); }), SFSI(".pop-up").on("click", function () { ("fbex-s2" == SFSI(this).attr("data-id") || "linkex-s2" == SFSI(this).attr("data-id")) && (SFSI("." + SFSI(this).attr("data-id")).hide(), SFSI("." + SFSI(this).attr("data-id")).css("opacity", "1"), SFSI("." + SFSI(this).attr("data-id")).css("z-index", "1000")), SFSI("." + SFSI(this).attr("data-id")).show("slow"); }), /*SFSI("#close_popup").live("click", function() {*/ SFSI(document).on("click", '#close_popup', function () { SFSI(".read-overlay").hide("slow"); }); var e = 0; sfsi_make_popBox(), SFSI('input[name="sfsi_popup_text"] ,input[name="sfsi_popup_background_color"],input[name="sfsi_popup_border_color"],input[name="sfsi_popup_border_thickness"],input[name="sfsi_popup_fontSize"],input[name="sfsi_popup_fontColor"]').on("keyup", sfsi_make_popBox), SFSI('input[name="sfsi_popup_text"] ,input[name="sfsi_popup_background_color"],input[name="sfsi_popup_border_color"],input[name="sfsi_popup_border_thickness"],input[name="sfsi_popup_fontSize"],input[name="sfsi_popup_fontColor"]').on("focus", sfsi_make_popBox), SFSI("#sfsi_popup_font ,#sfsi_popup_fontStyle").on("change", sfsi_make_popBox), /*SFSI(".radio").live("click", function() {*/ SFSI(document).on("click", '.radio', function () { var s = SFSI(this).parent().find("input:radio:first"); "sfsi_popup_border_shadow" == s.attr("name") && sfsi_make_popBox(); }), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? SFSI(document).on("click", 'img.sfsi_wicon', function (s) { /*console.log('document mouse click', s, s.target);*/ if (SFSI(s.target).parent().attr('href') == "") { s.preventDefault(); } if (!SFSI(this).hasClass('sfsi_click_wicon')) { s.stopPropagation && s.stopPropagation(); } var i = SFSI("#sfsi_floater_sec").val(); SFSI("div.sfsi_wicons").css("z-index", "0"), SFSI(this).parent().parent().parent().siblings("div.sfsi_wicons").find(".inerCnt").find("div.sfsi_tool_tip_2").hide(), SFSI(this).parent().parent().parent().parent().siblings("li").length > 0 && (SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_tool_tip_2").css("z-index", "0"), SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_wicons").find(".inerCnt").find("div.sfsi_tool_tip_2").hide()), SFSI(this).parent().parent().parent().css("z-index", "1000000"), SFSI(this).parent().parent().css({ "z-index": "999" }), SFSI(this).attr("data-effect") && "fade_in" == SFSI(this).attr("data-effect") && (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 10 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("data-effect") && "scale" == SFSI(this).attr("data-effect") && (SFSI(this).parent().addClass("scale"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 10 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("data-effect") && "combo" == SFSI(this).attr("data-effect") && (SFSI(this).parent().addClass("scale"), SFSI(this).parent().css("opacity", "1"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 10 })), ("top-left" == i || "top-right" == i || "center-top" == i) && SFSI(this).parent().parent().parent().parent("#sfsi_floater").length > 0 && "sfsi_floater" == SFSI(this).parent().parent().parent().parent().attr("id") ? (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").addClass("sfsi_plc_btm"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").find("span.bot_arow").addClass("top_big_arow"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 10, "bottom": "auto" }), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").show()) : (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").find("span.bot_arow").removeClass("top_big_arow"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").removeClass("sfsi_plc_btm"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e3 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").show()); }) : SFSI(document).on("mouseenter", "img.sfsi_wicon", function () { /*console.log('img mouseenter');*/ var s = SFSI("#sfsi_floater_sec").val(); //SFSI("div.sfsi_wicons").css("z-index", "0"), SFSI(this).parent().parent().parent().siblings("div.sfsi_wicons").find(".inerCnt").find("div.sfsi_tool_tip_2").hide(); SFSI(this).parent().parent().parent().parent().siblings("li").length > 0 && (SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_tool_tip_2").css("z-index", "0"), SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_wicons").find(".inerCnt").find("div.sfsi_tool_tip_2").hide()); // SFSI(this).parent().parent().parent().css("z-index", "1000000"); // SFSI(this).parent().parent().css({ "z-index": "999" }); SFSI(this).parent().css({ "opacity": "1" }); SFSI(this).attr("data-effect") && "fade_in" == SFSI(this).attr("data-effect") && (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e8 }), SFSI(this).parent().css("opacity", "1")); SFSI(this).attr("data-effect") && "scale" == SFSI(this).attr("data-effect") && (SFSI(this).parent().addClass("scale"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e8 }), SFSI(this).parent().css("opacity", "1")); SFSI(this).attr("data-effect") && "combo" == SFSI(this).attr("data-effect") && (SFSI(this).parent().addClass("scale"), SFSI(this).parent().css("opacity", "1"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e8 })); ("top-left" == s || "top-right" == s || "center-top" == s) && SFSI(this).parent().parent().parent().parent("#sfsi_floater").length > 0 && "sfsi_floater" == SFSI(this).parent().parent().parent().parent().attr("id") ? (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").addClass("sfsi_plc_btm"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").find("span.bot_arow").addClass("top_big_arow"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e8, "bottom": "auto" }), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").show()) : (SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").find("span.bot_arow").removeClass("top_big_arow"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").removeClass("sfsi_plc_btm"), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").css({ opacity: 1, "z-index": 1e8 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_tool_tip_2").show()); }); SFSI(document).on("mouseleave", "div.sfsi_wicons", function () { SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && "fade_in" == SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && SFSI(this).children("div.inerCnt").find("a.sficn").css("opacity", "0.6"), SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && "scale" == SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && SFSI(this).children("div.inerCnt").find("a.sficn").removeClass("scale"), SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && "combo" == SFSI(this).children("div.inerCnt").children("a.sficn").attr("data-effect") && SFSI(this).children("div.inerCnt").find("a.sficn").removeClass("scale").css("opacity", "0.6"), SFSI(this).parent("div").find("div.sfsi_tool_tip_2").css("display", "none"), SFSI(this).parent("div").find("div.sfsi_tool_tip_2").css("opacity", "0"); }); SFSI(document).on("mouseenter", "div.sfsi_tool_tip_2", function () { SFSI(this).find("div.sfsi_tool_tip_2").css({ "z-index": 1e8, "opacity": 1 }); }); SFSI("body").on("click", function (e) { var target = SFSI(e.target); if (!target.is(".sfsi_wicon")) { SFSI(".inerCnt").find("div.sfsi_tool_tip_2").hide(); } }); SFSI(".adminTooltip >a").on("hover", function () { SFSI(this).offset().top, SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").css("opacity", "1"), SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").show(); }); SFSI(".adminTooltip").on("mouseleave", function () { "none" != SFSI(".gpls_tool_bdr").css("display") && 0 != SFSI(".gpls_tool_bdr").css("opacity") ? SFSI(".pop_up_box ").on("click", function () { SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").css("opacity", "0"), SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").hide(); }) : (SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").css("opacity", "0"), SFSI(this).parent("div").find("div.sfsi_tool_tip_2_inr").hide()); }); SFSI(".expand-area").on("click", function () { "Read more" == SFSI(this).text() ? (SFSI(this).siblings("p").children("label").fadeIn("slow"), SFSI(this).text("Collapse")) : (SFSI(this).siblings("p").children("label").fadeOut("slow"), SFSI(this).text("Read more")); }); SFSI(".sfsi_wDiv").length > 0 && setTimeout(function () { var s = parseInt(SFSI(".sfsi_wDiv").height()) + 15 + "px"; SFSI(".sfsi_holders").each(function () { SFSI(this).css("height", s); SFSI(".sfsi_widget"); }); }, 200); /* Admin forum notification */ SFSI('.usm-widget__footer-text-link').on('click', function () { SFSI(this).parents('.usm-widget').toggle('usm-widget--open'); SFSI.ajax({ type: "post", dataType: "json", url: sfsi_icon_ajax_object.ajax_url, data: { nonce: sfsi_icon_ajax_object.nonce, action: "sfsi_hide_admin_forum_notification" }, success: function () { SFSI('.usm-widget').remove(); } }); }); /* Hide Admin forum notification popup */ SFSI('.usm-widget__toggle-btn').on('click', function () { var currentThis = SFSI(this); currentThis.parents('.usm-widget').toggleClass('usm-widget--open'); var toggleStatus = ''; if (currentThis.parents('.usm-widget').hasClass('usm-widget--open')) { toggleStatus = 'hide'; } else { toggleStatus = 'show'; } SFSI.ajax({ type: "post", dataType: "json", url: sfsi_icon_ajax_object.ajax_url, data: { action: "sfsi_default_hide_admin_notification", status: toggleStatus, nonce: sfsi_icon_ajax_object.unonce }, success: function () { currentThis.addClass('sfsi-first-click-enabled'); } }); }); }); //hiding popup on close button function sfsihidemepopup() { SFSI(".sfsi_FrntInner_chg").fadeOut(); } var initTop = new Array(); function close_overlay(selector) { if (typeof selector === "undefined") { selector = '.sfsi_overlay'; } jQuery(selector).removeClass('show').addClass('hide').hide(); } function sfsi_wechat_share(url) { if (jQuery('.sfsi_wechat_follow_overlay').length == 0) { jQuery('body').append("
×
\"Scan QR Code\" in WeChat and press ··· to share!
"); new QRCode(jQuery('.sfsi_wechat_follow_overlay .sfsi_wechat_qr_display')[0], encodeURI(decodeURI(window.location.href))) jQuery('.sfsi_wechat_follow_overlay .sfsi_wechat_qr_display img').attr('nopin', 'nopin') } else { jQuery('.sfsi_wechat_follow_overlay').removeClass('hide').addClass('show').show(); } } function sfsi_mobile_wechat_share(url) { if (jQuery('.sfsi_wechat_follow_overlay').length == 0) { jQuery('body').append("
"); } else { jQuery('.sfsi_wechat_scan').removeClass('hide').addClass('show'); } } function sfsi_copy_text_parent_input(event) { var target = jQuery(event.target); /*console.log(target);*/ input_target = target.parent().parent().parent().find('input'); input_target.select(); document.execCommand('copy'); } function sfsi_responsive_toggle() { jQuery(document).scroll(function ($) { var y = jQuery(this).scrollTop(); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { if (jQuery(window).scrollTop() + jQuery(window).height() >= jQuery(document).height() - 100) { jQuery('.sfsi_outr_div').css({ 'z-index': '9996', opacity: 1, top: jQuery(window).scrollTop() + "px", position: "absolute" }); jQuery('.sfsi_outr_div').fadeIn(200); jQuery('.sfsi_FrntInner_chg').fadeIn(200); } else { jQuery('.sfsi_outr_div').fadeOut(); jQuery('.sfsi_FrntInner_chg').fadeOut(); } } else { if (jQuery(window).scrollTop() + jQuery(window).height() >= jQuery(document).height() - 3) { jQuery('.sfsi_outr_div').css({ 'z-index': '9996', opacity: 1, top: jQuery(window).scrollTop() + 200 + "px", position: "absolute" }); jQuery('.sfsi_outr_div').fadeIn(200); jQuery('.sfsi_FrntInner_chg').fadeIn(200); } else { jQuery('.sfsi_outr_div').fadeOut(); jQuery('.sfsi_FrntInner_chg').fadeOut(); } } }); } function createCookie(name, value, expires, path, domain) { var cookie = name + "=" + escape(value) + ";"; if (expires) { // If it's a date if (expires instanceof Date) { // If it isn't a valid date if (isNaN(expires.getTime())) expires = new Date(); } else expires = new Date(new Date().getTime() + parseInt(expires) * 1000 * 60 * 60 * 24); cookie += "expires=" + expires.toGMTString() + ";"; } if (path) cookie += "path=" + path + ";"; if (domain) cookie += "domain=" + domain + ";"; document.cookie = cookie; } function sfsi_time_pop_up(time_popUp) { jQuery(document).ready(function ($) { try { // Check if cookie exists if (document.cookie.indexOf('sfsi_popup') !== -1) { return; } // If it doesn't exist, create it createCookie('sfsi_popup', new Date.getTime(), 30, '/'); } catch (Exception) { // Do nothing } setTimeout(function () { jQuery('.sfsi_outr_div').css({ 'z-index': '1000000', opacity: 1 }); jQuery('.sfsi_outr_div').fadeIn(200); jQuery('.sfsi_FrntInner_chg').fadeIn(200); }, time_popUp); }); } function sfsi_social_pop_up(time_popUp) { jQuery(document).ready(function ($) { //jQuery('.sfsi_outr_div').fadeIn(); try { // Check if cookie exists if (document.cookie.indexOf('sfsi_socialPopUp') !== -1) { return; } // If it doesn't sfsi_socialPopUp, create it createCookie('sfsi_popup', new Date.getTime(), 30, '/'); } catch (Exception) { // Do nothing } setTimeout(function () { jQuery('.sfsi_outr_div').css({ 'z-index': '1000000', opacity: 1 }); jQuery('.sfsi_outr_div').fadeIn(); }, time_popUp); }); } function sfsi_plugin_version(pluginVersion) { jQuery(document).ready(function (e) { jQuery("body").addClass("sfsi_" + pluginVersion) }); } function sfsi_widget_set() { jQuery(".sfsi_widget").each(function (index) { if (jQuery(this).attr("data-position") == "widget") { var wdgt_hght = jQuery(this).children(".norm_row.sfsi_wDiv").height(); var title_hght = jQuery(this).parent(".widget.sfsi").children(".widget-title").height(); var totl_hght = parseInt(title_hght) + parseInt(wdgt_hght); jQuery(this).parent(".widget.sfsi").css("min-height", totl_hght + "px"); /*console.log('widget');*/ } }); } SFSI(window).on('load', function () { SFSI('.sfsi_pinterest_sm_click').on('click touchstart', function () { sfsi_pinterest_modal_images(e); }); }); function sfsi_pinterest_modal_images(event, url, title) { /*console.log(event);*/ event && event.preventDefault(); var imgSrc = []; var page_title; page_title = SFSI('meta[property="og:title"]').attr('content'); if (undefined == page_title) { page_title = SFSI('head title').text(); } if (undefined == title) { title = page_title; } if (undefined == url) { url = window.location.href; // url = encodeURIComponent(window.location.href); } SFSI('body img').each(function (index) { var src = SFSI(this).attr('src') || ""; var height = SFSI(this).height(); var width = SFSI(this).width(); var image_title = SFSI(this).attr('title') || ""; var alt = SFSI(this).attr('alt') || ""; var no_pin = SFSI(this).attr('data-pin-nopin') || ""; var no_pin_old = SFSI(this).attr('nopin') || ""; if (src !== "" && !src.startsWith("javascript") && height > 100 && width > 100 && no_pin_old !== "nopin" && no_pin !== "true") { imgSrc.push({ src: src, title: title && "" !== title ? title : (image_title && "" !== image_title ? image_title : alt) }); } }); sfsi_pinterest_modal(); if (imgSrc.length == 0) { var meta_img = SFSI('meta[property="og:image"]').attr('content'); if (undefined == meta_img) { meta_img = ""; } SFSI('.sfsi_flex_container').append('
') } else { SFSI.each(imgSrc, function (index, val) { SFSI('.sfsi_flex_container').append('
'); }); } event.preventDefault(); } function sfsi_pinterest_modal(imgs) { // if (jQuery('.sfsi_premium_wechat_follow_overlay').length == 0) { jQuery('body').append( "
" + "
" + '×' + "
" + "

Pin It on Pinterest

" + "
" + "
" + "
" + "
" + "
" ); } // should execute at last so that every function is acceptable in body. var sfsi_functions_loaded = new CustomEvent('sfsi_functions_loaded', { detail: { "abc": "def" } }); window.dispatchEvent(sfsi_functions_loaded); /* Copy link */ function sfsi_copyLink(str) { try { const el = document.createElement('textarea'); el.value = str; el.setAttribute('readonly', ''); el.style.position = 'absolute'; el.style.left = '-9999px'; document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); // Confirmation of copy success e.g. alert or notification return true; } catch (e) { console.log(e); // Rejection notice of copy faliure e.g. alert or notification return false; } } document.querySelectorAll('a.sfsi_copylink').forEach(function (anchor) { anchor.addEventListener('click', function (e) { e.preventDefault(); sfsi_copyLink(window.location.href); }); }); ; jQuery(document).ready(function(){var t=!1;void 0!==eztoc_smooth_local.JumpJsLinks&&1===parseInt(eztoc_smooth_local.JumpJsLinks)&&(t=!0),document.querySelectorAll(".ez-toc-link").forEach(t=>{t=t.replaceWith(t.cloneNode(!0))}),document.querySelectorAll(".ez-toc-section").forEach(t=>{t.setAttribute("ez-toc-data-id","#"+decodeURI(t.getAttribute("id")))}),jQuery("a.ez-toc-link").click(function(){let e=jQuery(this).attr("data-href"),i=jQuery(this).attr("href");if(1===parseInt(eztoc_smooth_local.add_request_uri)){if(jQuery(this).attr("data-href")){let r=jQuery(this).attr("data-href").split("#");r&&r.length>1&&(e=`#${r[1]}`)}if(jQuery(this).attr("href")){let a=jQuery(this).attr("href").split("#");a&&a.length>1&&(i=`#${a[1]}`)}}let l=t?e:i,o=jQuery("#wpadminbar"),s=jQuery("header"),h=0;if(parseInt(eztoc_smooth_local.scroll_offset)>30&&(h=parseInt(eztoc_smooth_local.scroll_offset)),o.length&&(h+=o.height()),(s.length&&"fixed"==s.css("position")||"sticky"==s.css("position"))&&(h+=s.height()),jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').length>0&&(h=jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').offset().top-h),jQuery("html, body").animate({scrollTop:h},500),t)return!1})});; /*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ !function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i");u=function(){var J,L,K;if(z){return;}I=p.height();J=parseInt(w.css("border-top-width"),10);L=parseInt(w.css("padding-top"),10); G=parseInt(w.css("padding-bottom"),10);q=w.offset().top+J+L;i=w.height();if(r){r=false;D=false;if(f==null){t.insertAfter(v);v.detach();}t.css({position:"",top:"",width:"",bottom:""}).removeClass(g); K=true;}B=t.offset().top-(parseInt(t.css("margin-top"),10)||0)-l;C=t.outerHeight(true);y=t.css("float");if(v){v.css({width:t.outerWidth(true),height:C,display:t.css("display"),"vertical-align":t.css("vertical-align"),"float":y}); }if(K){return E();}};u();if(C===i){return;}F=void 0;s=l;A=c;E=function(){var L,O,M,K,J,N;if(z){return;}M=false;if(A!=null){A-=1;if(A<=0){A=c;u();M=true; }}if(!M&&p.height()!==I){u();M=true;}K=b.scrollTop();if(F!=null){O=K-F;}F=K;if(r){if(o){J=K+C+s>i+q;if(D&&!J){D=false;t.css({position:"fixed",bottom:"",top:s}).trigger("sticky_kit:unbottom"); }}if(KN){if(!D){s-=O;s=Math.max(N-C,s);s=Math.min(l,s);if(r){t.css({top:s+"px"});}}}}}else{if(K>B){r=true;L={position:"fixed",top:s}; L.width=t.css("box-sizing")==="border-box"?t.outerWidth()+"px":t.width()+"px";t.css(L).addClass(g);if(f==null){t.after(v);if(y==="left"||y==="right"){v.append(t); }}t.trigger("sticky_kit:stick");}}if(r&&o){if(J==null){J=K+C+s>i+q;}if(!D&&J){D=true;if(w.css("position")==="static"){w.css({position:"relative"});}return t.css({position:"absolute",bottom:G,top:"auto"}).trigger("sticky_kit:bottom"); }}};x=function(){u();return E();};H=function(){z=true;b.off("touchmove",E);b.off("scroll",E);b.off("resize",x);a(document.body).off("sticky_kit:recalc",x); t.off("sticky_kit:detach",H);t.removeData("sticky_kit");t.css({position:"",bottom:"",top:"",width:""});w.position("position","");if(r){if(f==null){if(y==="left"||y==="right"){t.insertAfter(v); }v.remove();}return t.removeClass(g);}};b.on("touchmove",E);b.on("scroll",E);b.on("resize",x);a(document.body).on("sticky_kit:recalc",x);t.on("sticky_kit:detach",H); return setTimeout(E,0);};for(j=0,k=this.length;j0&&o'+i+"");var n=e("#ez-toc-height-test"),c=n.height();return n.remove(),c-(o.children("ul").first().height()||0)}(t);!function(t){e(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",t+"px")}(o)}(o)}(o)}}n.length>0&&e(".ez-toc-widget-container").length&&e(window).on("load resize scroll",l)}e("#ez-toc-container").length&&(e("#ez-toc-container .ez-toc-toggle label span").html()||e("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon)),ezTOC.init=function(){t()},t(),void 0!==ezTOC.ajax_toggle&&1===parseInt(ezTOC.ajax_toggle)&&e(document).ajaxComplete((function(){t()}))}e("#ez-toc-more-links-enabler").click((function(){e(".ez-toc-more-link").show(),e("#ez-toc-more-links-enabler").hide(),e("#ez-toc-more-links-disabler").attr("style","display:inline-block")})),e("#ez-toc-more-links-disabler").click((function(){e(".ez-toc-more-link").hide(),e("#ez-toc-more-links-enabler").show(),e("#ez-toc-more-links-disabler").hide()})),e(document).on("click","#ez-toc-open-sub-hd",(function(t){e(this).attr("id","ez-toc-open-sub-hd-active"),t.preventDefault()})),e(document).on("click","#ez-toc-open-sub-hd-active",(function(t){e(this).attr("id","ez-toc-open-sub-hd"),t.preventDefault()}))}));; /** * File navigation.js. * * Handles toggling the navigation menu for small screens and enables TAB key * navigation support for dropdown menus. */ ( function() { var container, menu, links, i, len; container = document.getElementById( 'site-navigation' ); if ( ! container ) { return; } menu = container.getElementsByTagName( 'ul' )[0]; menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleFocus, true ); } /** * Sets or removes .focus class on an element. */ function toggleFocus() { var self = this; // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } /** * Toggles `focus` class to allow submenu access on tablets. */ ( function( container ) { var touchStartFn, i, parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); if ( 'ontouchstart' in window ) { touchStartFn = function( e ) { var menuItem = this.parentNode, i; if ( ! menuItem.classList.contains( 'focus' ) ) { e.preventDefault(); for ( i = 0; i < menuItem.parentNode.children.length; ++i ) { if ( menuItem === menuItem.parentNode.children[i] ) { continue; } menuItem.parentNode.children[i].classList.remove( 'focus' ); } menuItem.classList.add( 'focus' ); } else { menuItem.classList.remove( 'focus' ); } }; for ( i = 0; i < parentLink.length; ++i ) { parentLink[i].addEventListener( 'touchstart', touchStartFn, false ); } } }( container ) ); } )(); ; /*! Magnific Popup - v1.1.0 - 2016-02-20 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2016 Dmitry Semenov; */ ;(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS factory(require('jquery')); } else { // Browser globals factory(window.jQuery || window.Zepto); } }(function($) { /*>>core*/ /** * * Magnific Popup Core JS file * */ /** * Private static constants */ var CLOSE_EVENT = 'Close', BEFORE_CLOSE_EVENT = 'BeforeClose', AFTER_CLOSE_EVENT = 'AfterClose', BEFORE_APPEND_EVENT = 'BeforeAppend', MARKUP_PARSE_EVENT = 'MarkupParse', OPEN_EVENT = 'Open', CHANGE_EVENT = 'Change', NS = 'mfp', EVENT_NS = '.' + NS, READY_CLASS = 'mfp-ready', REMOVING_CLASS = 'mfp-removing', PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; /** * Private vars */ /*jshint -W079 */ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' MagnificPopup = function(){}, _isJQ = !!(window.jQuery), _prevStatus, _window = $(window), _document, _prevContentType, _wrapClasses, _currPopupType; /** * Private functions */ var _mfpOn = function(name, f) { mfp.ev.on(NS + name + EVENT_NS, f); }, _getEl = function(className, appendTo, html, raw) { var el = document.createElement('div'); el.className = 'mfp-'+className; if(html) { el.innerHTML = html; } if(!raw) { el = $(el); if(appendTo) { el.appendTo(appendTo); } } else if(appendTo) { appendTo.appendChild(el); } return el; }, _mfpTrigger = function(e, data) { mfp.ev.triggerHandler(NS + e, data); if(mfp.st.callbacks) { // converts "mfpEventName" to "eventName" callback and triggers it if it's present e = e.charAt(0).toLowerCase() + e.slice(1); if(mfp.st.callbacks[e]) { mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); } } }, _getCloseBtn = function(type) { if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); _currPopupType = type; } return mfp.currTemplate.closeBtn; }, // Initialize Magnific Popup only when called at least once _checkInstance = function() { if(!$.magnificPopup.instance) { /*jshint -W020 */ mfp = new MagnificPopup(); mfp.init(); $.magnificPopup.instance = mfp; } }, // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr supportsTransitions = function() { var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist v = ['ms','O','Moz','Webkit']; // 'v' for vendor if( s['transition'] !== undefined ) { return true; } while( v.length ) { if( v.pop() + 'Transition' in s ) { return true; } } return false; }; /** * Public functions */ MagnificPopup.prototype = { constructor: MagnificPopup, /** * Initializes Magnific Popup plugin. * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed */ init: function() { var appVersion = navigator.appVersion; mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; mfp.isAndroid = (/android/gi).test(appVersion); mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); mfp.supportsTransition = supportsTransitions(); // We disable fixed positioned lightbox on devices that don't handle it nicely. // If you know a better way of detecting this - let me know. mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); _document = $(document); mfp.popupsCache = {}; }, /** * Opens popup * @param data [description] */ open: function(data) { var i; if(data.isObj === false) { // convert jQuery collection to array to avoid conflicts later mfp.items = data.items.toArray(); mfp.index = 0; var items = data.items, item; for(i = 0; i < items.length; i++) { item = items[i]; if(item.parsed) { item = item.el[0]; } if(item === data.el[0]) { mfp.index = i; break; } } } else { mfp.items = $.isArray(data.items) ? data.items : [data.items]; mfp.index = data.index || 0; } // if popup is already opened - we just update the content if(mfp.isOpen) { mfp.updateItemHTML(); return; } mfp.types = []; _wrapClasses = ''; if(data.mainEl && data.mainEl.length) { mfp.ev = data.mainEl.eq(0); } else { mfp.ev = _document; } if(data.key) { if(!mfp.popupsCache[data.key]) { mfp.popupsCache[data.key] = {}; } mfp.currTemplate = mfp.popupsCache[data.key]; } else { mfp.currTemplate = {}; } mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; if(mfp.st.modal) { mfp.st.closeOnContentClick = false; mfp.st.closeOnBgClick = false; mfp.st.showCloseBtn = false; mfp.st.enableEscapeKey = false; } // Building markup // main containers are created only once if(!mfp.bgOverlay) { // Dark overlay mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { mfp.close(); }); mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { if(mfp._checkIfClose(e.target)) { mfp.close(); } }); mfp.container = _getEl('container', mfp.wrap); } mfp.contentContainer = _getEl('content'); if(mfp.st.preloader) { mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); } // Initializing modules var modules = $.magnificPopup.modules; for(i = 0; i < modules.length; i++) { var n = modules[i]; n = n.charAt(0).toUpperCase() + n.slice(1); mfp['init'+n].call(mfp); } _mfpTrigger('BeforeOpen'); if(mfp.st.showCloseBtn) { // Close button if(!mfp.st.closeBtnInside) { mfp.wrap.append( _getCloseBtn() ); } else { _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { values.close_replaceWith = _getCloseBtn(item.type); }); _wrapClasses += ' mfp-close-btn-in'; } } if(mfp.st.alignTop) { _wrapClasses += ' mfp-align-top'; } if(mfp.fixedContentPos) { mfp.wrap.css({ overflow: mfp.st.overflowY, overflowX: 'hidden', overflowY: mfp.st.overflowY }); } else { mfp.wrap.css({ top: _window.scrollTop(), position: 'absolute' }); } if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { mfp.bgOverlay.css({ height: _document.height(), position: 'absolute' }); } if(mfp.st.enableEscapeKey) { // Close on ESC key _document.on('keyup' + EVENT_NS, function(e) { if(e.keyCode === 27) { mfp.close(); } }); } _window.on('resize' + EVENT_NS, function() { mfp.updateSize(); }); if(!mfp.st.closeOnContentClick) { _wrapClasses += ' mfp-auto-cursor'; } if(_wrapClasses) mfp.wrap.addClass(_wrapClasses); // this triggers recalculation of layout, so we get it once to not to trigger twice var windowHeight = mfp.wH = _window.height(); var windowStyles = {}; if( mfp.fixedContentPos ) { if(mfp._hasScrollBar(windowHeight)){ var s = mfp._getScrollbarSize(); if(s) { windowStyles.marginRight = s; } } } if(mfp.fixedContentPos) { if(!mfp.isIE7) { windowStyles.overflow = 'hidden'; } else { // ie7 double-scroll bug $('body, html').css('overflow', 'hidden'); } } var classesToadd = mfp.st.mainClass; if(mfp.isIE7) { classesToadd += ' mfp-ie7'; } if(classesToadd) { mfp._addClassToMFP( classesToadd ); } // add content mfp.updateItemHTML(); _mfpTrigger('BuildControls'); // remove scrollbar, add margin e.t.c $('html').css(windowStyles); // add everything to DOM mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); // Save last focused element mfp._lastFocusedEl = document.activeElement; // Wait for next cycle to allow CSS transition setTimeout(function() { if(mfp.content) { mfp._addClassToMFP(READY_CLASS); mfp._setFocus(); } else { // if content is not defined (not loaded e.t.c) we add class only for BG mfp.bgOverlay.addClass(READY_CLASS); } // Trap the focus in popup _document.on('focusin' + EVENT_NS, mfp._onFocusIn); }, 16); mfp.isOpen = true; mfp.updateSize(windowHeight); _mfpTrigger(OPEN_EVENT); return data; }, /** * Closes the popup */ close: function() { if(!mfp.isOpen) return; _mfpTrigger(BEFORE_CLOSE_EVENT); mfp.isOpen = false; // for CSS3 animation if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { mfp._addClassToMFP(REMOVING_CLASS); setTimeout(function() { mfp._close(); }, mfp.st.removalDelay); } else { mfp._close(); } }, /** * Helper for close() function */ _close: function() { _mfpTrigger(CLOSE_EVENT); var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; mfp.bgOverlay.detach(); mfp.wrap.detach(); mfp.container.empty(); if(mfp.st.mainClass) { classesToRemove += mfp.st.mainClass + ' '; } mfp._removeClassFromMFP(classesToRemove); if(mfp.fixedContentPos) { var windowStyles = {marginRight: ''}; if(mfp.isIE7) { $('body, html').css('overflow', ''); } else { windowStyles.overflow = ''; } $('html').css(windowStyles); } _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); mfp.ev.off(EVENT_NS); // clean up DOM elements that aren't removed mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); mfp.bgOverlay.attr('class', 'mfp-bg'); mfp.container.attr('class', 'mfp-container'); // remove close button from target element if(mfp.st.showCloseBtn && (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { if(mfp.currTemplate.closeBtn) mfp.currTemplate.closeBtn.detach(); } if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { $(mfp._lastFocusedEl).focus(); // put tab focus back } mfp.currItem = null; mfp.content = null; mfp.currTemplate = null; mfp.prevHeight = 0; _mfpTrigger(AFTER_CLOSE_EVENT); }, updateSize: function(winHeight) { if(mfp.isIOS) { // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; var height = window.innerHeight * zoomLevel; mfp.wrap.css('height', height); mfp.wH = height; } else { mfp.wH = winHeight || _window.height(); } // Fixes #84: popup incorrectly positioned with position:relative on body if(!mfp.fixedContentPos) { mfp.wrap.css('height', mfp.wH); } _mfpTrigger('Resize'); }, /** * Set content of popup based on current index */ updateItemHTML: function() { var item = mfp.items[mfp.index]; // Detach and perform modifications mfp.contentContainer.detach(); if(mfp.content) mfp.content.detach(); if(!item.parsed) { item = mfp.parseEl( mfp.index ); } var type = item.type; _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); // BeforeChange event works like so: // _mfpOn('BeforeChange', function(e, prevType, newType) { }); mfp.currItem = item; if(!mfp.currTemplate[type]) { var markup = mfp.st[type] ? mfp.st[type].markup : false; // allows to modify markup _mfpTrigger('FirstMarkupParse', markup); if(markup) { mfp.currTemplate[type] = $(markup); } else { // if there is no markup found we just define that template is parsed mfp.currTemplate[type] = true; } } if(_prevContentType && _prevContentType !== item.type) { mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); } var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); mfp.appendContent(newContent, type); item.preloaded = true; _mfpTrigger(CHANGE_EVENT, item); _prevContentType = item.type; // Append container back after its content changed mfp.container.prepend(mfp.contentContainer); _mfpTrigger('AfterChange'); }, /** * Set HTML content of popup */ appendContent: function(newContent, type) { mfp.content = newContent; if(newContent) { if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && mfp.currTemplate[type] === true) { // if there is no markup, we just append close button element inside if(!mfp.content.find('.mfp-close').length) { mfp.content.append(_getCloseBtn()); } } else { mfp.content = newContent; } } else { mfp.content = ''; } _mfpTrigger(BEFORE_APPEND_EVENT); mfp.container.addClass('mfp-'+type+'-holder'); mfp.contentContainer.append(mfp.content); }, /** * Creates Magnific Popup data object based on given data * @param {int} index Index of item to parse */ parseEl: function(index) { var item = mfp.items[index], type; if(item.tagName) { item = { el: $(item) }; } else { type = item.type; item = { data: item, src: item.src }; } if(item.el) { var types = mfp.types; // check for 'mfp-TYPE' class for(var i = 0; i < types.length; i++) { if( item.el.hasClass('mfp-'+types[i]) ) { type = types[i]; break; } } item.src = item.el.attr('data-mfp-src'); if(!item.src) { item.src = item.el.attr('href'); } } item.type = type || mfp.st.type || 'inline'; item.index = index; item.parsed = true; mfp.items[index] = item; _mfpTrigger('ElementParse', item); return mfp.items[index]; }, /** * Initializes single popup or a group of popups */ addGroup: function(el, options) { var eHandler = function(e) { e.mfpEl = this; mfp._openClick(e, el, options); }; if(!options) { options = {}; } var eName = 'click.magnificPopup'; options.mainEl = el; if(options.items) { options.isObj = true; el.off(eName).on(eName, eHandler); } else { options.isObj = false; if(options.delegate) { el.off(eName).on(eName, options.delegate , eHandler); } else { options.items = el; el.off(eName).on(eName, eHandler); } } }, _openClick: function(e, el, options) { var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { return; } var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; if(disableOn) { if($.isFunction(disableOn)) { if( !disableOn.call(mfp) ) { return true; } } else { // else it's number if( _window.width() < disableOn ) { return true; } } } if(e.type) { e.preventDefault(); // This will prevent popup from closing if element is inside and popup is already opened if(mfp.isOpen) { e.stopPropagation(); } } options.el = $(e.mfpEl); if(options.delegate) { options.items = el.find(options.delegate); } mfp.open(options); }, /** * Updates text on preloader */ updateStatus: function(status, text) { if(mfp.preloader) { if(_prevStatus !== status) { mfp.container.removeClass('mfp-s-'+_prevStatus); } if(!text && status === 'loading') { text = mfp.st.tLoading; } var data = { status: status, text: text }; // allows to modify status _mfpTrigger('UpdateStatus', data); status = data.status; text = data.text; mfp.preloader.html(text); mfp.preloader.find('a').on('click', function(e) { e.stopImmediatePropagation(); }); mfp.container.addClass('mfp-s-'+status); _prevStatus = status; } }, /* "Private" helpers that aren't private at all */ // Check to close popup or not // "target" is an element that was clicked _checkIfClose: function(target) { if($(target).hasClass(PREVENT_CLOSE_CLASS)) { return; } var closeOnContent = mfp.st.closeOnContentClick; var closeOnBg = mfp.st.closeOnBgClick; if(closeOnContent && closeOnBg) { return true; } else { // We close the popup if click is on close button or on preloader. Or if there is no content. if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { return true; } // if click is outside the content if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { if(closeOnBg) { // last check, if the clicked element is in DOM, (in case it's removed onclick) if( $.contains(document, target) ) { return true; } } } else if(closeOnContent) { return true; } } return false; }, _addClassToMFP: function(cName) { mfp.bgOverlay.addClass(cName); mfp.wrap.addClass(cName); }, _removeClassFromMFP: function(cName) { this.bgOverlay.removeClass(cName); mfp.wrap.removeClass(cName); }, _hasScrollBar: function(winHeight) { return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); }, _setFocus: function() { (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); }, _onFocusIn: function(e) { if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { mfp._setFocus(); return false; } }, _parseMarkup: function(template, values, item) { var arr; if(item.data) { values = $.extend(item.data, values); } _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); $.each(values, function(key, value) { if(value === undefined || value === false) { return true; } arr = key.split('_'); if(arr.length > 1) { var el = template.find(EVENT_NS + '-'+arr[0]); if(el.length > 0) { var attr = arr[1]; if(attr === 'replaceWith') { if(el[0] !== value[0]) { el.replaceWith(value); } } else if(attr === 'img') { if(el.is('img')) { el.attr('src', value); } else { el.replaceWith( $('').attr('src', value).attr('class', el.attr('class')) ); } } else { el.attr(arr[1], value); } } } else { template.find(EVENT_NS + '-'+key).html(value); } }); }, _getScrollbarSize: function() { // thx David if(mfp.scrollbarSize === undefined) { var scrollDiv = document.createElement("div"); scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; document.body.appendChild(scrollDiv); mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } return mfp.scrollbarSize; } }; /* MagnificPopup core prototype end */ /** * Public static functions */ $.magnificPopup = { instance: null, proto: MagnificPopup.prototype, modules: [], open: function(options, index) { _checkInstance(); if(!options) { options = {}; } else { options = $.extend(true, {}, options); } options.isObj = true; options.index = index || 0; return this.instance.open(options); }, close: function() { return $.magnificPopup.instance && $.magnificPopup.instance.close(); }, registerModule: function(name, module) { if(module.options) { $.magnificPopup.defaults[name] = module.options; } $.extend(this.proto, module.proto); this.modules.push(name); }, defaults: { // Info about options is in docs: // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options disableOn: 0, key: null, midClick: false, mainClass: '', preloader: true, focus: '', // CSS selector of input to focus after popup is opened closeOnContentClick: false, closeOnBgClick: true, closeBtnInside: true, showCloseBtn: true, enableEscapeKey: true, modal: false, alignTop: false, removalDelay: 0, prependTo: null, fixedContentPos: 'auto', fixedBgPos: 'auto', overflowY: 'auto', closeMarkup: '', tClose: 'Close (Esc)', tLoading: 'Loading...', autoFocusLast: true } }; $.fn.magnificPopup = function(options) { _checkInstance(); var jqEl = $(this); // We call some API method of first param is a string if (typeof options === "string" ) { if(options === 'open') { var items, itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, index = parseInt(arguments[1], 10) || 0; if(itemOpts.items) { items = itemOpts.items[index]; } else { items = jqEl; if(itemOpts.delegate) { items = items.find(itemOpts.delegate); } items = items.eq( index ); } mfp._openClick({mfpEl:items}, jqEl, itemOpts); } else { if(mfp.isOpen) mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); } } else { // clone options obj options = $.extend(true, {}, options); /* * As Zepto doesn't support .data() method for objects * and it works only in normal browsers * we assign "options" object directly to the DOM element. FTW! */ if(_isJQ) { jqEl.data('magnificPopup', options); } else { jqEl[0].magnificPopup = options; } mfp.addGroup(jqEl, options); } return jqEl; }; /*>>core*/ /*>>inline*/ var INLINE_NS = 'inline', _hiddenClass, _inlinePlaceholder, _lastInlineElement, _putInlineElementsBack = function() { if(_lastInlineElement) { _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); _lastInlineElement = null; } }; $.magnificPopup.registerModule(INLINE_NS, { options: { hiddenClass: 'hide', // will be appended with `mfp-` prefix markup: '', tNotFound: 'Content not found' }, proto: { initInline: function() { mfp.types.push(INLINE_NS); _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { _putInlineElementsBack(); }); }, getInline: function(item, template) { _putInlineElementsBack(); if(item.src) { var inlineSt = mfp.st.inline, el = $(item.src); if(el.length) { // If target element has parent - we replace it with placeholder and put it back after popup is closed var parent = el[0].parentNode; if(parent && parent.tagName) { if(!_inlinePlaceholder) { _hiddenClass = inlineSt.hiddenClass; _inlinePlaceholder = _getEl(_hiddenClass); _hiddenClass = 'mfp-'+_hiddenClass; } // replace target inline element with placeholder _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); } mfp.updateStatus('ready'); } else { mfp.updateStatus('error', inlineSt.tNotFound); el = $('
'); } item.inlineElement = el; return el; } mfp.updateStatus('ready'); mfp._parseMarkup(template, {}, item); return template; } } }); /*>>inline*/ /*>>ajax*/ var AJAX_NS = 'ajax', _ajaxCur, _removeAjaxCursor = function() { if(_ajaxCur) { $(document.body).removeClass(_ajaxCur); } }, _destroyAjaxRequest = function() { _removeAjaxCursor(); if(mfp.req) { mfp.req.abort(); } }; $.magnificPopup.registerModule(AJAX_NS, { options: { settings: null, cursor: 'mfp-ajax-cur', tError: 'The content could not be loaded.' }, proto: { initAjax: function() { mfp.types.push(AJAX_NS); _ajaxCur = mfp.st.ajax.cursor; _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); }, getAjax: function(item) { if(_ajaxCur) { $(document.body).addClass(_ajaxCur); } mfp.updateStatus('loading'); var opts = $.extend({ url: item.src, success: function(data, textStatus, jqXHR) { var temp = { data:data, xhr:jqXHR }; _mfpTrigger('ParseAjax', temp); mfp.appendContent( $(temp.data), AJAX_NS ); item.finished = true; _removeAjaxCursor(); mfp._setFocus(); setTimeout(function() { mfp.wrap.addClass(READY_CLASS); }, 16); mfp.updateStatus('ready'); _mfpTrigger('AjaxContentAdded'); }, error: function() { _removeAjaxCursor(); item.finished = item.loadError = true; mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); } }, mfp.st.ajax.settings); mfp.req = $.ajax(opts); return ''; } } }); /*>>ajax*/ /*>>image*/ var _imgInterval, _getTitle = function(item) { if(item.data && item.data.title !== undefined) return item.data.title; var src = mfp.st.image.titleSrc; if(src) { if($.isFunction(src)) { return src.call(mfp, item); } else if(item.el) { return item.el.attr(src) || ''; } } return ''; }; $.magnificPopup.registerModule('image', { options: { markup: '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
', cursor: 'mfp-zoom-out-cur', titleSrc: 'title', verticalFit: true, tError: 'The image could not be loaded.' }, proto: { initImage: function() { var imgSt = mfp.st.image, ns = '.image'; mfp.types.push('image'); _mfpOn(OPEN_EVENT+ns, function() { if(mfp.currItem.type === 'image' && imgSt.cursor) { $(document.body).addClass(imgSt.cursor); } }); _mfpOn(CLOSE_EVENT+ns, function() { if(imgSt.cursor) { $(document.body).removeClass(imgSt.cursor); } _window.off('resize' + EVENT_NS); }); _mfpOn('Resize'+ns, mfp.resizeImage); if(mfp.isLowIE) { _mfpOn('AfterChange', mfp.resizeImage); } }, resizeImage: function() { var item = mfp.currItem; if(!item || !item.img) return; if(mfp.st.image.verticalFit) { var decr = 0; // fix box-sizing in ie7/8 if(mfp.isLowIE) { decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); } item.img.css('max-height', mfp.wH-decr); } }, _onImageHasSize: function(item) { if(item.img) { item.hasSize = true; if(_imgInterval) { clearInterval(_imgInterval); } item.isCheckingImgSize = false; _mfpTrigger('ImageHasSize', item); if(item.imgHidden) { if(mfp.content) mfp.content.removeClass('mfp-loading'); item.imgHidden = false; } } }, /** * Function that loops until the image has size to display elements that rely on it asap */ findImageSize: function(item) { var counter = 0, img = item.img[0], mfpSetInterval = function(delay) { if(_imgInterval) { clearInterval(_imgInterval); } // decelerating interval that checks for size of an image _imgInterval = setInterval(function() { if(img.naturalWidth > 0) { mfp._onImageHasSize(item); return; } if(counter > 200) { clearInterval(_imgInterval); } counter++; if(counter === 3) { mfpSetInterval(10); } else if(counter === 40) { mfpSetInterval(50); } else if(counter === 100) { mfpSetInterval(500); } }, delay); }; mfpSetInterval(1); }, getImage: function(item, template) { var guard = 0, // image load complete handler onLoadComplete = function() { if(item) { if (item.img[0].complete) { item.img.off('.mfploader'); if(item === mfp.currItem){ mfp._onImageHasSize(item); mfp.updateStatus('ready'); } item.hasSize = true; item.loaded = true; _mfpTrigger('ImageLoadComplete'); } else { // if image complete check fails 200 times (20 sec), we assume that there was an error. guard++; if(guard < 200) { setTimeout(onLoadComplete,100); } else { onLoadError(); } } } }, // image error handler onLoadError = function() { if(item) { item.img.off('.mfploader'); if(item === mfp.currItem){ mfp._onImageHasSize(item); mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); } item.hasSize = true; item.loaded = true; item.loadError = true; } }, imgSt = mfp.st.image; var el = template.find('.mfp-img'); if(el.length) { var img = document.createElement('img'); img.className = 'mfp-img'; if(item.el && item.el.find('img').length) { img.alt = item.el.find('img').attr('alt'); } item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); img.src = item.src; // without clone() "error" event is not firing when IMG is replaced by new IMG // TODO: find a way to avoid such cloning if(el.is('img')) { item.img = item.img.clone(); } img = item.img[0]; if(img.naturalWidth > 0) { item.hasSize = true; } else if(!img.width) { item.hasSize = false; } } mfp._parseMarkup(template, { title: _getTitle(item), img_replaceWith: item.img }, item); mfp.resizeImage(); if(item.hasSize) { if(_imgInterval) clearInterval(_imgInterval); if(item.loadError) { template.addClass('mfp-loading'); mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); } else { template.removeClass('mfp-loading'); mfp.updateStatus('ready'); } return template; } mfp.updateStatus('loading'); item.loading = true; if(!item.hasSize) { item.imgHidden = true; template.addClass('mfp-loading'); mfp.findImageSize(item); } return template; } } }); /*>>image*/ /*>>zoom*/ var hasMozTransform, getHasMozTransform = function() { if(hasMozTransform === undefined) { hasMozTransform = document.createElement('p').style.MozTransform !== undefined; } return hasMozTransform; }; $.magnificPopup.registerModule('zoom', { options: { enabled: false, easing: 'ease-in-out', duration: 300, opener: function(element) { return element.is('img') ? element : element.find('img'); } }, proto: { initZoom: function() { var zoomSt = mfp.st.zoom, ns = '.zoom', image; if(!zoomSt.enabled || !mfp.supportsTransition) { return; } var duration = zoomSt.duration, getElToAnimate = function(image) { var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, cssObj = { position: 'fixed', zIndex: 9999, left: 0, top: 0, '-webkit-backface-visibility': 'hidden' }, t = 'transition'; cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; newImg.css(cssObj); return newImg; }, showMainContent = function() { mfp.content.css('visibility', 'visible'); }, openTimeout, animatedImg; _mfpOn('BuildControls'+ns, function() { if(mfp._allowZoom()) { clearTimeout(openTimeout); mfp.content.css('visibility', 'hidden'); // Basically, all code below does is clones existing image, puts in on top of the current one and animated it image = mfp._getItemToZoom(); if(!image) { showMainContent(); return; } animatedImg = getElToAnimate(image); animatedImg.css( mfp._getOffset() ); mfp.wrap.append(animatedImg); openTimeout = setTimeout(function() { animatedImg.css( mfp._getOffset( true ) ); openTimeout = setTimeout(function() { showMainContent(); setTimeout(function() { animatedImg.remove(); image = animatedImg = null; _mfpTrigger('ZoomAnimationEnded'); }, 16); // avoid blink when switching images }, duration); // this timeout equals animation duration }, 16); // by adding this timeout we avoid short glitch at the beginning of animation // Lots of timeouts... } }); _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { if(mfp._allowZoom()) { clearTimeout(openTimeout); mfp.st.removalDelay = duration; if(!image) { image = mfp._getItemToZoom(); if(!image) { return; } animatedImg = getElToAnimate(image); } animatedImg.css( mfp._getOffset(true) ); mfp.wrap.append(animatedImg); mfp.content.css('visibility', 'hidden'); setTimeout(function() { animatedImg.css( mfp._getOffset() ); }, 16); } }); _mfpOn(CLOSE_EVENT+ns, function() { if(mfp._allowZoom()) { showMainContent(); if(animatedImg) { animatedImg.remove(); } image = null; } }); }, _allowZoom: function() { return mfp.currItem.type === 'image'; }, _getItemToZoom: function() { if(mfp.currItem.hasSize) { return mfp.currItem.img; } else { return false; } }, // Get element postion relative to viewport _getOffset: function(isLarge) { var el; if(isLarge) { el = mfp.currItem.img; } else { el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); } var offset = el.offset(); var paddingTop = parseInt(el.css('padding-top'),10); var paddingBottom = parseInt(el.css('padding-bottom'),10); offset.top -= ( $(window).scrollTop() - paddingTop ); /* Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. */ var obj = { width: el.width(), // fix Zepto height+padding issue height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop }; // I hate to do this, but there is no another option if( getHasMozTransform() ) { obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; } else { obj.left = offset.left; obj.top = offset.top; } return obj; } } }); /*>>zoom*/ /*>>iframe*/ var IFRAME_NS = 'iframe', _emptyPage = '//about:blank', _fixIframeBugs = function(isShowing) { if(mfp.currTemplate[IFRAME_NS]) { var el = mfp.currTemplate[IFRAME_NS].find('iframe'); if(el.length) { // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug if(!isShowing) { el[0].src = _emptyPage; } // IE8 black screen bug fix if(mfp.isIE8) { el.css('display', isShowing ? 'block' : 'none'); } } } }; $.magnificPopup.registerModule(IFRAME_NS, { options: { markup: '
'+ '
'+ ''+ '
', srcAction: 'iframe_src', // we don't care and support only one default type of URL by default 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() { mfp.types.push(IFRAME_NS); _mfpOn('BeforeChange', function(e, prevType, newType) { if(prevType !== newType) { if(prevType === IFRAME_NS) { _fixIframeBugs(); // iframe if removed } else if(newType === IFRAME_NS) { _fixIframeBugs(true); // iframe is showing } }// else { // iframe source is switched, don't do anything //} }); _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { _fixIframeBugs(); }); }, getIframe: function(item, template) { var embedSrc = item.src; var iframeSt = mfp.st.iframe; $.each(iframeSt.patterns, function() { if(embedSrc.indexOf( this.index ) > -1) { if(this.id) { if(typeof this.id === 'string') { embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); } else { embedSrc = this.id.call( this, embedSrc ); } } embedSrc = this.src.replace('%id%', embedSrc ); return false; // break; } }); var dataObj = {}; if(iframeSt.srcAction) { dataObj[iframeSt.srcAction] = embedSrc; } mfp._parseMarkup(template, dataObj, item); mfp.updateStatus('ready'); return template; } } }); /*>>iframe*/ /*>>gallery*/ /** * Get looped index depending on number of slides */ var _getLoopedId = function(index) { var numSlides = mfp.items.length; if(index > numSlides - 1) { return index - numSlides; } else if(index < 0) { return numSlides + index; } return index; }, _replaceCurrTotal = function(text, curr, total) { return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); }; $.magnificPopup.registerModule('gallery', { options: { enabled: false, arrowMarkup: '', preload: [0,2], navigateByImgClick: true, arrows: true, tPrev: 'Previous (Left arrow key)', tNext: 'Next (Right arrow key)', tCounter: '%curr% of %total%' }, proto: { initGallery: function() { var gSt = mfp.st.gallery, ns = '.mfp-gallery'; mfp.direction = true; // true - next, false - prev if(!gSt || !gSt.enabled ) return false; _wrapClasses += ' mfp-gallery'; _mfpOn(OPEN_EVENT+ns, function() { if(gSt.navigateByImgClick) { mfp.wrap.on('click'+ns, '.mfp-img', function() { if(mfp.items.length > 1) { mfp.next(); return false; } }); } _document.on('keydown'+ns, function(e) { if (e.keyCode === 37) { mfp.prev(); } else if (e.keyCode === 39) { mfp.next(); } }); }); _mfpOn('UpdateStatus'+ns, function(e, data) { if(data.text) { data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); } }); _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { var l = mfp.items.length; values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; }); _mfpOn('BuildControls' + ns, function() { if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { var markup = gSt.arrowMarkup, arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); arrowLeft.click(function() { mfp.prev(); }); arrowRight.click(function() { mfp.next(); }); mfp.container.append(arrowLeft.add(arrowRight)); } }); _mfpOn(CHANGE_EVENT+ns, function() { if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); mfp._preloadTimeout = setTimeout(function() { mfp.preloadNearbyImages(); mfp._preloadTimeout = null; }, 16); }); _mfpOn(CLOSE_EVENT+ns, function() { _document.off(ns); mfp.wrap.off('click'+ns); mfp.arrowRight = mfp.arrowLeft = null; }); }, next: function() { mfp.direction = true; mfp.index = _getLoopedId(mfp.index + 1); mfp.updateItemHTML(); }, prev: function() { mfp.direction = false; mfp.index = _getLoopedId(mfp.index - 1); mfp.updateItemHTML(); }, goTo: function(newIndex) { mfp.direction = (newIndex >= mfp.index); mfp.index = newIndex; mfp.updateItemHTML(); }, preloadNearbyImages: function() { var p = mfp.st.gallery.preload, preloadBefore = Math.min(p[0], mfp.items.length), preloadAfter = Math.min(p[1], mfp.items.length), i; for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { mfp._preloadItem(mfp.index+i); } for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { mfp._preloadItem(mfp.index-i); } }, _preloadItem: function(index) { index = _getLoopedId(index); if(mfp.items[index].preloaded) { return; } var item = mfp.items[index]; if(!item.parsed) { item = mfp.parseEl( index ); } _mfpTrigger('LazyLoad', item); if(item.type === 'image') { item.img = $('').on('load.mfploader', function() { item.hasSize = true; }).on('error.mfploader', function() { item.hasSize = true; item.loadError = true; _mfpTrigger('LazyLoadError', item); }).attr('src', item.src); } item.preloaded = true; } } }); /*>>gallery*/ /*>>retina*/ var RETINA_NS = 'retina'; $.magnificPopup.registerModule(RETINA_NS, { options: { replaceSrc: function(item) { return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); }, ratio: 1 // Function or number. Set to 1 to disable. }, proto: { initRetina: function() { if(window.devicePixelRatio > 1) { var st = mfp.st.retina, ratio = st.ratio; ratio = !isNaN(ratio) ? ratio : ratio(); if(ratio > 1) { _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { item.img.css({ 'max-width': item.img[0].naturalWidth / ratio, 'width': '100%' }); }); _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { item.src = st.replaceSrc(item, ratio); }); } } } } }); /*>>retina*/ _checkInstance(); }));;