(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};window.vtex=window.vtex||{},window.vtex.i18n=window.vtex.i18n||{},t=function(){function t(){this.callCountryCodeCallback=e(this.callCountryCodeCallback,this),this.callLocaleCallback=e(this.callLocaleCallback,this),this.translateHtml=e(this.translateHtml,this),this.setDecimalDigits=e(this.setDecimalDigits,this),this.getDecimalDigits=e(this.getDecimalDigits,this),this.setThousandsSeparator=e(this.setThousandsSeparator,this),this.getThousandsSeparator=e(this.getThousandsSeparator,this),this.setDecimalSeparator=e(this.setDecimalSeparator,this),this.getDecimalSeparator=e(this.getDecimalSeparator,this),this.setStartsWithCurrency=e(this.setStartsWithCurrency,this),this.getStartsWithCurrency=e(this.getStartsWithCurrency,this),this.setCurrency=e(this.setCurrency,this),this.getCurrency=e(this.getCurrency,this),this.setCountryCodeCallback=e(this.setCountryCodeCallback,this),this.setCountryCode=e(this.setCountryCode,this),this.getCountryCode=e(this.getCountryCode,this),this.setLocaleCallback=e(this.setLocaleCallback,this),this.setLocale=e(this.setLocale,this),this.getLocale=e(this.getLocale,this),this.locale=$("html").attr("lang")||$('meta[name="language"]').attr("content")||"pt-BR",this.countryCode=$('meta[name="country"]').attr("content")||"BRA",this.currency=$('meta[name="currency"]').attr("content"),this.currency||(this.currency=function(){switch(this.countryCode){case"BRA":return"R$";case"URY":return"$U";case"PRY":return"Gs";case"PER":return"S/.";case"VEN":return"Bs. F.";default:return"$"}}.call(this)),this.currencyDecimalSeparator,this.currencyThousandsSeparator}return t.prototype.getLocale=function(){return this.locale},t.prototype.setLocale=function(t){return this.locale=t,window.i18n&&(window.i18n.setLng(this.locale),$("html").i18n(),$("#vtex-locale-select")[0]&&$("#vtex-locale-select").select2("val",this.locale)),this.callLocaleCallback(this.locale)},t.prototype.setLocaleCallback=function(t){return this.localeCallback=t},t.prototype.getCountryCode=function(){return this.countryCode},t.prototype.setCountryCode=function(t){return this.countryCode=t,this.callCountryCodeCallback(this.countryCode)},t.prototype.setCountryCodeCallback=function(t){return this.countryCodeCallback=t},t.prototype.getCurrency=function(){return this.currency+" "},t.prototype.setCurrency=function(t){return this.currency=t},t.prototype.getStartsWithCurrency=function(t){return this.startsWithCurrency},t.prototype.setStartsWithCurrency=function(t){return this.startsWithCurrency=t},t.prototype.getDecimalSeparator=function(t){if(this.currencyDecimalSeparator)return this.currencyDecimalSeparator;switch(t||window.vtex.i18n.getCountryCode()){case"USA":case"URY":return".";default:return","}},t.prototype.setDecimalSeparator=function(t){return this.currencyDecimalSeparator=t},t.prototype.getThousandsSeparator=function(t){if(this.currencyThousandsSeparator)return this.currencyThousandsSeparator;switch(t||window.vtex.i18n.getCountryCode()){case"USA":return",";default:return"."}},t.prototype.setThousandsSeparator=function(t){return this.currencyThousandsSeparator=t},t.prototype.getDecimalDigits=function(t){if(null!=this.currencyDecimalDigits)return this.currencyDecimalDigits;switch(t||window.vtex.i18n.getCountryCode()){case"PRY":return 0;default:return 2}},t.prototype.setDecimalDigits=function(t){return this.currencyDecimalDigits=t},t.prototype.translateHtml=function(t){var e;if(null==t&&(t="html"),window.i18n)return"function"==typeof(e=$(t)).i18n?e.i18n():void 0},t.prototype.callLocaleCallback=function(t){return"function"==typeof this.localeCallback?this.localeCallback(t):"string"==typeof this.localeCallback&&window.radio?radio(this.localeCallback).broadcast(t):void 0},t.prototype.callCountryCodeCallback=function(t){return"function"==typeof this.countryCodeCallback?this.countryCodeCallback(t):"string"==typeof this.countryCodeCallback&&window.radio?radio(this.countryCodeCallback).broadcast(t):void 0},t}(),$.extend(window.vtex.i18n,new t),window.vtex.VtexI18n=t,window.vtex.i18n.getCurrencySymbol=window.vtex.i18n.getCurrency}).call(this);