(function(){var e,t,i=function(e,t){return function(){return e.apply(t,arguments)}},n=[].slice;(t=window||exports).EVENT_HISTORY||(t.EVENT_HISTORY={}),e=function(){function e(){this.generateSelectors=i(this.generateSelectors,this),this.triggerProductEvent=i(this.triggerProductEvent,this),this.bindProductEvent=i(this.bindProductEvent,this)}return e.prototype.bindProductEvent=function(e,t,i){var s,r,o,a,l,u;if(null==i&&(i=0),s=function(e,t,s){var r;if($(window).on(e,function(){var e,r,o;if(r=arguments[0],e=2<=arguments.length?n.call(arguments,1):[],s===(o=e[i]))return t.apply(null,[r].concat(n.call(e)))}),(null!=(r=EVENT_HISTORY[s])?r[e]:void 0)!=null)return t.apply(null,EVENT_HISTORY[s][e])},!this.options.multipleProductIds)return s(e,t,this.productId);for(o=0,l=this.productId,u=[],a=l.length;o
  • ').reference(i._get(!1,["name"]),i,"h").write('
  • ').section(i._get(!1,["isRadio"]),i,{else:t,block:n},null).write("
  • ")}function t(e,t){return e.write('")}function i(e,t){return e.write('")}function n(e,t){return e.write('').section(t._get(!1,["values"]),t,{block:s},null).write("")}function s(e,t){return e.write('")}dust.register("sku-selector-modal",function t(i,n){return i.write('
    Selecione a varia\xe7\xe3o do produto
    ').reference(n._get(!1,["name"]),n,"h").write('
    ').reference(n._get(!1,[
    ').section(n._get(!1,["dimensions"]),n,{block:e},null).write('

    Para ser avisado da disponibilidade deste Produto, basta preencher os campos abaixo.

    ')})}(),function(){function e(e,i){return e.write('")}function t(e,t){return e.write('")}function i(e,t){return e.write('")}function n(e,t){return e.write('').section(t._get(!1,["values"]),t,{block:s},null).write("")}function s(e,t){return e.write('")}dust.register("sku-selector-product",function t(i,n){return i.section(n._get(!1,["dimensions"]),n,{block:e},null)})}(),(function(){var e,t,i=function(e,t){return function(){return e.apply(t,arguments)}},n={}.hasOwnProperty,s=function(e,t){for(var i in t)n.call(t,i)&&(e[i]=t[i]);function s(){this.constructor=e}return s.prototype=t.prototype,e.prototype=new s,e.__super__=t.prototype,e};e=window.jQuery,_.extend(dust.filters,{sanitize:function(e){return _.sanitize(e)},spacesToHyphens:function(e){return _.spacesToHyphens(e)}}),t=function(t){function n(t,n,s){var r,o,a,l,u,c,h,d,f,p,m,g,v,k=this;for(u=0,this.element=t,this.productData=n,this.options=s,this.showWarnUnavailable=i(this.showWarnUnavailable,this),this.showPriceRange=i(this.showPriceRange,this),this.showPrice=i(this.showPrice,this),this.showConfirmButton=i(this.showConfirmButton,this),this.showBuyButton=i(this.showBuyButton,this),this.hideWarnUnavailable=i(this.hideWarnUnavailable,this),this.hidePriceRange=i(this.hidePriceRange,this),this.hidePrice=i(this.hidePrice,this),this.hideConfirmButton=i(this.hideConfirmButton,this),this.hideBuyButton=i(this.hideBuyButton,this),this.buyIfNoVariations=i(this.buyIfNoVariations,this),this.findPrices=i(this.findPrices,this),this.warnUnavailableSubmitHandler=i(this.warnUnavailableSubmitHandler,this),this.buyButtonHandler=i(this.buyButtonHandler,this),this.hideAllNM=i(this.hideAllNM,this),this.disableUnavailableValue=i(this.disableUnavailableValue,this),this.disableInvalidValue=i(this.disableInvalidValue,this),this.selectValue=i(this.selectValue,this),this.resetDimension=i(this.resetDimension,this),this.skuMatches=i(this.skuMatches,this),this.findSelectionStatus=i(this.findSelectionStatus,this),this.selectDimensionValue=i(this.selectDimensionValue,this),this.selectSku=i(this.selectSku,this),this.selectSkuHandler=i(this.selectSkuHandler,this),this.skuObjectFromId=i(this.skuObjectFromId,this),this.setSelectedDimension=i(this.setSelectedDimension,this),this.getSelectedDimension=i(this.getSelectedDimension,this),this.findUndefinedDimensions=i(this.findUndefinedDimensions,this),this.getDimensionByName=i(this.getDimensionByName,this),this.searchDimensions=i(this.searchDimensions,this),this.findSelectedSku=i(this.findSelectedSku,this),this.findSelectableSkus=i(this.findSelectableSkus,this),this.isSkuSelectable=i(this.isSkuSelectable,this),this.dimensionChangeHandler=i(this.dimensionChangeHandler,this),this.bindEvents=i(this.bindEvents,this),this.render=i(this.render,this),this.isSelectedInexistent=i(this.isSelectedInexistent,this),this.update=i(this.update,this),this.init=i(this.init,this),this.productId=this.productData.productId,this.name=this.productData.name,this.salesChannel=this.productData.salesChannel,this.skus=this.productData.skus,this.image=this.skus[0].image,a=0,this.dimensions=(function(){var e,t,i,n,s,r;for(e=0,i=this.productData.dimensions,r=[],t=i.length;e=0&&(n=S[s],r!==s);s=p+=-1)"invalid"===(h=this.findSelectionStatus((function(){var e,t,n,s;for(e=0,n=this.dimensions,s=[],t=n.length;e=0;s=m+=-1)if(null!==(n=D[s]).selected&&void 0!==n.selected){o=s;break}for(a=(function(){var e,t,n,s;for(e=0,n=this.dimensions,s=[],t=n.length;e=o)for(y=0,b=(x=n.values).length;y1&&(this.triggerProductEvent("vtex.sku.selectable",l),this.triggerProductEvent("skuSelectable.vtex",l))),this.hideConfirmButton(),this.hideAllNM(),this.hidePriceRange(),this.hidePrice(),1===l.length){if((u=l[0]).available)return this.showBuyButton(u),this.showPrice(u);if(this.hideBuyButton(),this.options.warnUnavailable)return(this.showNMTitle(),"success"===this.history[u.sku])?this.showNMSuccess():(this.findNMSkuId().val(u.sku),this.showNMForm())}else if(l.length>1&&this.options.showPriceRange)return this.showPriceRange(this.findPrices(l))},n.prototype.isSelectedInexistent=function(){return 0===this.findSelectableSkus().length},n.prototype.render=function(){var e,t=this;return e=this.options.modalLayout?"sku-selector-modal":"sku-selector-product",dust.render(e,this,function(e,i){if(e)throw Error("Sku Selector Dust error: "+e);return t.element.html(i),t.update(),t.showBuyButton(),t.buyIfNoVariations(),t.element.trigger("vtex.sku.ready"),t.element.trigger("skuReady.vtex")})},n.prototype.bindEvents=function(){if(this.findinputs().on("change",this.dimensionChangeHandler),this.bindProductEvent("skuSelect.vtex",this.selectSkuHandler),this.findbuyButton().on("click",this.buyButtonHandler),this.options.warnUnavailable)return this.findwarnUnavailable().find("form").on("submit",this.warnUnavailableSubmitHandler)},n.prototype.dimensionChangeHandler=function(t){var i,n,s;return n=(i=e(t.target)).data("dimension"),s=""===i.val()?void 0:i.val(),this.update(n,s)},n.prototype.isSkuSelectable=function(e){var t,i,n,s;for(i=0,n=(s=this.dimensions).length;i1&&this.findinstallment().text("ou at\xe9 "+n+"x de R$ "+i),this.findprice().show()},n.prototype.showPriceRange=function(e){var t,i,n;return t=this.findpriceRange().show(),n=_.formatCurrency(e[0]/100),i=_.formatCurrency(e[e.length-1]/100),t.find(".lowPrice").text(" R$ "+n+" "),t.find(".highPrice").text(" R$ "+i+" ")},n.prototype.showWarnUnavailable=function(e){return this.findwarnUnavailable().show().find("input.sku-notifyme-skuid").val(e)},n}(ProductComponent),e.fn.skuSelector=function(i,n){var s,r,o,a,l,u,c;for(null==n&&(n={}),r=e.extend(!0,{},e.fn.skuSelector.defaults),u=0,c=this.length;u