1(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{26:(function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var moneyFormats={USD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} USD"},EUR:{money_format:"€{{amount}}",money_with_currency_format:"€{{amount}} EUR"},GBP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} GBP"},CAD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} CAD"},ALL:{money_format:"Lek {{amount}}",money_with_currency_format:"Lek {{amount}} ALL"},DZD:{money_format:"DA {{amount}}",money_with_currency_format:"DA {{amount}} DZD"},AOA:{money_format:"Kz{{amount}}",money_with_currency_format:"Kz{{amount}} AOA"},ARS:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} ARS"},AMD:{money_format:"{{amount}} AMD",money_with_currency_format:"{{amount}} AMD"},AWG:{money_format:"Afl{{amount}}",money_with_currency_format:"Afl{{amount}} AWG"},AUD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} AUD"},BBD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} Bds"},AZN:{money_format:"m.{{amount}}",money_with_currency_format:"m.{{amount}} AZN"},BDT:{money_format:"Tk {{amount}}",money_with_currency_format:"Tk {{amount}} BDT"},BSD:{money_format:"BS${{amount}}",money_with_currency_format:"BS${{amount}} BSD"},BHD:{money_format:"{{amount}}0 BD",money_with_currency_format:"{{amount}}0 BHD"},BYR:{money_format:"Br {{amount}}",money_with_currency_format:"Br {{amount}} BYR"},BZD:{money_format:"BZ${{amount}}",money_with_currency_format:"BZ${{amount}} BZD"},BTN:{money_format:"Nu {{amount}}",money_with_currency_format:"Nu {{amount}} BTN"},BAM:{money_format:"KM {{amount_with_comma_separator}}",money_with_currency_format:"KM {{amount_with_comma_separator}} BAM"},BRL:{money_format:"R$ {{amount_with_comma_separator}}",money_with_currency_format:"R$ {{amount_with_comma_separator}} BRL"},BOB:{money_format:"Bs{{amount_with_comma_separator}}",money_with_currency_format:"Bs{{amount_with_comma_separator}} BOB"},BWP:{money_format:"P{{amount}}",money_with_currency_format:"P{{amount}} BWP"},BND:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} BND"},BGN:{money_format:"{{amount}} \u043B\u0432",money_with_currency_format:"{{amount}} \u043B\u0432 BGN"},MMK:{money_format:"K{{amount}}",money_with_currency_format:"K{{amount}} MMK"},KHR:{money_format:"KHR{{amount}}",money_with_currency_format:"KHR{{amount}}"},KYD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} KYD"},XAF:{money_format:"FCFA{{amount}}",money_with_currency_format:"FCFA{{amount}} XAF"},CLP:{money_format:"${{amount_no_decimals}}",money_with_currency_format:"${{amount_no_decimals}} CLP"},CNY:{money_format:"¥{{amount}}",money_with_currency_format:"¥{{amount}} CNY"},COP:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} COP"},CRC:{money_format:"₡ {{amount_with_comma_separator}}",money_with_currency_format:"₡ {{amount_with_comma_separator}} CRC"},HRK:{money_format:"{{amount_with_comma_separator}} kn",money_with_currency_format:"{{amount_with_comma_separator}} kn HRK"},CZK:{money_format:"{{amount_with_comma_separator}} Kč",money_with_currency_format:"{{amount_with_comma_separator}} Kč"},DKK:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"kr.{{amount_with_comma_separator}}"},DOP:{money_format:"RD$ {{amount}}",money_with_currency_format:"RD$ {{amount}}"},XCD:{money_format:"${{amount}}",money_with_currency_format:"EC${{amount}}"},EGP:{money_format:"LE {{amount}}",money_with_currency_format:"LE {{amount}} EGP"},ETB:{money_format:"Br{{amount}}",money_with_currency_format:"Br{{amount}} ETB"},XPF:{money_format:"{{amount_no_decimals_with_comma_separator}} XPF",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} XPF"},FJD:{money_format:"${{amount}}",money_with_currency_format:"FJ${{amount}}"},GMD:{money_format:"D {{amount}}",money_with_currency_format:"D {{amount}} GMD"},GHS:{money_format:"GH₵{{amount}}",money_with_currency_format:"GH₵{{amount}}"},GTQ:{money_format:"Q{{amount}}",money_with_currency_format:"{{amount}} GTQ"},GYD:{money_format:"G${{amount}}",money_with_currency_format:"${{amount}} GYD"},GEL:{money_format:"{{amount}} GEL",money_with_currency_format:"{{amount}} GEL"},HNL:{money_format:"L {{amount}}",money_with_currency_format:"L {{amount}} HNL"},HKD:{money_format:"${{amount}}",money_with_currency_format:"HK${{amount}}"},HUF:{money_format:"{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} Ft"},ISK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr ISK"},INR:{money_format:"Rs. {{amount}}",money_with_currency_format:"Rs. {{amount}}"},IDR:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"Rp {{amount_with_comma_separator}}"},ILS:{money_format:"{{amount}} NIS",money_with_currency_format:"{{amount}} NIS"},JMD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} JMD"},JPY:{money_format:"¥{{amount_no_decimals}}",money_with_currency_format:"¥{{amount_no_decimals}} JPY"},JEP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} JEP"},JOD:{money_format:"{{amount}}0 JD",money_with_currency_format:"{{amount}}0 JOD"},KZT:{money_format:"{{amount}} KZT",money_with_currency_format:"{{amount}} KZT"},KES:{money_format:"KSh{{amount}}",money_with_currency_format:"KSh{{amount}}"},KWD:{money_format:"{{amount}}0 KD",money_with_currency_format:"{{amount}}0 KWD"},KGS:{money_format:"\u043B\u0432{{amount}}",money_with_currency_format:"\u043B\u0432{{amount}}"},LVL:{money_format:"Ls {{amount}}",money_with_currency_format:"Ls {{amount}} LVL"},LBP:{money_format:"L£{{amount}}",money_with_currency_format:"L£{{amount}} LBP"},LTL:{money_format:"{{amount}} Lt",money_with_currency_format:"{{amount}} Lt"},MGA:{money_format:"Ar {{amount}}",money_with_currency_format:"Ar {{amount}} MGA"},MKD:{money_format:"\u0434\u0435\u043D {{amount}}",money_with_currency_format:"\u0434\u0435\u043D {{amount}} MKD"},MOP:{money_format:"MOP${{amount}}",money_with_currency_format:"MOP${{amount}}"},MVR:{money_format:"Rf{{amount}}",money_with_currency_format:"Rf{{amount}} MRf"},MXN:{money_format:"$ {{amount}}",money_with_currency_format:"$ {{amount}} MXN"},MYR:{money_format:"RM{{amount}} MYR",money_with_currency_format:"RM{{amount}} MYR"},MUR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} MUR"},MDL:{money_format:"{{amount}} MDL",money_with_currency_format:"{{amount}} MDL"},MAD:{money_format:"{{amount}} dh",money_with_currency_format:"Dh {{amount}} MAD"},MNT:{money_format:"{{amount_no_decimals}} ₮",money_with_currency_format:"{{amount_no_decimals}} MNT"},MZN:{money_format:"{{amount}} Mt",money_with_currency_format:"Mt {{amount}} MZN"},NAD:{money_format:"N${{amount}}",money_with_currency_format:"N${{amount}} NAD"},NPR:{money_format:"Rs{{amount}}",money_with_currency_format:"Rs{{amount}} NPR"},ANG:{money_format:"ƒ{{amount}}",money_with_currency_format:"{{amount}} NAƒ"},NZD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} NZD"},NIO:{money_format:"C${{amount}}",money_with_currency_format:"C${{amount}} NIO"},NGN:{money_format:"₦{{amount}}",money_with_currency_format:"₦{{amount}} NGN"},NOK:{money_format:"kr {{amount_with_comma_separator}}",money_with_currency_format:"kr {{amount_with_comma_separator}} NOK"},OMR:{money_format:"{{amount_with_comma_separator}} OMR",money_with_currency_format:"{{amount_with_comma_separator}} OMR"},PKR:{money_format:"Rs.{{amount}}",money_with_currency_format:"Rs.{{amount}} PKR"},PGK:{money_format:"K {{amount}}",money_with_currency_format:"K {{amount}} PGK"},PYG:{money_format:"Gs. {{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"Gs. {{amount_no_decimals_with_comma_separator}} PYG"},PEN:{money_format:"S/. {{amount}}",money_with_currency_format:"S/. {{amount}} PEN"},PHP:{money_format:"₱{{amount}}",money_with_currency_format:"₱{{amount}} PHP"},PLN:{money_format:"{{amount_with_comma_separator}} zl",money_with_currency_format:"{{amount_with_comma_separator}} zl PLN"},QAR:{money_format:"QAR {{amount_with_comma_separator}}",money_with_currency_format:"QAR {{amount_with_comma_separator}}"},RON:{money_format:"{{amount_with_comma_separator}} lei",money_with_currency_format:"{{amount_with_comma_separator}} lei RON"},RUB:{money_format:"руб{{amount_with_comma_separator}}",money_with_currency_format:"руб{{amount_with_comma_separator}} RUB"},RWF:{money_format:"{{amount_no_decimals}} RF",money_with_currency_format:"{{amount_no_decimals}} RWF"},WST:{money_format:"WS$ {{amount}}",money_with_currency_format:"WS$ {{amount}} WST"},SAR:{money_format:"{{amount}} SR",money_with_currency_format:"{{amount}} SAR"},STD:{money_format:"Db {{amount}}",money_with_currency_format:"Db {{amount}} STD"},RSD:{money_format:"{{amount}} RSD",money_with_currency_format:"{{amount}} RSD"},SCR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} SCR"},SGD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} SGD"},SYP:{money_format:"S£{{amount}}",money_with_currency_format:"S£{{amount}} SYP"},ZAR:{money_format:"R {{amount}}",money_with_currency_format:"R {{amount}} ZAR"},KRW:{money_format:"₩{{amount_no_decimals}}",money_with_currency_format:"₩{{amount_no_decimals}} KRW"},LKR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} LKR"},SEK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr SEK"},CHF:{money_format:"SFr. {{amount}}",money_with_currency_format:"SFr. {{amount}} CHF"},TWD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TWD"},THB:{money_format:"{{amount}} ฿",money_with_currency_format:"{{amount}} ฿ THB"},TZS:{money_format:"{{amount}} TZS",money_with_currency_format:"{{amount}} TZS"},TTD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TTD"},TND:{money_format:"{{amount}}",money_with_currency_format:"{{amount}} DT"},TRY:{money_format:"{{amount}}TL",money_with_currency_format:"{{amount}}TL"},UGX:{money_format:"Ush {{amount_no_decimals}}",money_with_currency_format:"Ush {{amount_no_decimals}} UGX"},UAH:{money_format:"\u20B4{{amount}}",money_with_currency_format:"\u20B4{{amount}} UAH"},AED:{money_format:"Dhs. {{amount}}",money_with_currency_format:"Dhs. {{amount}} AED"},UYU:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} UYU"},VUV:{money_format:"${{amount}}",money_with_currency_format:"${{amount}}VT"},VEF:{money_format:"Bs. {{amount_with_comma_separator}}",money_with_currency_format:"Bs. {{amount_with_comma_separator}} VEF"},VND:{money_format:"{{amount_no_decimals_with_comma_separator}}₫",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} VND"},XBT:{money_format:"{{amount_no_decimals}} BTC",money_with_currency_format:"{{amount_no_decimals}} BTC"},XOF:{money_format:"CFA{{amount}}",money_with_currency_format:"CFA{{amount}} XOF"},ZMW:{money_format:"K{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"ZMW{{amount_no_decimals_with_comma_separator}}"}};function formatWithDelimiters(number){var precision=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,thousands=arguments.length>2&&arguments[2]!==void 0?arguments[2]:",",decimal=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".";if(isNaN(number)||!number)return 0;var preciseNumber=(number/100).toFixed(precision),parts=preciseNumber.split(thousands),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}function formatMoney(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/;switch(format.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2,",",".");break;case"amount_with_space_separator":value=formatWithDelimiters(cents,2," ",".");break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'",".");break;case"amount_no_decimals":value=formatWithDelimiters(cents,0,",",".");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ",".");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,",",".");break}return format.replace(placeholderRegex,value)}function getCentsValue(moneyAmount,format,currency){var cents=0;return format.indexOf("amount_no_decimals")!==-1?cents=moneyAmount*100:currency==="JOD"||currency==="KWD"||currency==="BHD"?cents=moneyAmount/10:cents=moneyAmount,cents}function getMoneyValue(priceEl){var price=priceEl.getAttribute("data-currency-original")||priceEl.textContent,value=parseInt(price.replace(/[^0-9]/g,""),10);return isNaN(value)?"":value}var classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")},createClass=(function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}})(),CurrencyConverter=(function(){function CurrencyConverter2(){classCallCheck(this,CurrencyConverter2),this.defaults={switcherSelector:"[data-currency-converter]",priceSelector:".money",shopCurrency:"",defaultCurrency:"",displayFormat:"",moneyFormat:"",moneyFormatNoCurrency:"",moneyFormatCurrency:""},this.options={},this.moneyFormats=moneyFormats,this.storage="currency",this.currentCurrency=null,this.isInitialised=!1}return createClass(CurrencyConverter2,[{key:"init",value:function(settings){var _this=this;!window.Currency||this.isInitialised||(Object.keys(this.defaults).forEac
1h(function(key){_this.options[key]=settings[key]||_this.defaults[key]}),this.currentCurrency=this._getStoredCurrency()||this.options.defaultCurrency,this.moneyFormats[this.options.shopCurrency].money_with_currency_format=this.options.moneyFormatCurrency,this.moneyFormats[this.options.shopCurrency].money_format=this.options.moneyFormatNoCurrency,this.isInitialised=!0,this._current())}},{key:"setCurrency",value:function(newCurrency){this.isInitialised&&this._convertAll(newCurrency)}},{key:"update",value:function(priceEl){if(this.isInitialised){for(var attributes=priceEl.attributes,attr=0;attr<attributes.length;attr++){var attribute=attributes[attr];attribute.name.indexOf("data-currency")===0&&priceEl.setAttribute(attribute.name,"")}this._convertEl(priceEl,this.currentCurrency)}}},{key:"_getStoredCurrency",value:function(){try{return localStorage.getItem(this.storage)}catch(error){return console.warn(error),this.options.defaultCurrency}}},{key:"_setStoredCurrency",value:function(currency){try{localStorage.setItem(this.storage,currency)}catch(error){console.warn(error)}}},{key:"_current",value:function(){for(var switchers=document.querySelectorAll(this.options.switcherSelector),i=0;i<switchers.length;i+=1)for(var switcher=switchers[i],childrenEls=switcher.querySelectorAll("option"),j=0;j<childrenEls.length;j+=1){var optionEl=childrenEls[j];optionEl.selected&&optionEl.value!==this.currentCurrency&&(optionEl.selected=!1),optionEl.value===this.currentCurrency&&(optionEl.selected=!0)}this._convertAll(this.currentCurrency)}},{key:"_convertEl",value:function(priceEl,newCurrency){var oldCurrency=this.options.shopCurrency;if(priceEl.getAttribute("data-currency")!==newCurrency){if(priceEl.getAttribute("data-currency-"+newCurrency))priceEl.innerHTML=priceEl.getAttribute("data-currency-"+newCurrency);
1else{var oldFormat=this.moneyFormats[oldCurrency][this.options.displayFormat],newFormat=this.moneyFormats[newCurrency][this.options.displayFormat],moneyValue=getMoneyValue(priceEl),centsValue=getCentsValue(moneyValue,oldFormat,oldCurrency);if(centsValue==="")return;var cents=window.Currency.convert(centsValue,oldCurrency,newCurrency),oldPriceFormatted=formatMoney(centsValue,oldFormat),priceFormatted=formatMoney(cents,newFormat);priceEl.getAttribute("data-currency-original")||priceEl.setAttribute("data-currency-original",oldPriceFormatted),priceEl.setAttribute("data-currency-"+oldCurrency,oldPriceFormatted),priceEl.setAttribute("data-currency-"+newCurrency,priceFormatted),priceEl.innerHTML=priceFormatted}priceEl.setAttribute("data-currency",newCurrency)}}},{key:"_convertAll",value:function(newCurrency){var priceEls=document.querySelectorAll(this.options.priceSelector);if(priceEls){this.currentCurrency=newCurrency,this._setStoredCurrency(newCurrency);for(var i=0;i<priceEls.length;i+=1)this._convertEl(priceEls[i],newCurrency)}}}]),CurrencyConverter2})(),singletonInstance=new CurrencyConverter;exports.default=singletonInstance,exports.CurrencyConverter=CurrencyConverter}),60:(function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"default",function(){return StaticRecentlyViewed});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),shopify_currency_converter__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(26),shopify_currency_converter__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(shopify_currency_converter__WEBPACK_IMPORTED_MODULE_1__),flickity__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(6),flickity__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(flickity__WEBPACK_IMPORTED_MODULE_2__),rimg_shopify__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(7);function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}var StaticRecentlyViewed=(function(){function StaticRecentlyViewed2(section){var _this=this;_classCallCheck(this,StaticRecentlyViewed2),this.namespace="pxu",this.maxRecentlyViewed=30,this.maxStorageTime=720*3600,this.version=1,this.storageKey="".concat(this.namespace,"-recentlyViewed-").concat(this.version),this.$el=jquery__WEBPACK_IMPORTED_MODULE_0___default()(section.el),this.time=section.data.time,this.flickity=null,this.recentlyViewed=section.data.recently_viewed_info,this.cardSettings=section.data.product_card_settings,this.recentlyViewed&&this.time&&(this.recentlyViewed.timestamp=Math.round(new Date().getTime()/1e3)),this.slideImageLoaded=this._onSlideImageLoaded.bind(this);var recentlyViewed=[];if(this.time){recentlyViewed=this._getRecentlyViewed(),this.recentlyViewed&&(this.removeRecentlyViewed(this.recentlyViewed.handle,recentlyViewed),recentlyViewed.push(this.recentlyViewed));var promises=this._setRecentlyViewed(recentlyViewed);jquery__WEBPACK_IMPORTED_MODULE_0___default.a.when.apply(jquery__WEBPACK_IMPORTED_MODULE_0___default.a,_toConsumableArray(promises)).done(function(){if(recentlyViewed.length){var cardsMarkup=_this._getRecentlyViewedCards(),cardsData=_this._getRecentlyViewed();_this.$el.find("[data-recently-viewed-container]").append(cardsMarkup),_this.$el.find(".money").each(function(index,el){return shopify_currency_converter__WEBPACK_IMPORTED_MODULE_1___default.a.update(el)}),cardsData.forEach(function(productData){var timestamp=_this.timeSince(productData.timestamp);jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-product-handle=".concat(productData.handle,"]")).prepend(timestamp)}),rimg_shopify__WEBPACK_IMPORTED_MODULE_3__.a.watch(_this.$el[0]),_this.$carousel=_this.$el.find(".product-recently-viewed--content"),_this.slides=".product-recently-viewed-card",_this.$carousel.find(_this.slides).length>1&&_this._initSlider()}else _this.$el.find(".product-recently-viewed--section").addClass("hide")})}else this.recentlyViewed&&(recentlyViewed.push(this.recentlyViewed),this._setRecentlyViewed(recentlyViewed)),this.$el.find(".product-recently-viewed--section").addClass("hide");this.bindEvents()}return _createClass(StaticRecentlyViewed2,[{key:"bindEvents",value:function(){var _this2=this;this.$el.on("click","[data-remove-recently-viewed]",function(event){var $target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.currentTarget),handle=$target.closest("[data-product-handle]").data("product-handle"),recentlyViewed=_this2._getRecentlyViewed();_this2.removeRecentlyViewed(handle,recentlyViewed),_this2._setRecentlyViewed(recentlyViewed),$target.parents("[data-recently-viewed-card]").addClass("hide-card"),$target.parents("[data-recently-viewed-card]").nextAll().addClass("move-card"),setTimeout(function(){var index=$target.parents("[data-recently-viewed-card]").index();index!==0&&index--,$target.parents("[data-recently-viewed-card]").nextAll().removeClass("move-card"),$target.parents("[data-recently-viewed-card]").length&&_this2.flickity.remove($target.parents("[data-recently-viewed-card]")),_this2.flickity.selectCell(index)},500)}),this.$el.on("click","[data-clear-recently-viewed]",function(){_this2.clearRecentlyViewed()})}},{key:"timeSince",value:function(timestamp){var now=Math.round(new Date().getTime()/1e3),secondsPast=now-timestamp;if(secondsPast<60){var secondsAgo=parseInt(secondsPast,10);return secondsAgo===1?"".concat(secondsAgo," ").concat(this.time.second," ").concat(this.time.ago):"".concat(secondsAgo," ").concat(this.time.seconds," ").concat(this.time.ago)}if(secondsPast<3600){var minutesAgo=parseInt(secondsPast/60,10);return minutesAgo===1?"".concat(minutesAgo," ").concat(this.time.minute," ").concat(this.time.ago):"".concat(minutesAgo," ").concat(this.time.minutes," ").concat(this.time.ago)}if(secondsPast<=86400){var hoursAgo=parseInt(secondsPast/3600,10);return hoursAgo===1?"".concat(hoursAgo," ").concat(this.time.hour," ").concat(this.time.ago):"".concat(hoursAgo," ").concat(this.time.hours," ").concat(this.time.ago)}var date=new Date(timestamp*1e3),currentDate=new Date(now*1e3),day=date.getDate(),month=date.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ",""),year=date.getFullYear()===currentDate.getFullYear()?"":", ".concat(date.getFullYear());return"".concat(month," ").concat(day," ").concat(year)}},{key:"removeRecentlyViewed",value:function(handle,recentlyViewed){for(var i=0;i<recentlyViewed.length;i++)recentlyViewed[i].handle===handle&&recentlyViewed.splice(i,1);this._setRecentlyViewed(recentlyViewed);var cards=sessionStorage.getItem(this.storageKey)?JSON.parse(sessionStorage.getItem(this.storageKey)):{};delete cards[handle],sessionStorage.setItem(this.storageKey,JSON.stringify(cards)),recentlyViewed.length===0&&this.$el.find(".product-recently-viewed--section").addClass("hide"),this.$carousel&&this.$carousel[0].removeEventListener("rimg:load",this.slideImageLoaded)}},{key:"clearRecentlyViewed",value:function(){localStorage.removeItem(this.storageKey),sessionStorage.removeItem(this.storageKey),this.$el.find("[data-recently-viewed-card]").remove(),this.$el.find(".product-recently-viewed--section").addClass("hide")}},{key:"_onSlideImageLoaded",value:function(){this.flickity.resize()}},{key:"_initSlider",value:function(){this.flickityOptions={autoPlay:0,accessibility:!0,cellAlign:"left",cellSelector:this.slides,groupCells:!0,pageDots:!1,contain:!0,arrowShape:{x0:10,x1:60,y1:50,x2:65,y2:45,x3:20}},this.flickity=new flickity__WEBPACK_IMPORTED_MODULE_2___default.a(this.$carousel[0],this.flickityOptions),this.$carousel[0].addEventListener("rimg:load",this.slideImageLoaded)}},{key:"_setRecentlyViewed",value:function(productData){var _this3=this,now=Math.floor(Date.now()/1e3),minStorageTimestamp=now-this.maxStorageTime,filteredData=productData.filter(function(item){return item.timestamp>minStorageTimestamp});if(filteredData.length>this.maxRecentlyViewed){var removeCount=filteredData.length-this.maxRecentlyViewed;filteredData.splice(0,removeCount)}
1try{localStorage.setItem(this.storageKey,JSON.stringify(filteredData))}catch(error){console.warn(error)}try{var handles=filteredData?filteredData.map(function(x){return x.handle}):[],storedCards=sessionStorage.getItem(this.storageKey)?JSON.parse(sessionStorage.getItem(this.storageKey)):{};storedCards.cardSettings&&Object.keys(storedCards.cardSettings).forEach(function(key){storedCards.cardSettings[key]!==_this3.cardSettings[key]&&(storedCards={},sessionStorage.removeItem(_this3.storageKey))}),storedCards.cardSettings=this.cardSettings;var promises=handles.map(function(handle){if(storedCards[handle])return null;var fetchUrl="/products/".concat(handle,"?view=_recently-viewed");return jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(fetchUrl).catch(function(error){return console.error("Error:",error)}).then(function(response){if(response){storedCards[handle]=response;try{sessionStorage.setItem(_this3.storageKey,JSON.stringify(storedCards))}catch(error){console.warn(error)}}})});return promises}catch(error){return console.warn(error),!1}}},{key:"_getRecentlyViewed",value:function(){try{var recentlyViewed=localStorage.getItem(this.storageKey)?JSON.parse(localStorage.getItem(this.storageKey)):[];return recentlyViewed}catch(error){return console.warn(error),[]}}},{key:"_getRecentlyViewedCards",value:function(){for(var cards=sessionStorage.getItem(this.storageKey)?JSON.parse(sessionStorage.getItem(this.storageKey)):{},orderedItems=localStorage.getItem(this.storageKey)?JSON.parse(localStorage.getItem(this.storageKey)):{},markup=[],i=orderedItems.length-1;i>=0;i--){var cardKey=orderedItems[i].handle,domParser=new DOMParser,card=domParser.parseFromString(cards[cardKey],"text/html");card.querySelector(".productgrid--item")&&markup.push(cards[cardKey])}return markup.join("")}}]),StaticRecentlyViewed2})()})}]); 2//# sourceMappingURL=/cdn/shop/t/22/assets/StaticRecentlyViewed.bundle.js.map?v=156501774568275735351759165399
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.