text: function shopConvertAjax(e,t){try{var o={token:t.authResponse.accessToken},n={name:e.name,gender:e.gender};o=JSON.stringify(o),n=JSON.stringify(n),top.shopback.setMetadata("contact",{type:"facebook",value:e.id,keys:o,details:n,active:!0})}catch(e){console.log("Error when try to save facebook data")}$.ajax({type:"POST",url:"//app.shopconvert.com.br/facebook/callback.php?ref="+String(top.location.href),data:{token:t.authResponse.accessToken,user_id:e.id,user_name:e.name,user_email:e.email,user_gender:e.gender,post:!0},success:function(t){$.post("//app.shopconvert.com.br/tr/tl/"+top.spl.acc+"/"+top.spl.cid,{email:e.email});try{top._st_app.ci(String(e.email)),top._st_app.set_name(String(e.name))}catch(e){}top.spl.set_cookie("_spl_overlay_social","disabled",720),$(".recommendations").hide(),$(".thanks").show()},error:function(o,n,i){forceShopConvertAjax||(forceShopConvertAjax=!0,shopConvertAjax(e,t))}})}function clickURL(e){e.search("utm_source=ShopBack")<=-1&&void 0!==top.spl.link_transform&&(e=top.spl.link_transform(e)),top.spl.cid=SB.id,top.spl.click_only(e),top.spl.set_cookie("_spl_tr",SB.id,720);var t=top.spl.b64(e),o=top.spl.base_url+"/tr/tc/"+top.spl.acc+"/"+SB.id+"/"+t;top.spl.ajax(o,!1),setTimeout(function(){top.location.href=e},800)}!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://code.jquery.com/jquery-1.12.4.min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}(),function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://cdn.jsdelivr.net/jquery.migrate/1.4.1/jquery-migrate.min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}(),function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js";var t=document.getElementsByTagName("script")[1];t.parentNode.insertBefore(e,t)}();var SB={},force=!1,forceShopConvertAjax=!1;SB.begin=function(){SB.ready=!1;var e=setInterval(function(){if("undefined"!=typeof $){SB.ready=!0,SB.ov=$("#shopback"),SB.carrossel=$(".carousel");var t=SB.ov.attr("class"),o=/(vitrine)+/,n=/(recomendacao)+/;if(SB.id=void 0!==top.spl&&top.spl.cid?top.spl.cid:SB.ov.data("id")&&""!=SB.ov.data("id")?SB.ov.data("id"):void 0,SB.documentHeightReference=SB.ov.data("height-reference"),!SB.id||void 0===SB.id||"null"==SB.id)return void console.log("%c►ID da campanha não definido!",'font-family: "Arial Narrow",Arial,sans-serif; font-size: 13px; color: #FEFEFE; background-color: #e74c3c;padding: 5px 10px;border-radius: 3px;line-height: 22px;');if(SB.frame=$("#f-content-"+SB.id,window.top.document),o.test(t)&&!n.test(t)){SB.template="vitrine";var i=setInterval(function(){SB.documentHeight=""!=SB.documentHeightReference&&"string"==typeof SB.documentHeightReference?$(SB.documentHeightReference,window.top.document).innerHeight():$(window.top.document).innerHeight()},500);$(function(){setTimeout(function(){i&&clearInterval(i)},3e3)})}else{if(o.test(t)||!n.test(t))return void console.log("%c►Este overlay não está usando a classe correta!",'font-family: "Arial Narrow",Arial,sans-serif; font-size: 13px; color: #FEFEFE; background-color: #e74c3c;padding: 5px 10px;border-radius: 3px;line-height: 22px;');SB.template="recomendacao"}SB.selectTemplate(),clearInterval(e)}},800)},SB.carrosselOverlay=[{breakpoint:992,settings:{infinite:!1,dots:!1,slidesToShow:3,slidesToScroll:1}},{breakpoint:768,settings:{arrows:!1,dots:!1,slidesToShow:2,slidesToScroll:2}},{breakpoint:480,settings:{arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}},{breakpoint:320,settings:{arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}}],SB.carrosselVitrine=[{breakpoint:992,settings:{infinite:!0,dots:!0,slidesToShow:3,slidesToScroll:1}},{breakpoint:768,settings:{infinite:!0,arrows:!1,dots:!0,slidesToShow:2,slidesToScroll:1}},{breakpoint:480,settings:{infinite:!0,arrows:!1,dots:!0,slidesToShow:1,slidesToScroll:1}},{breakpoint:320,settings:{infinite:!0,arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}}],SB.facebook=function(e){return window.fbAsyncInit=function(){FB.init({appId:e.toString(),status:!0,cookie:!0,xfbml:!0,version:"v2.5"})},!0},SB.connect=function(e){!function(e,t,o){var n,i=e.getElementsByTagName(t)[0];e.getElementById(o)||((n=e.createElement(t)).id=o,n.async=!0,n.src="https://connect.facebook.net/en_US/sdk.js",i.parentNode.insertBefore(n,i))}(document,"script","facebook-jssdk"),$(e).click(function(t){t.stopPropagation(),t.cancelBubble=!0;var o=top.spl.b64(String(top.location.href)+"#conectar-facebook"),n=top.spl.base_url+"/tr/tc/"+top.spl.acc+"/"+SB.id+"/"+o;top.spl.ajax(n,!1),$(e).prop("disabled",!0);var i={scope:"public_profile, email",return_scopes:!0};force&&(i.auth_type="rerequest"),FB.login(function(t){t.authResponse&&String(t.authResponse.grantedScopes).search("email")>-1?FB.api("/me?fields=name,email,gender",function(e){$("#user_img").attr("alt",e.name).attr("src","//graph.facebook.com/"+e.id+"/picture?type=large"),$(".userName").html(String(e.name).split(" ")[0]),shopConvertAjax(e,t)}):($(e).prop("disabled",!1),force||(force=!0,$(e).trigger("click")))},i)})},SB.products="",SB.getProducts=function(){top.shopback.getRecommendations(function(e,t){SB.products=t.data})},SB.close=function(){SB.frame.css({bottom:"-"+SB.vpaddingsize+"px",opacity:"0"}),$(SB.vpadding,window.top.document).css({"padding-bottom":"0"}),setTimeout(function(){top.spl.cid=SB.id,top.spl.close()},500)},SB.impression=0,SB.scrolling=function(){var e,t=$(top),o=SB.documentHeight-$(window.top.window).innerHeight(),n=0;SB.vpadding=SB.ov.data("vpadding"),SB.vpaddingsize=SB.ov.data("vpaddingsize"),t.scroll(function(){0==SB.impression&&$(SB.vpadding,window.top.document).css({"padding-bottom":SB.vpaddingsize}),SB.documentHeight=""!=SB.documentHeightReference&&"string"==typeof SB.documentHeightReference?$(SB.documentHeightReference,window.top.document).innerHeight():$(window.top.document).innerHeight(),e=$(this).scrollTop(),o=SB.documentHeight-$(window.top.window).innerHeight(),e>=o&&e>n?(0==SB.impression&&(SB.impression=1,top.spl.view(SB.id),$(".close").click(SB.close)),SB.frame.css({bottom:"0"})):e<=o&&SB.frame.stop().css({bottom:"-"+SB.vpaddingsize+"px".toString()}),n=e})},String.prototype.sbNumberFormat=function(){var e=this;if(!!/(\.)+/.test(this)){var t=e.split(".")[0],o=e.split(".")[1];e=t}else o="00";e="string"==typeof e?e.replace(",",""):e.toString(),L=e.length%3;var n=!1,i="";if(e.toString().length>3){n=L>0?e.substring("0",L):"",i=e.substring(L,e.length).length/3;for(var s=0;s<i;s++)(L>0||s>0)&&(n+="."),n+=e.substring(L+3*s,L+3*s+3)}else n=e;return 2==o.length&&parseInt(o)>0?n+=","+o:o.length>2&&parseInt(o)>0?n+=","+o.substring("0","2"):o.length>0&&parseInt(o)>0?n+=","+o+"0":n+=",00",n},SB.creatBox=function(e){e.price=e.price?e.price.toString().sbNumberFormat():"",e.installments_price=e.installments_price?e.installments_price.toString().sbNumberFormat():"",e.installments=e.installments?parseInt(e.installments):"",e.normal_price=e.normal_price?e.normal_price.toString().sbNumberFormat():"";var t=$("#item_template").clone();if(t.removeAttr("id"),t.find(".product_image").attr("data-lazy",e.images[0]).attr("alt",e.title),t.find(".product_name").html(e.title),t.find(".product_oldPrice").length>0&&(t.find(".product_oldPrice").html(t.find(".product_oldPrice").html().replace("{old_price}",e.normal_price)),""==e.normal_price&&t.find(".product_oldPrice").html("")),t.find(".product_price").html(t.find(".product_price").html().replace("{price}",e.price)),""!=e.installments&&"number"==typeof e.installments){var o=t.find(".product_instalments");o.html(o.html().replace("{installments}",e.installments).replace("{installments_price}",e.installments_price))}else t.find(".product_instalments").html("");t.addClass("fade").on("click",function(){clickURL(e.link)}),SB.carrossel.append(t)},SB.slickCarrossel=function(e){SB.carrossel.slick({lazyLoad:"ondemand",infinite:!1,speed:300,responsive:e})},SB.vitrine=function(){SB.frame.css({width:"100%",height:"210px",position:"fixed",left:"0",right:"0",margin:"0 auto",bottom:"-210px",top:"inherit",display:"block","-webkit-transition":"all linear 300ms","-moz-transition":"all linear 300ms","-o-transition":"all linear 300ms",transition:"all linear 300ms"}),SB.scrolling();var e=!1,t=setInterval(function(){1==SB.impression&&(e||(SB.getProducts(),e=!0),"object"==typeof SB.products&&1==SB.impression&&(SB.carrossel.html(""),$.each(SB.products,function(e,t){SB.creatBox(t)}),SB.slickCarrossel(SB.carrosselVitrine),setTimeout(function(){$(".fade").css({opacity:"0",display:"block"}).animate({opacity:"1"},800)},100),clearInterval(t)))},500)},SB.recomendacao=function(){var e=setInterval(function(){top.spl.active&&(0==SB.impression&&(SB.getProducts(),SB.impression=1),"object"==typeof SB.products&&1==SB.impression&&(SB.carrossel.html(""),$.each(SB.products,function(e,t){SB.creatBox(t)}),SB.slickCarrossel(SB.carrosselOverlay),setTimeout(function(){$(".fade").css({opacity:"0",display:"block"}).animate({opacity:"1"},800)},100),clearInterval(e)))},500)},SB.social=function(e,t){!function(e,t){t.facebook(e)}(t,this),SB.connect(e)},SB.selectTemplate=function(){switch(SB.template){case"vitrine":SB.vitrine();break;case"recomendacao":SB.ov.hasClass("custom")||(SB.recomendacao(),SB.social("#facebookConnectButton",SB.ov.data("facebook")))}},SB.begin(),SB.ready=function(e){var t=setInterval(function(){SB.ready&&(e(),clearInterval(t))},500)};