New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@magento/recommendations-js-sdk

Package Overview
Dependencies
Maintainers
9
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magento/recommendations-js-sdk - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

6

dist/index.js

@@ -1,3 +0,3 @@

/*! @magento/recommendations-js-sdk@v2.0.0 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},190:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i;r.r(e),r.d(e,{default:()=>yt});var a=new Uint8Array(16);function s(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(a)}const u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const c=function(t){return"string"==typeof t&&u.test(t)};for(var f=[],l=0;l<256;++l)f.push((l+256).toString(16).substr(1));const d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};const p=function(t,e,r){var n=(t=t||{}).random||(t.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return d(n)};
/*! @magento/recommendations-js-sdk@v2.0.1 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},190:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i;r.r(e),r.d(e,{default:()=>gt});var s=new Uint8Array(16);function a(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}const u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const c=function(t){return"string"==typeof t&&u.test(t)};for(var f=[],d=0;d<256;++d)f.push((d+256).toString(16).substr(1));const l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};const p=function(t,e,r){var n=(t=t||{}).random||(t.rng||a)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return l(n)};
/*!

@@ -7,2 +7,2 @@ * mustache.js - Logic-less {{mustache}} templates with JavaScript

*/
var h=Object.prototype.toString,v=Array.isArray||function(t){return"[object Array]"===h.call(t)};function y(t){return"function"==typeof t}function g(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w(t,e){return null!=t&&"object"==typeof t&&e in t}var m=RegExp.prototype.test;var b=/\S/;function S(t){return!function(t,e){return m.call(t,e)}(b,t)}var _={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var x=/\s*/,C=/\s+/,k=/\s*=/,E=/\s*\}/,P=/#|\^|\/|>|\{|&|=|!/;function O(t){this.string=t,this.tail=t,this.pos=0}function I(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function V(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}O.prototype.eos=function(){return""===this.tail},O.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},O.prototype.scanUntil=function(t){var e,r=this.tail.search(t);switch(r){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=e.length,e},I.prototype.push=function(t){return new I(t,this)},I.prototype.lookup=function(t){var e,r,n,o=this.cache;if(o.hasOwnProperty(t))e=o[t];else{for(var i,a,s,u=this,c=!1;u;){if(t.indexOf(".")>0)for(i=u.view,a=t.split("."),s=0;null!=i&&s<a.length;)s===a.length-1&&(c=w(i,a[s])||(r=i,n=a[s],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(n))),i=i[a[s++]];else i=u.view[t],c=w(u.view,t);if(c){e=i;break}u=u.parent}o[t]=e}return y(e)&&(e=e.call(this.view)),e},V.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},V.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||j.tags).join(":"),o=void 0!==r,i=o?r.get(n):void 0;return null==i&&(i=function(t,e){if(!t)return[];var r,n,o,i=!1,a=[],s=[],u=[],c=!1,f=!1,l="",d=0;function p(){if(c&&!f)for(;u.length;)delete s[u.pop()];else u=[];c=!1,f=!1}function h(t){if("string"==typeof t&&(t=t.split(C,2)),!v(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(g(t[0])+"\\s*"),n=new RegExp("\\s*"+g(t[1])),o=new RegExp("\\s*"+g("}"+t[1]))}h(e||j.tags);for(var y,w,m,b,_,I,V=new O(t);!V.eos();){if(y=V.pos,m=V.scanUntil(r))for(var T=0,L=m.length;T<L;++T)S(b=m.charAt(T))?(u.push(s.length),l+=b):(f=!0,i=!0,l+=" "),s.push(["text",b,y,y+1]),y+=1,"\n"===b&&(p(),l="",d=0,i=!1);if(!V.scan(r))break;if(c=!0,w=V.scan(P)||"name",V.scan(x),"="===w?(m=V.scanUntil(k),V.scan(k),V.scanUntil(n)):"{"===w?(m=V.scanUntil(o),V.scan(E),V.scanUntil(n),w="&"):m=V.scanUntil(n),!V.scan(n))throw new Error("Unclosed tag at "+V.pos);if(_=">"==w?[w,m,y,V.pos,l,d,i]:[w,m,y,V.pos],d++,s.push(_),"#"===w||"^"===w)a.push(_);else if("/"===w){if(!(I=a.pop()))throw new Error('Unopened section "'+m+'" at '+y);if(I[1]!==m)throw new Error('Unclosed section "'+I[1]+'" at '+y)}else"name"===w||"{"===w||"&"===w?f=!0:"="===w&&h(m)}if(p(),I=a.pop())throw new Error('Unclosed section "'+I[1]+'" at '+V.pos);return function(t){for(var e,r=[],n=r,o=[],i=0,a=t.length;i<a;++i)switch((e=t[i])[0]){case"#":case"^":n.push(e),o.push(e),n=e[4]=[];break;case"/":o.pop()[5]=e[2],n=o.length>0?o[o.length-1][4]:r;break;default:n.push(e)}return r}(function(t){for(var e,r,n=[],o=0,i=t.length;o<i;++o)(e=t[o])&&("text"===e[0]&&r&&"text"===r[0]?(r[1]+=e[1],r[3]=e[3]):(n.push(e),r=e));return n}(s))}(t,e),o&&r.set(n,i)),i},V.prototype.render=function(t,e,r,n){var o=this.getConfigTags(n),i=this.parse(t,o),a=e instanceof I?e:new I(e,void 0);return this.renderTokens(i,a,r,t,n)},V.prototype.renderTokens=function(t,e,r,n,o){for(var i,a,s,u="",c=0,f=t.length;c<f;++c)s=void 0,"#"===(a=(i=t[c])[0])?s=this.renderSection(i,e,r,n,o):"^"===a?s=this.renderInverted(i,e,r,n,o):">"===a?s=this.renderPartial(i,e,r,o):"&"===a?s=this.unescapedValue(i,e):"name"===a?s=this.escapedValue(i,e,o):"text"===a&&(s=this.rawValue(i)),void 0!==s&&(u+=s);return u},V.prototype.renderSection=function(t,e,r,n,o){var i=this,a="",s=e.lookup(t[1]);if(s){if(v(s))for(var u=0,c=s.length;u<c;++u)a+=this.renderTokens(t[4],e.push(s[u]),r,n,o);else if("object"==typeof s||"string"==typeof s||"number"==typeof s)a+=this.renderTokens(t[4],e.push(s),r,n,o);else if(y(s)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(s=s.call(e.view,n.slice(t[3],t[5]),(function(t){return i.render(t,e,r,o)})))&&(a+=s)}else a+=this.renderTokens(t[4],e,r,n,o);return a}},V.prototype.renderInverted=function(t,e,r,n,o){var i=e.lookup(t[1]);if(!i||v(i)&&0===i.length)return this.renderTokens(t[4],e,r,n,o)},V.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),o=t.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!r)&&(o[i]=n+o[i]);return o.join("\n")},V.prototype.renderPartial=function(t,e,r,n){if(r){var o=this.getConfigTags(n),i=y(r)?r(t[1]):r[t[1]];if(null!=i){var a=t[6],s=t[5],u=t[4],c=i;0==s&&u&&(c=this.indentPartial(i,u,a));var f=this.parse(c,o);return this.renderTokens(f,e,r,c,n)}}},V.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(null!=r)return r},V.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||j.escape,o=e.lookup(t[1]);if(null!=o)return"number"==typeof o&&n===j.escape?String(o):n(o)},V.prototype.rawValue=function(t){return t[1]},V.prototype.getConfigTags=function(t){return v(t)?t:t&&"object"==typeof t?t.tags:void 0},V.prototype.getConfigEscape=function(t){return t&&"object"==typeof t&&!v(t)?t.escape:void 0};var j={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){T.templateCache=t},get templateCache(){return T.templateCache}},T=new V;j.clearCache=function(){return T.clearCache()},j.parse=function(t,e){return T.parse(t,e)},j.render=function(t,e,r,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+((v(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return T.render(t,e,r,n)},j.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return _[t]}))},j.Scanner=O,j.Context=I,j.Writer=V;const L=j;const R={"most-viewed":[{signal:"most_viewed",boost:100}],"most-purchased":[{signal:"most_purchased",boost:100}],"most-added-to-cart":[{signal:"most_added_to_cart",boost:100}],trending:[{signal:"trending",boost:100}],"just-for-you":[{signal:"viewed_viewed",key:["user_view_history"],boost:100},{signal:"more_like_this",key:["user_view_history"],boost:100}],"viewed-viewed":[{signal:"viewed_viewed",key:["current_pdp"],boost:100}],"viewed-bought":[{signal:"viewed_bought",key:["current_pdp"],boost:100}],"bought-bought":[{signal:"bought_bought",key:["current_pdp"],boost:100}],"more-like-this":[{signal:"more_like_this",key:["current_pdp"],boost:100}]};var H=function(t,e){var r=t.split(":");return r[0]=r[0].replace("categories","product.".concat(e,".categories")).replace("prices","product.".concat(e,".prices")),r.join(":")};const N='\n <div class="product-recommendations-unit">\n <h2 class="product-recommendations-label">Recommended Products</h2>\n\n <div class="product-recommendations">\n {{#results}}\n <div class="product-recommendation">\n <a\n class="product-recommendation-image"\n href="{{{shortest_canonical_url}}}"\n >\n <img src="{{{main_image_url}}}" alt="{{name}}">\n </a>\n\n <a\n class="product-recommendation-name"\n href="{{{shortest_canonical_url}}}"\n >\n {{name}}\n </a>\n\n <p class="product-recommendation-price">\n ${{regular_price}}\n </p>\n </div>\n {{/results}}\n </div>\n </div>\n';function U(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function A(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){U(i,n,o,a,s,"next",t)}function s(t){U(i,n,o,a,s,"throw",t)}a(void 0)}))}}var F=r(757),G=r.n(F),J=r(204),M=r.n(J),B="".concat("https://commerce.adobe.io/recs/v1/precs","/ping"),q="".concat("https://commerce.adobe.io/recs/v1/precs","/recommendations"),$="".concat("https://commerce.adobe.io/recs/v1/precs","/preconfigured"),D="recs_open",X=function(){var t=A(G().mark((function t(){var e,r,n;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M()(B);case 2:return e=t.sent,t.next=5,e.text();case 5:return r=t.sent,n={status:e.status,data:r},t.abrupt("return",n);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=A(G().mark((function t(){var e,r,n,o,i,a,s,u,c,f,l,d,p,h,v,y,g,w,m,b,S,_,x,C,k,E,P,O,I,V,j,T=arguments;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=T.length>0&&void 0!==T[0]?T[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,a=e.storeCode,s=void 0===a?"":a,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,l=void 0===f?"":f,d=e.pageType,p=void 0===d?"":d,h=e.category,v=void 0===h?"":h,y=e.units,g=void 0===y?[]:y,w=e.currentSku,m=void 0===w?"":w,b=e.cartSkus,S=void 0===b?[]:b,_=e.userViewHistorySkus,x=void 0===_?[]:_,C=e.userViewHistory,k=void 0===C?[]:C,E=e.userPurchaseHistory,P={environmentId:n,alternateEnvironmentId:i,storeCode:s,storeViewCode:c,websiteCode:l,pageType:p,category:v,units:g,currentSku:m,cartSkus:S,userViewHistorySkus:x,userViewHistory:k,userPurchaseHistory:void 0===E?[]:E},O={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(P)},t.next=5,M()(q,O);case 5:return I=t.sent,t.next=8,I.json();case 8:return V=t.sent,j={status:I.status,data:V},t.abrupt("return",j);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=A(G().mark((function t(){var e,r,n,o,i,a,s,u,c,f,l,d,p,h,v,y,g,w,m,b,S,_,x,C,k,E,P,O,I,V,j,T,L,R,H=arguments;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=H.length>0&&void 0!==H[0]?H[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,a=e.storeCode,s=void 0===a?"":a,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,l=void 0===f?"":f,d=e.pageType,p=void 0===d?"":d,h=e.category,v=void 0===h?"":h,y=e.currentSku,g=void 0===y?"":y,w=e.unitId,m=void 0===w?"":w,b=e.defaultStoreViewCode,S=void 0===b?"":b,_=e.cartSkus,x=void 0===_?[]:_,C=e.userViewHistorySkus,k=void 0===C?[]:C,E=e.userViewHistory,P=void 0===E?[]:E,O=e.userPurchaseHistory,I={environmentId:n,alternateEnvironmentId:i,storeCode:s,storeViewCode:c,websiteCode:l,pageType:p,category:v,currentSku:g,cartSkus:x,userViewHistorySkus:k,userViewHistory:P,userPurchaseHistory:void 0===O?[]:O,defaultStoreViewCode:S},V={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(I)},j=m?"".concat($,"/units/").concat(m):$,t.next=6,M()(j,V);case 6:return T=t.sent,t.next=9,T.json();case 9:return L=t.sent,R={status:T.status,data:L},t.abrupt("return",R);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getStorefrontInstance()?window.magentoStorefrontEvents.context.getStorefrontInstance()[t]:""},Q=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getCategory()?window.magentoStorefrontEvents.context.getCategory()[t]:""},z=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getPage()?window.magentoStorefrontEvents.context.getPage()[t]:""},Z=function(){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getProduct()?window.magentoStorefrontEvents.context.getProduct().sku:""},tt=function(){if(!window||!window.localStorage||!window.localStorage.getItem)return[];var t=JSON.parse(window.localStorage.getItem("ds-cart"));return t&&t.cart&&t.cart.items&&t.cart.items.length?t.cart.items.map((function(t){return t.product_sku})):[]},et=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history"));return t&&t.skus?t.skus:[]},rt=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history-time-decay"));return t||[]},nt=function(){var t=JSON.parse(window.localStorage.getItem("ds-purchase-history"));return t||[]},ot=function(){return window&&window.magentoStorefrontEvents?window.magentoStorefrontEvents.context.getContext("recsContext").alternateEnvironmentId:""};const it="2.0.0";function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){return(st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ut(t,e){return!e||"object"!==st(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ct(t){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function lt(t,e,r){return(lt=ft()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&at(o,r.prototype),o}).apply(null,arguments)}function dt(t){var e="function"==typeof Map?new Map:void 0;return(dt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return lt(t,arguments,ct(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),at(n,t)})(t)}function pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ct(t);if(e){var o=ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ut(this,r)}}const ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=pt(r);function r(t){var o;n(this,r);var i="Could not retrieve recommendations. Message: "+t;return(o=e.call(this,i)).name="ProductRecommendationsError",o}return r}(dt(Error));const vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.environmentId,o=void 0===r?Y("environmentId"):r,i=e.alternateEnvironmentId,a=void 0===i?ot():i,s=e.storeCode,u=void 0===s?Y("storeCode"):s,c=e.storeViewCode,f=void 0===c?Y("storeViewCode"):c,l=e.defaultStoreViewCode,d=void 0===l?"":l,p=e.websiteCode,h=void 0===p?Y("websiteCode"):p,v=e.pageType,y=void 0===v?z("pageType"):v,g=e.category,w=void 0===g?Q("urlPath"):g;n(this,t),this._environmentId=o,this._alternateEnvironmentId=a,this._storeCode=u,this._storeViewCode=f,this._defaultStoreViewCode=d,this._websiteCode=h,this._pageType=y,this._category=w,this.units=[]}var e,r,i;return e=t,(r=[{key:"version",value:function(){return it}},{key:"ping",value:function(){return X()}},{key:"register",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,r=void 0===e?"":e,n=t.filter,o=void 0===n?null:n,i=t.type,a=void 0===i?"":i,s=t.search,u=void 0===s?[]:s,c=p();u=a?R[a]:u;var f={id:c,name:r,filter:o=o?H(o,this._storeViewCode):o,search:u};return this.units.push(f),f}},{key:"unregister",value:function(t){var e=this.units.find((function(e){return e.id===t})),r=this.units.indexOf(e);return this.units.splice(r,1),e}},{key:"fetch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ids,r=void 0===e?[]:e,n=t.limit,o=void 0===n?5:n,i=t.offset,a=void 0===i?0:i,s=t.currentSku,u=void 0===s?Z():s,c=t.cartSkus,f=void 0===c?tt():c,l=t.userViewHistorySkus,d=void 0===l?et():l,p=t.userViewHistory,h=void 0===p?rt():p,v=t.userPurchaseHistory,y=void 0===v?nt():v,g=r.length?this.units.filter((function(t){return r.includes(t.id)})):this.units,w=g.map((function(t){return{limit:o,offset:a,unitId:t.id,unitName:t.name,filterQueryString:t.filter,rankerBlended:t.search}})),m={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,units:w,currentSku:u,cartSkus:f,userViewHistorySkus:d,userViewHistory:h,userPurchaseHistory:y};if(!this._environmentId)throw new ht("Environment ID is required");return K(m)}},{key:"fetchPreconfigured",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentSku,r=void 0===e?Z():e,n=t.cartSkus,o=void 0===n?tt():n,i=t.userViewHistorySkus,a=void 0===i?et():i,s=t.userViewHistory,u=void 0===s?rt():s,c=t.userPurchaseHistory,f=void 0===c?nt():c,l=t.unitId,d=void 0===l?"":l,p={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,currentSku:r,cartSkus:o,userViewHistorySkus:a,userViewHistory:u,userPurchaseHistory:f,unitId:d,defaultStoreViewCode:this._defaultStoreViewCode};if(!this._environmentId)throw new ht("Environment ID is required");return W(p)}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.template,r=void 0===e?"":e,n=t.unit,o=void 0===n?{}:n;r=r||N;var i=L.render(r,o);return i}}])&&o(e.prototype,r),i&&o(e,i),t}();"undefined"!=typeof window&&(window.RecommendationsClient=vt);const yt=vt},204:(t,e,r)=>{t.exports=self.fetch||(self.fetch=r(869).default||r(869))},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return V()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=k(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?h:d,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",d="suspendedYield",p="executing",h="completed",v={};function y(){}function g(){}function w(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(I([])));S&&S!==r&&n.call(S,i)&&(m=S);var _=w.prototype=y.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:V}}function V(){return{value:e,done:!0}}return g.prototype=_.constructor=w,w.constructor=g,g.displayName=u(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},x(C.prototype),C.prototype[a]=function(){return this},t.AsyncIterator=C,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new C(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),u(_,s,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},869:(t,e,r)=>{"use strict";function n(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],a=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var c in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),a.push([e,r]),s[e]=s[e]?s[e]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(c,e.headers[c]);o.send(e.body||null)}))}r.r(e),r.d(e,{default:()=>n})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(190)})()}));
var h=Object.prototype.toString,v=Array.isArray||function(t){return"[object Array]"===h.call(t)};function y(t){return"function"==typeof t}function g(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w(t,e){return null!=t&&"object"==typeof t&&e in t}var m=RegExp.prototype.test;var b=/\S/;function S(t){return!function(t,e){return m.call(t,e)}(b,t)}var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var _=/\s*/,x=/\s+/,k=/\s*=/,E=/\s*\}/,P=/#|\^|\/|>|\{|&|=|!/;function O(t){this.string=t,this.tail=t,this.pos=0}function I(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function V(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}O.prototype.eos=function(){return""===this.tail},O.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},O.prototype.scanUntil=function(t){var e,r=this.tail.search(t);switch(r){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=e.length,e},I.prototype.push=function(t){return new I(t,this)},I.prototype.lookup=function(t){var e,r,n,o=this.cache;if(o.hasOwnProperty(t))e=o[t];else{for(var i,s,a,u=this,c=!1;u;){if(t.indexOf(".")>0)for(i=u.view,s=t.split("."),a=0;null!=i&&a<s.length;)a===s.length-1&&(c=w(i,s[a])||(r=i,n=s[a],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(n))),i=i[s[a++]];else i=u.view[t],c=w(u.view,t);if(c){e=i;break}u=u.parent}o[t]=e}return y(e)&&(e=e.call(this.view)),e},V.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},V.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||j.tags).join(":"),o=void 0!==r,i=o?r.get(n):void 0;return null==i&&(i=function(t,e){if(!t)return[];var r,n,o,i=!1,s=[],a=[],u=[],c=!1,f=!1,d="",l=0;function p(){if(c&&!f)for(;u.length;)delete a[u.pop()];else u=[];c=!1,f=!1}function h(t){if("string"==typeof t&&(t=t.split(x,2)),!v(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(g(t[0])+"\\s*"),n=new RegExp("\\s*"+g(t[1])),o=new RegExp("\\s*"+g("}"+t[1]))}h(e||j.tags);for(var y,w,m,b,C,I,V=new O(t);!V.eos();){if(y=V.pos,m=V.scanUntil(r))for(var T=0,L=m.length;T<L;++T)S(b=m.charAt(T))?(u.push(a.length),d+=b):(f=!0,i=!0,d+=" "),a.push(["text",b,y,y+1]),y+=1,"\n"===b&&(p(),d="",l=0,i=!1);if(!V.scan(r))break;if(c=!0,w=V.scan(P)||"name",V.scan(_),"="===w?(m=V.scanUntil(k),V.scan(k),V.scanUntil(n)):"{"===w?(m=V.scanUntil(o),V.scan(E),V.scanUntil(n),w="&"):m=V.scanUntil(n),!V.scan(n))throw new Error("Unclosed tag at "+V.pos);if(C=">"==w?[w,m,y,V.pos,d,l,i]:[w,m,y,V.pos],l++,a.push(C),"#"===w||"^"===w)s.push(C);else if("/"===w){if(!(I=s.pop()))throw new Error('Unopened section "'+m+'" at '+y);if(I[1]!==m)throw new Error('Unclosed section "'+I[1]+'" at '+y)}else"name"===w||"{"===w||"&"===w?f=!0:"="===w&&h(m)}if(p(),I=s.pop())throw new Error('Unclosed section "'+I[1]+'" at '+V.pos);return function(t){for(var e,r=[],n=r,o=[],i=0,s=t.length;i<s;++i)switch((e=t[i])[0]){case"#":case"^":n.push(e),o.push(e),n=e[4]=[];break;case"/":o.pop()[5]=e[2],n=o.length>0?o[o.length-1][4]:r;break;default:n.push(e)}return r}(function(t){for(var e,r,n=[],o=0,i=t.length;o<i;++o)(e=t[o])&&("text"===e[0]&&r&&"text"===r[0]?(r[1]+=e[1],r[3]=e[3]):(n.push(e),r=e));return n}(a))}(t,e),o&&r.set(n,i)),i},V.prototype.render=function(t,e,r,n){var o=this.getConfigTags(n),i=this.parse(t,o),s=e instanceof I?e:new I(e,void 0);return this.renderTokens(i,s,r,t,n)},V.prototype.renderTokens=function(t,e,r,n,o){for(var i,s,a,u="",c=0,f=t.length;c<f;++c)a=void 0,"#"===(s=(i=t[c])[0])?a=this.renderSection(i,e,r,n,o):"^"===s?a=this.renderInverted(i,e,r,n,o):">"===s?a=this.renderPartial(i,e,r,o):"&"===s?a=this.unescapedValue(i,e):"name"===s?a=this.escapedValue(i,e,o):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(u+=a);return u},V.prototype.renderSection=function(t,e,r,n,o){var i=this,s="",a=e.lookup(t[1]);if(a){if(v(a))for(var u=0,c=a.length;u<c;++u)s+=this.renderTokens(t[4],e.push(a[u]),r,n,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)s+=this.renderTokens(t[4],e.push(a),r,n,o);else if(y(a)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(a=a.call(e.view,n.slice(t[3],t[5]),(function(t){return i.render(t,e,r,o)})))&&(s+=a)}else s+=this.renderTokens(t[4],e,r,n,o);return s}},V.prototype.renderInverted=function(t,e,r,n,o){var i=e.lookup(t[1]);if(!i||v(i)&&0===i.length)return this.renderTokens(t[4],e,r,n,o)},V.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),o=t.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!r)&&(o[i]=n+o[i]);return o.join("\n")},V.prototype.renderPartial=function(t,e,r,n){if(r){var o=this.getConfigTags(n),i=y(r)?r(t[1]):r[t[1]];if(null!=i){var s=t[6],a=t[5],u=t[4],c=i;0==a&&u&&(c=this.indentPartial(i,u,s));var f=this.parse(c,o);return this.renderTokens(f,e,r,c,n)}}},V.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(null!=r)return r},V.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||j.escape,o=e.lookup(t[1]);if(null!=o)return"number"==typeof o&&n===j.escape?String(o):n(o)},V.prototype.rawValue=function(t){return t[1]},V.prototype.getConfigTags=function(t){return v(t)?t:t&&"object"==typeof t?t.tags:void 0},V.prototype.getConfigEscape=function(t){return t&&"object"==typeof t&&!v(t)?t.escape:void 0};var j={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){T.templateCache=t},get templateCache(){return T.templateCache}},T=new V;j.clearCache=function(){return T.clearCache()},j.parse=function(t,e){return T.parse(t,e)},j.render=function(t,e,r,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+((v(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return T.render(t,e,r,n)},j.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return C[t]}))},j.Scanner=O,j.Context=I,j.Writer=V;const L=j;const R={"most-viewed":[{signal:"most_viewed",boost:100}],"most-purchased":[{signal:"most_purchased",boost:100}],"most-added-to-cart":[{signal:"most_added_to_cart",boost:100}],trending:[{signal:"trending",boost:100}],"just-for-you":[{signal:"viewed_viewed",key:["user_view_history"],boost:100},{signal:"more_like_this",key:["user_view_history"],boost:100}],"viewed-viewed":[{signal:"viewed_viewed",key:["current_pdp"],boost:100}],"viewed-bought":[{signal:"viewed_bought",key:["current_pdp"],boost:100}],"bought-bought":[{signal:"bought_bought",key:["current_pdp"],boost:100}],"more-like-this":[{signal:"more_like_this",key:["current_pdp"],boost:100}]};var H=function(t,e){var r=t.split(":");return r[0]=r[0].replace("categories","product.".concat(e,".categories")).replace("prices","product.".concat(e,".prices")),r.join(":")};const G='\n <div class="product-recommendations-unit">\n <h2 class="product-recommendations-label">Recommended Products</h2>\n\n <div class="product-recommendations">\n {{#results}}\n <div class="product-recommendation">\n <a\n class="product-recommendation-image"\n href="{{{shortest_canonical_url}}}"\n >\n <img src="{{{main_image_url}}}" alt="{{name}}">\n </a>\n\n <a\n class="product-recommendation-name"\n href="{{{shortest_canonical_url}}}"\n >\n {{name}}\n </a>\n\n <p class="product-recommendation-price">\n ${{regular_price}}\n </p>\n </div>\n {{/results}}\n </div>\n </div>\n';function N(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function U(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){N(i,n,o,s,a,"next",t)}function a(t){N(i,n,o,s,a,"throw",t)}s(void 0)}))}}var A=r(757),F=r.n(A),J=r(204),M=r.n(J),B="".concat("https://commerce.adobe.io/recs/v1/precs","/ping"),q="".concat("https://commerce.adobe.io/recs/v1/precs","/recommendations"),$="".concat("https://commerce.adobe.io/recs/v1/precs","/preconfigured"),D="recs_open",X=function(){var t=U(F().mark((function t(){var e,r,n;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M()(B);case 2:return e=t.sent,t.next=5,e.text();case 5:return r=t.sent,n={status:e.status,data:r},t.abrupt("return",n);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=U(F().mark((function t(){var e,r,n,o,i,s,a,u,c,f,d,l,p,h,v,y,g,w,m,b,S,C,_,x,k,E,P,O,I,V,j,T,L,R=arguments;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=R.length>0&&void 0!==R[0]?R[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,s=e.storeCode,a=void 0===s?"":s,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,d=void 0===f?"":f,l=e.pageType,p=void 0===l?"":l,h=e.category,v=void 0===h?"":h,y=e.units,g=void 0===y?[]:y,w=e.currentSku,m=void 0===w?"":w,b=e.cartSkus,S=void 0===b?[]:b,C=e.userViewHistorySkus,_=void 0===C?[]:C,x=e.userViewHistory,k=void 0===x?[]:x,E=e.userPurchaseHistory,P=void 0===E?[]:E,O=e.customerGroupCode,I={environmentId:n,alternateEnvironmentId:i,storeCode:a,storeViewCode:c,websiteCode:d,pageType:p,category:v,units:g,currentSku:m,cartSkus:S,userViewHistorySkus:_,userViewHistory:k,userPurchaseHistory:P,customerGroupCode:void 0===O?"":O},V={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(I)},t.next=5,M()(q,V);case 5:return j=t.sent,t.next=8,j.json();case 8:return T=t.sent,L={status:j.status,data:T},t.abrupt("return",L);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=U(F().mark((function t(){var e,r,n,o,i,s,a,u,c,f,d,l,p,h,v,y,g,w,m,b,S,C,_,x,k,E,P,O,I,V,j,T,L,R,H,G,N=arguments;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=N.length>0&&void 0!==N[0]?N[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,s=e.storeCode,a=void 0===s?"":s,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,d=void 0===f?"":f,l=e.pageType,p=void 0===l?"":l,h=e.category,v=void 0===h?"":h,y=e.currentSku,g=void 0===y?"":y,w=e.unitId,m=void 0===w?"":w,b=e.defaultStoreViewCode,S=void 0===b?"":b,C=e.cartSkus,_=void 0===C?[]:C,x=e.userViewHistorySkus,k=void 0===x?[]:x,E=e.userViewHistory,P=void 0===E?[]:E,O=e.userPurchaseHistory,I=void 0===O?[]:O,V=e.customerGroupCode,j={environmentId:n,alternateEnvironmentId:i,storeCode:a,storeViewCode:c,websiteCode:d,pageType:p,category:v,currentSku:g,cartSkus:_,userViewHistorySkus:k,userViewHistory:P,userPurchaseHistory:I,defaultStoreViewCode:S,customerGroupCode:void 0===V?"":V},T={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(j)},L=m?"".concat($,"/units/").concat(m):$,t.next=6,M()(L,T);case 6:return R=t.sent,t.next=9,R.json();case 9:return H=t.sent,G={status:R.status,data:H},t.abrupt("return",G);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getStorefrontInstance()?window.magentoStorefrontEvents.context.getStorefrontInstance()[t]:""},Q=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getCategory()?window.magentoStorefrontEvents.context.getCategory()[t]:""},z=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getPage()?window.magentoStorefrontEvents.context.getPage()[t]:""},Z=function(){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getProduct()?window.magentoStorefrontEvents.context.getProduct().sku:""},tt=function(){if(!window||!window.localStorage||!window.localStorage.getItem)return[];var t=JSON.parse(window.localStorage.getItem("ds-cart"));return t&&t.cart&&t.cart.items&&t.cart.items.length?t.cart.items.map((function(t){return t.product_sku})):[]},et=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history"));return t&&t.skus?t.skus:[]},rt=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history-time-decay"));return t||[]},nt=function(){var t=JSON.parse(window.localStorage.getItem("ds-purchase-history"));return t||[]},ot=function(){if(!window||!window.magentoStorefrontEvents)return"";var t=window.magentoStorefrontEvents.context.getContext("recsContext");return t?t.alternateEnvironmentId:""},it=function(){if(!window||!window.magentoStorefrontEvents)return"";var t=window.magentoStorefrontEvents.context.getContext("customerGroup");return t?t.customerGroupCode:""};const st="2.0.1";function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ct(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ft(t){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function dt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function lt(t,e,r){return(lt=dt()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&at(o,r.prototype),o}).apply(null,arguments)}function pt(t){var e="function"==typeof Map?new Map:void 0;return(pt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return lt(t,arguments,ft(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),at(n,t)})(t)}function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ft(t);if(e){var o=ft(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ct(this,r)}}const vt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=ht(r);function r(t){var o;n(this,r);var i="Could not retrieve recommendations. Message: "+t;return(o=e.call(this,i)).name="ProductRecommendationsError",o}return r}(pt(Error));const yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.environmentId,o=void 0===r?Y("environmentId"):r,i=e.alternateEnvironmentId,s=void 0===i?ot():i,a=e.storeCode,u=void 0===a?Y("storeCode"):a,c=e.storeViewCode,f=void 0===c?Y("storeViewCode"):c,d=e.defaultStoreViewCode,l=void 0===d?"":d,p=e.websiteCode,h=void 0===p?Y("websiteCode"):p,v=e.pageType,y=void 0===v?z("pageType"):v,g=e.category,w=void 0===g?Q("urlPath"):g,m=e.customerGroupCode,b=void 0===m?it():m;n(this,t),this._environmentId=o,this._alternateEnvironmentId=s,this._storeCode=u,this._storeViewCode=f,this._defaultStoreViewCode=l,this._websiteCode=h,this._pageType=y,this._category=w,this._customerGroupCode=b,this.units=[]}var e,r,i;return e=t,(r=[{key:"version",value:function(){return st}},{key:"ping",value:function(){return X()}},{key:"register",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,r=void 0===e?"":e,n=t.filter,o=void 0===n?null:n,i=t.type,s=void 0===i?"":i,a=t.search,u=void 0===a?[]:a,c=p();u=s?R[s]:u;var f={id:c,name:r,filter:o=o?H(o,this._storeViewCode):o,search:u};return this.units.push(f),f}},{key:"unregister",value:function(t){var e=this.units.find((function(e){return e.id===t})),r=this.units.indexOf(e);return this.units.splice(r,1),e}},{key:"fetch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ids,r=void 0===e?[]:e,n=t.limit,o=void 0===n?5:n,i=t.offset,s=void 0===i?0:i,a=t.currentSku,u=void 0===a?Z():a,c=t.cartSkus,f=void 0===c?tt():c,d=t.userViewHistorySkus,l=void 0===d?et():d,p=t.userViewHistory,h=void 0===p?rt():p,v=t.userPurchaseHistory,y=void 0===v?nt():v,g=r.length?this.units.filter((function(t){return r.includes(t.id)})):this.units,w=g.map((function(t){return{limit:o,offset:s,unitId:t.id,unitName:t.name,filterQueryString:t.filter,rankerBlended:t.search}})),m={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,units:w,currentSku:u,cartSkus:f,userViewHistorySkus:l,userViewHistory:h,userPurchaseHistory:y,customerGroupCode:this._customerGroupCode};if(!this._environmentId)throw new vt("Environment ID is required");return K(m)}},{key:"fetchPreconfigured",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentSku,r=void 0===e?Z():e,n=t.cartSkus,o=void 0===n?tt():n,i=t.userViewHistorySkus,s=void 0===i?et():i,a=t.userViewHistory,u=void 0===a?rt():a,c=t.userPurchaseHistory,f=void 0===c?nt():c,d=t.unitId,l=void 0===d?"":d,p={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,currentSku:r,cartSkus:o,userViewHistorySkus:s,userViewHistory:u,userPurchaseHistory:f,unitId:l,defaultStoreViewCode:this._defaultStoreViewCode,customerGroupCode:this._customerGroupCode};if(!this._environmentId)throw new vt("Environment ID is required");return W(p)}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.template,r=void 0===e?"":e,n=t.unit,o=void 0===n?{}:n;r=r||G;var i=L.render(r,o);return i}}])&&o(e.prototype,r),i&&o(e,i),t}();"undefined"!=typeof window&&(window.RecommendationsClient=yt);const gt=yt},204:(t,e,r)=>{t.exports=self.fetch||(self.fetch=r(869).default||r(869))},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),s=new O(n||[]);return i._invoke=function(t,e,r){var n=d;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return V()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=k(s,r);if(a){if(a===v)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?h:l,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d="suspendedStart",l="suspendedYield",p="executing",h="completed",v={};function y(){}function g(){}function w(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(I([])));S&&S!==r&&n.call(S,i)&&(m=S);var C=w.prototype=y.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,s,a){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(d).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}return{next:V}}function V(){return{value:e,done:!0}}return g.prototype=C.constructor=w,w.constructor=g,g.displayName=u(w,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,a,"GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},_(x.prototype),x.prototype[s]=function(){return this},t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new x(c(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(C),u(C,a,"Generator"),C[i]=function(){return this},C.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},869:(t,e,r)=>{"use strict";function n(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var c in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(c,e.headers[c]);o.send(e.body||null)}))}r.r(e),r.d(e,{default:()=>n})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(190)})()}));

@@ -1,3 +0,3 @@

/*! @magento/recommendations-js-sdk@v2.0.0 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},190:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i;r.r(e),r.d(e,{default:()=>yt});var a=new Uint8Array(16);function s(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(a)}const u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const c=function(t){return"string"==typeof t&&u.test(t)};for(var f=[],l=0;l<256;++l)f.push((l+256).toString(16).substr(1));const d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};const p=function(t,e,r){var n=(t=t||{}).random||(t.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return d(n)};
/*! @magento/recommendations-js-sdk@v2.0.1 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},190:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i;r.r(e),r.d(e,{default:()=>gt});var s=new Uint8Array(16);function a(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}const u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const c=function(t){return"string"==typeof t&&u.test(t)};for(var f=[],d=0;d<256;++d)f.push((d+256).toString(16).substr(1));const l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};const p=function(t,e,r){var n=(t=t||{}).random||(t.rng||a)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return l(n)};
/*!

@@ -7,2 +7,2 @@ * mustache.js - Logic-less {{mustache}} templates with JavaScript

*/
var h=Object.prototype.toString,v=Array.isArray||function(t){return"[object Array]"===h.call(t)};function y(t){return"function"==typeof t}function g(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w(t,e){return null!=t&&"object"==typeof t&&e in t}var m=RegExp.prototype.test;var b=/\S/;function S(t){return!function(t,e){return m.call(t,e)}(b,t)}var _={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var x=/\s*/,C=/\s+/,k=/\s*=/,E=/\s*\}/,P=/#|\^|\/|>|\{|&|=|!/;function O(t){this.string=t,this.tail=t,this.pos=0}function I(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function V(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}O.prototype.eos=function(){return""===this.tail},O.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},O.prototype.scanUntil=function(t){var e,r=this.tail.search(t);switch(r){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=e.length,e},I.prototype.push=function(t){return new I(t,this)},I.prototype.lookup=function(t){var e,r,n,o=this.cache;if(o.hasOwnProperty(t))e=o[t];else{for(var i,a,s,u=this,c=!1;u;){if(t.indexOf(".")>0)for(i=u.view,a=t.split("."),s=0;null!=i&&s<a.length;)s===a.length-1&&(c=w(i,a[s])||(r=i,n=a[s],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(n))),i=i[a[s++]];else i=u.view[t],c=w(u.view,t);if(c){e=i;break}u=u.parent}o[t]=e}return y(e)&&(e=e.call(this.view)),e},V.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},V.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||j.tags).join(":"),o=void 0!==r,i=o?r.get(n):void 0;return null==i&&(i=function(t,e){if(!t)return[];var r,n,o,i=!1,a=[],s=[],u=[],c=!1,f=!1,l="",d=0;function p(){if(c&&!f)for(;u.length;)delete s[u.pop()];else u=[];c=!1,f=!1}function h(t){if("string"==typeof t&&(t=t.split(C,2)),!v(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(g(t[0])+"\\s*"),n=new RegExp("\\s*"+g(t[1])),o=new RegExp("\\s*"+g("}"+t[1]))}h(e||j.tags);for(var y,w,m,b,_,I,V=new O(t);!V.eos();){if(y=V.pos,m=V.scanUntil(r))for(var T=0,L=m.length;T<L;++T)S(b=m.charAt(T))?(u.push(s.length),l+=b):(f=!0,i=!0,l+=" "),s.push(["text",b,y,y+1]),y+=1,"\n"===b&&(p(),l="",d=0,i=!1);if(!V.scan(r))break;if(c=!0,w=V.scan(P)||"name",V.scan(x),"="===w?(m=V.scanUntil(k),V.scan(k),V.scanUntil(n)):"{"===w?(m=V.scanUntil(o),V.scan(E),V.scanUntil(n),w="&"):m=V.scanUntil(n),!V.scan(n))throw new Error("Unclosed tag at "+V.pos);if(_=">"==w?[w,m,y,V.pos,l,d,i]:[w,m,y,V.pos],d++,s.push(_),"#"===w||"^"===w)a.push(_);else if("/"===w){if(!(I=a.pop()))throw new Error('Unopened section "'+m+'" at '+y);if(I[1]!==m)throw new Error('Unclosed section "'+I[1]+'" at '+y)}else"name"===w||"{"===w||"&"===w?f=!0:"="===w&&h(m)}if(p(),I=a.pop())throw new Error('Unclosed section "'+I[1]+'" at '+V.pos);return function(t){for(var e,r=[],n=r,o=[],i=0,a=t.length;i<a;++i)switch((e=t[i])[0]){case"#":case"^":n.push(e),o.push(e),n=e[4]=[];break;case"/":o.pop()[5]=e[2],n=o.length>0?o[o.length-1][4]:r;break;default:n.push(e)}return r}(function(t){for(var e,r,n=[],o=0,i=t.length;o<i;++o)(e=t[o])&&("text"===e[0]&&r&&"text"===r[0]?(r[1]+=e[1],r[3]=e[3]):(n.push(e),r=e));return n}(s))}(t,e),o&&r.set(n,i)),i},V.prototype.render=function(t,e,r,n){var o=this.getConfigTags(n),i=this.parse(t,o),a=e instanceof I?e:new I(e,void 0);return this.renderTokens(i,a,r,t,n)},V.prototype.renderTokens=function(t,e,r,n,o){for(var i,a,s,u="",c=0,f=t.length;c<f;++c)s=void 0,"#"===(a=(i=t[c])[0])?s=this.renderSection(i,e,r,n,o):"^"===a?s=this.renderInverted(i,e,r,n,o):">"===a?s=this.renderPartial(i,e,r,o):"&"===a?s=this.unescapedValue(i,e):"name"===a?s=this.escapedValue(i,e,o):"text"===a&&(s=this.rawValue(i)),void 0!==s&&(u+=s);return u},V.prototype.renderSection=function(t,e,r,n,o){var i=this,a="",s=e.lookup(t[1]);if(s){if(v(s))for(var u=0,c=s.length;u<c;++u)a+=this.renderTokens(t[4],e.push(s[u]),r,n,o);else if("object"==typeof s||"string"==typeof s||"number"==typeof s)a+=this.renderTokens(t[4],e.push(s),r,n,o);else if(y(s)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(s=s.call(e.view,n.slice(t[3],t[5]),(function(t){return i.render(t,e,r,o)})))&&(a+=s)}else a+=this.renderTokens(t[4],e,r,n,o);return a}},V.prototype.renderInverted=function(t,e,r,n,o){var i=e.lookup(t[1]);if(!i||v(i)&&0===i.length)return this.renderTokens(t[4],e,r,n,o)},V.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),o=t.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!r)&&(o[i]=n+o[i]);return o.join("\n")},V.prototype.renderPartial=function(t,e,r,n){if(r){var o=this.getConfigTags(n),i=y(r)?r(t[1]):r[t[1]];if(null!=i){var a=t[6],s=t[5],u=t[4],c=i;0==s&&u&&(c=this.indentPartial(i,u,a));var f=this.parse(c,o);return this.renderTokens(f,e,r,c,n)}}},V.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(null!=r)return r},V.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||j.escape,o=e.lookup(t[1]);if(null!=o)return"number"==typeof o&&n===j.escape?String(o):n(o)},V.prototype.rawValue=function(t){return t[1]},V.prototype.getConfigTags=function(t){return v(t)?t:t&&"object"==typeof t?t.tags:void 0},V.prototype.getConfigEscape=function(t){return t&&"object"==typeof t&&!v(t)?t.escape:void 0};var j={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){T.templateCache=t},get templateCache(){return T.templateCache}},T=new V;j.clearCache=function(){return T.clearCache()},j.parse=function(t,e){return T.parse(t,e)},j.render=function(t,e,r,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+((v(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return T.render(t,e,r,n)},j.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return _[t]}))},j.Scanner=O,j.Context=I,j.Writer=V;const L=j;const R={"most-viewed":[{signal:"most_viewed",boost:100}],"most-purchased":[{signal:"most_purchased",boost:100}],"most-added-to-cart":[{signal:"most_added_to_cart",boost:100}],trending:[{signal:"trending",boost:100}],"just-for-you":[{signal:"viewed_viewed",key:["user_view_history"],boost:100},{signal:"more_like_this",key:["user_view_history"],boost:100}],"viewed-viewed":[{signal:"viewed_viewed",key:["current_pdp"],boost:100}],"viewed-bought":[{signal:"viewed_bought",key:["current_pdp"],boost:100}],"bought-bought":[{signal:"bought_bought",key:["current_pdp"],boost:100}],"more-like-this":[{signal:"more_like_this",key:["current_pdp"],boost:100}]};var H=function(t,e){var r=t.split(":");return r[0]=r[0].replace("categories","product.".concat(e,".categories")).replace("prices","product.".concat(e,".prices")),r.join(":")};const N='\n <div class="product-recommendations-unit">\n <h2 class="product-recommendations-label">Recommended Products</h2>\n\n <div class="product-recommendations">\n {{#results}}\n <div class="product-recommendation">\n <a\n class="product-recommendation-image"\n href="{{{shortest_canonical_url}}}"\n >\n <img src="{{{main_image_url}}}" alt="{{name}}">\n </a>\n\n <a\n class="product-recommendation-name"\n href="{{{shortest_canonical_url}}}"\n >\n {{name}}\n </a>\n\n <p class="product-recommendation-price">\n ${{regular_price}}\n </p>\n </div>\n {{/results}}\n </div>\n </div>\n';function U(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function A(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){U(i,n,o,a,s,"next",t)}function s(t){U(i,n,o,a,s,"throw",t)}a(void 0)}))}}var F=r(757),G=r.n(F),J=r(204),M=r.n(J),B="".concat("https://commerce.adobe.io/recs/v1/precs","/ping"),q="".concat("https://commerce.adobe.io/recs/v1/precs","/recommendations"),$="".concat("https://commerce.adobe.io/recs/v1/precs","/preconfigured"),D="recs_open",X=function(){var t=A(G().mark((function t(){var e,r,n;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M()(B);case 2:return e=t.sent,t.next=5,e.text();case 5:return r=t.sent,n={status:e.status,data:r},t.abrupt("return",n);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=A(G().mark((function t(){var e,r,n,o,i,a,s,u,c,f,l,d,p,h,v,y,g,w,m,b,S,_,x,C,k,E,P,O,I,V,j,T=arguments;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=T.length>0&&void 0!==T[0]?T[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,a=e.storeCode,s=void 0===a?"":a,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,l=void 0===f?"":f,d=e.pageType,p=void 0===d?"":d,h=e.category,v=void 0===h?"":h,y=e.units,g=void 0===y?[]:y,w=e.currentSku,m=void 0===w?"":w,b=e.cartSkus,S=void 0===b?[]:b,_=e.userViewHistorySkus,x=void 0===_?[]:_,C=e.userViewHistory,k=void 0===C?[]:C,E=e.userPurchaseHistory,P={environmentId:n,alternateEnvironmentId:i,storeCode:s,storeViewCode:c,websiteCode:l,pageType:p,category:v,units:g,currentSku:m,cartSkus:S,userViewHistorySkus:x,userViewHistory:k,userPurchaseHistory:void 0===E?[]:E},O={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(P)},t.next=5,M()(q,O);case 5:return I=t.sent,t.next=8,I.json();case 8:return V=t.sent,j={status:I.status,data:V},t.abrupt("return",j);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=A(G().mark((function t(){var e,r,n,o,i,a,s,u,c,f,l,d,p,h,v,y,g,w,m,b,S,_,x,C,k,E,P,O,I,V,j,T,L,R,H=arguments;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=H.length>0&&void 0!==H[0]?H[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,a=e.storeCode,s=void 0===a?"":a,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,l=void 0===f?"":f,d=e.pageType,p=void 0===d?"":d,h=e.category,v=void 0===h?"":h,y=e.currentSku,g=void 0===y?"":y,w=e.unitId,m=void 0===w?"":w,b=e.defaultStoreViewCode,S=void 0===b?"":b,_=e.cartSkus,x=void 0===_?[]:_,C=e.userViewHistorySkus,k=void 0===C?[]:C,E=e.userViewHistory,P=void 0===E?[]:E,O=e.userPurchaseHistory,I={environmentId:n,alternateEnvironmentId:i,storeCode:s,storeViewCode:c,websiteCode:l,pageType:p,category:v,currentSku:g,cartSkus:x,userViewHistorySkus:k,userViewHistory:P,userPurchaseHistory:void 0===O?[]:O,defaultStoreViewCode:S},V={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(I)},j=m?"".concat($,"/units/").concat(m):$,t.next=6,M()(j,V);case 6:return T=t.sent,t.next=9,T.json();case 9:return L=t.sent,R={status:T.status,data:L},t.abrupt("return",R);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getStorefrontInstance()?window.magentoStorefrontEvents.context.getStorefrontInstance()[t]:""},Q=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getCategory()?window.magentoStorefrontEvents.context.getCategory()[t]:""},z=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getPage()?window.magentoStorefrontEvents.context.getPage()[t]:""},Z=function(){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getProduct()?window.magentoStorefrontEvents.context.getProduct().sku:""},tt=function(){if(!window||!window.localStorage||!window.localStorage.getItem)return[];var t=JSON.parse(window.localStorage.getItem("ds-cart"));return t&&t.cart&&t.cart.items&&t.cart.items.length?t.cart.items.map((function(t){return t.product_sku})):[]},et=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history"));return t&&t.skus?t.skus:[]},rt=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history-time-decay"));return t||[]},nt=function(){var t=JSON.parse(window.localStorage.getItem("ds-purchase-history"));return t||[]},ot=function(){return window&&window.magentoStorefrontEvents?window.magentoStorefrontEvents.context.getContext("recsContext").alternateEnvironmentId:""};const it="2.0.0";function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){return(st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ut(t,e){return!e||"object"!==st(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ct(t){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function lt(t,e,r){return(lt=ft()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&at(o,r.prototype),o}).apply(null,arguments)}function dt(t){var e="function"==typeof Map?new Map:void 0;return(dt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return lt(t,arguments,ct(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),at(n,t)})(t)}function pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ct(t);if(e){var o=ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ut(this,r)}}const ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=pt(r);function r(t){var o;n(this,r);var i="Could not retrieve recommendations. Message: "+t;return(o=e.call(this,i)).name="ProductRecommendationsError",o}return r}(dt(Error));const vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.environmentId,o=void 0===r?Y("environmentId"):r,i=e.alternateEnvironmentId,a=void 0===i?ot():i,s=e.storeCode,u=void 0===s?Y("storeCode"):s,c=e.storeViewCode,f=void 0===c?Y("storeViewCode"):c,l=e.defaultStoreViewCode,d=void 0===l?"":l,p=e.websiteCode,h=void 0===p?Y("websiteCode"):p,v=e.pageType,y=void 0===v?z("pageType"):v,g=e.category,w=void 0===g?Q("urlPath"):g;n(this,t),this._environmentId=o,this._alternateEnvironmentId=a,this._storeCode=u,this._storeViewCode=f,this._defaultStoreViewCode=d,this._websiteCode=h,this._pageType=y,this._category=w,this.units=[]}var e,r,i;return e=t,(r=[{key:"version",value:function(){return it}},{key:"ping",value:function(){return X()}},{key:"register",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,r=void 0===e?"":e,n=t.filter,o=void 0===n?null:n,i=t.type,a=void 0===i?"":i,s=t.search,u=void 0===s?[]:s,c=p();u=a?R[a]:u;var f={id:c,name:r,filter:o=o?H(o,this._storeViewCode):o,search:u};return this.units.push(f),f}},{key:"unregister",value:function(t){var e=this.units.find((function(e){return e.id===t})),r=this.units.indexOf(e);return this.units.splice(r,1),e}},{key:"fetch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ids,r=void 0===e?[]:e,n=t.limit,o=void 0===n?5:n,i=t.offset,a=void 0===i?0:i,s=t.currentSku,u=void 0===s?Z():s,c=t.cartSkus,f=void 0===c?tt():c,l=t.userViewHistorySkus,d=void 0===l?et():l,p=t.userViewHistory,h=void 0===p?rt():p,v=t.userPurchaseHistory,y=void 0===v?nt():v,g=r.length?this.units.filter((function(t){return r.includes(t.id)})):this.units,w=g.map((function(t){return{limit:o,offset:a,unitId:t.id,unitName:t.name,filterQueryString:t.filter,rankerBlended:t.search}})),m={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,units:w,currentSku:u,cartSkus:f,userViewHistorySkus:d,userViewHistory:h,userPurchaseHistory:y};if(!this._environmentId)throw new ht("Environment ID is required");return K(m)}},{key:"fetchPreconfigured",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentSku,r=void 0===e?Z():e,n=t.cartSkus,o=void 0===n?tt():n,i=t.userViewHistorySkus,a=void 0===i?et():i,s=t.userViewHistory,u=void 0===s?rt():s,c=t.userPurchaseHistory,f=void 0===c?nt():c,l=t.unitId,d=void 0===l?"":l,p={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,currentSku:r,cartSkus:o,userViewHistorySkus:a,userViewHistory:u,userPurchaseHistory:f,unitId:d,defaultStoreViewCode:this._defaultStoreViewCode};if(!this._environmentId)throw new ht("Environment ID is required");return W(p)}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.template,r=void 0===e?"":e,n=t.unit,o=void 0===n?{}:n;r=r||N;var i=L.render(r,o);return i}}])&&o(e.prototype,r),i&&o(e,i),t}();"undefined"!=typeof window&&(window.RecommendationsClient=vt);const yt=vt},204:(t,e,r)=>{t.exports=self.fetch||(self.fetch=r(869).default||r(869))},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return V()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=k(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?h:d,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",d="suspendedYield",p="executing",h="completed",v={};function y(){}function g(){}function w(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(I([])));S&&S!==r&&n.call(S,i)&&(m=S);var _=w.prototype=y.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:V}}function V(){return{value:e,done:!0}}return g.prototype=_.constructor=w,w.constructor=g,g.displayName=u(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},x(C.prototype),C.prototype[a]=function(){return this},t.AsyncIterator=C,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new C(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),u(_,s,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},869:(t,e,r)=>{"use strict";function n(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],a=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var c in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),a.push([e,r]),s[e]=s[e]?s[e]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(c,e.headers[c]);o.send(e.body||null)}))}r.r(e),r.d(e,{default:()=>n})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(190)})()}));
var h=Object.prototype.toString,v=Array.isArray||function(t){return"[object Array]"===h.call(t)};function y(t){return"function"==typeof t}function g(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function w(t,e){return null!=t&&"object"==typeof t&&e in t}var m=RegExp.prototype.test;var b=/\S/;function S(t){return!function(t,e){return m.call(t,e)}(b,t)}var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var _=/\s*/,x=/\s+/,k=/\s*=/,E=/\s*\}/,P=/#|\^|\/|>|\{|&|=|!/;function O(t){this.string=t,this.tail=t,this.pos=0}function I(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function V(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}O.prototype.eos=function(){return""===this.tail},O.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},O.prototype.scanUntil=function(t){var e,r=this.tail.search(t);switch(r){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=e.length,e},I.prototype.push=function(t){return new I(t,this)},I.prototype.lookup=function(t){var e,r,n,o=this.cache;if(o.hasOwnProperty(t))e=o[t];else{for(var i,s,a,u=this,c=!1;u;){if(t.indexOf(".")>0)for(i=u.view,s=t.split("."),a=0;null!=i&&a<s.length;)a===s.length-1&&(c=w(i,s[a])||(r=i,n=s[a],null!=r&&"object"!=typeof r&&r.hasOwnProperty&&r.hasOwnProperty(n))),i=i[s[a++]];else i=u.view[t],c=w(u.view,t);if(c){e=i;break}u=u.parent}o[t]=e}return y(e)&&(e=e.call(this.view)),e},V.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},V.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||j.tags).join(":"),o=void 0!==r,i=o?r.get(n):void 0;return null==i&&(i=function(t,e){if(!t)return[];var r,n,o,i=!1,s=[],a=[],u=[],c=!1,f=!1,d="",l=0;function p(){if(c&&!f)for(;u.length;)delete a[u.pop()];else u=[];c=!1,f=!1}function h(t){if("string"==typeof t&&(t=t.split(x,2)),!v(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(g(t[0])+"\\s*"),n=new RegExp("\\s*"+g(t[1])),o=new RegExp("\\s*"+g("}"+t[1]))}h(e||j.tags);for(var y,w,m,b,C,I,V=new O(t);!V.eos();){if(y=V.pos,m=V.scanUntil(r))for(var T=0,L=m.length;T<L;++T)S(b=m.charAt(T))?(u.push(a.length),d+=b):(f=!0,i=!0,d+=" "),a.push(["text",b,y,y+1]),y+=1,"\n"===b&&(p(),d="",l=0,i=!1);if(!V.scan(r))break;if(c=!0,w=V.scan(P)||"name",V.scan(_),"="===w?(m=V.scanUntil(k),V.scan(k),V.scanUntil(n)):"{"===w?(m=V.scanUntil(o),V.scan(E),V.scanUntil(n),w="&"):m=V.scanUntil(n),!V.scan(n))throw new Error("Unclosed tag at "+V.pos);if(C=">"==w?[w,m,y,V.pos,d,l,i]:[w,m,y,V.pos],l++,a.push(C),"#"===w||"^"===w)s.push(C);else if("/"===w){if(!(I=s.pop()))throw new Error('Unopened section "'+m+'" at '+y);if(I[1]!==m)throw new Error('Unclosed section "'+I[1]+'" at '+y)}else"name"===w||"{"===w||"&"===w?f=!0:"="===w&&h(m)}if(p(),I=s.pop())throw new Error('Unclosed section "'+I[1]+'" at '+V.pos);return function(t){for(var e,r=[],n=r,o=[],i=0,s=t.length;i<s;++i)switch((e=t[i])[0]){case"#":case"^":n.push(e),o.push(e),n=e[4]=[];break;case"/":o.pop()[5]=e[2],n=o.length>0?o[o.length-1][4]:r;break;default:n.push(e)}return r}(function(t){for(var e,r,n=[],o=0,i=t.length;o<i;++o)(e=t[o])&&("text"===e[0]&&r&&"text"===r[0]?(r[1]+=e[1],r[3]=e[3]):(n.push(e),r=e));return n}(a))}(t,e),o&&r.set(n,i)),i},V.prototype.render=function(t,e,r,n){var o=this.getConfigTags(n),i=this.parse(t,o),s=e instanceof I?e:new I(e,void 0);return this.renderTokens(i,s,r,t,n)},V.prototype.renderTokens=function(t,e,r,n,o){for(var i,s,a,u="",c=0,f=t.length;c<f;++c)a=void 0,"#"===(s=(i=t[c])[0])?a=this.renderSection(i,e,r,n,o):"^"===s?a=this.renderInverted(i,e,r,n,o):">"===s?a=this.renderPartial(i,e,r,o):"&"===s?a=this.unescapedValue(i,e):"name"===s?a=this.escapedValue(i,e,o):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(u+=a);return u},V.prototype.renderSection=function(t,e,r,n,o){var i=this,s="",a=e.lookup(t[1]);if(a){if(v(a))for(var u=0,c=a.length;u<c;++u)s+=this.renderTokens(t[4],e.push(a[u]),r,n,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)s+=this.renderTokens(t[4],e.push(a),r,n,o);else if(y(a)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(a=a.call(e.view,n.slice(t[3],t[5]),(function(t){return i.render(t,e,r,o)})))&&(s+=a)}else s+=this.renderTokens(t[4],e,r,n,o);return s}},V.prototype.renderInverted=function(t,e,r,n,o){var i=e.lookup(t[1]);if(!i||v(i)&&0===i.length)return this.renderTokens(t[4],e,r,n,o)},V.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),o=t.split("\n"),i=0;i<o.length;i++)o[i].length&&(i>0||!r)&&(o[i]=n+o[i]);return o.join("\n")},V.prototype.renderPartial=function(t,e,r,n){if(r){var o=this.getConfigTags(n),i=y(r)?r(t[1]):r[t[1]];if(null!=i){var s=t[6],a=t[5],u=t[4],c=i;0==a&&u&&(c=this.indentPartial(i,u,s));var f=this.parse(c,o);return this.renderTokens(f,e,r,c,n)}}},V.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(null!=r)return r},V.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||j.escape,o=e.lookup(t[1]);if(null!=o)return"number"==typeof o&&n===j.escape?String(o):n(o)},V.prototype.rawValue=function(t){return t[1]},V.prototype.getConfigTags=function(t){return v(t)?t:t&&"object"==typeof t?t.tags:void 0},V.prototype.getConfigEscape=function(t){return t&&"object"==typeof t&&!v(t)?t.escape:void 0};var j={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){T.templateCache=t},get templateCache(){return T.templateCache}},T=new V;j.clearCache=function(){return T.clearCache()},j.parse=function(t,e){return T.parse(t,e)},j.render=function(t,e,r,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+((v(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)'));var o;return T.render(t,e,r,n)},j.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return C[t]}))},j.Scanner=O,j.Context=I,j.Writer=V;const L=j;const R={"most-viewed":[{signal:"most_viewed",boost:100}],"most-purchased":[{signal:"most_purchased",boost:100}],"most-added-to-cart":[{signal:"most_added_to_cart",boost:100}],trending:[{signal:"trending",boost:100}],"just-for-you":[{signal:"viewed_viewed",key:["user_view_history"],boost:100},{signal:"more_like_this",key:["user_view_history"],boost:100}],"viewed-viewed":[{signal:"viewed_viewed",key:["current_pdp"],boost:100}],"viewed-bought":[{signal:"viewed_bought",key:["current_pdp"],boost:100}],"bought-bought":[{signal:"bought_bought",key:["current_pdp"],boost:100}],"more-like-this":[{signal:"more_like_this",key:["current_pdp"],boost:100}]};var H=function(t,e){var r=t.split(":");return r[0]=r[0].replace("categories","product.".concat(e,".categories")).replace("prices","product.".concat(e,".prices")),r.join(":")};const G='\n <div class="product-recommendations-unit">\n <h2 class="product-recommendations-label">Recommended Products</h2>\n\n <div class="product-recommendations">\n {{#results}}\n <div class="product-recommendation">\n <a\n class="product-recommendation-image"\n href="{{{shortest_canonical_url}}}"\n >\n <img src="{{{main_image_url}}}" alt="{{name}}">\n </a>\n\n <a\n class="product-recommendation-name"\n href="{{{shortest_canonical_url}}}"\n >\n {{name}}\n </a>\n\n <p class="product-recommendation-price">\n ${{regular_price}}\n </p>\n </div>\n {{/results}}\n </div>\n </div>\n';function N(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}function U(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){N(i,n,o,s,a,"next",t)}function a(t){N(i,n,o,s,a,"throw",t)}s(void 0)}))}}var A=r(757),F=r.n(A),J=r(204),M=r.n(J),B="".concat("https://commerce.adobe.io/recs/v1/precs","/ping"),q="".concat("https://commerce.adobe.io/recs/v1/precs","/recommendations"),$="".concat("https://commerce.adobe.io/recs/v1/precs","/preconfigured"),D="recs_open",X=function(){var t=U(F().mark((function t(){var e,r,n;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M()(B);case 2:return e=t.sent,t.next=5,e.text();case 5:return r=t.sent,n={status:e.status,data:r},t.abrupt("return",n);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=U(F().mark((function t(){var e,r,n,o,i,s,a,u,c,f,d,l,p,h,v,y,g,w,m,b,S,C,_,x,k,E,P,O,I,V,j,T,L,R=arguments;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=R.length>0&&void 0!==R[0]?R[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,s=e.storeCode,a=void 0===s?"":s,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,d=void 0===f?"":f,l=e.pageType,p=void 0===l?"":l,h=e.category,v=void 0===h?"":h,y=e.units,g=void 0===y?[]:y,w=e.currentSku,m=void 0===w?"":w,b=e.cartSkus,S=void 0===b?[]:b,C=e.userViewHistorySkus,_=void 0===C?[]:C,x=e.userViewHistory,k=void 0===x?[]:x,E=e.userPurchaseHistory,P=void 0===E?[]:E,O=e.customerGroupCode,I={environmentId:n,alternateEnvironmentId:i,storeCode:a,storeViewCode:c,websiteCode:d,pageType:p,category:v,units:g,currentSku:m,cartSkus:S,userViewHistorySkus:_,userViewHistory:k,userPurchaseHistory:P,customerGroupCode:void 0===O?"":O},V={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(I)},t.next=5,M()(q,V);case 5:return j=t.sent,t.next=8,j.json();case 8:return T=t.sent,L={status:j.status,data:T},t.abrupt("return",L);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=U(F().mark((function t(){var e,r,n,o,i,s,a,u,c,f,d,l,p,h,v,y,g,w,m,b,S,C,_,x,k,E,P,O,I,V,j,T,L,R,H,G,N=arguments;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=N.length>0&&void 0!==N[0]?N[0]:{},r=e.environmentId,n=void 0===r?"":r,o=e.alternateEnvironmentId,i=void 0===o?"":o,s=e.storeCode,a=void 0===s?"":s,u=e.storeViewCode,c=void 0===u?"":u,f=e.websiteCode,d=void 0===f?"":f,l=e.pageType,p=void 0===l?"":l,h=e.category,v=void 0===h?"":h,y=e.currentSku,g=void 0===y?"":y,w=e.unitId,m=void 0===w?"":w,b=e.defaultStoreViewCode,S=void 0===b?"":b,C=e.cartSkus,_=void 0===C?[]:C,x=e.userViewHistorySkus,k=void 0===x?[]:x,E=e.userViewHistory,P=void 0===E?[]:E,O=e.userPurchaseHistory,I=void 0===O?[]:O,V=e.customerGroupCode,j={environmentId:n,alternateEnvironmentId:i,storeCode:a,storeViewCode:c,websiteCode:d,pageType:p,category:v,currentSku:g,cartSkus:_,userViewHistorySkus:k,userViewHistory:P,userPurchaseHistory:I,defaultStoreViewCode:S,customerGroupCode:void 0===V?"":V},T={method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":D},body:JSON.stringify(j)},L=m?"".concat($,"/units/").concat(m):$,t.next=6,M()(L,T);case 6:return R=t.sent,t.next=9,R.json();case 9:return H=t.sent,G={status:R.status,data:H},t.abrupt("return",G);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getStorefrontInstance()?window.magentoStorefrontEvents.context.getStorefrontInstance()[t]:""},Q=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getCategory()?window.magentoStorefrontEvents.context.getCategory()[t]:""},z=function(t){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getPage()?window.magentoStorefrontEvents.context.getPage()[t]:""},Z=function(){return window&&window.magentoStorefrontEvents&&window.magentoStorefrontEvents.context.getProduct()?window.magentoStorefrontEvents.context.getProduct().sku:""},tt=function(){if(!window||!window.localStorage||!window.localStorage.getItem)return[];var t=JSON.parse(window.localStorage.getItem("ds-cart"));return t&&t.cart&&t.cart.items&&t.cart.items.length?t.cart.items.map((function(t){return t.product_sku})):[]},et=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history"));return t&&t.skus?t.skus:[]},rt=function(){var t=JSON.parse(window.localStorage.getItem("ds-view-history-time-decay"));return t||[]},nt=function(){var t=JSON.parse(window.localStorage.getItem("ds-purchase-history"));return t||[]},ot=function(){if(!window||!window.magentoStorefrontEvents)return"";var t=window.magentoStorefrontEvents.context.getContext("recsContext");return t?t.alternateEnvironmentId:""},it=function(){if(!window||!window.magentoStorefrontEvents)return"";var t=window.magentoStorefrontEvents.context.getContext("customerGroup");return t?t.customerGroupCode:""};const st="2.0.1";function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ct(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ft(t){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function dt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function lt(t,e,r){return(lt=dt()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&at(o,r.prototype),o}).apply(null,arguments)}function pt(t){var e="function"==typeof Map?new Map:void 0;return(pt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return lt(t,arguments,ft(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),at(n,t)})(t)}function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ft(t);if(e){var o=ft(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ct(this,r)}}const vt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,t);var e=ht(r);function r(t){var o;n(this,r);var i="Could not retrieve recommendations. Message: "+t;return(o=e.call(this,i)).name="ProductRecommendationsError",o}return r}(pt(Error));const yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.environmentId,o=void 0===r?Y("environmentId"):r,i=e.alternateEnvironmentId,s=void 0===i?ot():i,a=e.storeCode,u=void 0===a?Y("storeCode"):a,c=e.storeViewCode,f=void 0===c?Y("storeViewCode"):c,d=e.defaultStoreViewCode,l=void 0===d?"":d,p=e.websiteCode,h=void 0===p?Y("websiteCode"):p,v=e.pageType,y=void 0===v?z("pageType"):v,g=e.category,w=void 0===g?Q("urlPath"):g,m=e.customerGroupCode,b=void 0===m?it():m;n(this,t),this._environmentId=o,this._alternateEnvironmentId=s,this._storeCode=u,this._storeViewCode=f,this._defaultStoreViewCode=l,this._websiteCode=h,this._pageType=y,this._category=w,this._customerGroupCode=b,this.units=[]}var e,r,i;return e=t,(r=[{key:"version",value:function(){return st}},{key:"ping",value:function(){return X()}},{key:"register",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,r=void 0===e?"":e,n=t.filter,o=void 0===n?null:n,i=t.type,s=void 0===i?"":i,a=t.search,u=void 0===a?[]:a,c=p();u=s?R[s]:u;var f={id:c,name:r,filter:o=o?H(o,this._storeViewCode):o,search:u};return this.units.push(f),f}},{key:"unregister",value:function(t){var e=this.units.find((function(e){return e.id===t})),r=this.units.indexOf(e);return this.units.splice(r,1),e}},{key:"fetch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ids,r=void 0===e?[]:e,n=t.limit,o=void 0===n?5:n,i=t.offset,s=void 0===i?0:i,a=t.currentSku,u=void 0===a?Z():a,c=t.cartSkus,f=void 0===c?tt():c,d=t.userViewHistorySkus,l=void 0===d?et():d,p=t.userViewHistory,h=void 0===p?rt():p,v=t.userPurchaseHistory,y=void 0===v?nt():v,g=r.length?this.units.filter((function(t){return r.includes(t.id)})):this.units,w=g.map((function(t){return{limit:o,offset:s,unitId:t.id,unitName:t.name,filterQueryString:t.filter,rankerBlended:t.search}})),m={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,units:w,currentSku:u,cartSkus:f,userViewHistorySkus:l,userViewHistory:h,userPurchaseHistory:y,customerGroupCode:this._customerGroupCode};if(!this._environmentId)throw new vt("Environment ID is required");return K(m)}},{key:"fetchPreconfigured",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.currentSku,r=void 0===e?Z():e,n=t.cartSkus,o=void 0===n?tt():n,i=t.userViewHistorySkus,s=void 0===i?et():i,a=t.userViewHistory,u=void 0===a?rt():a,c=t.userPurchaseHistory,f=void 0===c?nt():c,d=t.unitId,l=void 0===d?"":d,p={environmentId:this._environmentId,alternateEnvironmentId:this._alternateEnvironmentId,storeCode:this._storeCode,storeViewCode:this._storeViewCode,websiteCode:this._websiteCode,pageType:this._pageType,category:this._category,currentSku:r,cartSkus:o,userViewHistorySkus:s,userViewHistory:u,userPurchaseHistory:f,unitId:l,defaultStoreViewCode:this._defaultStoreViewCode,customerGroupCode:this._customerGroupCode};if(!this._environmentId)throw new vt("Environment ID is required");return W(p)}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.template,r=void 0===e?"":e,n=t.unit,o=void 0===n?{}:n;r=r||G;var i=L.render(r,o);return i}}])&&o(e.prototype,r),i&&o(e,i),t}();"undefined"!=typeof window&&(window.RecommendationsClient=yt);const gt=yt},204:(t,e,r)=>{t.exports=self.fetch||(self.fetch=r(869).default||r(869))},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),s=new O(n||[]);return i._invoke=function(t,e,r){var n=d;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return V()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=k(s,r);if(a){if(a===v)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?h:l,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var d="suspendedStart",l="suspendedYield",p="executing",h="completed",v={};function y(){}function g(){}function w(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(I([])));S&&S!==r&&n.call(S,i)&&(m=S);var C=w.prototype=y.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,s,a){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(d).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function k(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}return{next:V}}function V(){return{value:e,done:!0}}return g.prototype=C.constructor=w,w.constructor=g,g.displayName=u(w,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,a,"GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},_(x.prototype),x.prototype[s]=function(){return this},t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new x(c(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(C),u(C,a,"Generator"),C[i]=function(){return this},C.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var u=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(u&&c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},869:(t,e,r)=>{"use strict";function n(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var c in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(c,e.headers[c]);o.send(e.body||null)}))}r.r(e),r.d(e,{default:()=>n})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(190)})()}));
{
"name": "@magento/recommendations-js-sdk",
"version": "2.0.0",
"version": "2.0.1",
"description": "📚 JavaScript library for retrieving and displaying Magento product recommendations.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc