(function(){jQuery(document).ready(function(e){var t,n,i,a,l,d,g,r=String.fromCharCode(57395),p=String.fromCharCode(57393);window.ags_wc_filters_isInVisualBuilder=e(document.body).hasClass("et-fb"),t=e(".ags-wc-filters-target:visible:first"),i={},e(".ags-wc-filters-button-apply").click(function(){window.ags_wc_filters_applyFilters(e(this).closest(".ags_woo_products_filters"))}),e(window).on("resize",function(){var n=e(".ags-wc-filters-target:visible:first");t.is(n)||(t=n,o())}),e(document.body).on("click",function(t){var n=e(t.target).closest(".ags-wc-filters-hide-on-click");e(".ags-wc-filters-hide-on-click").not(n).hide(),!t.isTrigger&&!e(t.target).closest(".ags-wc-filters-row .ags-wc-filters-section:not(ags-wc-filters-section-toggle-closed)").length&&e(".ags-wc-filters-row .ags-wc-filters-section").addClass("ags-wc-filters-section-toggle-closed")}),window.ags_wc_filters_isInVisualBuilder||e(document).on("click",".ags-wc-filters-section-title.ags-wc-filters-section-toggle",function(){var n=e(this).parent().toggleClass("ags-wc-filters-section-toggle-closed");e(this).closest(".ags-wc-filters-row").find(".ags-wc-filters-section").not(n).addClass("ags-wc-filters-section-toggle-closed")}),window.ags_wc_filters_maybeToggleNoOptionsMessage=function(t){var n,s=t.find(".ags-wc-filters-list:first");s.length&&(s.children(":not(.ags-wc-filters-hidden)").length?t.remove(".ags-wc-filters-no-options"):t.has(".ags-wc-filters-no-options").length||(n=t.find("h4").clone(),n.children().remove(),e("<div>").addClass("ags-wc-filters-no-options").text(t.closest("div[data-no-options-text]").attr("data-no-options-text").replace("%s",n.text())).appendTo(t.find(".ags-wc-filters-section-inner:first"))))},window.ags_wc_filters_aliases&&ags_wc_filters_set_aliases(window.ags_wc_filters_aliases),window.ags_wc_filters_parentClassPolyfill=function(t,n,s,o,i,a){t.each(function(){for(var t,r,c,l=0;l<n.length;++l)t=e(this).closest(n[l]),t.length&&(!window.getComputedStyle||window.getComputedStyle(t[0])[o]!==i)&&(r=t.attr("class"),r.substring(0,10)==="et-module-"?(c=r.substring(0,r.indexOf(" ")),c&&e("<style>").attr("id","dswcp-pcp-"+c).text("."+c+"{"+a+"}").appendTo(document.head)):t.addClass(s))})},ags_wc_filters_parentClassPolyfill(e(".ags_woo_mini_cart"),[".et_pb_column"],"ags-woo-mini-cart-ancestor","zIndex","3","z-index:3"),window.ags_wc_filters_initFilters=function(n){var s,o,a,r,c,l,u,h,m,f,p,g,v,y=window.ags_wc_filters_getDisplayType(n),_=n.data("ags-wc-filters-query-var"),i=n.closest(".ags_woo_products_filters"),d=i.find(".ags-wc-filters-button-apply:first"),b=i.closest(".et_pb_row")[0];switch(window.ags_wc_filters_isInVisualBuilder?b.style.zIndex="10":b.style.zIndex="3",y){case"checkboxes_list":case"radio_buttons":case"colors":case"images":n.find(".ags-wc-filters-list:first :checkbox, .ags-wc-filters-list:first :radio").change(function(e){!d.length&&!e.isTrigger&&window.ags_wc_filters_applyFilters(i)});break;case"dropdown_single_select":n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-active a").click(function(e){n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options").toggle(),e.stopPropagation()}),n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a").click(function(e){var t,s=jQuery(this).data("label");n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a").removeClass("ags-wc-filters-active"),jQuery(this).addClass("ags-wc-filters-active"),t=n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-active a span").text(s),t.html(window.ags_wc_filters_processOptionLabel(t.html())),n.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options").hide(),!d.length&&!e.isTrigger&&window.ags_wc_filters_applyFilters(i)});break;case"dropdown_multi_select":n.find(".ags-wc-filters-dropdown-multi .ags-wc-filters-active span").click(function(e){n.find(".ags-wc-filters-dropdown-multi-options").toggle(),e.stopPropagation()}),n.find(".ags-wc-filters-dropdown-multi-options li input").change(function(t){var s,o=e(this);o.closest("li").toggleClass("ags-wc-filters-active",o.prop("checked")),s=n.find(".ags-wc-filters-list:first :checked").map(function(e,t){return jQuery(t).data("label")}).get(),s.length===0?n.find(".ags-wc-filters-dropdown-multi > .ags-wc-filters-active span").text(n.find(".ags-wc-filters-dropdown-multi:first").data("placeholder-text")):n.find(".ags-wc-filters-dropdown-multi > .ags-wc-filters-active span").text(s.join(", ")),!d.length&&!t.isTrigger&&window.ags_wc_filters_applyFilters(i)});break;case"search":function j(e,t){if(t.length){var n,s=e.find(".ags-wc-filters-search-suggestions:first").empty();s.length||(s=jQuery('<ul class="ags-wc-filters-search-suggestions">').appendTo(jQuery('<div class="ags-wc-filters-search-suggestions-container ags-wc-filters-hide-on-click">').append('<div class="ags-wc-filters-dropdown-toggle"></div>').appendTo(e)));for(n=0;n<t.length;++n)jQuery("<li>").append(jQuery("<a>").attr({href:t[n].link,target:"_blank"}).text(t[n].label)).appendTo(s);s.parent().show()}else e.children(".ags-wc-filters-search-suggestions-container:first").hide()}window.ags_wc_filters_isInVisualBuilder&&n.has(".ags-wc-filters-search-with-suggestions").length&&(j(n.find(".ags-wc-filters-search-container:first"),[{label:wp.i18n.__("Product One","divi-shop-builder"),link:"#"},{label:wp.i18n.__("Product Two","divi-shop-builder"),link:"#"}]),n.find(".ags-wc-filters-search-suggestions-container:first").hide().removeClass("ags-wc-filters-hide-on-click").find("a").click(function(){return!1})),n.find('input[type="search"]:first').on("input",function(e){!d.length&&!e.isTrigger&&window.ags_wc_filters_applyFiltersThrottled(i)}).on("focus input",function(t){var n,o,s=jQuery(this),i=s.closest(".ags-wc-filters-search-container");!t.isTrigger&&!window.ags_wc_filters_isInVisualBuilder&&i.hasClass("ags-wc-filters-search-with-suggestions")&&(o=s.val(),n&&clearTimeout(n),o?n=setTimeout(function(){n=null,e.post(DiviWoocommercePagesFrontendData.ajaxUrl,{action:"ags_wc_filters_search_suggestions",query:o},function(e){e.success&&e.data&&j(i,e.data)},"json")},200):s.siblings(".ags-wc-filters-search-suggestions-container:first").hide())});break;case"number_range":u=n.find(".ags-wc-filters-slider:first"),s=n.find('input[type="number"]:first'),h=n.find('input[type="number"]:last'),c=t.find(".ags-divi-wc-query-price-range:first"),c.length&&(s.data("min-default")||s.data({"min-default":s.attr("min"),"max-default":s.attr("max")}),c.data("max")?c.data("max")-c.data("min")<3?(r=Math.max(0,Math.floor(c.data("min"))-1),a=Math.ceil(c.data("min"))+1):(r=Math.floor(c.data("min")),a=Math.ceil(c.data("max"))):(r=s.data("min-default"),a=s.data("max-default")),s.add(h).attr({min:r,max:a})),u.length&&(u.siblings(".rs-container").remove(),r=parseInt(s.attr("min")),a=parseInt(s.attr("max")),f={target:u[0],values:{min:r,max:a},step:1,range:!0,scale:!1,labels:!1,tooltip:s.hasClass("ags-wc-filters-hidden"),onChange:function(e){if(!o.hadFirstOnChange){o.hadFirstOnChange=!0;return}o.isInOnChange=!0,e=e.split(","),s.val(parseInt(e[0])===r?"":e[0]),h.val(parseInt(e[1])===a?"":e[1]).trigger("input"),d.length||window.ags_wc_filters_applyFiltersThrottled(i),o.isInOnChange=!1}},v=u.closest(".ags-wc-filters-number-range-container").data("currency-symbol"),v&&(f.valuePrefix=v),p=s.val(),m=h.val(),(p.length||m.length)&&(f.set=[p.length?parseInt(p):r,m.length?parseInt(m):a]),o=new rSlider(f),o.setValues2=function(e,t){o.setValues(e,t),clearTimeout(o.timeout)}),n.find('input[type="number"]').on("input",function(e){var t=jQuery(this).closest(".ags-wc-filters-number-range-container"),n=t.find('input[type="number"]:first').val(),s=t.find('input[type="number"]:last').val();u.length&&!o.isInOnChange&&o.setValues2(n.length?parseInt(n):r,s.length?parseInt(s):a),!d.length&&!e.isTrigger&&window.ags_wc_filters_applyFiltersThrottled(i)});break;case"stars":g=n.find(".ags-wc-filters-stars-control:first"),l=g.find(".ags-wc-filters-stars:first"),l.children().click(function(e){var t=jQuery(this).index()+1;l.children(":lt("+t+")").removeClass("ags-wc-filters-star-empty").addClass("ags-wc-filters-star-filled"),l.children(":gt("+(t-1)+")").removeClass("ags-wc-filters-star-filled").addClass("ags-wc-filters-star-empty"),g.attr("data-value",t+(g.hasClass("ags-wc-filters-stars-control-only")?"":"+")),!d.length&&!e.isTrigger&&window.ags_wc_filters_applyFilters(i)}).hover(function(){var e=jQuery(this).index()+1;l.children(":lt("+e+")").addClass("ags-wc-filters-star-hover"),l.children(":gt("+(e-1)+")").removeClass("ags-wc-filters-star-hover")}),l.mouseout(function(){l.children().removeClass("ags-wc-filters-star-hover")});break}},window.ags_wc_filters_processOptionLabel=function(e){var t=e.indexOf(r);return(e[t+4]===p||e[t+4]===r)&&(e=(t>0?e.substring(0,t-1)+(e[t-1]===" "?"&nbsp;":e[t-1]):"")+'<span class="ags-wc-filters-stars">'+e.substring(t,t+5).replaceAll(new RegExp(r,"g"),'<span class="ags-wc-filters-star-filled">'+r+"</span>").replaceAll(new RegExp(p,"g"),'<span class="ags-wc-filters-star-empty">'+r+"</span>")+"</span>"+(e.length>t+5?e[t+5]===" "?"&nbsp;":e[t+5]:"")+e.substring(t+6)),e},window.ags_wc_filters_applyFiltersThrottled=function(e){var t=e[0].className.match(/ags_woo_products_filters_[0-9]+/)[0];i[t]&&clearTimeout(i[t]),i[t]=setTimeout(function(){delete i[t],window.ags_wc_filters_applyFilters(e)},200)},window.ags_wc_filters_applyFilters=function(n,i,a,r,l){if(window.ags_wc_filters_isInVisualBuilder)return!1;var u,h,p,g,j,y,w,O,C,E,A,S,x="",d={},b=n.find(".ags-wc-filters-selected:first").empty(),_=[],k=null;function m(e,t,n,s){var o=jQuery('<p class="ags-wc-filters-selected-inner">').attr("data-filter",e+":"+t);s?o.html(n):o.text(n),o.prepend('<span class="ags-wc-filters-remove">x&nbsp;</span>').html(window.ags_wc_filters_processOptionLabel(o.html())).appendTo(b.not(':has([data-filter="'+e+":"+t+'"])'))}if(E=["add-to-cart"],n.find(".ags-wc-filters-section").each(function(){var t,s,o,i,a,r,l,u,h,f,p,g,v,b,c=0;switch(E.push(e(this).data("ags-wc-filters-query-var")),t=e(this),o=t.data("ags-wc-filters-query-var"),r=t.data("ags-wc-filters-dynamic-product-counts"),b=t.hasClass("ags-wc-filters-hide-zero-count"),g=window.ags_wc_filters_getDisplayType(t),g){case"dropdown_single_select":f=t.find('.ags-wc-filters-dropdown-single-options:first .ags-wc-filters-active:not([data-id="all"]):first'),f.length&&(m(o,f.data("id"),f.data("label")),s=f.data("id").toString(),c=1),(r||b||t.attr("data-condition")==="notempty")&&t.find(".ags-wc-filters-dropdown-single-options:first a").each(function(){var n=e(this);_.push({parent:"#"+n.attr("id"),filter:r||t.attr("data-ags-wc-filters-real-query-var"),value:n.data("id")})});break;case"dropdown_multi_select":case"checkboxes_list":case"radio_buttons":case"colors":case"images":s=t.find('.ags-wc-filters-list:first :checked:not([value="all"])').each(function(){var t=e(this);m(o,t.val(),g==="colors"||g==="images"?t.siblings("label:first").attr("title"):t.data("label"))}).map(function(){return e(this).val()}).get(),c=s.length,(r||b||t.attr("data-condition")==="notempty")&&t.find(".ags-wc-filters-list:first input").each(function(){var n=e(this);_.push({parent:'label[for="'+n.attr("id")+'"]',filter:r||t.attr("data-ags-wc-filters-real-query-var"),value:n.val()})});break;case"search":s=t.find('input[type="search"]:first').val().trim(),s&&(m(o,s,'"'+s+'"'),c=1);break;case"number_range":p=t.find('input[type="number"]:first'),a=p.val(),i=t.find('input[type="number"]:last').val(),(a||i)&&(parseInt(a)!==parseInt(p.attr("min"))||parseInt(i)!==parseInt(p.attr("max")))?(a=a.length?parseInt(a):"",i=i.length?parseInt(i):"",s=a+"-"+i,h=t.find(".ags-wc-filters-number-range-container").data("currency-symbol"),h||(h=""),a?i?(u="min-max"):(u="min"):(u="max"),l=n.find(".ags-wc-filters-sections:first").parent().attr("data-range-text-"+u).replace("%filter%",t.find(".ags-wc-filters-section-title h4:first").text()),u!=="max"&&(l=l.replace("%min%",h+a)),u!=="min"&&(l=l.replace("%max%",h+i)),m(o,s,l),c=1):(s=null);break;case"stars":v=t.find(".ags-wc-filters-stars-control:first").clone(),v.find(".ags-wc-filters-star-hover").removeClass("ags-wc-filters-star-hover"),s=v.attr("data-value"),s==="0"?s=null:(m(o,s,v.html(),!0),c=1);break}s&&(s.length&&(o=t.data("ags-wc-filters-query-var"),d[o]||(d[o]=[]),typeof s=="object"?d[o]=d[o].concat(s):d[o].push(s)),t.attr("data-ags-wc-filters-real-query-var")==="shopCategory"&&(k=s)),t.find(".ags-wc-filters-title-active-count:first").text(c?"("+c+")":"")}),b.has("*").length?b.closest(".ags-wc-filters-selected-outer").show():b.closest(".ags-wc-filters-selected-outer").hide(),i!==!1){for(p in d){y=[];for(h=0;h<d[p].length;++h)y.indexOf(d[p][h])===-1&&y.push(d[p][h]);x+=(x?"&":"")+p+"="+y.map(encodeURIComponent).join("&"+p+"=")}if(u=i||location.href,O=u.indexOf("#"),O===-1?(C=""):(C=u.substring(O),u=u.substring(0,O)),g=u.indexOf("?"),g!==-1){d=u.substring(g+1).split("&"),j=[];for(h=0;h<d.length;++h)d[h]=d[h].split("="),E.indexOf(d[h][0])===-1&&(i||l||d[h][0].substring(0,8)!=="shopPage")&&j.push(d[h].join("="));u=u.substring(0,g)+(j.length?"?"+j.join("&"):"")}x&&(u+=(u.indexOf("?")===-1?"?":"&")+x),u=u+C,w=t.attr("data-shop-url"),w||(w=window.location.href),A=!v(u,w),(A||!t.hasClass("ags-woo-shop-ajax-loaded"))&&(A&&window.history.pushState("",document.title,u),c(t,a,r)),S=n.closest(".ags_woo_products_filters").addBack(".ags_woo_products_filters"),s(e(".ags_woo_products_filters").not(S)),o(null,null,S),k&&n.find('.ags-wc-filters-section[data-condition="category"]').each(function(){for(var t=e(this),a=t.attr("data-condition-categories").split(","),o=!1,i=0;i<a.length;++i)if(k.indexOf(a[i])!==-1){o=!0;break}o||s(n,!0,t),t.closest(".ags_woo_products_filters_child").toggleClass("ags-wc-filters-hidden",!o)})}_.length&&e.post(f(!0),{ags_wc_filters_product_counts:JSON.stringify(_)},function(t){for(var i,a,r,c,o=0;o<t.length;++o)t[o].parent&&(r=parseInt(t[o].count),i=e(t[o].parent),a=i.closest(".ags-wc-filters-section"),c=!1,a.hasClass("ags-wc-filters-hide-zero-count")&&(i.closest("li").toggleClass("ags-wc-filters-hidden",!r),c=!r,window.ags_wc_filters_maybeToggleNoOptionsMessage(a)),!c&&a.data("ags-wc-filters-dynamic-product-counts")&&i.find(".ags-wc-filters-product-count").text(t[o].count));n.find('.ags-wc-filters-section[data-condition="notempty"]').each(function(){var o,i,a=e(this),r=a.attr("data-ags-wc-filters-dynamic-product-counts");if(r||(r=a.attr("data-ags-wc-filters-real-query-var")),r){o=!0;for(i=0;i<t.length;++i)if(t[i].filter===r){if(parseInt(t[i].count)){o=!0;break}o=!1}o||s(n,!0,a),a.closest(".ags_woo_products_filters_child").toggleClass("ags-wc-filters-hidden",!o)}})},"json")};function v(e,t){e[0]==="/"&&(e=window.location.protocol+"//"+window.location.host+(window.location.port?":"+window.location.port:"")+e),t[0]==="/"&&(t=window.location.protocol+"//"+window.location.host+(window.location.port?":"+window.location.port:"")+t);var n,s,o,i,a,r=e.indexOf("#");if(r!==-1&&(e=e.substring(0,r)),i=t.indexOf("#"),i!==-1&&(t=t.substring(0,i)),n=e.indexOf("?"),n!==t.indexOf("?"))return!1;if(n===-1)return e===t;if(e.substring(0,n)!==t.substring(0,n))return!1;if(s=e.substring(n+1).split("&"),a=t.substring(n+1).split("&"),s.length!==a.length)return!1;for(o=0;o<s.length;++o)if(a.indexOf(s[o])===-1)return!1;return!0}function f(t){var n,s,i,c,o=window.location.href,r=o.indexOf("?"),a=o.indexOf("#");if(r!==-1){s=o.substring(r+1,a===-1?o.length:a).split("&"),i={};for(n=0;n<s.length;++n)s[n]=s[n].split("="),t&&(c=e('.ags-wc-filters-section[data-ags-wc-filters-real-query-var][data-ags-wc-filters-query-var="'+s[n][0].replaceAll(/"/g,"")+'"]'),c.length&&(s[n][0]=c.attr("data-ags-wc-filters-real-query-var"))),i[s[n][0]]?i[s[n][0]].push([s[n][1]]):i[s[n][0]]=[s[n][1]];for(fieldName in i)i[fieldName]=fieldName+"="+i[fieldName].join("%2C");o=o.substring(0,r+1)+Object.values(i).join("&")+(a===-1?"":o.substring(a))}return o}function c(n,s,o){s||(s=[]);var i=n.closest("body"),a=i.find(".ags_woo_notices").get().map(function(e){return e.className.split(" ").filter(function(e){return e.indexOf("ags_woo_notices_")===0})[0]}),a=a.map(function(e){return{name:"ags_wc_filters_ajax_notices[]",value:e}}),c=[{name:"ags_wc_filters_ajax_shop",value:n[0].className.split(" ").filter(function(e){return e.indexOf("ags_woo_shop_plus_")===0})[0]}].concat(a).concat(s),r=f();t.attr("data-shop-url",r),e.ajax({type:"POST",dataType:"text",url:r,data:c,beforeSend:function(){n.addClass("ags-woo-shop-loading")},success:function(t){var n=t.indexOf("");if(t=n===-1?null:JSON.parse(t.substring(n+21)),t){if(t.dswcpRedirect){window.location.href=t.dswcpRedirect;return}for(shopId in t.shop)h(i.find("."+shopId).html(t.shop[shopId]).removeClass("ags-woo-shop-loading").addClass("ags-woo-shop-ajax-loaded"));if(e('.ags-wc-filters-sections .ags-wc-filters-section[data-ags-wc-filters-query-var="shopPrice"]').each(function(){ags_wc_filters_initFilters(e(this))}),t.notices)for(noticeId in t.notices)i.find("."+noticeId).html(t.notices[noticeId])}o&&o(t)},error:function(){n.removeClass("ags-woo-shop-loading"),o&&o()}})}function h(t){t.find("select.orderby").change(function(t){t.originalEvent.stopPropagation();var o=e(this),s=o.val(),n=e(".ags_woo_shop_plus").index(o.closest(".ags_woo_shop_plus")),n=n?n+1:"";return window.history.pushState(null,document.title,new RegExp("([?&]shopOrder"+n+"=)").test(window.location.search)?window.location.href.replace(new RegExp("([?&]shopOrder"+n+"=)([^&]*)"),s==="menu_order"?"":"$1"+s.replaceAll(/\$/g,"$$")):window.location.href.substring(0,window.location.href.length-window.location.hash.length)+(s==="menu_order"?"":(window.location.href.indexOf("?")===-1?"?":"&")+"shopOrder"+n+"="+s)+window.location.hash),c(o.closest(".ags-divi-wc-shop-ajax")),!1})}window.ags_wc_filters_isInVisualBuilder||h(e(".ags-divi-wc-shop-ajax").on("click","a",function(){var n,s,i,a,r,l,d,u,h,m,f,p,g,t=e(this);if(t.hasClass("add_to_cart_button")&&t.attr("href").indexOf("add-to-cart=")!==-1&&!t.hasClass("wcpa_has_options")){if(d=[],d=t.closest(".product").find(":input").serializeArray(),u=t.attr("href").split("?"),u.length===2){s=u[1].split("&");for(n=0;n<s.length;++n)g={},a=s[n].indexOf("="),d.push({name:a?s[n].substring(0,a):s[n],value:a?s[n].substring(a+1):""})}return c(t.closest(".ags-divi-wc-shop-ajax"),d,function(e){window.jQuery(document.body).trigger("added_to_cart",[e&&e["wc-fragments"]?e["wc-fragments"]:{},e&&e["wc-cart-hash"]?e["wc-cart-hash"]:""])}),!1}if(t.closest(".woocommerce-pagination").length)return i=t.closest(".ags-divi-wc-shop-ajax"),m=e(".ags_woo_shop_plus").index(i.closest(".ags_woo_shop_plus")),r="shopPage"+(m?m+1:""),p=t.attr("href"),h=new RegExp("[?&]"+r+"=([0-9]+)").exec(p),l=h?h[1]:null,window.history.pushState(null,document.title,new RegExp("([?&]"+r+"=)").test(window.location.search)?window.location.href.replace(new RegExp("([?&]"+r+"=)([^&]*)"),l?"$1"+l:""):window.location.href.substring(0,window.location.href.length-window.location.hash.length)+(l?(window.location.href.indexOf("?")===-1?"?":"&")+r+"="+l:"")+window.location.hash),c(i,null,function(){window.et_pb_smooth_scroll&&window.et_pb_smooth_scroll(i)}),!1;if(t.closest(".categories").length&&(f=t.data("filter-url"),f&&e('.ags-wc-filters-section[data-ags-wc-filters-query-var="shopCategory"]:not(.ags-wc-filters-children-hide):first').length))return i=t.closest(".ags-divi-wc-shop-ajax"),window.history.pushState(null,document.title,decodeURIComponent(f)),o(null,function(){window.et_pb_smooth_scroll&&window.et_pb_smooth_scroll(i)}),!1}));function o(t,n,o,i){t&&e(".ags-wc-filters-sections").each(function(){s(e(this))});for(var a,r,c,l,m,f,p,u=e(".ags-wc-filters-section").get().map(function(t){return e(t).data("ags-wc-filters-query-var")}),g=window.location.search.substring(1).split("&"),d={},h=0;h<g.length;++h)for(l=0;l<u.length;++l)if(g[h].substring(0,u[l].length+1)===u[l]+"="){c=u[l],p=decodeURIComponent(g[h].substring(c.length+1)),d[c]?d[c].push(p):d[c]=[p];break}for(c in d)a=d[c],a.length&&(r=!1,e('.ags-wc-filters-section[data-ags-wc-filters-query-var="'+c+'"]').each(function(){switch($filters=e(this),window.ags_wc_filters_getDisplayType($filters)){case"checkboxes_list":case"dropdown_multi_select":case"colors":case"images":for(var t=$filters.find(".ags-wc-filters-list:first :checkbox[value='"+a[0]+"']"),n=1;n<a.length;++n)t=t.add($filters.find(".ags-wc-filters-list:first :checkbox[value='"+a[n]+"']"));r=$filters.find(".ags-wc-filters-list:first :checkbox:checked").not(t).prop("checked",!1).change().length||r,r=t.not(":checked").prop("checked",!0).change().length||r;break;case"radio_buttons":r=$filters.find(".ags-wc-filters-list:first :radio[value='"+a[0]+"']:not(:checked)").prop("checked",!0).change().length||r;break;case"dropdown_single_select":r=$filters.find('.ags-wc-filters-dropdown-single-options:first a[data-id="'+a[0]+'"]:not(.ags-wc-filters-active):first').click().length||r;break;case"search":$filters.find('input[type="search"]:first').val(a[0]).trigger("input");break;case"number_range":a=a[0].split("-"),$filters.find('input[type="number"]:first').val(a[0]),$filters.find('input[type="number"]:last').val(a[1]).trigger("input");break;case"stars":(a[0].length===2?a[0][1]==="+":a[0].length===1)&&a[0][0]>=1&&a[0][0]<=5&&$filters.find(".ags-wc-filters-stars:first span:eq("+(a[0][0]-1)+")").click();break}}));m=typeof o=="object",(!o||m)&&(f=e(".ags_woo_products_filters"),m&&(f=f.not(o)),f.each(function(){window.ags_wc_filters_applyFilters(e(this),!m&&null,null,n,i)}))}window.ags_wc_filters_isInVisualBuilder||(e(window).on("popstate",o),e(".ags-wc-filters-button-clear").click(function(){s(e(this).closest(".ags_woo_products_filters"),!0)}));function s(t,n,s){t.find(".ags-wc-filters-section").filter(s||"*").each(function(){var o,i,a,r,c,l,d,u,s=e(this);switch(window.ags_wc_filters_getDisplayType(s)){case"radio_buttons":o=s.find("input[value='all']:first"),o.prop("checked")||(o.prop("checked",!0).change(),n&&window.ags_wc_filters_applyFilters(t));break;case"dropdown_single_select":s.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a").removeClass("ags-wc-filters-active"),d=s.find(".ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a[data-id='all']").addClass("ags-wc-filters-active").data("label"),s.find(".ags-wc-filters-dropdown-single .ags-wc-filters-active a span").text(d),s.closest(".ags_woo_products_filters").find('.ags-wc-filters-selected:first .ags-wc-filters-selected-inner[data-filter^="'+s.data("ags-wc-filters-query-var")+':"]').remove(),n&&window.ags_wc_filters_applyFilters(t);break;case"dropdown_multi_select":case"checkboxes_list":case"colors":case"images":i=!1,s.find(".ags-wc-filters-list:first :checkbox").each(function(){e(this).prop("checked")===!0&&(e(this).prop("checked",!1).change(),i=!0)}),i&&n&&window.ags_wc_filters_applyFilters(t),s.find(".ags-wc-filters-active span").text(s.find(".ags-wc-filters-dropdown-multi:first").data("placeholder-text"));break;case"search":a=s.find('input[type="search"]:first'),a.val()&&(a.val("").trigger("input"),n&&window.ags_wc_filters_applyFilters(t));break;case"number_range":r=s.find('input[type="number"]:first'),c=s.find('input[type="number"]:last'),(r.val()||c.val())&&(r.val(""),c.val("").trigger("input"),n&&window.ags_wc_filters_applyFilters(t));break;case"stars":l=s.find(".ags-wc-filters-stars-control:first"),u=parseInt(l.attr("data-value"))!==0,u&&(l.attr("data-value",0).find(".ags-wc-filters-stars:first > span").removeClass("ags-wc-filters-star-filled").addClass("ags-wc-filters-star-empty"),s.closest(".ags_woo_products_filters").find('.ags-wc-filters-selected:first .ags-wc-filters-selected-inner[data-filter^="'+s.data("ags-wc-filters-query-var")+':"]').remove(),n&&window.ags_wc_filters_applyFilters(t));break}})}e(".ags_woo_products_filters .ags-wc-filters-filter-clear").on("click",function(){return s(e(this).closest(".ags_woo_products_filters"),!0,e(this).closest(".ags-wc-filters-section")),!1}),e(".ags_woo_products_filters").find(".ags-wc-filters-selected:first").on("click",".ags-wc-filters-remove",function(){if(window.ags_wc_filters_isInVisualBuilder)return!1;var o,a,n=e(this).parent(),i=n.data("filter").split(":"),s=n.closest(".ags_woo_products_filters"),t=s.find('.ags-wc-filters-section[data-ags-wc-filters-query-var="'+i[0]+'"]');switch(window.ags_wc_filters_getDisplayType(t)){case"dropdown_multi_select":case"checkboxes_list":case"colors":case"images":t.find('.ags-wc-filters-list:first input[value="'+i[1]+'"]').prop("checked",!1).change();break;case"dropdown_single_select":t.find('.ags-wc-filters-dropdown-single-options:first a[data-id="all"]:first').click();break;case"radio_buttons":t.find('.ags-wc-filters-list:first input[value="all"]').prop("checked",!0).change();break;case"search":t.find('input[type="search"]:first').val("").trigger("input");break;case"number_range":t.find('input[type="number"]:first').val(""),t.find('input[type="number"]:last').val("").trigger("input");break;case"stars":o=t.find(".ags-wc-filters-stars-control:first"),a=o.data("star-empty"),o.attr("data-value",0).find(".ags-wc-filters-stars:first > span").removeClass("ags-wc-filters-star-filled").addClass("ags-wc-filters-star-empty");break}s.has(".ags-wc-filters-button-apply").length||window.ags_wc_filters_applyFilters(s),n.remove()}),e(".ags-wc-filters-section").each(function(){var t=e(this);window.ags_wc_filters_initFilters(t),window.ags_wc_filters_maybeToggleNoOptionsMessage(t)}),e(window).on("et_builder_api_ready",function(){var s,n=[];function o(e){for(var t=0;t<e.length;++t)e[t].type==="ags_woo_shop_plus"?e[t].attrs.filter_target==="on"&&n.push(e[t]._key):typeof e[t].content=="object"&&o(e[t].content)}window.et_gb.wp.hooks.addFilter("et.builder.store.action.dispatched","ags-wc-filters",function(e){switch(e.actionType){case"MODULE_EDIT_SETTINGS_CHANGE":if(e.module.props.type==="ags_woo_shop_plus"&&e.setting==="filter_target"){var t=n.indexOf(e.module.props._key);e.newValue==="on"?t===-1&&n.push(e.module.props._key):t!==-1&&n.splice(t,1),window.ags_wc_filters_noShopFilteringModule=!n.length,window.ags_wc_filters_multipleShopFilteringModules=n.length>1}break;case"ET_SET_ROOT_MOUNTED":o(ETBuilderBackend.shortcodeObject),window.ags_wc_filters_noShopFilteringModule=!n.length,window.ags_wc_filters_multipleShopFilteringModules=n.length>1;break}return e}),window.et_gb.wp.hooks.addAction("et.builder.store.module.settings.open","ags-wc-filters",function(e){if(s&&(clearTimeout(s),s=null),window.jQuery(".et_pb_module[data-agswc-active-toggle]").attr("data-agswc-active-toggle",null),e.props&&e.props.type&&e.props.type.substring(0,8)==="ags_woo_"){var n=e.props._key,t=null;s=setInterval(function(){var e=window.et_gb.jQuery(".et-fb-tabs__panel--active:first .et-fb-form__toggle-opened:first").data("name");(e!==t||!window.jQuery(".et-module-"+n+"[data-agswc-active-toggle]").length)&&(t=e,window.jQuery(".et-module-"+n).attr("data-agswc-active-toggle",t||null))},500)}}),window.et_gb.wp.hooks.addAction("et.builder.store.module.settings.close","ags-wc-filters",function(){s&&(clearTimeout(s),s=null),window.jQuery(".et_pb_module[data-agswc-active-toggle]").attr("data-agswc-active-toggle",null)})}),window.ags_wc_filters_isInVisualBuilder||o(null,null,!1,!0),e(".dswcp-checkout-steps a").on("click",function(){return location.hash=e(this).attr("href"),!1}),d=e(".dswcp-checkout-steps").attr("data-hidden-steps"),d&&e(d).hide(),g=e(".dswcp-checkout-steps li:first").addClass("dswcp-checkout-step-active"),e(".dswcp-checkout-steps li:not(.dswcp-checkout-step-active)").each(function(){e(e(this).attr("data-selector")).hide()}),a=e(".dswcp-checkout-steps-buttons:first").insertAfter(g.attr("data-selector")),a.find(".dswcp-button-back").hide();function b(t){e(".dswcp-checkout-loader").prependTo(t)}function m(){e(".dswcp-checkout-loader").appendTo(".ags_woo_multi_step_checkout")}location.hash&&e('.dswcp-checkout-steps li a[href="'+location.hash+'"]').length&&(location.hash=""),l=!0,e(window).on("hashchange",function(t){if(!l){l=!0;return}if(location.hash)var n,o,i,r,s=e('.dswcp-checkout-steps li:has(a[href="'+location.hash+'"]):first');else if(t.originalEvent&&t.originalEvent.oldURL&&t.originalEvent.oldURL.indexOf("#")!==-1&&e('.dswcp-checkout-steps li a[href="#'+t.originalEvent.oldURL.split("#").pop()+'"]:first').length)s=e(".dswcp-checkout-steps li:first");else return;n=e(".dswcp-checkout-steps .dswcp-checkout-step-active:first"),o=e(n.attr("data-selector")),i=e(s.attr("data-selector")),r=function(){n.removeClass("dswcp-checkout-step-active"),o.hide(),s.addClass("dswcp-checkout-step-active");var t=i.find("button#place_order"),e=a.find(".dswcp-button-continue");t.length?(e.attr("data-original-content",e.html()).html(t.html()).attr("type","submit"),t.hide()):e.attr("type")==="submit"&&e.attr("type","button").html(e.attr("data-original-content")),i.show(),window.et_pb_smooth_scroll&&window.et_pb_smooth_scroll(i),a.insertAfter(i),a.find(".dswcp-button-back").toggle(s.prev().length>0),m()},e(".ags_woo_notices:visible .woocommerce-notices-wrapper").empty().length||e(".ags_woo_multi_step_checkout .dswcp-checkout-steps").next(".woocommerce-notices-wrapper").empty(),n.length&&n.index()<s.index()&&o.has(":input").length?(b(o),e.post(woocommerce_params.ajax_url,{action:"dswcp_validate_checkout_step",fields:o.find(":input").serialize()},function(t){if(t.success||!t.data)r();else{var o,s=e(".ags_woo_notices:visible .woocommerce-notices-wrapper").first();s.length||(o=e(".ags_woo_multi_step_checkout .dswcp-checkout-steps"),s=o.next(".woocommerce-notices-wrapper"),s.length||(s=e("<div>").addClass("woocommerce-notices-wrapper").insertAfter(o))),s.empty().append(t.data),l=!1,location.hash=n.children("a").attr("href"),window.et_pb_smooth_scroll&&window.et_pb_smooth_scroll(s),m()}}).fail(function(){r()})):r()}),e(document).on("focus blur",".ags_woo_mini_cart .et_pb_module_inner > a",function(t){e(this).closest(".ags_woo_mini_cart").toggleClass("dswcp-focus",t.type==="focusin")}),e(document).on("click",".ags_woo_mini_cart .et_pb_module_inner > a",function(){var t,n,s=e(this).trigger("blur"),o=s.closest(".ags_woo_mini_cart"),i=e(window).outerWidth()<=980;switch(s.closest(".ags_woo_mini_cart").attr(i?"data-action-click-mobile":"data-action-click")){case"sidecart":return n=o.attr("data-side-cart-id"),n&&(t=e("#"+n),t.hasClass("dswcp-show-side-cart")?(t.addClass("dswcp-closing-side-cart"),t.removeClass("dswcp-show-side-cart dswcp-show-side-cart-click"),setTimeout(function(){t.removeClass("dswcp-closing-side-cart")},400)):t.addClass("dswcp-show-side-cart dswcp-show-side-cart-click")),!1;case"dropdowncart":return i||o.closest(".ags_woo_mini_cart").toggleClass("dswcp-show-dropdown"),!1}}),n=null;function u(t,n,s,o){if(t.addClass("ags_woo_mini_cart_updating"),!s){var a,r,i=t.attr("data-side-cart-id");i&&(a=e("#"+i),r=a.attr("class"),a.addClass("ags_woo_mini_cart_updating").prepend(e("<div>").addClass("dswcp-side-cart-overlay").append(e("<span>").text(t.attr("data-loading-text")))))}e("<div>").addClass("dswcp-dropdown-cart-overlay").append(e("<span>").text(t.attr("data-loading-text"))).prependTo(t.find(".dswcp-dropdown-cart:first")),e.post(woocommerce_params.ajax_url,Object.assign({action:"dswcp_update_cart",cartConfig:t.attr("data-update-cart-config"),sideCartId:s?"":i,_ajax_nonce:t.attr("data-update-cart-nonce")},n||{}),function(n){if(n.success&&n.data&&n.data.html){!s&&i&&e("#"+i).remove();var a=t.find(".et_pb_module_inner:first");a.html(n.data.html),t.removeClass("ags_woo_mini_cart_updating"),!s&&i&&e("#"+i).attr("class",null).attr("class",r),o&&o()}else location.reload()},"json").fail(function(){location.reload()})}window.ags_wc_filters_isInVisualBuilder||(e(document).on("change",".dswcp-side-cart .dswcp-quantity",function(){var n,s=e(this),t=s.closest(".dswcp-side-cart").attr("id");if(t&&(t=t.substring(0,t.length-11),n=e("."+t+":first")),!t||!n.length)return;u(n,{cartAction:"update-quantity",item:s.closest("[data-cart-item-key]").attr("data-cart-item-key"),quantity:s.val()},!1,function(){e(document.body).trigger("updated_wc_div",{_dswcp_skip:n})})}),e(document).on("click",".ags_woo_mini_cart .dswcp-remove, .dswcp-side-cart .dswcp-remove",function(){var t,s=e(this),n=s.closest(".ags_woo_mini_cart");if(n.length||(t=s.closest(".dswcp-side-cart").attr("id"),t&&(t=t.substring(0,t.length-11),n=e("."+t+":first"))),!n.length)return;u(n,{cartAction:"item-remove",item:s.closest("[data-cart-item-key]").attr("data-cart-item-key")},!1,function(){e(document.body).trigger("removed_from_cart",{_dswcp_skip:n})})}),e(document.body).on("added_to_cart removed_from_cart updated_wc_div wc_cart_emptied",function(t,n){var s=e(".et_pb_module.ags_woo_mini_cart");n._dswcp_skip&&(s=s.not(n._dswcp_skip)),s.each(function(){u(e(this),null,n._dswcp_skip&&n._dswcp_skip.attr("data-side-cart-id")&&n._dswcp_skip.attr("data-side-cart-id")===e(this).attr("data-side-cart-id"))})})),e(document).on("click",".dswcp-side-cart .dswcp-close",function(){var t=e(this).closest(".dswcp-side-cart");t.addClass("dswcp-closing-side-cart").removeClass("dswcp-show-side-cart dswcp-show-side-cart-click"),setTimeout(function(){t.removeClass("dswcp-closing-side-cart")},500)}),e(document).on("click",".ags_woo_mini_cart .dswcp-dropdown-cart .dswcp-close",function(){e(this).closest(".ags_woo_mini_cart").removeClass("dswcp-show-dropdown")}),e(document).on("click",'.dswcp-button-continue[type="button"]',function(){location.hash=e(".dswcp-checkout-steps .dswcp-checkout-step-active:first").next().children("a").attr("href")}),e(document).on("click",".dswcp-button-back",function(){location.hash=e(".dswcp-checkout-steps .dswcp-checkout-step-active:first").prev().children("a").attr("href")}),e(document).on("touchstart",".dswcp-side-cart",function(t){t.originalEvent.touches.length===1&&(n=t.originalEvent.touches[0].clientX,e(this).addClass("dswcp-dragging"))}),e(document).on("touchmove",function(t){n!==null&&e(".dswcp-side-cart.dswcp-dragging").css("right",t.originalEvent.touches[0].clientX-n>0?n-t.originalEvent.touches[0].clientX+"px":null)}),e(document).on("touchend",function(){if(n!==null){n=null;var s=e(".dswcp-side-cart.dswcp-dragging"),o=parseInt(s.css("right"))*-2>=s.width();o&&(s.addClass("dswcp-closing-side-cart").removeClass("dswcp-show-side-cart"),setTimeout(function(){s.removeClass("dswcp-closing-side-cart")},400)),s.removeClass("dswcp-dragging").css("right","")}})}),!function(){"use strict";e=function(e){this.input=null,this.inputDisplay=null,this.slider=null,this.sliderWidth=0,this.sliderLeft=0,this.pointerWidth=0,this.pointerR=null,this.pointerL=null,this.activePointer=null,this.selected=null,this.scale=null,this.step=0,this.tipL=null,this.tipR=null,this.timeout=null,this.valRange=!1,this.values={start:null,end:null},this.conf={target:null,values:null,set:null,range:!1,width:null,scale:!0,labels:!0,tooltip:!0,step:null,disabled:!1,onChange:null,valuePrefix:""},this.cls={container:"rs-container",background:"rs-bg",selected:"rs-selected",pointer:"rs-pointer",scale:"rs-scale",noscale:"rs-noscale",tip:"rs-tooltip"};for(var t in this.conf)e.hasOwnProperty(t)&&(this.conf[t]=e[t]);this.init()},e.prototype.init=function(){return"object"==typeof this.conf.target?this.input=this.conf.target:this.input=document.getElementById(this.conf.target.replace("#","")),this.input?(this.inputDisplay=getComputedStyle(this.input,null).display,this.input.style.display="none",this.valRange=!(this.conf.values instanceof Array),!this.valRange||this.conf.values.hasOwnProperty("min")&&this.conf.values.hasOwnProperty("max")?this.createSlider():console.log("Missing min or max value...")):console.log("Cannot find target element...")},e.prototype.createSlider=function(){return this.slider=t("div",this.cls.container),this.slider.innerHTML='<div class="rs-bg"></div>',this.selected=t("div",this.cls.selected),this.pointerL=t("div",this.cls.pointer,["dir","left"]),this.conf.scale&&(this.scale=t("div",this.cls.scale)),this.conf.tooltip&&(this.tipL=t("div",this.cls.tip),this.tipR=t("div",this.cls.tip),this.pointerL.appendChild(this.tipL)),this.slider.appendChild(this.selected),this.conf.scale&&this.slider.appendChild(this.scale),this.slider.appendChild(this.pointerL),this.conf.range&&(this.pointerR=t("div",this.cls.pointer,["dir","right"]),this.conf.tooltip&&this.pointerR.appendChild(this.tipR),this.slider.appendChild(this.pointerR)),this.input.parentNode.insertBefore(this.slider,this.input.nextSibling),this.conf.width&&(this.slider.style.width=parseInt(this.conf.width)+"px"),this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.pointerWidth=this.pointerL.clientWidth,this.conf.scale||this.slider.classList.add(this.cls.noscale),this.setInitialValues()},e.prototype.setInitialValues=function(){if(this.disabled(this.conf.disabled),this.valRange&&(this.conf.values=s(this.conf)),this.values.start=0,this.values.end=this.conf.range?this.conf.values.length-1:0,this.conf.set&&this.conf.set.length&&o(this.conf)){var e=this.conf.set;this.conf.range?(this.values.start=this.conf.values.indexOf(e[0]),this.values.end=this.conf.set[1]?this.conf.values.indexOf(e[1]):null):this.values.end=this.conf.values.indexOf(e[0])}return this.createScale()},e.prototype.createScale=function(){if(this.step=this.sliderWidth/(this.conf.values.length-1),this.conf.scale)for(var s,o,n=0,i=this.conf.values.length;n<i;n++)o=t("span"),s=t("ins"),o.appendChild(s),this.scale.appendChild(o),o.style.width=n===i-1?0:this.step+"px",this.conf.labels?s.innerHTML=this.conf.values[n]:0!==n&&n!==i-1||(s.innerHTML=this.conf.valuePrefix+this.conf.values[n]),s.style.marginLeft=s.clientWidth/2*-1+"px";return this.addEvents()},e.prototype.updateScale=function(){this.step=this.sliderWidth/(this.conf.values.length-1);for(var t=this.slider.querySelectorAll("span"),e=0,n=t.length;e<n;e++)t[e].style.width=this.step+"px";return this.setValues()},e.prototype.addEvents=function(){var e,t,s=this.slider.querySelectorAll("."+this.cls.pointer),o=this.slider.querySelectorAll("span");n(document,"mousemove touchmove",this.move.bind(this)),n(document,"mouseup touchend touchcancel",this.drop.bind(this));for(e=0,t=s.length;e<t;e++)n(s[e],"mousedown touchstart",this.drag.bind(this));for(e=0,t=o.length;e<t;e++)n(o[e],"click",this.onClickPiece.bind(this));return window.addEventListener("resize",this.onResize.bind(this)),this.setValues()},e.prototype.drag=function(e){if(e.preventDefault(),!this.conf.disabled){var t=e.target.getAttribute("data-dir");return"left"===t&&(this.activePointer=this.pointerL),"right"===t&&(this.activePointer=this.pointerR),this.slider.classList.add("sliding")}},e.prototype.move=function(e){if(this.activePointer&&!this.conf.disabled){var t=("touchmove"===e.type?e.touches[0].clientX:e.pageX)-this.sliderLeft-this.pointerWidth/2;return(t=Math.round(t/this.step))<=0&&(t=0),t>this.conf.values.length-1&&(t=this.conf.values.length-1),this.conf.range?(this.activePointer===this.pointerL&&(this.values.start=t),this.activePointer===this.pointerR&&(this.values.end=t)):this.values.end=t,this.setValues()}},e.prototype.drop=function(){this.activePointer=null},e.prototype.setValues=function(e,t){var n=this.conf.range?"start":"end";return this.conf.values.indexOf(e)>-1&&(this.values[n]=this.conf.values.indexOf(e)),t&&this.conf.values.indexOf(t)>-1&&(this.values.end=this.conf.values.indexOf(t)),this.conf.range&&this.values.start>this.values.end&&(this.values.start=this.values.end),this.pointerL.style.left=this.values[n]*this.step-this.pointerWidth/2+"px",this.conf.range?(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.valuePrefix+this.conf.values[this.values.start],this.tipR.innerHTML=this.conf.valuePrefix+this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.start]+","+this.conf.values[this.values.end],this.pointerR.style.left=this.values.end*this.step-this.pointerWidth/2+"px"):(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.end]),this.values.end>this.conf.values.length-1&&(this.values.end=this.conf.values.length-1),this.values.start<0&&(this.values.start=0),this.selected.style.width=(this.values.end-this.values.start)*this.step+"px",this.selected.style.left=this.values.start*this.step+"px",this.onChange()},e.prototype.onClickPiece=function(e){if(!this.conf.disabled){var t=Math.round((e.clientX-this.sliderLeft)/this.step);return t>this.conf.values.length-1&&(t=this.conf.values.length-1),t<0&&(t=0),this.conf.range&&t-this.values.start<=this.values.end-t?this.values.start=t:this.values.end=t,this.slider.classList.remove("sliding"),this.setValues()}},e.prototype.onChange=function(){var e=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){if(e.conf.onChange&&"function"==typeof e.conf.onChange)return e.conf.onChange(e.input.value)},500)},e.prototype.onResize=function(){return this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.updateScale()},e.prototype.disabled=function(e){this.conf.disabled=e,this.slider.classList[e?"add":"remove"]("disabled")},e.prototype.getValue=function(){return this.input.value},e.prototype.destroy=function(){this.input.style.display=this.inputDisplay,this.slider.remove()};var e,t=function(e,t,n){var s=document.createElement(e);return t&&(s.className=t),n&&2===n.length&&s.setAttribute("data-"+n[0],n[1]),s},n=function(e,t,n){for(var o=t.split(" "),s=0,i=o.length;s<i;s++)e.addEventListener(o[s],n)},s=function(e){var n,s,t=[],o=e.values.max-e.values.min;if(!e.step)return console.log("No step defined..."),[e.values.min,e.values.max];for(n=0,s=o/e.step;n<s;n++)t.push(e.values.min+n*e.step);return t.indexOf(e.values.max)<0&&t.push(e.values.max),t},o=function(e){return!e.set||e.set.length<1?null:e.values.indexOf(e.set[0])<0?null:!e.range||!(e.set.length<2||e.values.indexOf(e.set[1])<0)||null};window.rSlider=e}()})();function ags_wc_filters_getDisplayType(e){if(e.has(".ags-wc-filters-checkbox-list").length)return"checkboxes_list";if(e.has(".ags-wc-filters-radio-button-list").length||e.has(".ags-wc-filters-tagcloud").length)return"radio_buttons";if(e.has(".ags-wc-filters-dropdown-single").length)return"dropdown_single_select";if(e.has(".ags-wc-filters-dropdown-multi").length)return"dropdown_multi_select";if(e.has(".ags-wc-filters-search-container").length)return"search";if(e.has(".ags-wc-filters-number-range-container").length)return"number_range";if(e.has(".ags-wc-filters-stars-control").length)return"stars";if(e.has(".ags-wc-filters-colors").length)return"colors";if(e.has(".ags-wc-filters-images").length)return"images"}function ags_wc_filters_set_aliases(e){window.jQuery(".ags-wc-filters-section").each(function(){var t,n,s=window.jQuery(this).attr("data-ags-wc-filters-query-var");s.substring(0,14)==="shopAttribute_"?(t="shopAttribute"):s.substring(0,13)==="shopTaxonomy_"?(t="shopTaxonomy"):(t=s),n=e[t],n&&((t==="shopAttribute"||t==="shopTaxonomy")&&(n=n.replaceAll(/%s/g,s.substring(14))),window.jQuery(this).attr("data-ags-wc-filters-query-var",n))}),delete window.ags_wc_filters_aliases};
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);r=200==Math.round(t(n.width)),s.isBoxSizeOuter=r,i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,I=d&&r,x=t(s.width);x!==!1&&(a.width=x+(I?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(I?0:y+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+z),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var o=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?o.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,o){t=i.makeArray(t);var n=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!o)return void n.push(t);e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}}),n},i.debounceMethod=function(t,e,i){i=i||100;var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout(function(){o.apply(s,e),delete s[n]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var s=i.toDashed(o),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach(function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(a){return void(n&&n.error("Error parsing "+r+" on "+t.className+": "+a))}var u=new e(t,i);l&&l.data(t,o,u)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,r="string"==typeof s.transition?"transition":"WebkitTransition",a="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],h={transform:a,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"},d=o.prototype=Object.create(t.prototype);d.constructor=o,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var o=h[i]||i;e[o]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=parseFloat(o),r=parseFloat(n),a=this.layout.size;o.indexOf("%")!=-1&&(s=s/100*a.width),n.indexOf("%")!=-1&&(r=r/100*a.height),s=isNaN(s)?0:s,r=isNaN(r)?0:r,s-=e?a.paddingLeft:a.paddingRight,r-=i?a.paddingTop:a.paddingBottom,this.position.x=s,this.position.y=r},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),n&&!this.isTransitioning)return void this.layoutPosition();var s=t-i,r=e-o,a={};a.transform=this.getTranslate(s,r),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop");return t=i?t:-t,e=o?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+n(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(u,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(c)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,s){return e(t,i,o,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n){"use strict";function s(t,e){var i=o.getQueryElement(t);if(!i)return void(u&&u.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++l;this.element.outlayerGUID=n,f[n]=this,this._create();var s=this._getOption("initLayout");s&&this.layout()}function r(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var n=m[o]||1;return i*n}var u=t.console,h=t.jQuery,d=function(){},l=0,f={};s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=s.prototype;o.extend(c,e.prototype),c.option=function(t){o.extend(this.options,t)},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},s.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=e[n],r=new i(s,this);o.push(r)}return o},c._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map(function(t){return t.element})},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=i(this.element)},c._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},c._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)},this),this._processLayoutQueue(i)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},c.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},c._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},c._getContainerSize=d,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},c._emitCompleteOnItems=function(t,e){function i(){n.dispatchEvent(t+"Complete",null,[e])}function o(){r++,r==s&&i()}var n=this,s=e.length;if(!e||!s)return void i();var r=0;e.forEach(function(e){e.once(t,o)})},c.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),h)if(this.$element=this.$element||h(this.element),e){var n=h.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},c.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){o.removeFrom(this.stamps,t),this.unignore(t)},this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},c._manageStamp=d,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t),s={left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom};return s},c.handleEvent=o.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},o.debounceMethod(s,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),o.removeFrom(this.items,t)},this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete f[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){var i=r(s);return i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},s.compatOptions),i.namespace=t,i.data=s.data,i.Item=r(n),o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i};var m={ms:1,s:1e3};return s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype,n=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"];return n.forEach(function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}}),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry-layout/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o,a=r&&r<1?"round":"floor";s=Math[a](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,o=e(i);this.containerWidth=o&&o.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&e<1?"round":"ceil",o=Math[i](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var n=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",s=this[n](o,t),r={x:this.columnWidth*s.col,y:s.y},a=s.y+t.size.outerHeight,u=o+s.col,h=s.col;h<u;h++)this.colYs[h]=a;return r},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,o=t>1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a){var u=void 0!==e[s]?e[s]:e,h=u?1:-1;return(r>a?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},l._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},l.layout=function(){return!this._isLayoutInited&&this._getOption("initLayout")?void this.arrange():void this._layout()},l._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},l.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},l._init=l.arrange,l._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},l._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},l._bindArrangeComplete=function(){function t(){e&&i&&o&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},l._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},l._getFilterTest=function(t){return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t);
}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
(function(factory){
if(typeof define==="function"&&define.amd){
define(["jquery"], factory);
}else if(typeof module==="object"&&module.exports){
module.exports=factory(require("jquery") );
}else{
factory(jQuery);
}}(function($){
$.extend($.fn, {
validate: function(options){
if(!this.length){
if(options&&options.debug&&window.console){
console.warn("Nothing selected, can't validate, returning nothing.");
}
return;
}
var validator=$.data(this[ 0 ], "validator");
if(validator){
return validator;
}
this.attr("novalidate", "novalidate");
validator=new $.validator(options, this[ 0 ]);
$.data(this[ 0 ], "validator", validator);
if(validator.settings.onsubmit){
this.on("click.validate", ":submit", function(event){
validator.submitButton=event.currentTarget;
if($(this).hasClass("cancel") ){
validator.cancelSubmit=true;
}
if($(this).attr("formnovalidate")!==undefined){
validator.cancelSubmit=true;
}});
this.on("submit.validate", function(event){
if(validator.settings.debug){
event.preventDefault();
}
function handle(){
var hidden, result;
if(validator.submitButton&&(validator.settings.submitHandler||validator.formSubmitted) ){
hidden=$("<input type='hidden'/>")
.attr("name", validator.submitButton.name)
.val($(validator.submitButton).val())
.appendTo(validator.currentForm);
}
if(validator.settings.submitHandler&&!validator.settings.debug){
result=validator.settings.submitHandler.call(validator, validator.currentForm, event);
if(hidden){
hidden.remove();
}
if(result!==undefined){
return result;
}
return false;
}
return true;
}
if(validator.cancelSubmit){
validator.cancelSubmit=false;
return handle();
}
if(validator.form()){
if(validator.pendingRequest){
validator.formSubmitted=true;
return false;
}
return handle();
}else{
validator.focusInvalid();
return false;
}});
}
return validator;
},
valid: function(){
var valid, validator, errorList;
if($(this[ 0 ]).is("form") ){
valid=this.validate().form();
}else{
errorList=[];
valid=true;
validator=$(this[ 0 ].form).validate();
this.each(function(){
valid=validator.element(this)&&valid;
if(!valid){
errorList=errorList.concat(validator.errorList);
}});
validator.errorList=errorList;
}
return valid;
},
rules: function(command, argument){
var element=this[ 0 ],
isContentEditable=typeof this.attr("contenteditable")!=="undefined"&&this.attr("contenteditable")!=="false",
settings, staticRules, existingRules, data, param, filtered;
if(element===null||typeof element==='undefined'){
return;
}
if(!element.form&&isContentEditable){
element.form=this.closest("form")[ 0 ];
element.name=this.attr("name");
}
if(element.form===null||typeof element.form==='undefined'){
return;
}
if(command){
settings=$.data(element.form, "validator").settings;
staticRules=settings.rules;
existingRules=$.validator.staticRules(element);
switch(command){
case "add":
$.extend(existingRules, $.validator.normalizeRule(argument) );
delete existingRules.messages;
staticRules[ element.name ]=existingRules;
if(argument.messages){
settings.messages[ element.name ]=$.extend(settings.messages[ element.name ], argument.messages);
}
break;
case "remove":
if(!argument){
delete staticRules[ element.name ];
return existingRules;
}
filtered={};
$.each(argument.split(/\s/), function(index, method){
filtered[ method ]=existingRules[ method ];
delete existingRules[ method ];
});
return filtered;
}}
data=$.validator.normalizeRules($.extend({},
$.validator.classRules(element),
$.validator.attributeRules(element),
$.validator.dataRules(element),
$.validator.staticRules(element)
), element);
if(data.required){
param=data.required;
delete data.required;
data=$.extend({ required: param }, data);
}
if(data.remote){
param=data.remote;
delete data.remote;
data=$.extend(data, { remote: param });
}
return data;
}});
var trim=function(str){
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
};
$.extend($.expr.pseudos||$.expr[ ":" ], {		// '||$.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
blank: function(a){
return !trim("" + $(a).val());
},
filled: function(a){
var val=$(a).val();
return val!==null&&!!trim("" + val);
},
unchecked: function(a){
return !$(a).prop("checked");
}});
$.validator=function(options, form){
this.settings=$.extend(true, {}, $.validator.defaults, options);
this.currentForm=form;
this.init();
};
$.validator.format=function(source, params){
if(arguments.length===1){
return function(){
var args=$.makeArray(arguments);
args.unshift(source);
return $.validator.format.apply(this, args);
};}
if(params===undefined){
return source;
}
if(arguments.length > 2&&params.constructor!==Array){
params=$.makeArray(arguments).slice(1);
}
if(params.constructor!==Array){
params=[ params ];
}
$.each(params, function(i, n){
source=source.replace(new RegExp("\\{" + i + "\\}", "g"), function(){
return n;
});
});
return source;
};
$.extend($.validator, {
defaults: {
messages: {},
groups: {},
rules: {},
errorClass: "error",
pendingClass: "pending",
validClass: "valid",
errorElement: "label",
focusCleanup: false,
focusInvalid: true,
errorContainer: $([]),
errorLabelContainer: $([]),
onsubmit: true,
ignore: ":hidden",
ignoreTitle: false,
onfocusin: function(element){
this.lastActive=element;
if(this.settings.focusCleanup){
if(this.settings.unhighlight){
this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);
}
this.hideThese(this.errorsFor(element) );
}},
onfocusout: function(element){
if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element) )){
this.element(element);
}},
onkeyup: function(element, event){
var excludedKeys=[
16, 17, 18, 20, 35, 36, 37,
38, 39, 40, 45, 144, 225
];
if(event.which===9&&this.elementValue(element)===""||$.inArray(event.keyCode, excludedKeys)!==-1){
return;
}else if(element.name in this.submitted||element.name in this.invalid){
this.element(element);
}},
onclick: function(element){
if(element.name in this.submitted){
this.element(element);
}else if(element.parentNode.name in this.submitted){
this.element(element.parentNode);
}},
highlight: function(element, errorClass, validClass){
if(element.type==="radio"){
this.findByName(element.name).addClass(errorClass).removeClass(validClass);
}else{
$(element).addClass(errorClass).removeClass(validClass);
}},
unhighlight: function(element, errorClass, validClass){
if(element.type==="radio"){
this.findByName(element.name).removeClass(errorClass).addClass(validClass);
}else{
$(element).removeClass(errorClass).addClass(validClass);
}}
},
setDefaults: function(settings){
$.extend($.validator.defaults, settings);
},
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
equalTo: "Please enter the same value again.",
maxlength: $.validator.format("Please enter no more than {0} characters."),
minlength: $.validator.format("Please enter at least {0} characters."),
rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
range: $.validator.format("Please enter a value between {0} and {1}."),
max: $.validator.format("Please enter a value less than or equal to {0}."),
min: $.validator.format("Please enter a value greater than or equal to {0}."),
step: $.validator.format("Please enter a multiple of {0}.")
},
autoCreateRanges: false,
prototype: {
init: function(){
this.labelContainer=$(this.settings.errorLabelContainer);
this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);
this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);
this.submitted={};
this.valueCache={};
this.pendingRequest=0;
this.pending={};
this.invalid={};
this.reset();
var currentForm=this.currentForm,
groups=(this.groups={}),
rules;
$.each(this.settings.groups, function(key, value){
if(typeof value==="string"){
value=value.split(/\s/);
}
$.each(value, function(index, name){
groups[ name ]=key;
});
});
rules=this.settings.rules;
$.each(rules, function(key, value){
rules[ key ]=$.validator.normalizeRule(value);
});
function delegate(event){
var isContentEditable=typeof $(this).attr("contenteditable")!=="undefined"&&$(this).attr("contenteditable")!=="false";
if(!this.form&&isContentEditable){
this.form=$(this).closest("form")[ 0 ];
this.name=$(this).attr("name");
}
if(currentForm!==this.form){
return;
}
var validator=$.data(this.form, "validator"),
eventType="on" + event.type.replace(/^validate/, ""),
settings=validator.settings;
if(settings[ eventType ]&&!$(this).is(settings.ignore) ){
settings[ eventType ].call(validator, this, event);
}}
$(this.currentForm)
.on("focusin.validate focusout.validate keyup.validate",
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate)
.on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate);
if(this.settings.invalidHandler){
$(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler);
}},
form: function(){
this.checkForm();
$.extend(this.submitted, this.errorMap);
this.invalid=$.extend({}, this.errorMap);
if(!this.valid()){
$(this.currentForm).triggerHandler("invalid-form", [ this ]);
}
this.showErrors();
return this.valid();
},
checkForm: function(){
this.prepareForm();
for(var i=0, elements=(this.currentElements=this.elements()); elements[ i ]; i++){
this.check(elements[ i ]);
}
return this.valid();
},
element: function(element){
var cleanElement=this.clean(element),
checkElement=this.validationTargetFor(cleanElement),
v=this,
result=true,
rs, group;
if(checkElement===undefined){
delete this.invalid[ cleanElement.name ];
}else{
this.prepareElement(checkElement);
this.currentElements=$(checkElement);
group=this.groups[ checkElement.name ];
if(group){
$.each(this.groups, function(name, testgroup){
if(testgroup===group&&name!==checkElement.name){
cleanElement=v.validationTargetFor(v.clean(v.findByName(name) ));
if(cleanElement&&cleanElement.name in v.invalid){
v.currentElements.push(cleanElement);
result=v.check(cleanElement)&&result;
}}
});
}
rs=this.check(checkElement)!==false;
result=result&&rs;
if(rs){
this.invalid[ checkElement.name ]=false;
}else{
this.invalid[ checkElement.name ]=true;
}
if(!this.numberOfInvalids()){
this.toHide=this.toHide.add(this.containers);
}
this.showErrors();
$(element).attr("aria-invalid", !rs);
}
return result;
},
showErrors: function(errors){
if(errors){
var validator=this;
$.extend(this.errorMap, errors);
this.errorList=$.map(this.errorMap, function(message, name){
return {
message: message,
element: validator.findByName(name)[ 0 ]
};});
this.successList=$.grep(this.successList, function(element){
return !(element.name in errors);
});
}
if(this.settings.showErrors){
this.settings.showErrors.call(this, this.errorMap, this.errorList);
}else{
this.defaultShowErrors();
}},
resetForm: function(){
if($.fn.resetForm){
$(this.currentForm).resetForm();
}
this.invalid={};
this.submitted={};
this.prepareForm();
this.hideErrors();
var elements=this.elements()
.removeData("previousValue")
.removeAttr("aria-invalid");
this.resetElements(elements);
},
resetElements: function(elements){
var i;
if(this.settings.unhighlight){
for(i=0; elements[ i ]; i++){
this.settings.unhighlight.call(this, elements[ i ],
this.settings.errorClass, "");
this.findByName(elements[ i ].name).removeClass(this.settings.validClass);
}}else{
elements
.removeClass(this.settings.errorClass)
.removeClass(this.settings.validClass);
}},
numberOfInvalids: function(){
return this.objectLength(this.invalid);
},
objectLength: function(obj){
var count=0,
i;
for(i in obj){
if(obj[ i ]!==undefined&&obj[ i ]!==null&&obj[ i ]!==false){
count++;
}}
return count;
},
hideErrors: function(){
this.hideThese(this.toHide);
},
hideThese: function(errors){
errors.not(this.containers).text("");
this.addWrapper(errors).hide();
},
valid: function(){
return this.size()===0;
},
size: function(){
return this.errorList.length;
},
focusInvalid: function(){
if(this.settings.focusInvalid){
try {
$(this.findLastActive()||this.errorList.length&&this.errorList[ 0 ].element||[])
.filter(":visible")
.trigger("focus")
.trigger("focusin");
} catch(e){
}}
},
findLastActive: function(){
var lastActive=this.lastActive;
return lastActive&&$.grep(this.errorList, function(n){
return n.element.name===lastActive.name;
}).length===1&&lastActive;
},
elements: function(){
var validator=this,
rulesCache={};
return $(this.currentForm)
.find("input, select, textarea, [contenteditable]")
.not(":submit, :reset, :image, :disabled")
.not(this.settings.ignore)
.filter(function(){
var name=this.name||$(this).attr("name");
var isContentEditable=typeof $(this).attr("contenteditable")!=="undefined"&&$(this).attr("contenteditable")!=="false";
if(!name&&validator.settings.debug&&window.console){
console.error("%o has no name assigned", this);
}
if(isContentEditable){
this.form=$(this).closest("form")[ 0 ];
this.name=name;
}
if(this.form!==validator.currentForm){
return false;
}
if(name in rulesCache||!validator.objectLength($(this).rules()) ){
return false;
}
rulesCache[ name ]=true;
return true;
});
},
clean: function(selector){
return $(selector)[ 0 ];
},
errors: function(){
var errorClass=this.settings.errorClass.split(" ").join(".");
return $(this.settings.errorElement + "." + errorClass, this.errorContext);
},
resetInternals: function(){
this.successList=[];
this.errorList=[];
this.errorMap={};
this.toShow=$([]);
this.toHide=$([]);
},
reset: function(){
this.resetInternals();
this.currentElements=$([]);
},
prepareForm: function(){
this.reset();
this.toHide=this.errors().add(this.containers);
},
prepareElement: function(element){
this.reset();
this.toHide=this.errorsFor(element);
},
elementValue: function(element){
var $element=$(element),
type=element.type,
isContentEditable=typeof $element.attr("contenteditable")!=="undefined"&&$element.attr("contenteditable")!=="false",
val, idx;
if(type==="radio"||type==="checkbox"){
return this.findByName(element.name).filter(":checked").val();
}else if(type==="number"&&typeof element.validity!=="undefined"){
return element.validity.badInput ? "NaN":$element.val();
}
if(isContentEditable){
val=$element.text();
}else{
val=$element.val();
}
if(type==="file"){
if(val.substr(0, 12)==="C:\\fakepath\\"){
return val.substr(12);
}
idx=val.lastIndexOf("/");
if(idx >=0){
return val.substr(idx + 1);
}
idx=val.lastIndexOf("\\");
if(idx >=0){
return val.substr(idx + 1);
}
return val;
}
if(typeof val==="string"){
return val.replace(/\r/g, "");
}
return val;
},
check: function(element){
element=this.validationTargetFor(this.clean(element) );
var rules=$(element).rules(),
rulesCount=$.map(rules, function(n, i){
return i;
}).length,
dependencyMismatch=false,
val=this.elementValue(element),
result, method, rule, normalizer;
if(typeof rules.normalizer==="function"){
normalizer=rules.normalizer;
}else if(typeof this.settings.normalizer==="function"){
normalizer=this.settings.normalizer;
}
if(normalizer){
val=normalizer.call(element, val);
delete rules.normalizer;
}
for(method in rules){
rule={ method: method, parameters: rules[ method ] };
try {
result=$.validator.methods[ method ].call(this, val, element, rule.parameters);
if(result==="dependency-mismatch"&&rulesCount===1){
dependencyMismatch=true;
continue;
}
dependencyMismatch=false;
if(result==="pending"){
this.toHide=this.toHide.not(this.errorsFor(element) );
return;
}
if(!result){
this.formatAndAdd(element, rule);
return false;
}} catch(e){
if(this.settings.debug&&window.console){
console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e);
}
if(e instanceof TypeError){
e.message +=".  Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
}
throw e;
}}
if(dependencyMismatch){
return;
}
if(this.objectLength(rules) ){
this.successList.push(element);
}
return true;
},
customDataMessage: function(element, method){
return $(element).data("msg" + method.charAt(0).toUpperCase() +
method.substring(1).toLowerCase())||$(element).data("msg");
},
customMessage: function(name, method){
var m=this.settings.messages[ name ];
return m&&(m.constructor===String ? m:m[ method ]);
},
findDefined: function(){
for(var i=0; i < arguments.length; i++){
if(arguments[ i ]!==undefined){
return arguments[ i ];
}}
return undefined;
},
defaultMessage: function(element, rule){
if(typeof rule==="string"){
rule={ method: rule };}
var message=this.findDefined(this.customMessage(element.name, rule.method),
this.customDataMessage(element, rule.method),
!this.settings.ignoreTitle&&element.title||undefined,
$.validator.messages[ rule.method ],
"<strong>Warning: No message defined for " + element.name + "</strong>"
),
theregex=/\$?\{(\d+)\}/g;
if(typeof message==="function"){
message=message.call(this, rule.parameters, element);
}else if(theregex.test(message) ){
message=$.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
}
return message;
},
formatAndAdd: function(element, rule){
var message=this.defaultMessage(element, rule);
this.errorList.push({
message: message,
element: element,
method: rule.method
});
this.errorMap[ element.name ]=message;
this.submitted[ element.name ]=message;
},
addWrapper: function(toToggle){
if(this.settings.wrapper){
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper) );
}
return toToggle;
},
defaultShowErrors: function(){
var i, elements, error;
for(i=0; this.errorList[ i ]; i++){
error=this.errorList[ i ];
if(this.settings.highlight){
this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);
}
this.showLabel(error.element, error.message);
}
if(this.errorList.length){
this.toShow=this.toShow.add(this.containers);
}
if(this.settings.success){
for(i=0; this.successList[ i ]; i++){
this.showLabel(this.successList[ i ]);
}}
if(this.settings.unhighlight){
for(i=0, elements=this.validElements(); elements[ i ]; i++){
this.settings.unhighlight.call(this, elements[ i ], this.settings.errorClass, this.settings.validClass);
}}
this.toHide=this.toHide.not(this.toShow);
this.hideErrors();
this.addWrapper(this.toShow).show();
},
validElements: function(){
return this.currentElements.not(this.invalidElements());
},
invalidElements: function(){
return $(this.errorList).map(function(){
return this.element;
});
},
showLabel: function(element, message){
var place, group, errorID, v,
error=this.errorsFor(element),
elementID=this.idOrName(element),
describedBy=$(element).attr("aria-describedby");
if(error.length){
error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
error.html(message);
}else{
error=$("<" + this.settings.errorElement + ">")
.attr("id", elementID + "-error")
.addClass(this.settings.errorClass)
.html(message||"");
place=error;
if(this.settings.wrapper){
place=error.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
}
if(this.labelContainer.length){
this.labelContainer.append(place);
}else if(this.settings.errorPlacement){
this.settings.errorPlacement.call(this, place, $(element) );
}else{
place.insertAfter(element);
}
if(error.is("label") ){
error.attr("for", elementID);
}else if(error.parents("label[for='" + this.escapeCssMeta(elementID) + "']").length===0){
errorID=error.attr("id");
if(!describedBy){
describedBy=errorID;
}else if(!describedBy.match(new RegExp("\\b" + this.escapeCssMeta(errorID) + "\\b") )){
describedBy +=" " + errorID;
}
$(element).attr("aria-describedby", describedBy);
group=this.groups[ element.name ];
if(group){
v=this;
$.each(v.groups, function(name, testgroup){
if(testgroup===group){
$("[name='" + v.escapeCssMeta(name) + "']", v.currentForm)
.attr("aria-describedby", error.attr("id") );
}});
}}
}
if(!message&&this.settings.success){
error.text("");
if(typeof this.settings.success==="string"){
error.addClass(this.settings.success);
}else{
this.settings.success(error, element);
}}
this.toShow=this.toShow.add(error);
},
errorsFor: function(element){
var name=this.escapeCssMeta(this.idOrName(element) ),
describer=$(element).attr("aria-describedby"),
selector="label[for='" + name + "'], label[for='" + name + "'] *";
if(describer){
selector=selector + ", #" + this.escapeCssMeta(describer)
.replace(/\s+/g, ", #");
}
return this
.errors()
.filter(selector);
},
escapeCssMeta: function(string){
if(string===undefined){
return "";
}
return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1");
},
idOrName: function(element){
return this.groups[ element.name ]||(this.checkable(element) ? element.name:element.id||element.name);
},
validationTargetFor: function(element){
if(this.checkable(element) ){
element=this.findByName(element.name);
}
return $(element).not(this.settings.ignore)[ 0 ];
},
checkable: function(element){
return(/radio|checkbox/i).test(element.type);
},
findByName: function(name){
return $(this.currentForm).find("[name='" + this.escapeCssMeta(name) + "']");
},
getLength: function(value, element){
switch(element.nodeName.toLowerCase()){
case "select":
return $("option:selected", element).length;
case "input":
if(this.checkable(element) ){
return this.findByName(element.name).filter(":checked").length;
}}
return value.length;
},
depend: function(param, element){
return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ](param, element):true;
},
dependTypes: {
"boolean": function(param){
return param;
},
"string": function(param, element){
return !!$(param, element.form).length;
},
"function": function(param, element){
return param(element);
}},
optional: function(element){
var val=this.elementValue(element);
return !$.validator.methods.required.call(this, val, element)&&"dependency-mismatch";
},
startRequest: function(element){
if(!this.pending[ element.name ]){
this.pendingRequest++;
$(element).addClass(this.settings.pendingClass);
this.pending[ element.name ]=true;
}},
stopRequest: function(element, valid){
this.pendingRequest--;
if(this.pendingRequest < 0){
this.pendingRequest=0;
}
delete this.pending[ element.name ];
$(element).removeClass(this.settings.pendingClass);
if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()&&this.pendingRequest===0){
$(this.currentForm).trigger("submit");
if(this.submitButton){
$("input:hidden[name='" + this.submitButton.name + "']", this.currentForm).remove();
}
this.formSubmitted=false;
}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){
$(this.currentForm).triggerHandler("invalid-form", [ this ]);
this.formSubmitted=false;
}},
previousValue: function(element, method){
method=typeof method==="string"&&method||"remote";
return $.data(element, "previousValue")||$.data(element, "previousValue", {
old: null,
valid: true,
message: this.defaultMessage(element, { method: method })
});
},
destroy: function(){
this.resetForm();
$(this.currentForm)
.off(".validate")
.removeData("validator")
.find(".validate-equalTo-blur")
.off(".validate-equalTo")
.removeClass("validate-equalTo-blur")
.find(".validate-lessThan-blur")
.off(".validate-lessThan")
.removeClass("validate-lessThan-blur")
.find(".validate-lessThanEqual-blur")
.off(".validate-lessThanEqual")
.removeClass("validate-lessThanEqual-blur")
.find(".validate-greaterThanEqual-blur")
.off(".validate-greaterThanEqual")
.removeClass("validate-greaterThanEqual-blur")
.find(".validate-greaterThan-blur")
.off(".validate-greaterThan")
.removeClass("validate-greaterThan-blur");
}},
classRuleSettings: {
required: { required: true },
email: { email: true },
url: { url: true },
date: { date: true },
dateISO: { dateISO: true },
number: { number: true },
digits: { digits: true },
creditcard: { creditcard: true }},
addClassRules: function(className, rules){
if(className.constructor===String){
this.classRuleSettings[ className ]=rules;
}else{
$.extend(this.classRuleSettings, className);
}},
classRules: function(element){
var rules={},
classes=$(element).attr("class");
if(classes){
$.each(classes.split(" "), function(){
if(this in $.validator.classRuleSettings){
$.extend(rules, $.validator.classRuleSettings[ this ]);
}});
}
return rules;
},
normalizeAttributeRule: function(rules, type, method, value){
if(/min|max|step/.test(method)&&(type===null||/number|range|text/.test(type) )){
value=Number(value);
if(isNaN(value) ){
value=undefined;
}}
if(value||value===0){
rules[ method ]=value;
}else if(type===method&&type!=="range"){
rules[ type==="date" ? "dateISO":method ]=true;
}},
attributeRules: function(element){
var rules={},
$element=$(element),
type=element.getAttribute("type"),
method, value;
for(method in $.validator.methods){
if(method==="required"){
value=element.getAttribute(method);
if(value===""){
value=true;
}
value = !!value;
}else{
value=$element.attr(method);
}
this.normalizeAttributeRule(rules, type, method, value);
}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength) ){
delete rules.maxlength;
}
return rules;
},
dataRules: function(element){
var rules={},
$element=$(element),
type=element.getAttribute("type"),
method, value;
for(method in $.validator.methods){
value=$element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase());
if(value===""){
value=true;
}
this.normalizeAttributeRule(rules, type, method, value);
}
return rules;
},
staticRules: function(element){
var rules={},
validator=$.data(element.form, "validator");
if(validator.settings.rules){
rules=$.validator.normalizeRule(validator.settings.rules[ element.name ])||{};}
return rules;
},
normalizeRules: function(rules, element){
$.each(rules, function(prop, val){
if(val===false){
delete rules[ prop ];
return;
}
if(val.param||val.depends){
var keepRule=true;
switch(typeof val.depends){
case "string":
keepRule = !!$(val.depends, element.form).length;
break;
case "function":
keepRule=val.depends.call(element, element);
break;
}
if(keepRule){
rules[ prop ]=val.param!==undefined ? val.param:true;
}else{
$.data(element.form, "validator").resetElements($(element) );
delete rules[ prop ];
}}
});
$.each(rules, function(rule, parameter){
rules[ rule ]=typeof parameter==="function"&&rule!=="normalizer" ? parameter(element):parameter;
});
$.each([ "minlength", "maxlength" ], function(){
if(rules[ this ]){
rules[ this ]=Number(rules[ this ]);
}});
$.each([ "rangelength", "range" ], function(){
var parts;
if(rules[ this ]){
if(Array.isArray(rules[ this ]) ){
rules[ this ]=[ Number(rules[ this ][ 0 ]), Number(rules[ this ][ 1 ]) ];
}else if(typeof rules[ this ]==="string"){
parts=rules[ this ].replace(/[\[\]]/g, "").split(/[\s,]+/);
rules[ this ]=[ Number(parts[ 0 ]), Number(parts[ 1 ]) ];
}}
});
if($.validator.autoCreateRanges){
if(rules.min!==null&&typeof rules.min!=='undefined'&&rules.max!==null&&typeof rules.max!=='undefined'){
rules.range=[ rules.min, rules.max ];
delete rules.min;
delete rules.max;
}
if(typeof rules.minlength!=='undefined'&&rules.minlength!==null&&typeof rules.maxlength!=='undefined'&&rules.maxlength!==null){
rules.rangelength=[ rules.minlength, rules.maxlength ];
delete rules.minlength;
delete rules.maxlength;
}}
return rules;
},
normalizeRule: function(data){
if(typeof data==="string"){
var transformed={};
$.each(data.split(/\s/), function(){
transformed[ this ]=true;
});
data=transformed;
}
return data;
},
addMethod: function(name, method, message){
$.validator.methods[ name ]=method;
$.validator.messages[ name ]=message!==undefined ? message:$.validator.messages[ name ];
if(method.length < 3){
$.validator.addClassRules(name, $.validator.normalizeRule(name) );
}},
methods: {
required: function(value, element, param){
if(!this.depend(param, element) ){
return "dependency-mismatch";
}
if(element.nodeName.toLowerCase()==="select"){
var val=$(element).val();
return val&&val.length > 0;
}
if(this.checkable(element) ){
return this.getLength(value, element) > 0;
}
return value!==undefined&&value!==null&&value.length > 0;
},
email: function(value, element){
return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
},
url: function(value, element){
return this.optional(element)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
},
date:(function(){
var called=false;
return function(value, element){
if(!called){
called=true;
if(this.settings.debug&&window.console){
console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\n" +
"Please don't use it, since it relies on the Date constructor, which\n" +
"behaves very differently across browsers and locales. Use `dateISO`\n" +
"instead or one of the locale specific methods in `localizations/`\n" +
"and `additional-methods.js`."
);
}}
return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString());
};}()),
dateISO: function(value, element){
return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
},
number: function(value, element){
return this.optional(element)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
},
digits: function(value, element){
return this.optional(element)||/^\d+$/.test(value);
},
minlength: function(value, element, param){
var length=Array.isArray(value) ? value.length:this.getLength(value, element);
return this.optional(element)||length >=param;
},
maxlength: function(value, element, param){
var length=Array.isArray(value) ? value.length:this.getLength(value, element);
return this.optional(element)||length <=param;
},
rangelength: function(value, element, param){
var length=Array.isArray(value) ? value.length:this.getLength(value, element);
return this.optional(element)||(length >=param[ 0 ]&&length <=param[ 1 ]);
},
min: function(value, element, param){
return this.optional(element)||value >=param;
},
max: function(value, element, param){
return this.optional(element)||value <=param;
},
range: function(value, element, param){
return this.optional(element)||(value >=param[ 0 ]&&value <=param[ 1 ]);
},
step: function(value, element, param){
var type=$(element).attr("type"),
errorMessage="Step attribute on input type " + type + " is not supported.",
supportedTypes=[ "text", "number", "range" ],
re=new RegExp("\\b" + type + "\\b"),
notSupported=type&&!re.test(supportedTypes.join()),
decimalPlaces=function(num){
var match=("" + num).match(/(?:\.(\d+))?$/);
if(!match){
return 0;
}
return match[ 1 ] ? match[ 1 ].length:0;
},
toInt=function(num){
return Math.round(num * Math.pow(10, decimals) );
},
valid=true,
decimals;
if(notSupported){
throw new Error(errorMessage);
}
decimals=decimalPlaces(param);
if(decimalPlaces(value) > decimals||toInt(value) % toInt(param)!==0){
valid=false;
}
return this.optional(element)||valid;
},
equalTo: function(value, element, param){
var target=$(param);
if(this.settings.onfocusout&&target.not(".validate-equalTo-blur").length){
target.addClass("validate-equalTo-blur").on("blur.validate-equalTo", function(){
$(element).valid();
});
}
return value===target.val();
},
remote: function(value, element, param, method){
if(this.optional(element) ){
return "dependency-mismatch";
}
method=typeof method==="string"&&method||"remote";
var previous=this.previousValue(element, method),
validator, data, optionDataString;
if(!this.settings.messages[ element.name ]){
this.settings.messages[ element.name ]={};}
previous.originalMessage=previous.originalMessage||this.settings.messages[ element.name ][ method ];
this.settings.messages[ element.name ][ method ]=previous.message;
param=typeof param==="string"&&{ url: param }||param;
optionDataString=$.param($.extend({ data: value }, param.data) );
if(previous.old===optionDataString){
return previous.valid;
}
previous.old=optionDataString;
validator=this;
this.startRequest(element);
data={};
data[ element.name ]=value;
$.ajax($.extend(true, {
mode: "abort",
port: "validate" + element.name,
dataType: "json",
data: data,
context: validator.currentForm,
success: function(response){
var valid=response===true||response==="true",
errors, message, submitted;
validator.settings.messages[ element.name ][ method ]=previous.originalMessage;
if(valid){
submitted=validator.formSubmitted;
validator.resetInternals();
validator.toHide=validator.errorsFor(element);
validator.formSubmitted=submitted;
validator.successList.push(element);
validator.invalid[ element.name ]=false;
validator.showErrors();
}else{
errors={};
message=response||validator.defaultMessage(element, { method: method, parameters: value });
errors[ element.name ]=previous.message=message;
validator.invalid[ element.name ]=true;
validator.showErrors(errors);
}
previous.valid=valid;
validator.stopRequest(element, valid);
}}, param) );
return "pending";
}}
});
var pendingRequests={},
ajax;
if($.ajaxPrefilter){
$.ajaxPrefilter(function(settings, _, xhr){
var port=settings.port;
if(settings.mode==="abort"){
if(pendingRequests[ port ]){
pendingRequests[ port ].abort();
}
pendingRequests[ port ]=xhr;
}});
}else{
ajax=$.ajax;
$.ajax=function(settings){
var mode=("mode" in settings ? settings:$.ajaxSettings).mode,
port=("port" in settings ? settings:$.ajaxSettings).port;
if(mode==="abort"){
if(pendingRequests[ port ]){
pendingRequests[ port ].abort();
}
pendingRequests[ port ]=ajax.apply(this, arguments);
return pendingRequests[ port ];
}
return ajax.apply(this, arguments);
};}
return $;
}));
!(function (a){
"function"===typeof define&&define.amd ? define(["jquery", "./jquery.validate.min"], a):"object"===typeof module&&module.exports ? (module.exports=a(require("jquery"))):a(jQuery);
})(function (a){
return (
(function (){
function b(a){
return a
.replace(/<.[^<>]*?>/g, " ")
.replace(/&nbsp;|&#160;/gi, " ")
.replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "");
}
a.validator.addMethod("maxWords",
function (a, c, d){
return this.optional(c)||b(a).match(/\b\w+\b/g).length <=d;
},
a.validator.format("Please enter {0} words or less.")
),
a.validator.addMethod("minWords",
function (a, c, d){
return this.optional(c)||b(a).match(/\b\w+\b/g).length >=d;
},
a.validator.format("Please enter at least {0} words.")
),
a.validator.addMethod("rangeWords",
function (a, c, d){
var e=b(a),
f=/\b\w+\b/g;
return this.optional(c)||(e.match(f).length >=d[0]&&e.match(f).length <=d[1]);
},
a.validator.format("Please enter between {0} and {1} words.")
);
})(),
a.validator.addMethod("abaRoutingNumber",
function (a){
var b=0,
c=a.split(""),
d=c.length;
if(9!==d) return !1;
for (var e=0; e < d; e +=3) b +=3 * parseInt(c[e], 10) + 7 * parseInt(c[e + 1], 10) + parseInt(c[e + 2], 10);
return 0!==b&&b % 10===0;
},
"Please enter a valid routing number."
),
a.validator.addMethod("accept",
function (b, c, d){
var e,
f,
g,
h="string"===typeof d ? d.replace(/\s/g, ""):"image/*",
i=this.optional(c);
if(i) return i;
if("file"===a(c).attr("type") &&
((h=h
.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, "\\$&")
.replace(/,/g, "|")
.replace(/\/\*/g, "/.*")),
c.files&&c.files.length)
)
for (g=new RegExp(".?(" + h + ")$", "i"), e=0; e < c.files.length; e++) if(((f=c.files[e]), !f.type.match(g))) return !1;
return !0;
},
a.validator.format("Please enter a value with a valid mimetype.")
),
a.validator.addMethod("alphanumeric",
function (a, b){
return this.optional(b)||/^\w+$/i.test(a);
},
"Letters, numbers, and underscores only please."
),
a.validator.addMethod("bankaccountNL",
function (a, b){
if(this.optional(b)) return !0;
if(!/^[0-9]{9}|([0-9]{2}){3}[0-9]{3}$/.test(a)) return !1;
var c,
d,
e,
f=a.replace(/ /g, ""),
g=0,
h=f.length;
for (c=0; c < h; c++) (d=h - c), (e=f.substring(c, c + 1)), (g +=d * e);
return g % 11===0;
},
"Please specify a valid bank account number."
),
a.validator.addMethod("bankorgiroaccountNL",
function (b, c){
return this.optional(c)||a.validator.methods.bankaccountNL.call(this, b, c)||a.validator.methods.giroaccountNL.call(this, b, c);
},
"Please specify a valid bank or giro account number."
),
a.validator.addMethod("bic",
function (a, b){
return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a.toUpperCase());
},
"Please specify a valid BIC code."
),
a.validator.addMethod("cifES",
function (a, b){
"use strict";
function c(a){
return a % 2===0;
}
if(this.optional(b)) return !0;
var d,
e,
f,
g,
h=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),
i=a.substring(0, 1),
j=a.substring(1, 8),
k=a.substring(8, 9),
l=0,
m=0,
n=0;
if(9!==a.length||!h.test(a)) return !1;
for (d=0; d < j.length; d++) (e=parseInt(j[d], 10)), c(d) ? ((e *=2), (n +=e < 10 ? e:e - 9)):(m +=e);
return (
(l=m + n),
(f=(10 - l.toString().substr(-1)).toString()),
(f=parseInt(f, 10) > 9 ? "0":f),
(g="JABCDEFGHI".substr(f, 1).toString()),
i.match(/[ABEH]/) ? k===f:i.match(/[KPQS]/) ? k===g:k===f||k===g
);
},
"Please specify a valid CIF number."
),
a.validator.addMethod("cnhBR",
function (a){
if(((a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "")), 11!==a.length)) return !1;
var b,
c,
d,
e,
f,
g,
h=0,
i=0;
if(((b=a.charAt(0)), new Array(12).join(b)===a)) return !1;
for (e=0, f=9, g=0; e < 9; ++e, --f) h +=+(a.charAt(e) * f);
for (c=h % 11, c >=10&&((c=0), (i=2)), h=0, e=0, f=1, g=0; e < 9; ++e, ++f) h +=+(a.charAt(e) * f);
return (d=h % 11), d >=10 ? (d=0):(d -=i), String(c).concat(d)===a.substr(-2);
},
"Please specify a valid CNH number."
),
a.validator.addMethod("cnpjBR",
function (a, b){
"use strict";
if(this.optional(b)) return !0;
if(((a=a.replace(/[^\d]+/g, "")), 14!==a.length)) return !1;
if("00000000000000"===a ||
"11111111111111"===a ||
"22222222222222"===a ||
"33333333333333"===a ||
"44444444444444"===a ||
"55555555555555"===a ||
"66666666666666"===a ||
"77777777777777"===a ||
"88888888888888"===a ||
"99999999999999"===a
)
return !1;
for (var c=a.length - 2, d=a.substring(0, c), e=a.substring(c), f=0, g=c - 7, h=c; h >=1; h--) (f +=d.charAt(c - h) * g--), g < 2&&(g=9);
var i=f % 11 < 2 ? 0:11 - (f % 11);
if(i!==parseInt(e.charAt(0), 10)) return !1;
(c +=1), (d=a.substring(0, c)), (f=0), (g=c - 7);
for (var j=c; j >=1; j--) (f +=d.charAt(c - j) * g--), g < 2&&(g=9);
return (i=f % 11 < 2 ? 0:11 - (f % 11)), i===parseInt(e.charAt(1), 10);
},
"Please specify a CNPJ value number."
),
a.validator.addMethod("cpfBR",
function (a, b){
"use strict";
if(this.optional(b)) return !0;
if(((a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "")), 11!==a.length)) return !1;
var c,
d,
e,
f,
g=0;
if(((c=parseInt(a.substring(9, 10), 10)),
(d=parseInt(a.substring(10, 11), 10)),
(e=function (a, b){
var c=(10 * a) % 11;
return (10!==c&&11!==c)||(c=0), c===b;
}),
""===a ||
"00000000000"===a ||
"11111111111"===a ||
"22222222222"===a ||
"33333333333"===a ||
"44444444444"===a ||
"55555555555"===a ||
"66666666666"===a ||
"77777777777"===a ||
"88888888888"===a ||
"99999999999"===a)
)
return !1;
for (f=1; f <=9; f++) g +=parseInt(a.substring(f - 1, f), 10) * (11 - f);
if(e(g, c)){
for (g=0, f=1; f <=10; f++) g +=parseInt(a.substring(f - 1, f), 10) * (12 - f);
return e(g, d);
}
return !1;
},
"Please specify a valid CPF number."
),
a.validator.addMethod("creditcard",
function (a, b){
if(this.optional(b)) return "dependency-mismatch";
if(/[^0-9 \-]+/.test(a)) return !1;
var c,
d,
e=0,
f=0,
g = !1;
if(((a=a.replace(/\D/g, "")), a.length < 13||a.length > 19)) return !1;
for (c=a.length - 1; c >=0; c--) (d=a.charAt(c)), (f=parseInt(d, 10)), g&&(f *=2) > 9&&(f -=9), (e +=f), (g = !g);
return e % 10===0;
},
"Please enter a valid credit card number."
),
a.validator.addMethod("creditcardtypes",
function (a, b, c){
if(/[^0-9\-]+/.test(a)) return !1;
a=a.replace(/\D/g, "");
var d=0;
return (
c.mastercard&&(d |=1),
c.visa&&(d |=2),
c.amex&&(d |=4),
c.dinersclub&&(d |=8),
c.enroute&&(d |=16),
c.discover&&(d |=32),
c.jcb&&(d |=64),
c.unknown&&(d |=128),
c.all&&(d=255),
1 & d&&(/^(5[12345])/.test(a)||/^(2[234567])/.test(a))
? 16===a.length
: 2 & d&&/^(4)/.test(a)
? 16===a.length
: 4 & d&&/^(3[47])/.test(a)
? 15===a.length
: 8 & d&&/^(3(0[012345]|[68]))/.test(a)
? 14===a.length
: 16 & d&&/^(2(014|149))/.test(a)
? 15===a.length
: 32 & d&&/^(6011)/.test(a)
? 16===a.length
: 64 & d&&/^(3)/.test(a)
? 16===a.length
: 64 & d&&/^(2131|1800)/.test(a)
? 15===a.length
: !!(128 & d)
);
},
"Please enter a valid credit card number."
),
a.validator.addMethod("currency",
function (a, b, c){
var d,
e="string"===typeof c,
f=e ? c:c[0],
g = !!e||c[1];
return (
(f=f.replace(/,/g, "")),
(f=g ? f + "]":f + "]?"),
(d="^[" + f + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"),
(d=new RegExp(d)),
this.optional(b)||d.test(a)
);
},
"Please specify a valid currency."
),
a.validator.addMethod("dateFA",
function (a, b){
return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a);
},
a.validator.messages.date
),
a.validator.addMethod("dateITA",
function (a, b){
var c,
d,
e,
f,
g,
h = !1,
i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;
return (
i.test(a)
? ((c=a.split("/")),
(d=parseInt(c[0], 10)),
(e=parseInt(c[1], 10)),
(f=parseInt(c[2], 10)),
(g=new Date(Date.UTC(f, e - 1, d, 12, 0, 0, 0))),
(h=g.getUTCFullYear()===f&&g.getUTCMonth()===e - 1&&g.getUTCDate()===d))
: (h = !1),
this.optional(b)||h
);
},
a.validator.messages.date
),
a.validator.addMethod("dateNL",
function (a, b){
return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a);
},
a.validator.messages.date
),
a.validator.addMethod("extension",
function (a, b, c){
return (c="string"===typeof c ? c.replace(/,/g, "|"):"png|jpe?g|gif"), this.optional(b)||a.match(new RegExp("\\.(" + c + ")$", "i"));
},
a.validator.format("Please enter a value with a valid extension.")
),
a.validator.addMethod("giroaccountNL",
function (a, b){
return this.optional(b)||/^[0-9]{1,7}$/.test(a);
},
"Please specify a valid giro account number."
),
a.validator.addMethod("greaterThan",
function (b, c, d){
var e=a(d);
return (
this.settings.onfocusout &&
e.not(".validate-greaterThan-blur").length &&
e.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan", function (){
a(c).valid();
}),
b > e.val()
);
},
"Please enter a greater value."
),
a.validator.addMethod("greaterThanEqual",
function (b, c, d){
var e=a(d);
return (
this.settings.onfocusout &&
e.not(".validate-greaterThanEqual-blur").length &&
e.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual", function (){
a(c).valid();
}),
b >=e.val()
);
},
"Please enter a greater value."
),
a.validator.addMethod("iban",
function (a, b){
if(this.optional(b)) return !0;
var c,
d,
e,
f,
g,
h,
i,
j,
k,
l=a.replace(/ /g, "").toUpperCase(),
m="",
n = !0,
o="",
p="",
q=5;
if(l.length < q) return !1;
if(((c=l.substring(0, 2)),
(h={
AL: "\\d{8}[\\dA-Z]{16}",
AD: "\\d{8}[\\dA-Z]{12}",
AT: "\\d{16}",
AZ: "[\\dA-Z]{4}\\d{20}",
BE: "\\d{12}",
BH: "[A-Z]{4}[\\dA-Z]{14}",
BA: "\\d{16}",
BR: "\\d{23}[A-Z][\\dA-Z]",
BG: "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
CR: "\\d{17}",
HR: "\\d{17}",
CY: "\\d{8}[\\dA-Z]{16}",
CZ: "\\d{20}",
DK: "\\d{14}",
DO: "[A-Z]{4}\\d{20}",
EE: "\\d{16}",
FO: "\\d{14}",
FI: "\\d{14}",
FR: "\\d{10}[\\dA-Z]{11}\\d{2}",
GE: "[\\dA-Z]{2}\\d{16}",
DE: "\\d{18}",
GI: "[A-Z]{4}[\\dA-Z]{15}",
GR: "\\d{7}[\\dA-Z]{16}",
GL: "\\d{14}",
GT: "[\\dA-Z]{4}[\\dA-Z]{20}",
HU: "\\d{24}",
IS: "\\d{22}",
IE: "[\\dA-Z]{4}\\d{14}",
IL: "\\d{19}",
IT: "[A-Z]\\d{10}[\\dA-Z]{12}",
KZ: "\\d{3}[\\dA-Z]{13}",
KW: "[A-Z]{4}[\\dA-Z]{22}",
LV: "[A-Z]{4}[\\dA-Z]{13}",
LB: "\\d{4}[\\dA-Z]{20}",
LI: "\\d{5}[\\dA-Z]{12}",
LT: "\\d{16}",
LU: "\\d{3}[\\dA-Z]{13}",
MK: "\\d{3}[\\dA-Z]{10}\\d{2}",
MT: "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
MR: "\\d{23}",
MU: "[A-Z]{4}\\d{19}[A-Z]{3}",
MC: "\\d{10}[\\dA-Z]{11}\\d{2}",
MD: "[\\dA-Z]{2}\\d{18}",
ME: "\\d{18}",
NL: "[A-Z]{4}\\d{10}",
NO: "\\d{11}",
PK: "[\\dA-Z]{4}\\d{16}",
PS: "[\\dA-Z]{4}\\d{21}",
PL: "\\d{24}",
PT: "\\d{21}",
RO: "[A-Z]{4}[\\dA-Z]{16}",
SM: "[A-Z]\\d{10}[\\dA-Z]{12}",
SA: "\\d{2}[\\dA-Z]{18}",
RS: "\\d{18}",
SK: "\\d{20}",
SI: "\\d{15}",
ES: "\\d{20}",
SE: "\\d{20}",
CH: "\\d{5}[\\dA-Z]{12}",
TN: "\\d{20}",
TR: "\\d{5}[\\dA-Z]{17}",
AE: "\\d{3}\\d{16}",
GB: "[A-Z]{4}\\d{14}",
VG: "[\\dA-Z]{4}\\d{16}",
}),
(g=h[c]),
"undefined"!==typeof g&&((i=new RegExp("^[A-Z]{2}\\d{2}" + g + "$", "")), !i.test(l)))
)
return !1;
for (d=l.substring(4, l.length) + l.substring(0, 4), j=0; j < d.length; j++) (e=d.charAt(j)), "0"!==e&&(n = !1), n||(m +="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));
for (k=0; k < m.length; k++) (f=m.charAt(k)), (p="" + o + f), (o=p % 97);
return 1===o;
},
"Please specify a valid IBAN."
),
a.validator.addMethod("integer",
function (a, b){
return this.optional(b)||/^-?\d+$/.test(a);
},
"A positive or negative non-decimal number please."
),
a.validator.addMethod("ipv4",
function (a, b){
return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a);
},
"Please enter a valid IP v4 address."
),
a.validator.addMethod("ipv6",
function (a, b){
return (
this.optional(b) ||
/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a
)
);
},
"Please enter a valid IP v6 address."
),
a.validator.addMethod("lessThan",
function (b, c, d){
var e=a(d);
return (
this.settings.onfocusout &&
e.not(".validate-lessThan-blur").length &&
e.addClass("validate-lessThan-blur").on("blur.validate-lessThan", function (){
a(c).valid();
}),
b < e.val()
);
},
"Please enter a lesser value."
),
a.validator.addMethod("lessThanEqual",
function (b, c, d){
var e=a(d);
return (
this.settings.onfocusout &&
e.not(".validate-lessThanEqual-blur").length &&
e.addClass("validate-lessThanEqual-blur").on("blur.validate-lessThanEqual", function (){
a(c).valid();
}),
b <=e.val()
);
},
"Please enter a lesser value."
),
a.validator.addMethod("lettersonly",
function (a, b){
return this.optional(b)||/^[a-z]+$/i.test(a);
},
"Letters only please."
),
a.validator.addMethod("letterswithbasicpunc",
function (a, b){
return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a);
},
"Letters or punctuation only please."
),
a.validator.addMethod("maxfiles",
function (b, c, d){
return !!this.optional(c)||!("file"===a(c).attr("type")&&c.files&&c.files.length > d);
},
a.validator.format("Please select no more than {0} files.")
),
a.validator.addMethod("maxsize",
function (b, c, d){
if(this.optional(c)) return !0;
if("file"===a(c).attr("type")&&c.files&&c.files.length) for (var e=0; e < c.files.length; e++) if(c.files[e].size > d) return !1;
return !0;
},
a.validator.format("File size must not exceed {0} bytes each.")
),
a.validator.addMethod("maxsizetotal",
function (b, c, d){
if(this.optional(c)) return !0;
if("file"===a(c).attr("type")&&c.files&&c.files.length) for (var e=0, f=0; f < c.files.length; f++) if(((e +=c.files[f].size), e > d)) return !1;
return !0;
},
a.validator.format("Total size of all files must not exceed {0} bytes.")
),
a.validator.addMethod("mobileNL",
function (a, b){
return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a);
},
"Please specify a valid mobile number."
),
a.validator.addMethod("mobileRU",
function (a, b){
var c=a.replace(/\(|\)|\s+|-/g, "");
return this.optional(b)||(c.length > 9&&/^((\+7|7|8)+([0-9]){10})$/.test(c));
},
"Please specify a valid mobile number."
),
a.validator.addMethod("mobileUK",
function (a, b){
return (a=a.replace(/\(|\)|\s+|-/g, "")), this.optional(b)||(a.length > 9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/));
},
"Please specify a valid mobile number."
),
a.validator.addMethod("netmask",
function (a, b){
return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(a);
},
"Please enter a valid netmask."
),
a.validator.addMethod("nieES",
function (a, b){
"use strict";
if(this.optional(b)) return !0;
var c,
d=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),
e="TRWAGMYFPDXBNJZSQVHLCKET",
f=a.substr(a.length - 1).toUpperCase();
return (
(a=a.toString().toUpperCase()),
!(a.length > 10||a.length < 9||!d.test(a))&&((a=a.replace(/^[X]/, "0").replace(/^[Y]/, "1").replace(/^[Z]/, "2")), (c=9===a.length ? a.substr(0, 8):a.substr(0, 9)), e.charAt(parseInt(c, 10) % 23)===f)
);
},
"Please specify a valid NIE number."
),
a.validator.addMethod("nifES",
function (a, b){
"use strict";
return (
!!this.optional(b) ||
((a=a.toUpperCase()),
!!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") &&
(/^[0-9]{8}[A-Z]{1}$/.test(a) ? "TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8, 0) % 23)===a.charAt(8):!!/^[KLM]{1}/.test(a)&&a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8, 1) % 23)))
);
},
"Please specify a valid NIF number."
),
a.validator.addMethod("nipPL",
function (a){
"use strict";
if(((a=a.replace(/[^0-9]/g, "")), 10!==a.length)) return !1;
for (var b=[6, 5, 7, 2, 3, 4, 5, 6, 7], c=0, d=0; d < 9; d++) c +=b[d] * a[d];
var e=c % 11,
f=10===e ? 0:e;
return f===parseInt(a[9], 10);
},
"Please specify a valid NIP number."
),
a.validator.addMethod("nisBR",
function (a){
var b,
c,
d,
e,
f,
g=0;
if(((a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "")), 11!==a.length)) return !1;
for (c=parseInt(a.substring(10, 11), 10), b=parseInt(a.substring(0, 10), 10), e=2; e < 12; e++) (f=e), 10===e&&(f=2), 11===e&&(f=3), (g +=(b % 10) * f), (b=parseInt(b / 10, 10));
return (d=g % 11), (d=d > 1 ? 11 - d:0), c===d;
},
"Please specify a valid NIS/PIS number."
),
a.validator.addMethod("notEqualTo",
function (b, c, d){
return this.optional(c)||!a.validator.methods.equalTo.call(this, b, c, d);
},
"Please enter a different value, values must not be the same."
),
a.validator.addMethod("nowhitespace",
function (a, b){
return this.optional(b)||/^\S+$/i.test(a);
},
"No white space please."
),
a.validator.addMethod("pattern",
function (a, b, c){
return !!this.optional(b)||("string"===typeof c&&(c=new RegExp("^(?:" + c + ")$")), c.test(a));
},
"Invalid format."
),
a.validator.addMethod("phoneNL",
function (a, b){
return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a);
},
"Please specify a valid phone number."
),
a.validator.addMethod("phonePL",
function (a, b){
a=a.replace(/\s+/g, "");
var c=/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
return this.optional(b)||c.test(a);
},
"Please specify a valid phone number."
),
a.validator.addMethod("phonesUK",
function (a, b){
return (a=a.replace(/\(|\)|\s+|-/g, "")), this.optional(b)||(a.length > 9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/));
},
"Please specify a valid uk phone number."
),
a.validator.addMethod("phoneUK",
function (a, b){
return (
(a=a.replace(/\(|\)|\s+|-/g, "")),
this.optional(b)||(a.length > 9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/))
);
},
"Please specify a valid phone number."
),
a.validator.addMethod("phoneUS",
function (a, b){
return (a=a.replace(/\s+/g, "")), this.optional(b)||(a.length > 9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/));
},
"Please specify a valid phone number."
),
a.validator.addMethod("postalcodeBR",
function (a, b){
return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a);
},
"Informe um CEP válido."
),
a.validator.addMethod("postalCodeCA",
function (a, b){
return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(a);
},
"Please specify a valid postal code."
),
a.validator.addMethod("postalcodeIT",
function (a, b){
return this.optional(b)||/^\d{5}$/.test(a);
},
"Please specify a valid postal code."
),
a.validator.addMethod("postalcodeNL",
function (a, b){
return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a);
},
"Please specify a valid postal code."
),
a.validator.addMethod("postcodeUK",
function (a, b){
return (
this.optional(b) ||
/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a
)
);
},
"Please specify a valid UK postcode."
),
a.validator.addMethod("require_from_group",
function (b, c, d){
var e=a(d[1], c.form),
f=e.eq(0),
g=f.data("valid_req_grp") ? f.data("valid_req_grp"):a.extend({}, this),
h =
e.filter(function (){
return g.elementValue(this);
}).length >=d[0];
return (
f.data("valid_req_grp", g),
a(c).data("being_validated") ||
(e.data("being_validated", !0),
e.each(function (){
g.element(this);
}),
e.data("being_validated", !1)),
h
);
},
a.validator.format("Please fill at least {0} of these fields.")
),
a.validator.addMethod("skip_or_fill_minimum",
function (b, c, d){
var e=a(d[1], c.form),
f=e.eq(0),
g=f.data("valid_skip") ? f.data("valid_skip"):a.extend({}, this),
h=e.filter(function (){
return g.elementValue(this);
}).length,
i=0===h||h >=d[0];
return (
f.data("valid_skip", g),
a(c).data("being_validated") ||
(e.data("being_validated", !0),
e.each(function (){
g.element(this);
}),
e.data("being_validated", !1)),
i
);
},
a.validator.format("Please either skip these fields or fill at least {0} of them.")
),
a.validator.addMethod("stateUS",
function (a, b, c){
var d,
e="undefined"===typeof c,
f = !e&&"undefined"!==typeof c.caseSensitive&&c.caseSensitive,
g = !e&&"undefined"!==typeof c.includeTerritories&&c.includeTerritories,
h = !e&&"undefined"!==typeof c.includeMilitary&&c.includeMilitary;
return (
(d =
g||h
? g&&h
? "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"
: g
? "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"
: "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"
: "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"),
(d=f ? new RegExp(d):new RegExp(d, "i")),
this.optional(b)||d.test(a)
);
},
"Please specify a valid state."
),
a.validator.addMethod("strippedminlength",
function (b, c, d){
return a(b).text().length >=d;
},
a.validator.format("Please enter at least {0} characters.")
),
a.validator.addMethod("time",
function (a, b){
return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a);
},
"Please enter a valid time, between 00:00 and 23:59."
),
a.validator.addMethod("time12h",
function (a, b){
return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a);
},
"Please enter a valid time in 12-hour am/pm format."
),
a.validator.addMethod("url2",
function (a, b){
return (
this.optional(b) ||
/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a
)
);
},
a.validator.messages.url
),
a.validator.addMethod("vinUS",
function (a){
if(17!==a.length) return !1;
var b,
c,
d,
e,
f,
g,
h=["A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
i=[1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9],
j=[8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2],
k=0;
for (b=0; b < 17; b++){
if(((e=j[b]), (d=a.slice(b, b + 1)), 8===b&&(g=d), isNaN(d))){
for (c=0; c < h.length; c++)
if(d.toUpperCase()===h[c]){
(d=i[c]), (d *=e), isNaN(g)&&8===c&&(g=h[c]);
break;
}} else d *=e;
k +=d;
}
return (f=k % 11), 10===f&&(f="X"), f===g;
},
"The specified vehicle identification number (VIN) is invalid."
),
a.validator.addMethod("zipcodeUS",
function (a, b){
return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a);
},
"The specified US ZIP Code is invalid."
),
a.validator.addMethod("ziprange",
function (a, b){
return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a);
},
"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx."
),
a
);
});
!function(){function e(){jQuery(".de_fb_form").each(function(e,t){main_count=Number(0),jQuery(this).find(".de_fb_form_field").each(function(e,t){var i=Number(jQuery(this).find(".search_filter_cont").attr("data-count"));isNaN(i)&&(i=0),main_count+=i,main_count>="100"&&(jQuery(this).addClass("last-item"),main_count=Number(0))})})}function t(e,t){if(jQuery(".in_step").length>0)var i=jQuery(".df_form_step").last().find(".step_button_wrapper");else i=jQuery(".divi-form-submit-container");var a='<button class="divi-form-submit et_pb_button '+t+'" type="submit">'+e+"</button>";0===i.find(".divi-form-submit").length&&i.append(a)}function a(){jQuery(".field_wrapper[data-conditional-logic]").each(function(){var e=jQuery(this),t=e.data("conditional-logic"),a=e.data("conditional-relation"),r=!1,o=[];jQuery.each(t,function(e,t){var a=!1,r=jQuery("#"+t[0]+"_wrapper");r.addClass("condition-field");var n=r.find(".et_pb_contact_field").data("type"),d="",s=t[2],l=""!==s&&!isNaN(s);switch(l&&(s=parseFloat(s)),"checkbox"===n||"radio"===n?(d=[],r.find("input:checked").each(function(){l?d.push(parseFloat(jQuery(this).val())):d.push(jQuery(this).val())})):d=l?parseFloat(jQuery("#"+t[0]).val()):jQuery("#"+t[0]).val(),null===d&&(d=""),t[1]){case"is":a=Array.isArray(d)?d.includes(s):d===s;break;case"is not":a=Array.isArray(d)?!d.includes(s):d!==s;break;case"is greater":if(jQuery.isNumeric(s))if(Array.isArray(d))for(i=0;i<d.size;i++)jQuery.isNumeric(d[i])&&d[i]>s&&(a=!0);else a=jQuery.isNumeric(d)&&d>s;else a=!1;break;case"is less":if(jQuery.isNumeric(s))if(Array.isArray(d))for(i=0;i<d.size;i++)jQuery.isNumeric(d[i])&&d[i]<s&&(a=!0);else a=jQuery.isNumeric(d)&&d<s;else a=!1;break;case"contains":if(Array.isArray(d))for(i=0;i<d.size;i++)-1!==d[i].indexOf(s)&&(a=!0);else a=-1!==d.indexOf(s);break;case"does not contain":if(Array.isArray(d))for(i=0;i<d.length;i++)-1===d[i].indexOf(s)&&(a=!0);else a=-1===d.indexOf(s);break;case"is empty":a=Array.isArray(d)?0===d.length:""===d;break;case"is not empty":a=Array.isArray(d)?0!==d.length:""!==d}o.push(a)}),"any"===a?o.includes(!0)&&(r=!0):o.includes(!1)||(r=!0),!0===r?(e.closest(".de_fb_form_field").removeClass("condition-hide").show(),e.find("*[required]").removeAttr("disabled"),e.find("input, select, textarea").removeAttr("disabled"),e.find(".signature-field canvas").each(function(){var e=jQuery(this),t=e.closest(".signature-field").attr("id");if(t&&"undefined"!=typeof fb_signature&&fb_signature.signature_objs){var i="signaturePad_"+t.replace("_wrapper",""),a=fb_signature.signature_objs[i];if(a){var r=e.closest(".de_fb_form_field").width();e[0].setAttribute("width",r),a.clear()}}})):(e.closest(".de_fb_form_field").addClass("condition-hide").hide(),e.find("*[required]").attr("disabled","disabled"),e.find('input:not([type="hidden"]), select, textarea').attr("disabled","disabled"))}),jQuery(document).ready(function(e){$is_machine_carousel=!1,jQuery(".et_pb_de_mach_carousel").length>0&&($is_machine_carousel=!0),e.fn.slick&&0==$is_machine_carousel&&setTimeout(function(){jQuery(".slick-initialized").slick("setPosition").slick()},500)}),jQuery(window).trigger("resize")}function r(e,t){void 0===t&&(t=2);var i="undefined"!=typeof de_fb_obj&&de_fb_obj.amount_separator?de_fb_obj.amount_separator:",",a="undefined"!=typeof de_fb_obj&&de_fb_obj.amount_decimalpoint?de_fb_obj.amount_decimalpoint:".",r=parseFloat(e).toFixed(t).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),r.join(a)}jQuery(document).on("divi_machine_modal_loaded",function(){a(),e(),function(){var e=document.getElementsByClassName("de_fb_autocomplete");function t(e){var t=e.getPlace();e.input_obj.parent().find(".de_fb_lat").val(t.geometry.location.lat()),e.input_obj.parent().find(".de_fb_lng").val(t.geometry.location.lng()),e.input_obj[0].dispatchEvent(new Event("change"))}if(void 0!==google.maps.places.Autocomplete)for(var i=0;i<e.length;i++){var a=new google.maps.places.Autocomplete(e[i]);a.input_obj=jQuery(e[i]),google.maps.event.addListener(a,"place_changed",function(e){return function(){t(e)}}(a))}}()}),jQuery(document).ready(function(t){t(".dfb_input_icon.input_password").click(function(){t(this).toggleClass("show_password");var e=t(t(this).closest(".et_pb_contact_field").find("input.divi-form-builder-field"));"password"===e.attr("type")?e.attr("type","text"):e.attr("type","password")}),t(".dropzone").on("dragover",function(e){var i=t(this),a=window.dropZoneTimeout;a?clearTimeout(a):(i.addClass("in"),i.closest(".field_wrapper").addClass("drag-over"));var r=t(e.target).closest(i);i.not(r).removeClass("hover"),r.addClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,i.removeClass("in hover"),i.closest(".field_wrapper").removeClass("drag-over")},100)}),"undefined"!=typeof ms_obj&&"on"!==ms_obj.next_on_enter&&t(".de_fb_form form").keydown(function(e){t(e.target).is("textarea, select")||13===e.keyCode&&(e.preventDefault(),t(this).submit())}),e();var i=t(".upload_field");t(window).on("dragenter",function(e){e.preventDefault()}),t(i).bind("dragover",function(e){t(this).closest(".field_wrapper").addClass("drag-over")}),t(i).bind("dragleave",function(e){t(this).closest(".field_wrapper").removeClass("drag-over")}),t(".fb_form.hide_until_loaded").each(function(){t(this).parent().find(".preloader").remove(),t(this).show()}),a(),t(document).on("change",".condition-field input, .condition-field textarea, .condition-field select",function(){a()}),t(document).on("click",".edit_form_modal",function(i){i.preventDefault(),i.stopPropagation();var r=t(this),o=r.attr("data-id"),n=r.attr("data-modal-layout"),d=r.attr("loading_animation_color"),s=r.attr("data-modal-style"),l=r.attr("data-loading-text"),c=r.attr("data-original-text")||r.text(),f={action:"de_fb_get_edit_form_ajax_handler",pid:o,modal_layout:n,fb_nonce:de_fb_obj.fb_nonce};t("#edit-form-modal-"+o).length>0?(t("#edit-form-modal-"+o).addClass("open"),t("#edit-form-modal-"+o).closest(".de_fb-grid-item").addClass("highest-priority"),t("#edit-form-modal-"+o).closest(".et_pb_row").addClass("highest-priority"),t("#edit-form-modal-"+o).closest(".grid-col").addClass("highest-priority"),t("#edit-form-modal-"+o).closest("#main-content").addClass("highest-priority")):t.ajax({url:de_fb_obj.ajax_url,data:f,type:"POST",dataType:"JSON",beforeSend:function(){l&&""!==l&&(r.addClass("de-fb-loading"),r.text(l))},success:function(i){l&&""!==l&&(r.removeClass("de-fb-loading"),r.text(c)),t("#de-fb-modal-wrapper-"+o).html('<div id="edit-form-modal-'+o+'" class="de-fb-popup '+s+'"><div class="post-modal-cont"><div class="modal-close"></div>'+i.content+"</div></div>"),e(),""!==d&&t("#loading-modal .line").each(function(e,i){t(this).css("background-color",d)}),t("#edit-form-modal-"+o).addClass("open"),t("#edit-form-modal-"+o).closest(".de_fb-grid-item").addClass("highest-priority"),t("#edit-form-modal-"+o).closest(".et_pb_row").addClass("highest-priority"),t("#edit-form-modal-"+o).closest(".grid-col").addClass("highest-priority"),t("#edit-form-modal-"+o).closest("#main-content").addClass("highest-priority"),t("#edit-form-modal-"+o).find("form").show(),t("body").css("overflow","hidden"),a(),void 0!==t.fn.fileupload&&t("#edit-form-modal-"+o).find(".de_fb_file_upload").each(function(){var e=t(this);t(document).trigger("de_fb_reinit_fileupload",[e])})},error:function(){l&&""!==l&&(r.removeClass("de-fb-loading"),r.text(c))}})}),t(document).on("touchstart click",".de-fb-popup .modal-close",function(){t(this).closest(".de-fb-popup").removeClass("open"),t(this).closest(".de-fb-popup").closest(".et_pb_row").removeClass("highest-priority"),t(".de_fb-grid-item").removeClass("highest-priority"),t(this).closest(".de-fb-popup").closest(".grid-col").removeClass("highest-priority"),t(".de-fb-popup").closest("#main-content").removeClass("highest-priority"),t("body").css("overflow","auto")}),t(".signature_clear").click(function(){var e=t(this).parent().find("input").attr("id");fb_signature.signature_objs["signaturePad_"+e].clear()}),t(".disable_submit_for_required").each(function(){console.log("disable_submit_for_required");let e=t(this).closest(".de_fb_form"),i=e.find(".divi-form-submit");function a(){let a=e.find(".required, *[required]"),r=!0;a.each(function(){if(!(t(this).closest(".de_fb_payment_area").length>0||t(this).closest(".de_fb_form_field").hasClass("condition-hide"))){let e=t(this).closest(".et_pb_contact_field").data("type");"checkbox"===e||"radio"===e?0===t(this).find("input:checked").length&&(r=!1):"file"===e||"image"===e?0===t(this).find(".files .template-upload").length&&(r=!1):""===(t(this).val()||"").trim()&&(r=!1)}}),r?i.removeAttr("disabled"):i.attr("disabled",!0),console.log("Required fields checked (excluding payment): "+r)}e.on("input change",".required, *[required]",a),a()})}),jQuery(document).ready(function(e){e('input[name="custom_price"]').change(function(){var t=e(this).closest("form");let i=r(this.value),a=t.find('input[name="form_display_type"]').val(),o=t.find('button[type="submit"].divi-form-submit'),n=t.find('input[name="popup_button_text"]').val(),d=t.find('input[name="popup_button_text"]').data("currency"),s=t.find('input[name="de_fb_payment_action"]').val();console.log(i),t.find("#de_fb_payment_amount").val(i),"in_overlay"===a&&"stripe"===s&&(n=n.replace("%s",d+i),o.text(n).attr("id","open-popup"));let l=r(e(this).val()),c=parseFloat(e(this).data("min")),f=parseFloat(e(this).data("max")),u=parseFloat(e(this).data("step")),p=e(this).data("step-error"),_=e(this).data("min-error"),m=e(this).data("max-error");if(t.find(".payment-error").hide().text(""),l<c||l>f||l%u!==0){let i="";l<c?i=_.replace("%f",r(c)):l>f?i=m.replace("%f",r(f)):l%u!==0&&(i=p.replace("%f",r(u))),t.find(".payment-error").text(i).show(),e(this).addClass("input-error")}else e(this).removeClass("input-error")}),e(".divi_fb_gateways a").click(function(t){console.log("Payment gateway clicked");var i=e(this).closest("form");e(t.target).is('input[type="radio"]')||t.preventDefault(),i.find('input[name="custom_price"]').trigger("change"),i.find(".divi_fb_gateways a").removeClass("selected");let a=i.find('input[name="form_display_type"]').val(),r=i.find('input[name="popup_button_text"]').val(),o=i.find('button[type="submit"].divi-form-submit');o.data("original-text")||o.data("original-text",o.text());let n=i.find("#de_fb_payment_amount").val(),d=i.find(".calculation_field .result");i.find(".divi_fb_gateways a").each(function(){var t=e(this).find('input[name="divi_fb_payment_gateway"]').val();i.removeClass("de_fb_gateway_"+t+"_form")}),e(this).addClass("selected"),e(this).find('input[name="divi_fb_payment_gateway"]').prop("checked",!0);var s=e(this).find('input[name="divi_fb_payment_gateway"]').val();if(i.find(".de_fb_payment_action").val(s),i.addClass("de_fb_gateway_"+s+"_form"),i.find(".gateway-form").addClass("hide").find('input[type="text"]').val("").removeAttr("required"),i.find("."+s+"-gateway-form").removeClass("hide").find('input[type="text"]').attr("required","required"),"in_overlay"===a&&"stripe"===s){let e=i.find('input[name="popup_button_text"]').data("currency");r=r.replace("%s",e+n),o.text(r).attr("id","open-popup")}else o.text(o.data("original-text")).removeAttr("id");0===d.length&&e(".cost-wrap").length>0&&(i.find(".calculation-error").remove(),i.find(".cost-wrap").html('<p class="calculation-error" style="color: red;">Please add the calculation field to get a calculated cost.</p>'))}),e('form[id^="fb_form_"]').each(function(){var t=e(this),i=t.find(".divi_fb_gateways a.selected");if(i.length>0)i.trigger("click");else{let e=t.find('.divi_fb_gateways input[type="radio"]:checked').closest("li");e.length>0&&e.trigger("click")}}),e('form[id^="fb_form_"]').each(function(t){let i=e(this),a=i.find('input[name="form_display_type"]').val(),r=i.find('button[type="submit"].divi-form-submit');r.data("original-popup-btn-text")||r.data("original-popup-btn-text",r.text()),"in_overlay"===a&&i.on("click","#open-popup",function(t){var a=r.text(),o=i.find("#de_fb_payment_amount").val(),n=i.find("#de_fb_payment_amount");if((e("#et-main-area").css("z-index","999999"),e("#et-main-area").css("position","sticky"),t.preventDefault(),e(".g-recaptcha").length>0)&&0===grecaptcha.getResponse().length)return e(".g-recaptcha").after('<p class="error" style="color:red">Please check the reCAPTCHA.</p>'),i.find(".divi-form-submit").prop("disabled",!1),!1;if(parseFloat(o)<=0?(i.find(".plan-price").find(".payment-error").remove(),0===i.find(".plan-price .payment-error").length&&i.find(".plan-price").append('<div class="payment-error et_pb_contact_error_text">Please add a valid value for payment</div>'),e(n).addClass("input-error")):(i.find(".plan-price").find(".payment-error").remove(),e(n).removeClass("input-error")),e(".input-error").length>0)return!1;if(!i.valid())return!1;let d=i.find("#card-wrap").clone(!0);e("#modalFormContainer").html(d),e("#stripeModal").fadeIn();let s=e("#modalFormContainer").find("#card-wrap");s.find("input, select, checkbox").removeClass("error"),s.find(".cvcerror, .tcerror, label.error").hide(),0===e("#modalFormContainer .popup-submit").length&&e("#modalFormContainer").append('<input type="submit" value="'+a+'" class="divi-form-submit popup-submit et_pb_button">'),e(".stripe-close, #stripeModal").click(function(t){(e(t.target).is("#stripeModal")||e(t.target).hasClass("stripe-close"))&&(e("#et-main-area").css("z-index",""),e("#et-main-area").css("position",""),e("#stripeModal").fadeOut())})})});const t=e("#card-number"),i=e(".payment-errors"),a=e(".de_fb_gateway_stripe_form");e(".de_fb_card_icons .card-icon");function o(){const e=t.val();return""===e.trim()?(i.text("Card number is required.").css("color","red"),!1):function(e){const t=e.replace(/\s+/g,"");if(!/^\d{13,19}$/.test(t))return!1;let i=0,a=!1;for(let e=t.length-1;e>=0;e--){let r=parseInt(t.charAt(e),10);a&&(r*=2,r>9&&(r-=9)),i+=r,a=!a}return i%10==0&&[{type:"visa",pattern:/^4\d{12}(?:\d{3,6})?$/},{type:"mastercard",pattern:/^5[1-5]\d{14}$/},{type:"amex",pattern:/^3[47]\d{13}$/},{type:"discover",pattern:/^(6011\d{12}|65\d{14}|64[4-9]\d{13}|622(?:1[2-9]|[2-8]\d|9[01])\d{10})$/},{type:"diners",pattern:/^3(?:0[0-5]|[68]\d)\d{11}$/},{type:"jcb",pattern:/^(?:2131|1800)\d{11}|35\d{14}$/}].some(e=>e.pattern.test(t))}(e)?(i.text(""),!0):(i.text("Invalid card number. Please check and try again.").css("color","red"),!1)}function n(e){const t=e.replace(/\D/g,""),i={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^(6011|65|64[4-9]|622)/,diners:/^3(0[0-5]|[68])/,jcb:/^(2131|1800|35)/};for(let e in i)if(i[e].test(t))return e;return null}function d(){const t=e("#card-number").val(),i=n(t),a=""===t.trim();e(".de_fb_card_icons .card-icon").removeClass("active"),a?e(".de_fb_card_icons .visa, .de_fb_card_icons .mastercard, .de_fb_card_icons .amex").addClass("active"):i?e(`.de_fb_card_icons .${i}`).addClass("active"):e(".de_fb_card_icons .general").addClass("active")}function s(){var e=this.closest("form"),t=e.querySelector(".password"),i=e.querySelector(".confirm_password");t.value!=i.value?i.setCustomValidity("Passwords Don't Match"):i.setCustomValidity("")}0!==t.length&&0!==a.length&&(e(document).on("input","#card-number",function(e){let t=this.value.replace(/\D/g,""),i="";const a=n(t);i="amex"===a?t.replace(/^(\d{0,4})(\d{0,6})(\d{0,5}).*/,(e,t,i,a)=>[t,i,a].filter(Boolean).join(" ")):"diners"===a?t.replace(/^(\d{0,4})(\d{0,6})(\d{0,4}).*/,(e,t,i,a)=>[t,i,a].filter(Boolean).join(" ")):t.length>16?t.replace(/^(\d{0,4})(\d{0,4})(\d{0,4})(\d{0,4})(\d{0,3}).*/,(e,t,i,a,r,o)=>[t,i,a,r,o].filter(Boolean).join(" ")):t.replace(/(\d{4})/g,"$1 ").trim(),this.value=i,d()}),t.on("blur",o),a.on("submit",function(e){if(!o())return e.preventDefault(),e.stopImmediatePropagation(),!1}),d(),document.querySelectorAll("form .password").forEach(function(e){e.addEventListener("change",s)}),document.querySelectorAll("form .confirm_password").forEach(function(e){e.addEventListener("keyup",s)}))}),window.de_fb_ajax_form_submit=function(e){jQuery(document).ready(function(t){var i=new FormData(e);i.append("action","de_fb_ajax_submit_ajax_handler"),i.append("fb_nonce",de_fb_obj.fb_nonce);var a=t(e).attr("data-ajax-btn"),r=t(e).attr("data-ajax-hide-sub"),o=t(e).find(".de_fb_ajax_submit").text();let n="true"===t(e).attr("data-reset-form-on-submit");jQuery.ajax({type:"POST",url:de_fb_obj.ajax_url,type:"POST",contentType:!1,cache:!1,processData:!1,data:i,beforeSend:function(){t(".de_fb_ajax_submit").html(a),t(e).find("input, select, textarea, button").prop("disabled","disabled"),t(e).find(".wp-editor-container").each(function(){var e=t(this).find("textarea").attr("id");tinymce.get(e).getBody().setAttribute("contenteditable","false")}),t(e).find(".message_wrapper").remove()},success:function(i){t(e).find("#stripeModal").fadeOut(),t(e).removeClass("submitting"),t(e).find("input, select, textarea, button").removeProp("disabled"),t(e).find("input, select, textarea, button").removeAttr("disabled"),t(e).closest(".de_fb_form ").find(".message_wrapper").remove(),t(e).find(".wp-editor-container").each(function(){var e=t(this).find("textarea").attr("id");tinymce.get(e).getBody().setAttribute("contenteditable","true")}),"undefined"!=typeof grecaptcha&&void 0!==window.___grecaptcha_cfg&&window.___grecaptcha_cfg.count>0&&grecaptcha.reset(),t(".de_fb_ajax_submit").html(o),""!==i.result&&(void 0!==i.redirect&&""!==i.redirect?document.location.href=i.redirect:(""!==i.message&&("before_title"===i.message_position?jQuery(e).before(i.message):"after_title"===i.message_position?jQuery(e).find(".form-title").after(i.message):"before_button"===i.message_position?jQuery(e).find(".et_contact_bottom_container").before(i.message):"after_button"===i.message_position&&jQuery(e).after(i.message)),t(".signature_clear").trigger("click")),"on"===r&&"failed"!==i.result&&(t(e).find(".divi-form-wrapper").hide(),t(e).find(".df_progressbar_container").hide(),t(e).find(".divi-form-submit").hide(),t(e).find(".submit-container").hide(),t(e).find(".bloom_subscribe").hide(),t(e).find(".de_fb_payment_area").hide()),n&&(e.reset(),t(e).hasClass("multistep")&&init_step(t(e))),t(e).find(".file_preview_container .template-upload").remove(),t(e).find('.et_pb_contact_field[data-type="file"], .et_pb_contact_field[data-type="image"]').removeAttr("data-uploaded"),t(e).removeClass("submitting"))}})})},window.de_fb_ajax_files_upload=function(e){e.find(".file_preview_container .template-upload").length>0&&e.find(".file_preview_container .template-upload .start").trigger("click")},window.validateTime=function(e,i,a){e*=1e3,setTimeout(function(){t(i,a)},e)},window.validateField=function(e,i,a,r){e=e.toLowerCase();var o=jQuery('[name="de_fb_'+e+'"]'),n="",d=o.attr("type");void 0===d&&(d=o.attr("data-field_type")),void 0===d&&(d=(o=jQuery('[name="de_fb_'+e+'[]"]')).attr("type")),void 0===d&&(d=(o=jQuery('[name="de_fb_'+e+'[]"]')).attr("type")),"checkbox"===d?(n=[],o.each(function(){jQuery(this).is(":checked")&&n.push(jQuery(this).val())})):n="radio"===d?jQuery('[name="de_fb_'+e+'"]:checked').val():"select"===d?jQuery('[name="de_fb_'+e+'"] option:selected').val():o.val(),Array.isArray(n)?n.includes(i)&&t(a,r):n===i?t(a,r):jQuery(".divi-form-submit").remove()}}();