https://www.toolbazaar.co.uk/cdn/shop/t/6/assets/ets_social_login.js?v=94708498786240053171677669644
1if("undefined"!=typeof jQueryETS)jQueryETS(document).ready(ETS_SOCIAL_LOGIN_FUNC);else var ETS_SOCIAL_LOGIN_INTERVAL=setInterval(function(){"undefined"!=typeof jQueryETS&&(jQueryETS(document).ready(ETS_SOCIAL_LOGIN_FUNC),clearInterval(ETS_SOCIAL_LOGIN_INTERVAL))},200);function ETS_SOCIAL_LOGIN_FUNC(o){var e={showLoginButtons:function(){if(-1!==window.location.href.search("/account/login")&&ETS_SN_CONFIG.config.login_page.active&&o('input[name="customer[email]"]').closest("form").after('<div class="ets-social-login--position '+(ETS_SN_CONFIG.config.login_page.hide_on_mobile?"ets-socal-login--hide-on-mobile":"")+'"><div class="ets-social-login-or"><span>Or</span></div>'+e.generateSNButtons(ETS_SN_CONFIG.config.login_page)+"</div>"),-1!==window.location.href.search("/account/register")&&ETS_SN_CONFIG.config.register_page.active&&o('input[name="customer[email]"]').closest("form").after('<div class="ets-social-login--position '+(ETS_SN_CONFIG.config.register_page.hide_on_mobile?"ets-socal-login--hide-on-mobile":"")+'"><div class="ets-social-login-or"><span>Or</span></div>'+e.generateSNButtons(ETS_SN_CONFIG.config.register_page)+"</div>"),ETS_SN_CONFIG.config.login_popup.active&&ETS_SN_CONFIG.config.login_popup.sn_use){var i=ETS_SN_CONFIG.config.login_popup.nets,t="",s="";if(ETS_SN_CONFIG.config.login_popup.display_title&&(s+=" btn-has-title"),ETS_SN_CONFIG.config.login_popup.btn_rounded)switch(ETS_SN_CONFIG.config.login_popup.btn_rounded){case 0:s+=" btn-square";break;case 1:s+=" btn-rounded";break;case 2:s+=" btn-circle";break;default:s+=" btn-rounded"}if(ETS_SN_CONFIG.config.login_popup.btn_size)switch(ETS_SN_CONFIG.config.login_popup.btn_size){case"small":s+=" btn-small";break;case"large":s+=" btn-large";break;case"medium":default:s+=" btn-medium"}"click"==ETS_SN_CONFIG.config.login_popup.popup_type&&(t+='<div class="ets-social-login--overlay-popup">'),t+='<div class="ets-social-login--popup-login" id="ets-social-login--popup-login">',t+='<div class="popup-inner">',t+='<div class="popup-social-login">',t+='<div class="popup-title">'+ETS_SN_CONFIG.config.login_popup.login_title+("click"==ETS_SN_CONFIG.config.login_popup.popup_type?'<span class="close-popup"></span>':"")+"</div>",t+='<div class="popup-sn-buttons">';for(var n=0;n<i.length;n++)t+='<a href="javascript:void(0)" title="'+i[n].name+'" class="ets-social-login--btn js-ets-social-login--btn btn-'+i[n].provider.toLowerCase()+" "+s+("google"==i[n].provider.toLowerCase()&&1==ETS_SN_CONFIG.config.login_popup.temp_type?" g-new-temp":"")+'" data-provider="'+i[n].provider+'"><i class="icon-sn icon-btn-'+i[n].provider.toLowerCase()+'"></i>'+(ETS_SN_CONFIG.config.login_popup.display_title?'<span class="sn-title">'+i[n].name+"</span>":"")+"</a>";t+="</div>",t+='<div class="popup-desc">'+ETS_SN_CONFIG.config.login_popup.login_desc+"</div>",t+="</div>",t+='<div class="ets-social-login-or"><span>Or</span></div>',t+='<div class="popup-normal-login">',t+='<div class="popup-form">',t+='<form action="/account/login" method="POST" class="form-login">',t+='<div class="form-error"></div>',t+='<div class="input-box">',t+='<label class="input-label">Email</label>',t+='<input type="email" required class="input-field" name="customer[email]">',t+="</div>",t+='<div class="input-box">',t+='<label class="input-label">Password</label>',t+='<input type="password" required class="input-field" name="customer[password]">',t+="</div>",t+='<div class="input-box text-center">',t+='<button class="btn js-btn-login" type="submit">Login</button>',t+="</div>",t+='<div class="link-actions">',t+='<a href="#recover" class="ets-social-login--link-recover">Forgot your password?</a>',t+='<a href="/account/register" class="js-link-register">Create account</a>',t+="</div>",t+="</form>",t+='<form action="/account/recover" method="POST" class="form-recover hidden">',t+='<div class="recover-desc">We will send you an email to reset your password.</div>',t+='<div class="input-box">',t+='<label class="input-label">Email</label>',t+='<input type="email" required class="input-field" name="email">',t+="</div>",t+='<div class="input-box text-center">',t+='<button class="btn js-btn-reset-pwd" type="submit">Reset password</button>',t+="</div>",t+='<div class="input-box">',t+='<a href="#" class="ets-social-login--cancel-recover">Cancel</a>',t+="</div>",t+="</form>",t+="</div>",t+="</div>",t+="</div>",t+="</div>","click"==ETS_SN_CONFIG.config.login_popup.popup_type&&(t+="</div>"),o('a[href*="/account"]').length&&0==o(".ets-social-login--customer_logged_in").length&&o('a[href*="/account"]').each(function(e,i){o(this).addClass("ets-social-login--relative "+("hover"==ETS_SN_CONFIG.config.login_popup.popup_type?"ets-social-login--popup-hover":"ets-social-login--popup-click")+(ETS_SN_CONFIG.config.login_popup.hide_on_mobile?" ets-social-login--hide-on-mobile":"")),o(this).append(t),"hover"==ETS_SN_CONFIG.config.login_popup.popup_type&&o(this).find(".ets-social-login--popup-login").css("top",o(this).outerHeight()-10+"px")})}ETS_SN_CONFIG.config.embedded_code.active&&!o(".ets-social-login--customer_logged_in").length&&o(".ets-social-login--position.generated").length&&o(".ets-social-login--position.generated").each(function(){if(o(this).attr("data-sn_use")){var i={display_title:"1"==o(this).attr("data-display_title")?1:0,btn_rounded:"1"==o(this).attr("data-btn_rounded")?1:0,btn_size:o(this).attr("data-btn_size"),login_title:o(this).attr("data-login_title"),login_desc:o(this).attr("data-login_desc"),hide_one_mobile:"1"==o(this).attr("data-hide_one_mobile")?1:0,sn_use:o(this).attr("data-sn_use")},t=[],s=o(this).attr("data-names"),n=i.sn_use.split(",");o.each(s.split(","),function(o,e){t.push({name:e,provider:n[o]})}),i.nets=t,i.hide_on_mobile&&o(this).addClass("ets-social-login--hide-on-mobile"),o(this).html(e.generateSNButtons(i))}})},generateSNButtons:function(o){var e=o.nets,i="";if(o.display_title&&(i+=" btn-has-title"),o.btn_rounded)switch(o.btn_rounded){case 0:i+=" btn-square";break;case 1:i+=" btn-rounded";break;case 2:i+=" btn-circle";break;default:i+=" btn-rounded"}if(o.btn_size)switch(o.btn_size){case"small":i+=" btn-small";break;case"large":i+=" btn-large";break;case"medium":i+=" btn-medium"}var t="";t+='<div class="ets-social-login-title">'+o.login_title+"</div>",t+='<div class="ets-social-login-group-btn">';for(var s=0;s<e.length;s++)t+='<a href="javascript:void(0)" title="'+e[s].name+'" class="ets-social-login--btn js-ets-social-login--btn btn-'+e[s].provider.toLowerCase()+" "+i+("google"==e[s].provider.toLowerCase()&&1==o.temp_type?" g-new-temp":"")+'" data-provider="'+e[s].provider+'"><i class="icon-sn icon-btn-'+e[s].provider.toLowerCase()+'"></i>'+(o.display_title?'<span class="sn-title">'+e[s].name+"</span>":"")+"</a>";return t+="</div>",t+='<div class="ets-social-login-desc">'+o.login_desc+"</div>",t+='<div class="clearfix"></div>',t+='<div class="ets-social-g_d_p_r">'+ETS_SN_CONFIG.gdpr+"</div>"},etsLogin:function(e,i){var t={"customer[email]":e,"customer[password]":i,form_type:"customer_login",utf8:"â"};return o.ajax({url:"/account/login",method:"post",data:t,dataType:"html",async:!0})},getShop:function(){return"undefined"!=typeof ETS_SOLO_DOMAIN_SHOP&&ETS_SOLO_DOMAIN_SHOP?ETS_SOLO_DOMAIN_SHOP:window.location.hostname.replace("wwww.","")},getQueryParam:function(o,e){return urlObj=new URL(o),urlObj.searchParams.get(e)},getDataLogin:function(i,t){o.ajax({url:ETS_SN_CONFIG.base_path+"/apps/customer/auth",type:"POST",dataType:"json",data:{u:i,v:t},success:function(o){o&&e.doLogin(o,1)}})},updateDataLogin:function(i){o.ajax({url:ETS_SN_CONFIG.base_path+"/apps/customer/update",type:"POST",dataType:"json",data:{e:i,s:e.getShop()},success:function(o){o&&e.doLogin(o,2)}})},doLogin:function(o,i){e.etsLogin(o.u,o.v).done(function(t){-1!==t.indexOf("Invalid login credentials")?1==i||2==i?(e.updateDataLogin(o),2==i&&(window.opener.location.href="/account",window.close())):(window.opener.location.href="/account",window.close()):(localStorage.getItem("ets_social_login_c3")?window.opener.location.href="/discount/"+localStorage.getItem("ets_social_login_c3"):window.opener.location.href="/account",window.close())})},validateEmail:function(o){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(o).toLowerCase())},showPopupDiscount:function(e,i,t,s,n){var l=ETS_SN_CONFIG.popup_discount_content;l=l.replace("[discount_code]",'<span class="box_discount_code"><i>
1<svg style="width: 20px;height: 20px; position: relative; top: 4px;" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cut" class="svg-inline--fa fa-cut fa-w-14" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M278.06 256L444.48 89.57c4.69-4.69 4.69-12.29 0-16.97-32.8-32.8-85.99-32.8-118.79 0L210.18 188.12l-24.86-24.86c4.31-10.92 6.68-22.81 6.68-35.26 0-53.02-42.98-96-96-96S0 74.98 0 128s42.98 96 96 96c4.54 0 8.99-.32 13.36-.93L142.29 256l-32.93 32.93c-4.37-.61-8.83-.93-13.36-.93-53.02 0-96 42.98-96 96s42.98 96 96 96 96-42.98 96-96c0-12.45-2.37-24.34-6.68-35.26l24.86-24.86L325.69 439.4c32.8 32.8 85.99 32.8 118.79 0 4.69-4.68 4.69-12.28 0-16.97L278.06 256zM96 160c-17.64 0-32-14.36-32-32s14.36-32 32-32 32 14.36 32 32-14.36 32-32 32zm0 256c-17.64 0-32-14.36-32-32s14.36-32 32-32 32 14.36 32 32-14.36 32-32 32z"/></svg></i><span class="outer_input_code"><span class="tooltip_copied">Copied</span><span class="discount_code">'+e+"</span></span></span>"),l=i&&"null"!=i?l.replace("[reduction]","<strong>"+i+"</strong>"):l.replace("[reduction]",""),l=t&&"null"!=t?l.replace("[discount_from]","<strong>"+t+"</strong>"):l.replace("[discount_from]",""),l=s&&"null"!=s?l.replace("[discount_to]","<strong>"+s+"</strong>"):l.replace("[discount_to]",""),l=n&&"null"!=n?l.replace("[minimum_purchase]","<strong>"+n+"</strong>"):l.replace("[minimum_purchase]","");var a='<div class="ets-social-login--popup-discount" id="ets-social-login--popup-discount"><div class="popup-content"><div class="popup-header"> <span class="close">×</span></div><div class="popup-body"><p class="discount-text text-large"><strong>'+ETS_SN_CONFIG.popup_discount_title+"</strong></p>"+l+"</div></div></div>";o("body").append(a),o(".ets-social-login--popup-discount").addClass("open-popup")},formatDate:function(o){var e=new Date(o),i=e.getDay();i<10&&(i="0"+i);var t=e.getMonth()+1;return t<10&&(t="0"+t),i+"-"+t+"-"+e.getFullYear()}};if("undefined"!=typeof ETS_SN_CONFIG){e.getQueryParam(window.location.href,"c3")&&(localStorage.setItem("ets_social_login_c3",e.getQueryParam(window.location.href,"c3")),localStorage.setItem("ets_social_login_c31",e.getQueryParam(window.location.href,"c31")),localStorage.setItem("ets_social_login_c32",e.getQueryParam(window.location.href,"c32")),localStorage.setItem("ets_social_login_c33",e.getQueryParam(window.location.href,"c33")),localStorage.setItem("ets_social_login_c34",e.getQueryParam(window.location.href,"c34")));var i=0;o("script").each(function(){if(-1!=o(this).text().indexOf("asyncLoad")&&-1!=o(this).text().indexOf("ets_social_login_init.js?"))return i=1,!1}),i&&(e.showLoginButtons(),o(document).on("click",".js-ets-social-login--btn",function(i){i.preventDefault(),localStorage.setItem("ets_social_login_logging",1);var t=o(this).attr("data-provider"),s=500;o(window).width()<768&&(s=300);var n=window.screen.width/2-(s/2+10),l=window.screen.height/2-300;ets_solo_win=window.open(ETS_SN_CONFIG.base_path+"/apps/oauth?provider="+t+"&shop="+e.getShop(),"","width="+s+",height=500,screenX="+n+",screenY="+l)}),e.getQueryParam(window.location.href,"u1")&&e.getDataLogin(e.getQueryParam(window.location.href,"u1"),e.getQueryParam(window.location.href,"u2")),e.getQueryParam(window.location.href,"etsSoloDiscount")&&localStorage.getItem("ets_social_login_logging")&&(localStorage.setItem("ets_social_login_c3",e.getQueryParam(window.location.href,"etsSoloDiscount")),localStorage.setItem("ets_social_login_c31",e.getQueryParam(window.location.href,"etsSoloDiscountReduction")),localStorage.setItem("ets_social_login_c32",e.getQueryParam(window.location.href,"etsSoloDiscountFrom")),localStorage.setItem("ets_social_login_c33",e.getQueryParam(window.location.href,"etsSoloDiscountTo")),localStorage.setItem("ets_social_login_c34",e.getQueryParam(window.location.href,"etsSoloMinimumPurchase"))),-1!==window.location.href.search("/account")&&-1===window.location.href.search("/account/login")&&-1===window.location.href.search("account/register")&&window.opener&&(localStorage.getItem("ets_social_login_c3")?window.opener.location.href="/discount/"+localStorage.getItem("ets_social_login_c3"):window.opener.location.href="/account",window.close()),window.opener||localStorage.getItem("ets_social_login_c3")&&setTimeout(function(){e.showPopupDiscount(localStorage.getItem("ets_social_login_c3"),localStorage.getItem("ets_social_login_c31"),localStorage.getItem("ets_social_login_c32"),localStorage.getItem("ets_social_login_c33"),localStorage.getItem("ets_social_login_c34")),localStorage.removeItem("ets_social_login_c3"),localStorage.getItem("ets_social_login_c31")&&localStorage.removeItem("ets_social_login_c31"),localStorage.getItem("ets_social_login_c32")&&localStorage.removeItem("ets_social_login_c32"),localStorage.getItem("ets_social_login_c33")&&localStorage.removeItem("ets_social_login_c33"),localStorage.getItem("ets_social_login_c34")&&localStorage.removeItem("ets_social_login_c34")},2e3),o(document).on("click",".ets-social-login--popup-click",function(e){if(o(this).hasClass("ets-social-login--hide-on-mobile")&&o(window).width()<=768)return!0;var i=o(e.target);return o(this).find(".ets-social-login--overlay-popup").hasClass("open-popup")?i.is(".ets-social-login--popup-login")||(o(this).find(".ets-social-login--overlay-popup").removeClass("open-popup"),o(this).find(".ets-social-login--popup-login").removeClass("open")):(o(this).find(".ets-social-login--overlay-popup").addClass("open-popup"),o(this).find(".ets-social-login--popup-login").first().hasClass("open")||o(this).find(".ets-social-login--popup-login").first().addClass("open")),!1}),o(document).on("click",".ets-social-login--popup-click .close-popup",function(e){return o(this).closest(".ets-social-login--popup-login").removeClass("open"),o(".ets-social-login--overlay-popup").removeClass("open-popup"),!1}),o(document).on("keyup",function(e){27==e.keyCode&&(o(".ets-social-login--popup-login").removeClass("open"),o(".ets-social-login--overlay-popup").removeClass("open-popup"))}),o(document).on("click",".ets-social-login--popup-discount .discount_code",function(e){e.preventDefault();var i=o(this).html(),t=document.getElementsByTagName("body")[0],s=document.createElement("input");t.appendChild(s),s.setAttribute("value",i),s.select(),document.execCommand("copy"),t.removeChild(s),o(this).closest(".outer_input_code").find(".tooltip_copied").show();var n=o(this);setTimeout(function(){n.closest(".outer_input_code").find(".tooltip_copied").hide()},3e3)}),o(document).on("mouseover",".ets-social-login--popup-hover",function(e){return!!(o(this).hasClass("ets-social-login--hide-on-mobile")&&o(window).width()<=768)||(o(this).find(".ets-social-login--popup-login").first().hasClass("open")||o(this).find(".ets-social-login--popup-login").first().addClass("open"),!1)}),o(document).on("mouseleave",".ets-social-login--popup-hover",function(e){return o(".ets-social-login--popup-login input").is(e.target)||0!==o("ets-social-login--popup-login input").has(e.target).length||o(this).find(".ets-social-login--popup-login").first().removeClass("open"),!1}),o(document).on("click",".ets-social-login--popup-login .ets-social-login--link-recover",function(e){o(this).closest(".ets-social-login--popup-login").find(".form-recover").hasClass("hidden")&&o(this).closest(".ets-social-login--popup-login").find(".form-recover").removeClass("hidden"),o(this).closest(".ets-social-login--popup-login").find(".form-login").hasClass("hidden")||o(this).closest(".ets-social-login--popup-login").find(".form-login").addClass("hidden")}),o(document).on("click",".ets-social-login--popup-login .ets-social-login--cancel-recover",function(e){o(this).closest(".ets-social-login--popup-login").find(".form-recover").hasClass("hidden")||o(this).closest(".ets-social-login--popup-login").find(".form-recover").addClass("hidden"),o(this).closest(".ets-social-login--popup-login").find(".form-login").hasClass("hidden")&&o(this).closest(".ets-social-login--popup-login").find(".form-login").removeClass("hidden")}),o(document).on("click",".ets-social-login--popup-login",function(o){return!1}),o(document).click(function(e){!o(e.target).closest(".ets-social-login--popup-login").length&&o(".ets-social-login--popup-login").hasClass("open")&&o(".ets-social-login--popup-login").removeClass("open")}),o(document).on("click",".ets-social-login--popup-login .js-btn-login",function(i){var t=o(this).closest("form").find('input[name="customer[email]"]').val(),s=o(this).closest("form").find('input[name="customer[password]"]').val();if(t&&s){o(this).prop("disabled",!0);var n=o(this);e.etsLogin(t,s).done(function(o){-1!==o.indexOf("Invalid login credentials")?n.closest("form").find(".form-error").html("Invalid login credentials"):window.location.href="/account",n.prop("disabled",!1)})}else n.closest("form").find(".form-error").html("Email and password is required")}),o(document).on("click",".ets-social-login--popup-login .js-btn-reset-pwd",function(e){o(this).closest("form").find('input[name="email"]').val()?(o(this).prop("disabled",!0),o(this).closest("form").submit()):$this.closest("form").find(".form-error").html("Email is required")}),o(document).on("click",".ets-social-login--popup-login .js-link-register",function(e){window.location.href=o(this).attr("href")}),o(document).on("click","#ets-social-login--popup-discount .close",function(e){o(this).closest("#ets-social-login--popup-discount").removeClass("open-popup")}),o(window).on("click",function(e){o(e.target).is("#ets-social-login--popup-discount")&&o("#ets-social-login--popup-discount").removeClass("open-popup")}))}}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.