commercelayer
Advanced tools
Comparing version 1.5.8 to 1.5.9
@@ -1,2 +0,2 @@ | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([function(e,t,n){"use strict";var r=n(10),s=n(23),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:s,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,s=arguments.length;r<s;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,function(t,s){e[s]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){e.exports={config:document.querySelector("#clayer-config"),main:document.querySelector("#clayer-main"),prices:Array.prototype.slice.call(document.querySelectorAll(".clayer-price"),0),variants:Array.prototype.slice.call(document.querySelectorAll(".clayer-variant"),0),variantSelect:document.querySelector(".clayer-variant-select"),availabilityMessageContainer:document.querySelector("#clayer-availability-message-container"),availabilityMessageAvailableTemplate:document.querySelector("#clayer-availability-message-available-template"),availabilityMessageUnavailableTemplate:document.querySelector("#clayer-availability-message-unavailable-template"),addToBag:document.querySelector(".clayer-add-to-bag"),shoppingBagContainer:document.querySelector("#clayer-shopping-bag-container"),shoppingBagItemsContainer:document.querySelector("#clayer-shopping-bag-items-container"),shoppingBagItemTemplate:document.querySelector("#clayer-shopping-bag-item-template"),shoppingBagItemsCount:document.querySelector("#clayer-shopping-bag-items-count"),shoppingBagSubtotal:document.querySelector("#clayer-shopping-bag-subtotal"),shoppingBagShipping:document.querySelector("#clayer-shopping-bag-shipping"),shoppingBagPayment:document.querySelector("#clayer-shopping-bag-payment"),shoppingBagDiscount:document.querySelector("#clayer-shopping-bag-discount"),shoppingBagTaxes:document.querySelector("#clayer-shopping-bag-taxes"),shoppingBagTotal:document.querySelector("#clayer-shopping-bag-total"),shoppingBagCheckout:document.querySelector("#clayer-shopping-bag-checkout"),shoppingBagClose:document.querySelector("#clayer-shopping-bag-close"),shoppingBagToggle:document.querySelector("#clayer-shopping-bag-toggle"),shoppingBagUnavailableMessage:document.querySelector(".clayer-shopping-bag-unavailable-message")}},function(e,t){e.exports={clayer:{default:!0,client_id:"351020e9c84f2076755083f08bfe8e47365a76395db1059c3219c37abff86534",market_id:"185",base_url:"https://static-commerce.commercelayer.io",base_path:null,country_code:"US",language_code:"en"},sdk:{debug:!0,trace:!1,raw_response:!1}}},function(e,t,n){const r=n(1);e.exports={baseUrl:function(){return r.config.dataset.baseUrl},clientId:function(){return r.config.dataset.clientId},marketId:function(){return r.config.dataset.marketId},countryCode:function(){return r.config.dataset.countryCode},languageCode:function(){return r.config.dataset.languageCode.split("-")[0]},cartUrl:function(){return r.config.dataset.cartUrl},returnUrl:function(){return r.config.dataset.returnUrl},privacyUrl:function(){return r.config.dataset.privacyUrl},termsUrl:function(){return r.config.dataset.termsUrl}}},function(e,t,n){const r=n(3),s=n(16);e.exports={getOrderCookieName:function(){return`order_token_${r.clientId()}_${r.marketId()}_${r.countryCode()}`},getAccessTokenCookieName:function(){return`access_token_${r.clientId()}_${r.marketId()}`},getAccessTokenRetryLockCookieName:function(){return`${this.getAccessTokenCookieName()}_retry_lock`},getOrderToken:function(){return s.get(this.getOrderCookieName())},setOrderToken:function(e){return s.set(this.getOrderCookieName(),e,{expires:30})},deleteOrderToken:function(){return s.remove(this.getOrderCookieName())},getAccessTokenCookie:function(){return s.get(this.getAccessTokenCookieName())},setAccessTokenCookie:function(e,t){s.set(this.getAccessTokenCookieName(),e,t)},getAccessTokenRetryLockCookie:function(){return s.get(this.getAccessTokenRetryLockCookieName())},setAccessTokenRetryLockCookie:function(){s.set(this.getAccessTokenRetryLockCookieName(),"1",{expires:1/1440})},getElementFromTemplate:function(e){return"TEMPLATE"==e.tagName?document.importNode(e.content.firstElementChild,!0):document.importNode(e.firstElementChild,!0)},getInventoryFirstAvailableLevel:function(e){if(first_level=e.levels[0],0==first_level.quantity)for(k=1;k<e.levels.length;k++)if(level=e.levels[k],level.quantity>0){first_level=level;break}return first_level}}},function(e,t,n){"use strict";(function(t){var r=n(0),s=n(26),i={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:("undefined"!=typeof XMLHttpRequest?a=n(11):void 0!==t&&(a=n(11)),a),transformRequest:[function(e,t){return s(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(i)}),e.exports=u}).call(this,n(25))},function(e,t,n){const r=n(2).sdk;e.exports={log:e=>{r.debug&&console.log(null==e?"":e)},extendMap:(e,t)=>(null!=t&&Object.keys(t).forEach(n=>{e[n]=t[n]}),e),mergeMaps:(e,t)=>({...e,...t}),cloneMap:e=>null==e?e:{...e}}},function(e,t,n){const r=n(1),s=n(3),o=n(4),a=n(8),u=n(9);e.exports={getPrices:function(){if($prices=r.prices,$prices.length>0){let e=[];$prices.forEach(function(t){e.push(t.dataset.skuCode)});let t=(new u.query.QueryFilter).filter("codes",e.join(",")).include("prices").page(null,25),n=["id","code","prices.formatted_amount","prices.formatted_compare_at_amount","prices.amount_cents","prices.compare_at_amount_cents"];u.listSkus(t.build()).then(e=>{a.updatePrices(e.get(n));let r=e.dataset.meta.page_count;if(r>1)for(p=2;p<=r;p++)t.pageNumber(p),u.listSkus(t).then(e=>a.updatePrices(e.get(n)))})}},getVariants:function(){if(a.disableElement(r.addToBag),$variants=r.variants,$variants.length>0){let t=[];$variants.forEach(function(e){a.disableElement(e),t.push(e.dataset.skuCode)});let n=(new u.query.QueryFilter).filter("codes",t.join(","));u.listSkus(n.build()).then(t=>{let n=t.get(["id","code"]);for(i=0;i<n.length;i++)variant=document.querySelector('.clayer-variant[data-sku-code="'+n[i].code+'"]'),variant&&(variant.value=n[i].id,a.enableElement(variant),0==i&&e.exports.selectVariant(variant))})}},getInventory:function(e,t){u.retrieveSku(e,{"fields[skus]":"inventory"}).then(n=>{let r=n.get("inventory");a.updateAvailabilityMessage(r),r.available?(a.updateAddToBagSKU(e,t),a.enableAddToBag()):a.disableAddToBag()})},selectVariant:function(t){switch(t.tagName){case"INPUT":switch(t.type){case"radio":t.click();break;case"hidden":e.exports.getInventory(t.value,t.dataset.skuName)}break;case"OPTION":$select=t.parentNode,$select.value=t.value,$select.dispatchEvent(new Event("change"))}},createOrder:function(){u.createOrder({type:"orders",shipping_country_code_lock:s.countryCode(),language_code:s.languageCode(),cart_url:s.cartUrl(),return_url:s.returnUrl(),privacy_url:s.privacyUrl(),terms_url:s.termsUrl()}).then(e=>(o.setOrderToken(e.get("token")),e))},refreshOrder:function(){o.getOrderToken()&&this.getOrder().then(function(e){e&&"placed"==e.get("status")&&(o.deleteOrderToken(),a.clearShoppingBag())})},createLineItem:function(e,t,n,r){return u.createLineItem({data:{type:"line_items",attributes:{quantity:1,name:n,image_url:r,_update_quantity:1},relationships:{order:{data:{type:"orders",id:e}},item:{data:{type:"skus",id:t}}}}})},deleteLineItem:function(e){return u.deleteLineItem(e).then(function(){return!0})},updateLineItem:function(e,t){return u.updateLineItem(e,{data:{type:"line_items",id:e,attributes:t}})},updateLineItemQty:function(e,t){api=this,api.updateLineItem(e,{quantity:t}).then(function(){api.getOrder()}).catch(function(e){if(e)switch(e.status){case 422:a.displayShoppingBagUnavailableMessage()}})},updateShoppingBagItems:function(e){if(api=this,$shoppingBagItemsContainer=r.shoppingBagItemsContainer,$shoppingBagItemsContainer&&(normalized_order=e.get(["id","formatted_subtotal_amount","formatted_discount_amount","formatted_shipping_amount","formatted_payment_method_amount","formatted_total_tax_amount","formatted_total_amount_with_taxes","line_items.id","line_items.item_type","line_items.image_url","line_items.name","line_items.quantity","line_items.formatted_unit_amount","line_items.formatted_total_amount"])[0],normalized_order.line_items))for($shoppingBagItemsContainer.innerHTML="",i=0;i<normalized_order.line_items.length;i++)if(line_item=normalized_order.line_items[i],"skus"==line_item.item_type&&($shoppingBagItemTemplate=r.shoppingBagItemTemplate,$shoppingBagItemTemplate)){for($shoppingBagItem=o.getElementFromTemplate($shoppingBagItemTemplate),$shoppingBagItemImage=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-image"),$shoppingBagItemImage.src=line_item.image_url,$shoppingBagItemName=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-name"),$shoppingBagItemName.innerHTML=line_item.name,$shoppingBagItemQtyContainer=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-qty-container"),$qtySelect=document.createElement("select"),$qtySelect.dataset.lineItemId=line_item.id,qty=1;qty<=10;qty++)$option=document.createElement("option"),$option.value=qty,$option.text=qty,qty==line_item.quantity&&($option.selected=!0),$qtySelect.appendChild($option);$qtySelect.addEventListener("change",function(e){api.updateLineItemQty(this.dataset.lineItemId,this.value)}),$shoppingBagItemQtyContainer.appendChild($qtySelect),$shoppingBagItemUnitAmount=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-unit-amount"),$shoppingBagItemUnitAmount.innerHTML=line_item.formatted_unit_amount,$shoppingBagItemTotalAmount=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-total-amount"),$shoppingBagItemTotalAmount.innerHTML=line_item.formatted_total_amount,$shoppingBagItemRemove=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-remove"),$shoppingBagItemRemove.dataset.lineItemId=line_item.id,$shoppingBagItemRemove.addEventListener("click",function(e){e.preventDefault(),api.deleteLineItem(this.dataset.lineItemId).then(function(e){api.getOrder()})}),$shoppingBagItemsContainer.appendChild($shoppingBagItem)}},getOrder:function(){api=this;let e=new u.query.QueryFilter;return e.include("line_items").filter("token",o.getOrderToken()),u.listOrders(e).then(function(e){if(e.get(["line_items"]).length>0)return api.updateShoppingBagItems(e),a.hideShoppingBagUnavailableMessage(),a.updateShoppingBagSummary(e.dataset.data[0]),a.updateShoppingBagCheckout(e),0==e.get("skus_count")&&a.clearShoppingBag(),e})}}},function(e,t,n){const r=n(1),s=n(4);n(17);e.exports={enableElement:function(e){e&&e.classList.remove("disabled")},disableElement:function(e){e&&e.classList.add("disabled")},setElementHTML(e,t,n){el=e.querySelector(t),el&&(el.innerHTML=n)},displayElement:function(e){e&&(e.style.display="block")},hideElement:function(e){e&&(e.style.display="none")},updatePrices:function(e){for(k=0;k<e.length;k++)priceAmount=document.querySelector('[data-sku-code="'+e[k].code+'"] > .amount'),priceAmount&&(priceAmount.innerHTML=e[k].prices[0].formatted_amount),priceCompareAmount=document.querySelector('[data-sku-code="'+e[k].code+'"] > .compare-at-amount'),priceCompareAmount&&e[k].prices[0].compare_at_amount_cents>e[k].prices[0].amount_cents&&(priceCompareAmount.innerHTML=e[k].prices[0].formatted_compare_at_amount)},updateAddToBagSKU:function(e,t){$addToBag=r.addToBag,$addToBag&&($addToBag.dataset.skuId=e,$addToBag.dataset.skuName=t)},enableAddToBag:function(){$addToBag=r.addToBag,$addToBag&&this.enableElement($addToBag)},disableAddToBag:function(){$addToBag=r.addToBag,$addToBag&&this.disableElement($addToBag)},updateAvailabilityMessage:function(e){$container=r.availabilityMessageContainer,$container&&(first_level=s.getInventoryFirstAvailableLevel(e),first_level.quantity>0?(dlt=first_level.delivery_lead_times[0],qty=first_level.quantity,minDays=dlt.min.days,maxDays=dlt.max.days,shippingMethodName=dlt.shipping_method.name,shippingMethodPrice=dlt.shipping_method.formatted_price_amount,this.displayAvailableMessage(qty,minDays,maxDays,shippingMethodName,shippingMethodPrice)):this.displayUnavailableMessage())},updateShoppingBagSummary:function(e){$shoppingBagItemsCount=r.shoppingBagItemsCount,$shoppingBagItemsCount&&($shoppingBagItemsCount.innerHTML=e.attributes.skus_count),$shoppingBagTotal=r.shoppingBagTotal,$shoppingBagTotal&&($shoppingBagTotal.innerHTML=e.attributes.formatted_total_amount_with_taxes),$shoppingBagSubtotal=r.shoppingBagSubtotal,$shoppingBagSubtotal&&($shoppingBagSubtotal.innerHTML=e.attributes.formatted_subtotal_amount),$shoppingBagShipping=r.shoppingBagShipping,$shoppingBagShipping&&($shoppingBagShipping.innerHTML=e.attributes.formatted_shipping_amount),$shoppingBagPayment=r.shoppingBagPayment,$shoppingBagPayment&&($shoppingBagPayment.innerHTML=e.attributes.formatted_payment_method_amount),$shoppingBagTaxes=r.shoppingBagTaxes,$shoppingBagTaxes&&($shoppingBagTaxes.innerHTML=e.attributes.formatted_total_tax_amount),$shoppingBagDiscount=r.shoppingBagDiscount,$shoppingBagDiscount&&($shoppingBagDiscount.innerHTML=e.attributes.formatted_discount_amount)},updateShoppingBagCheckout:function(e){$shoppingBagCheckout=r.shoppingBagCheckout,$shoppingBagCheckout&&(normalized_order=e.get(["line_items.id","checkout_url"])[0],normalized_order.line_items?(this.enableElement($shoppingBagCheckout),$shoppingBagCheckout.href=normalized_order.checkout_url):($shoppingBagCheckout.href="",this.disableElement($shoppingBagCheckout)))},displayAvailableMessage:function(e,t,n,i,o){$container=r.availabilityMessageContainer,$container&&($tmp=r.availabilityMessageAvailableTemplate,$tmp&&($el=s.getElementFromTemplate($tmp),this.setElementHTML($el,".clayer-availability-message-available-qty",e),this.setElementHTML($el,".clayer-availability-message-available-min-days",t),this.setElementHTML($el,".clayer-availability-message-available-max-days",n),this.setElementHTML($el,".clayer-availability-message-available-shipping-method-name",i),this.setElementHTML($el,".clayer-availability-message-available-shipping-method-price",o),$container.innerHTML="",$container.appendChild($el)))},displayUnavailableMessage:function(){$container=r.availabilityMessageContainer,$container&&($tmp=r.availabilityMessageUnavailableTemplate,$tmp&&($el=s.getElementFromTemplate($tmp),$container.innerHTML="",$container.appendChild($el)))},toggleShoppingBag:function(){$shoppingBagContainer=r.shoppingBagContainer,$shoppingBagContainer&&$shoppingBagContainer.classList.toggle("open"),$main=r.main,$main&&$main.classList.toggle("open")},openShoppingBag:function(){$shoppingBagContainer=r.shoppingBagContainer,$shoppingBagContainer&&$shoppingBagContainer.classList.add("open"),$main=r.main,$main&&$main.classList.remove("open")},clearShoppingBag:function(){r.shoppingBagItemsContainer&&(r.shoppingBagItemsContainer.innerHTML="")},displayShoppingBagUnavailableMessage:function(){this.displayElement(r.shoppingBagUnavailableMessage)},hideShoppingBagUnavailableMessage:function(){this.hideElement(r.shoppingBagUnavailableMessage)}}},function(e,t,n){e.exports=n(18),e.exports.model=n(43),e.exports.query=n(44)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0),s=n(27),i=n(29),o=n(30),a=n(31),u=n(12),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(32);e.exports=function(e){return new Promise(function(t,p){var l=e.data,d=e.headers;r.isFormData(l)&&delete d["Content-Type"];var h=new XMLHttpRequest,g="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||a(e.url)||(h=new window.XDomainRequest,g="onload",m=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var f=e.auth.username||"",_=e.auth.password||"";d.Authorization="Basic "+c(f+":"+_)}if(h.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[g]=function(){if(h&&(4===h.readyState||m)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?o(h.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:e,request:h};s(t,p,r),h=null}},h.onerror=function(){p(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){p(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var y=n(33),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&r.forEach(d,function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),p(e),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t,n,s,i){var o=new Error(e);return r(o,t,n,s,i)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){function r(){const r=n(7),s=n(45),i=n(3),o=n(9);t.init=function(){o.initialize({client_id:i.clientId(),market_id:i.marketId(),base_url:i.baseUrl(),country_code:i.countryCode(),language_code:i.languageCode()}),o.settings.debug=!0,o.settings.console=!0,o.settings.trace=!0,r.getPrices(),r.getVariants(),s.setVariantSelect(),s.setAddToShoppingBag(),s.setShoppingBagToggle(),r.refreshOrder()},window.commercelayer=e.exports,e.exports.init()}"loading"==document.readyState?document.addEventListener("readystatechange",function(e){"interactive"==document.readyState&&r()}):r()},function(e,t,n){var r,s; | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([function(e,t,n){"use strict";var r=n(10),s=n(23),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:s,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,s=arguments.length;r<s;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,function(t,s){e[s]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){e.exports={config:document.querySelector("#clayer-config"),main:document.querySelector("#clayer-main"),prices:Array.prototype.slice.call(document.querySelectorAll(".clayer-price"),0),variants:Array.prototype.slice.call(document.querySelectorAll(".clayer-variant"),0),variantSelect:document.querySelector(".clayer-variant-select"),availabilityMessageContainer:document.querySelector("#clayer-availability-message-container"),availabilityMessageAvailableTemplate:document.querySelector("#clayer-availability-message-available-template"),availabilityMessageUnavailableTemplate:document.querySelector("#clayer-availability-message-unavailable-template"),addToBag:document.querySelector(".clayer-add-to-bag"),shoppingBagContainer:document.querySelector("#clayer-shopping-bag-container"),shoppingBagItemsContainer:document.querySelector("#clayer-shopping-bag-items-container"),shoppingBagItemTemplate:document.querySelector("#clayer-shopping-bag-item-template"),shoppingBagItemsCount:document.querySelector("#clayer-shopping-bag-items-count"),shoppingBagSubtotal:document.querySelector("#clayer-shopping-bag-subtotal"),shoppingBagShipping:document.querySelector("#clayer-shopping-bag-shipping"),shoppingBagPayment:document.querySelector("#clayer-shopping-bag-payment"),shoppingBagDiscount:document.querySelector("#clayer-shopping-bag-discount"),shoppingBagTaxes:document.querySelector("#clayer-shopping-bag-taxes"),shoppingBagTotal:document.querySelector("#clayer-shopping-bag-total"),shoppingBagCheckout:document.querySelector("#clayer-shopping-bag-checkout"),shoppingBagClose:document.querySelector("#clayer-shopping-bag-close"),shoppingBagToggle:document.querySelector("#clayer-shopping-bag-toggle"),shoppingBagUnavailableMessage:document.querySelector(".clayer-shopping-bag-unavailable-message")}},function(e,t){e.exports={clayer:{default:!0,client_id:"351020e9c84f2076755083f08bfe8e47365a76395db1059c3219c37abff86534",market_id:"185",base_url:"https://static-commerce.commercelayer.io",base_path:null,country_code:"US",language_code:"en"},sdk:{debug:!0,trace:!1,raw_response:!1}}},function(e,t,n){const r=n(1);e.exports={baseUrl:function(){return r.config.dataset.baseUrl},clientId:function(){return r.config.dataset.clientId},marketId:function(){return r.config.dataset.marketId},countryCode:function(){return r.config.dataset.countryCode},languageCode:function(){return r.config.dataset.languageCode.split("-")[0]},cartUrl:function(){return r.config.dataset.cartUrl},returnUrl:function(){return r.config.dataset.returnUrl},privacyUrl:function(){return r.config.dataset.privacyUrl},termsUrl:function(){return r.config.dataset.termsUrl}}},function(e,t,n){const r=n(3),s=n(16);e.exports={getOrderCookieName:function(){return`order_token_${r.clientId()}_${r.marketId()}_${r.countryCode()}`},getAccessTokenCookieName:function(){return`access_token_${r.clientId()}_${r.marketId()}`},getAccessTokenRetryLockCookieName:function(){return`${this.getAccessTokenCookieName()}_retry_lock`},getOrderToken:function(){return s.get(this.getOrderCookieName())},setOrderToken:function(e){return s.set(this.getOrderCookieName(),e,{expires:30})},deleteOrderToken:function(){return s.remove(this.getOrderCookieName())},getAccessTokenCookie:function(){return s.get(this.getAccessTokenCookieName())},setAccessTokenCookie:function(e,t){s.set(this.getAccessTokenCookieName(),e,t)},getAccessTokenRetryLockCookie:function(){return s.get(this.getAccessTokenRetryLockCookieName())},setAccessTokenRetryLockCookie:function(){s.set(this.getAccessTokenRetryLockCookieName(),"1",{expires:1/1440})},getElementFromTemplate:function(e){return"TEMPLATE"==e.tagName?document.importNode(e.content.firstElementChild,!0):document.importNode(e.firstElementChild,!0)},getInventoryFirstAvailableLevel:function(e){if(first_level=e.levels[0],0==first_level.quantity)for(k=1;k<e.levels.length;k++)if(level=e.levels[k],level.quantity>0){first_level=level;break}return first_level}}},function(e,t,n){"use strict";(function(t){var r=n(0),s=n(26),i={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:("undefined"!=typeof XMLHttpRequest?a=n(11):void 0!==t&&(a=n(11)),a),transformRequest:[function(e,t){return s(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(i)}),e.exports=u}).call(this,n(25))},function(e,t,n){const r=n(2).sdk;e.exports={log:e=>{r.debug&&console.log(null==e?"":e)},extendMap:(e,t)=>(null!=t&&Object.keys(t).forEach(n=>{e[n]=t[n]}),e),mergeMaps:(e,t)=>({...e,...t}),cloneMap:e=>null==e?e:{...e}}},function(e,t,n){const r=n(1),s=n(3),o=n(4),a=n(8),u=n(9);e.exports={getPrices:function(){if($prices=Array.prototype.slice.call(document.querySelectorAll(".clayer-price"),0),$prices.length>0){let e=[];$prices.forEach(function(t){e.push(t.dataset.skuCode)});let t=(new u.query.QueryFilter).filter("codes",e.join(",")).include("prices").page(null,25),n=["id","code","prices.formatted_amount","prices.formatted_compare_at_amount","prices.amount_cents","prices.compare_at_amount_cents"];u.listSkus(t.build()).then(e=>{a.updatePrices(e.get(n));let r=e.dataset.meta.page_count;if(r>1)for(p=2;p<=r;p++)t.pageNumber(p),u.listSkus(t).then(e=>a.updatePrices(e.get(n)))})}},getVariants:function(){if(a.disableElement(r.addToBag),$variants=r.variants,$variants.length>0){let t=[];$variants.forEach(function(e){a.disableElement(e),t.push(e.dataset.skuCode)});let n=(new u.query.QueryFilter).filter("codes",t.join(","));u.listSkus(n.build()).then(t=>{let n=t.get(["id","code"]);for(i=0;i<n.length;i++)variant=document.querySelector('.clayer-variant[data-sku-code="'+n[i].code+'"]'),variant&&(variant.value=n[i].id,a.enableElement(variant),0==i&&e.exports.selectVariant(variant))})}},getInventory:function(e,t){u.retrieveSku(e,{"fields[skus]":"inventory"}).then(n=>{let r=n.get("inventory");a.updateAvailabilityMessage(r),r.available?(a.updateAddToBagSKU(e,t),a.enableAddToBag()):a.disableAddToBag()})},selectVariant:function(t){switch(t.tagName){case"INPUT":switch(t.type){case"radio":t.click();break;case"hidden":e.exports.getInventory(t.value,t.dataset.skuName)}break;case"OPTION":$select=t.parentNode,$select.value=t.value,$select.dispatchEvent(new Event("change"))}},createOrder:function(){u.createOrder({type:"orders",shipping_country_code_lock:s.countryCode(),language_code:s.languageCode(),cart_url:s.cartUrl(),return_url:s.returnUrl(),privacy_url:s.privacyUrl(),terms_url:s.termsUrl()}).then(e=>(o.setOrderToken(e.get("token")),e))},refreshOrder:function(){o.getOrderToken()&&this.getOrder().then(function(e){e&&"placed"==e.get("status")&&(o.deleteOrderToken(),a.clearShoppingBag())})},createLineItem:function(e,t,n,r){return u.createLineItem({data:{type:"line_items",attributes:{quantity:1,name:n,image_url:r,_update_quantity:1},relationships:{order:{data:{type:"orders",id:e}},item:{data:{type:"skus",id:t}}}}})},deleteLineItem:function(e){return u.deleteLineItem(e).then(function(){return!0})},updateLineItem:function(e,t){return u.updateLineItem(e,{data:{type:"line_items",id:e,attributes:t}})},updateLineItemQty:function(e,t){api=this,api.updateLineItem(e,{quantity:t}).then(function(){api.getOrder()}).catch(function(e){if(e)switch(e.status){case 422:a.displayShoppingBagUnavailableMessage()}})},updateShoppingBagItems:function(e){if(api=this,$shoppingBagItemsContainer=r.shoppingBagItemsContainer,$shoppingBagItemsContainer&&(normalized_order=e.get(["id","formatted_subtotal_amount","formatted_discount_amount","formatted_shipping_amount","formatted_payment_method_amount","formatted_total_tax_amount","formatted_total_amount_with_taxes","line_items.id","line_items.item_type","line_items.image_url","line_items.name","line_items.quantity","line_items.formatted_unit_amount","line_items.formatted_total_amount"])[0],normalized_order.line_items))for($shoppingBagItemsContainer.innerHTML="",i=0;i<normalized_order.line_items.length;i++)if(line_item=normalized_order.line_items[i],"skus"==line_item.item_type&&($shoppingBagItemTemplate=r.shoppingBagItemTemplate,$shoppingBagItemTemplate)){for($shoppingBagItem=o.getElementFromTemplate($shoppingBagItemTemplate),$shoppingBagItemImage=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-image"),$shoppingBagItemImage.src=line_item.image_url,$shoppingBagItemName=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-name"),$shoppingBagItemName.innerHTML=line_item.name,$shoppingBagItemQtyContainer=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-qty-container"),$qtySelect=document.createElement("select"),$qtySelect.dataset.lineItemId=line_item.id,qty=1;qty<=10;qty++)$option=document.createElement("option"),$option.value=qty,$option.text=qty,qty==line_item.quantity&&($option.selected=!0),$qtySelect.appendChild($option);$qtySelect.addEventListener("change",function(e){api.updateLineItemQty(this.dataset.lineItemId,this.value)}),$shoppingBagItemQtyContainer.appendChild($qtySelect),$shoppingBagItemUnitAmount=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-unit-amount"),$shoppingBagItemUnitAmount.innerHTML=line_item.formatted_unit_amount,$shoppingBagItemTotalAmount=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-total-amount"),$shoppingBagItemTotalAmount.innerHTML=line_item.formatted_total_amount,$shoppingBagItemRemove=$shoppingBagItem.querySelector(".clayer-shopping-bag-item-remove"),$shoppingBagItemRemove.dataset.lineItemId=line_item.id,$shoppingBagItemRemove.addEventListener("click",function(e){e.preventDefault(),api.deleteLineItem(this.dataset.lineItemId).then(function(e){api.getOrder()})}),$shoppingBagItemsContainer.appendChild($shoppingBagItem)}},getOrder:function(){api=this;let e=new u.query.QueryFilter;return e.include("line_items").filter("token",o.getOrderToken()),u.listOrders(e).then(function(e){if(e.get(["line_items"]).length>0)return api.updateShoppingBagItems(e),a.hideShoppingBagUnavailableMessage(),a.updateShoppingBagSummary(e.dataset.data[0]),a.updateShoppingBagCheckout(e),0==e.get("skus_count")&&a.clearShoppingBag(),e})}}},function(e,t,n){const r=n(1),s=n(4);n(17);e.exports={enableElement:function(e){e&&e.classList.remove("disabled")},disableElement:function(e){e&&e.classList.add("disabled")},setElementHTML(e,t,n){el=e.querySelector(t),el&&(el.innerHTML=n)},displayElement:function(e){e&&(e.style.display="block")},hideElement:function(e){e&&(e.style.display="none")},updatePrices:function(e){for(k=0;k<e.length;k++)priceAmount=document.querySelector('[data-sku-code="'+e[k].code+'"] > .amount'),priceAmount&&(priceAmount.innerHTML=e[k].prices[0].formatted_amount),priceCompareAmount=document.querySelector('[data-sku-code="'+e[k].code+'"] > .compare-at-amount'),priceCompareAmount&&e[k].prices[0].compare_at_amount_cents>e[k].prices[0].amount_cents&&(priceCompareAmount.innerHTML=e[k].prices[0].formatted_compare_at_amount)},updateAddToBagSKU:function(e,t){$addToBag=r.addToBag,$addToBag&&($addToBag.dataset.skuId=e,$addToBag.dataset.skuName=t)},enableAddToBag:function(){$addToBag=r.addToBag,$addToBag&&this.enableElement($addToBag)},disableAddToBag:function(){$addToBag=r.addToBag,$addToBag&&this.disableElement($addToBag)},updateAvailabilityMessage:function(e){$container=r.availabilityMessageContainer,$container&&(first_level=s.getInventoryFirstAvailableLevel(e),first_level.quantity>0?(dlt=first_level.delivery_lead_times[0],qty=first_level.quantity,minDays=dlt.min.days,maxDays=dlt.max.days,shippingMethodName=dlt.shipping_method.name,shippingMethodPrice=dlt.shipping_method.formatted_price_amount,this.displayAvailableMessage(qty,minDays,maxDays,shippingMethodName,shippingMethodPrice)):this.displayUnavailableMessage())},updateShoppingBagSummary:function(e){$shoppingBagItemsCount=r.shoppingBagItemsCount,$shoppingBagItemsCount&&($shoppingBagItemsCount.innerHTML=e.attributes.skus_count),$shoppingBagTotal=r.shoppingBagTotal,$shoppingBagTotal&&($shoppingBagTotal.innerHTML=e.attributes.formatted_total_amount_with_taxes),$shoppingBagSubtotal=r.shoppingBagSubtotal,$shoppingBagSubtotal&&($shoppingBagSubtotal.innerHTML=e.attributes.formatted_subtotal_amount),$shoppingBagShipping=r.shoppingBagShipping,$shoppingBagShipping&&($shoppingBagShipping.innerHTML=e.attributes.formatted_shipping_amount),$shoppingBagPayment=r.shoppingBagPayment,$shoppingBagPayment&&($shoppingBagPayment.innerHTML=e.attributes.formatted_payment_method_amount),$shoppingBagTaxes=r.shoppingBagTaxes,$shoppingBagTaxes&&($shoppingBagTaxes.innerHTML=e.attributes.formatted_total_tax_amount),$shoppingBagDiscount=r.shoppingBagDiscount,$shoppingBagDiscount&&($shoppingBagDiscount.innerHTML=e.attributes.formatted_discount_amount)},updateShoppingBagCheckout:function(e){$shoppingBagCheckout=r.shoppingBagCheckout,$shoppingBagCheckout&&(normalized_order=e.get(["line_items.id","checkout_url"])[0],normalized_order.line_items?(this.enableElement($shoppingBagCheckout),$shoppingBagCheckout.href=normalized_order.checkout_url):($shoppingBagCheckout.href="",this.disableElement($shoppingBagCheckout)))},displayAvailableMessage:function(e,t,n,i,o){$container=r.availabilityMessageContainer,$container&&($tmp=r.availabilityMessageAvailableTemplate,$tmp&&($el=s.getElementFromTemplate($tmp),this.setElementHTML($el,".clayer-availability-message-available-qty",e),this.setElementHTML($el,".clayer-availability-message-available-min-days",t),this.setElementHTML($el,".clayer-availability-message-available-max-days",n),this.setElementHTML($el,".clayer-availability-message-available-shipping-method-name",i),this.setElementHTML($el,".clayer-availability-message-available-shipping-method-price",o),$container.innerHTML="",$container.appendChild($el)))},displayUnavailableMessage:function(){$container=r.availabilityMessageContainer,$container&&($tmp=r.availabilityMessageUnavailableTemplate,$tmp&&($el=s.getElementFromTemplate($tmp),$container.innerHTML="",$container.appendChild($el)))},toggleShoppingBag:function(){$shoppingBagContainer=r.shoppingBagContainer,$shoppingBagContainer&&$shoppingBagContainer.classList.toggle("open"),$main=r.main,$main&&$main.classList.toggle("open")},openShoppingBag:function(){$shoppingBagContainer=r.shoppingBagContainer,$shoppingBagContainer&&$shoppingBagContainer.classList.add("open"),$main=r.main,$main&&$main.classList.remove("open")},clearShoppingBag:function(){r.shoppingBagItemsContainer&&(r.shoppingBagItemsContainer.innerHTML="")},displayShoppingBagUnavailableMessage:function(){this.displayElement(r.shoppingBagUnavailableMessage)},hideShoppingBagUnavailableMessage:function(){this.hideElement(r.shoppingBagUnavailableMessage)}}},function(e,t,n){e.exports=n(18),e.exports.model=n(43),e.exports.query=n(44)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0),s=n(27),i=n(29),o=n(30),a=n(31),u=n(12),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(32);e.exports=function(e){return new Promise(function(t,p){var l=e.data,d=e.headers;r.isFormData(l)&&delete d["Content-Type"];var h=new XMLHttpRequest,g="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||a(e.url)||(h=new window.XDomainRequest,g="onload",m=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var f=e.auth.username||"",_=e.auth.password||"";d.Authorization="Basic "+c(f+":"+_)}if(h.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[g]=function(){if(h&&(4===h.readyState||m)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?o(h.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:e,request:h};s(t,p,r),h=null}},h.onerror=function(){p(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){p(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var y=n(33),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&r.forEach(d,function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)}),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){h&&(h.abort(),p(e),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t,n,s,i){var o=new Error(e);return r(o,t,n,s,i)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){function r(){const r=n(7),s=n(45),i=n(3),o=n(9);t.init=function(){o.initialize({client_id:i.clientId(),market_id:i.marketId(),base_url:i.baseUrl(),country_code:i.countryCode(),language_code:i.languageCode()}),o.settings.debug=!0,o.settings.console=!0,o.settings.trace=!0,r.getPrices(),r.getVariants(),s.setVariantSelect(),s.setAddToShoppingBag(),s.setShoppingBagToggle(),r.refreshOrder()},window.commercelayer=e.exports,e.exports.init()}"loading"==document.readyState?document.addEventListener("readystatechange",function(e){"interactive"==document.readyState&&r()}):r()},function(e,t,n){var r,s; | ||
/*! | ||
@@ -3,0 +3,0 @@ * JavaScript Cookie v2.2.0 |
{ | ||
"name": "commercelayer", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"description": "The Official Commerce Layer JS library", | ||
@@ -5,0 +5,0 @@ "main": "./src/main.js", |
@@ -12,3 +12,3 @@ const elements = require('./elements') | ||
$prices = elements.prices | ||
$prices = Array.prototype.slice.call(document.querySelectorAll('.clayer-price'), 0) | ||
@@ -54,3 +54,3 @@ if ($prices.length > 0) { | ||
); | ||
} | ||
@@ -78,3 +78,3 @@ }, | ||
.then(data => { | ||
let skus = data.get(['id', 'code' ]); | ||
@@ -93,3 +93,3 @@ | ||
} | ||
} | ||
@@ -327,3 +327,3 @@ ); | ||
.then(function(response) { | ||
if (response.get(['line_items']).length > 0) { | ||
@@ -330,0 +330,0 @@ api.updateShoppingBagItems(response) |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253320
2129